njab.sklearn.scoring module#
- class njab.sklearn.scoring.ConfusionMatrix(y_true, y_pred)[source]#
Bases:
object
Wrapper for sklearn.metrics.confusion_matrix
- property as_array#
Return sklearn.metrics.confusion_matrix array
- njab.sklearn.scoring.get_custom_pred(clf, X: DataFrame, cutoff=0.5) Series [source]#
Calculate predicted class for binary classifier using the specified cutoff. Keep indices of from data X.
- njab.sklearn.scoring.get_label_binary_classification(y_true: int, y_pred: int) str [source]#
Get labels (TP, FN, TN, FP) for single case in binary classification.
- njab.sklearn.scoring.get_lr_multiplicative_decomposition(results: Results, X: DataFrame, prob: Series, y: Series) DataFrame [source]#
Multiplicative decompositon of odds at the base of the logistic regresion model.
- njab.sklearn.scoring.get_pred(clf, X: DataFrame) Series [source]#
Predict class for binary classifier and keep indices of from data X.