Metrics¶
- class mastml.metrics.Metrics(metrics_list, metrics_type='regression')[source]¶
Bases:
object
Class containing access to a wide range of metrics from scikit-learn and a number of MAST-ML custom-written metrics
- Args:
metrics_list: (list), list of strings of metric names to use
metrics_type: (str), one of ‘regression’ or ‘classification’: whether to use set of common regression/classifier metrics
- Methods:
- evaluate: main method to evaluate the specified metrics and the provided true and pred data
- Args:
y_true: (pd.Series), series of true y data
y_pred: (pd.Series), series of predicted y data
- Returns:
stats_dict: (dict), dictionary of calculated statistics for each metric
- _get_metrics: builds the metrics dict of metric namesmetric instances based on the metrics specified in metrics_list
- Args:
None
- Returns:
None
- _metric_zoo: method to retrieve full dict of metric namesmetric instance pairs
- Args:
None
- Returns:
all_metrics (dict), dictionary of all metric names and instances
Methods Summary
evaluate
(y_true, y_pred)Methods Documentation