src.report.classification_report
Classes
|
- class src.report.classification_report.ClassificationReport(**kwargs)
- Author:
Alberto M. Esmoris Pena
Class to handle reports related to classifications. See
Report. See alsoClassificationModel.- Variables:
class_names – See
ClassificationEvaluation.yhat_count – See
ClassificationEvaluation.y_count – See
ClassificationEvaluation.conf_mat – See
ClassificationEvaluation.metric_names – See
ClassificationEvaluation.metric_scores – See
ClassificationEvaluation.class_metric_names – See
ClassificationEvaluation.class_metric_scores – See
ClassificationEvaluation.
- __init__(**kwargs)
Initialize an instance of ClassificationReport.
- Parameters:
kwargs – The key-word arguments defining the report’s attributes.
- to_global_eval_string()
Generate the string representing the classification report with respect to the global evaluation.
- Returns:
String representing the classification report with respect to the global evaluation.
- to_class_eval_string()
Generate the string representing the classification report with respect to the class-wise evaluation.
- Returns:
String representing the classification report with respect to the class-wise evaluation.
- to_confusion_matrix_string()
Generate the string representing the classification report with respect to the confusion matrix.
- Returns:
String representing the classification report with respect to the confusion matrix.
- Return type:
str
- to_class_distribution_string()
Generate the string representing the classification report with respect to the class distribution.
- Returns:
String representing the classification report with respect to the class distribution.
- Return type:
str
- to_file(report_path, class_report_path=None, confusion_matrix_report_path=None, class_distribution_report_path=None, out_prefix=None)
Write the classification report to files.
- Parameters:
report_path – See
ClassificationEvaluator.class_report_path – See
ClassificationEvaluator.confusion_matrix_report_path – See
ClassificationEvaluator.class_distribution_report_path – See
ClassificationEvaluator.out_prefix (str) – The output prefix to expand the path (OPTIONAL).
- Returns:
Nothing, the output is written to files.
- has_global_eval_info()
Check whether the report contains information about the global evaluation.
- Returns:
True if the report contains information about the global evaluation, False otherwise.
- has_class_eval_info()
Check whether the report contains information about the class-wise evaluation.
- Returns:
True if the report contains information about the class-wise evaluation, False otherwise.
- has_confusion_matrix()
Check whether the report contains the confusion matrix.
- Returns:
True if the report contains the confusion matrix, False otherwise.
- has_class_distribution_info()
Check whether the report contains information about the class distribution.
- Returns:
True if the report contains information about the class distribution, False otherwise.