擅长:python、mysql、java
<p>这是因为<code>sklearn</code>中没有<code>cross_validation</code>对象。你可能在寻找更像<code>cross_validate</code>函数的东西。你可以通过</p>
<pre><code>from sklearn.model_selection import cross_validate
</code></pre>
<p>但是,您不需要导入任何交叉验证软件来执行列车测试拆分,因为这只是从数据中随机抽样。试试看</p>
<pre><code>from sklearn.model_selection import train_test_split
</code></pre>
<p>接</p>
<pre><code>features_train, features_test, labels_train, labels_test = train_test_split(word_data, authors, test_size=0.1, random_state=42)
</code></pre>