2
0

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 3 years have passed since last update.

sklearnで機械学習を楽しんでたらハマったところ

Last updated at Posted at 2020-03-02

個人的にハマってしまったところの解決策集です。

#max_iterがerrorになったとき
N予備校の機械学習コースで、breast_cancerのデータセットを使ってPerceptronで予測モデルを作るチュートリアルをやっていたときに出てきたエラーです。

学習を開始しようとすると、

ppn = Perceptron(max_iter=1000,random_state=42)
ppn.fit(X_train_std,y_train)

出てきたエラー

__init__() got an unexpected keyword argument 'max_iter'

代わりにn_iterを使うとerrorが出なくなりました。
n_iterは非推奨らしいので、他の回避方法がわかればアップデートします

#pandasのDataFrameが認識されなくなった件
mlxtendを入れた後,pandasがエラーを吐くようになって先に進めなくなった

cannot import name 'DataFrame'

ググってみると、conda update pandasをしろとの記事が。
やってみると、

Examining conflict for anaconda XXXXXXXXX python.app mlxtend scikit-learn certi/

(XXXは色々と変化していく)

どうもanacondaの中で、mlxtendを入れた影響でconflictしてるよう。
10分くらい経つと

Examining conflict for python pandas scikit-learn anaconda:  30%|▎| 3/10 [07:\

まだ何か解決中。。。
終了までになんやかんやで40分経過しました

その後、jupyterで走ってるプログラムを一旦shutdownしてから、再度起動

すると問題なくRunしました

2
0
2

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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?