Skip to content

Commit e53446b

Browse files
Update 16_spot_hpt_sklearn_multiclass_classification.ipynb
1 parent 43cf3a3 commit e53446b

1 file changed

Lines changed: 31 additions & 11 deletions

File tree

notebooks/16_spot_hpt_sklearn_multiclass_classification.ipynb

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"---\n",
8-
"title: \"River Hyperparameter Tuning with SPOT Sklearn: Classification\"\n",
8+
"title: \"Scikit-learn Hyperparameter Tuning With spotPython - A Tutorial for Classification\"\n",
99
"format: html\n",
1010
"---"
1111
]
@@ -561,12 +561,12 @@
561561
"# core_model = RidgeCV\n",
562562
"# core_model = GradientBoostingRegressor\n",
563563
"# core_model = ElasticNet\n",
564-
"# core_model = RandomForestClassifier\n",
564+
"core_model = RandomForestClassifier\n",
565565
"# core_model = SVC\n",
566566
"# core_model = LogisticRegression\n",
567567
"# core_model = KNeighborsClassifier\n",
568568
"# core_model = GradientBoostingClassifier\n",
569-
"core_model = HistGradientBoostingClassifier\n",
569+
"# core_model = HistGradientBoostingClassifier\n",
570570
"fun_control = add_core_model_to_fun_control(core_model=core_model,\n",
571571
" fun_control=fun_control,\n",
572572
" hyper_dict=SklearnHyperDict,\n",
@@ -674,6 +674,31 @@
674674
":::"
675675
]
676676
},
677+
{
678+
"attachments": {},
679+
"cell_type": "markdown",
680+
"metadata": {},
681+
"source": [
682+
"### Multi-class Classification Metrics\n",
683+
"\n",
684+
"\n",
685+
"\"predict_proba\": predict_proba,\n",
686+
"\n",
687+
"#### MAPK\n",
688+
"\n",
689+
"metric_sklearn = mapk_score\n",
690+
"metric_params: {\"k\": 3}, # default\n",
691+
"\n",
692+
"#### top_k_accuracy_score\n",
693+
"\n",
694+
"* top_k_accuracy_score\n",
695+
"\n",
696+
"#### ROC\n",
697+
"\n",
698+
"* metric_sklearn = roc_auc_score\n",
699+
"* metric_params = {\"multi_class\": \"ovr\"} \n"
700+
]
701+
},
677702
{
678703
"cell_type": "code",
679704
"execution_count": 18,
@@ -699,15 +724,10 @@
699724
"# metric_sklearn = average_precision_score\n",
700725
"\n",
701726
"fun_control.update({\n",
702-
" \"horizon\": None,\n",
703-
" \"oml_grace_period\": None,\n",
704-
" \"weights\": weights,\n",
705-
" \"step\": None,\n",
706727
" \"log_level\": 50,\n",
707-
" \"weight_coeff\": None,\n",
708-
" \"metric_river\": None,\n",
709-
" \"metric_sklearn\": metric_sklearn,\n",
710-
" \"predict_proba\": predict_proba, \n",
728+
" \"weights\": -1,\n",
729+
" \"metric_sklearn\": mapk_score,\n",
730+
" \"predict_proba\": True, \n",
711731
" \"metric_params\": {\"k\": 3},\n",
712732
" })"
713733
]

0 commit comments

Comments
 (0)