Skip to content

Commit

Permalink
Update Lecture_TextMining_3
Browse files Browse the repository at this point in the history
1. sklearn cross_validation has been deprecated, so switched to sklearn model_Selection
2. was getting a "STOP: TOTAL NO. of ITERATIONS REACHED LIMIT." warning for the LR model, so switched the max iterations to 1500
  • Loading branch information
jack-epstein authored Nov 13, 2020
1 parent fb5ef11 commit 664f41e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ipython/python35/Lecture_TextMining_3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.naive_bayes import BernoulliNB\n",
"from sklearn import metrics\n",
"from sklearn import cross_validation\n",
"from sklearn.cross_validation import train_test_split\n",
"from sklearn.model_selection import cross_validate\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn.feature_extraction.text import CountVectorizer\n",
"from sklearn.feature_extraction.text import TfidfVectorizer\n",
"\n",
Expand Down Expand Up @@ -602,7 +602,7 @@
"X_test_counts = count_vectorizer.transform(X_test)\n",
"\n",
"# Model\n",
"model = LogisticRegression()\n",
"model = LogisticRegression(max_iter=1500)\n",
"model.fit(X_train_counts, Y_train)\n",
"\n",
"print(\"Area under the ROC curve on the test data = %.3f\" % metrics.roc_auc_score(model.predict(X_test_counts), Y_test))"
Expand Down

0 comments on commit 664f41e

Please sign in to comment.