Skip to content

Commit

Permalink
chore: correct accuracy display in XGBclassifier notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBredehoft committed Nov 2, 2023
1 parent 55f23c3 commit a6f1b55
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions docs/advanced_examples/XGBClassifier.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"from matplotlib.colors import ListedColormap\n",
"from sklearn.datasets import fetch_openml, make_circles\n",
"from sklearn.ensemble import RandomForestClassifier as SklearnRandomForestClassifier\n",
"from sklearn.metrics import make_scorer, matthews_corrcoef\n",
"from sklearn.metrics import accuracy_score, make_scorer, matthews_corrcoef\n",
"from sklearn.model_selection import GridSearchCV, train_test_split\n",
"from xgboost.sklearn import XGBClassifier as SklearnXGBClassifier\n",
"\n",
Expand Down Expand Up @@ -611,20 +611,19 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Clear FP32 sklearn model MCC: 0.5\n",
"Clear quantized model MCC: 0.6\n",
"FHE model MCC: 0.6\n"
"Accuracy scores:\n",
"- Scikit-Learn (clear floating points): 0.5\n",
"- Concrete ML (clear quantized): 0.6\n",
"- Concrete ML (FHE): 0.6\n"
]
}
],
"source": [
"# Print all matthews correlation coefficients with a string to explain\n",
"from sklearn.metrics import accuracy_score\n",
"\n",
"print(\"Accuracy scores:\")\n",
"print(\n",
" f\"Clear FP32 sklearn model MCC: {accuracy_score(y_test_fhe, y_preds_sklearn)}\\n\"\n",
" f\"Clear quantized model MCC: {accuracy_score(y_test_fhe, y_preds_clear)}\\n\"\n",
" f\"FHE model MCC: {accuracy_score(y_test_fhe, y_preds_fhe)}\"\n",
" f\"- Scikit-Learn (clear floating points): {accuracy_score(y_test_fhe, y_preds_sklearn)}\\n\"\n",
" f\"- Concrete ML (clear quantized): {accuracy_score(y_test_fhe, y_preds_clear)}\\n\"\n",
" f\"- Concrete ML (FHE): {accuracy_score(y_test_fhe, y_preds_fhe)}\"\n",
")"
]
}
Expand Down

0 comments on commit a6f1b55

Please sign in to comment.