tabensemb.utils.utils.metric_sklearn#
- tabensemb.utils.utils.metric_sklearn(y_true: ndarray, y_pred: ndarray, metric: str) float[source]#
Calculate metrics using
sklearnAPIs. The format ofy_trueandy_predshould follow the requirement ofmetric(See https://scikit-learn.org/stable/modules/model_evaluation.html), so we recommend usingauto_metric_sklearn()to automatically deal with different metrics.- Parameters:
- y_true
An array of ground truth values.
- y_pred
An array of predictions.
- metric
Use
tabensemb.utils.utils.REGRESSION_METRICS,tabensemb.utils.utils.BINARY_METRICS, andtabensemb.utils.utils.MULTICLASS_METRICSto check all available metrics for regression, binary, and multiclass tasks respectively.
- Returns:
- float
The metric.
See also