15
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

sklearn.cross_varidationが使えない件

Posted at

#sklearn.cross_varidationがimportできない
sklearn.cross_varidationからimportしようと思ったが下記のようなエラーが出る.

SyntaxError: invalid syntax

調べてみたあっさり原因が見つかった.

##cross_varidationの廃止
原因は,cross_varidationの廃止だったそうな.じゃあなに使えばいいのっていうとsklearn.model_selectionというのを代わりに使えばいいらしい.
具体的には...

from sklearn.model_selection import cross_val_score

こんな感じ

大体のクラスや関数は置き換えなのでcross_validationを書き換えるだけでいいっぽい

ソースはここ
ImportError: No module named 'sklearn.cross_validation'の対処

15
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?