Esempio n. 1
0
def get_classification_report_for_evaluation(base_model: BaseModel) -> Dict:
    y_pred, y_test = base_model.test_model()
    report = classification_report(y_test,
                                   y_pred,
                                   target_names=_CLASS_NAMES,
                                   output_dict=True)
    return report
Esempio n. 2
0
def evaluate_model(base_model: BaseModel) -> None:
    y_pred, y_test = base_model.test_model()

    print(classification_report(y_test, y_pred, target_names=_CLASS_NAMES))

    cm = confusion_matrix(y_test, y_pred)
    df_cm = pd.DataFrame(cm, index=_CLASS_NAMES, columns=_CLASS_NAMES)
    show_confusion_matrix(df_cm)