Skip to content

Commit

Permalink
fix: map class predictions for XGB results
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocarvp committed Feb 7, 2020
1 parent d8631f8 commit 3747e2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions forest_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@
"outputs": [],
"source": [
"preds_valid = np.array(clf_xgb.predict_proba(X_valid, ))\n",
"valid_acc = accuracy_score(y_pred=np.argmax(preds_valid, axis=1), y_true=y_valid)\n",
"valid_acc = accuracy_score(y_pred=np.argmax(preds_valid, axis=1) + 1, y_true=y_valid)\n",
"print(valid_acc)\n",
"\n",
"preds_test = np.array(clf_xgb.predict_proba(X_test))\n",
"test_acc = accuracy_score(y_pred=np.argmax(preds_test, axis=1), y_true=y_test)\n",
"test_acc = accuracy_score(y_pred=np.argmax(preds_test, axis=1) + 1, y_true=y_test)\n",
"print(test_acc)"
]
},
Expand Down

0 comments on commit 3747e2f

Please sign in to comment.