Skip to content

Commit

Permalink
Updated to use fstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawenwu0113 committed Nov 8, 2020
1 parent 534a518 commit b39a8ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ipython/python35/Lecture_TextMining_3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@
"model = LogisticRegression()\n",
"model.fit(X_train_binary, Y_train)\n",
"\n",
"print(\"Area under the ROC curve on the test data = %.3f\" % metrics.roc_auc_score(model.predict(X_test_binary), Y_test))"
"print(f'Area under the ROC curve on the test data = {round(metrics.roc_auc_score(model.predict(X_test_binary), Y_test), 3)}')"
]
},
{
Expand Down Expand Up @@ -605,7 +605,7 @@
"model = LogisticRegression()\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))"
"print(f'Area under the ROC curve on the test data = {round(metrics.roc_auc_score(model.predict(X_test_counts), Y_test), 3)}')"
]
},
{
Expand Down Expand Up @@ -684,7 +684,7 @@
"model = LogisticRegression()\n",
"model.fit(X_train_tfidf, 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))"
"print(f'Area under the ROC curve on the test data = {round(metrics.roc_auc_score(model.predict(X_test_counts), Y_test), 3)}')"
]
},
{
Expand Down Expand Up @@ -829,7 +829,7 @@
}
],
"source": [
"print(\"AUC on the count data = %.3f\" % metrics.roc_auc_score(model.predict(X_test_tfidf), Y_test))"
"print(f'AUC on the count data = {round(metrics.roc_auc_score(model.predict(X_test_tfidf), Y_test), 3)}')"
]
},
{
Expand Down

0 comments on commit b39a8ff

Please sign in to comment.