Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在练习:模型调优中输出调优后的模型 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion finding_donors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,12 @@
"predictions = (clf.fit(X_train, y_train)).predict(X_val)\n",
"best_predictions = best_clf.predict(X_val)\n",
"\n",
"# 汇报调优后的模型\n",
"print \"best_clf\\n------\"\n",
"print best_clf\n",
"\n",
"# 汇报调参前和调参后的分数\n",
"print \"Unoptimized model\\n------\"\n",
"print \"\\nUnoptimized model\\n------\"\n",
"print \"Accuracy score on validation data: {:.4f}\".format(accuracy_score(y_val, predictions))\n",
"print \"F-score on validation data: {:.4f}\".format(fbeta_score(y_val, predictions, beta = 0.5))\n",
"print \"\\nOptimized Model\\n------\"\n",
Expand Down