museotoolbox.ai.SuperLearner.get_stats_from_cv¶
-
SuperLearner.
get_stats_from_cv
(confusion_matrix=True, kappa=False, OA=False, F1=False, nTrain=False, resampler=False)[source]¶ Extract statistics from the Cross-Validation. If Cross-Validation is 5-fold, getStatsFromCV will return 5 confusion matrix, 5 kappas…
- Parameters
confusion_matrix (bool, default True.) – If True, will return first the Confusion Matrix.
kappa (bool, default False.) – If True, will return in kappa.
OA (bool, default False.) – If True, will return Overall Accuracy/
F1 (bool, default False.) – If True, will return F1 Score per class.
nTrain (bool, default False.) – If True, will return number of train samples ordered asc. per label.
resampler (imblearn class or False, optional) – Default is False If class is given, each fold will be retreated resampler.fit_resample(X,y) method.
- Returns
Accuracies – A dictionary of each statistic asked.
- Return type
dict
Examples
After having learned with
museotoolbox.ai.SuperLearner
:>>> for stats in SL.get_stats_from_cv(confusion_matrix=False,kappa=True): >>> stats['kappa'] 0.942560083148 0.94227598585 0.942560083148 ...