is_dir (bool) – Whether the given path is to a directory. If is_dir is False, the given path is to a file or an object,
then this file’s parent directory will be checked.
Calculate the Mean Absolute Error between predictions and targets.
masks can be used for filtering. For values==0 in masks,
values at their corresponding positions in predictions will be ignored.
Parameters:
predictions (Union[ndarray, Tensor]) – The prediction data to be evaluated.
targets (Union[ndarray, Tensor]) – The target data for helping evaluate the predictions.
masks (Union[ndarray, Tensor, None]) – The masks for filtering the specific values in inputs and target from evaluation.
When given, only values at corresponding positions where values ==1 in masks will be used for evaluation.
Calculate the Mean Square Error between predictions and targets.
masks can be used for filtering. For values==0 in masks,
values at their corresponding positions in predictions will be ignored.
Parameters:
predictions (Union[ndarray, Tensor]) – The prediction data to be evaluated.
targets (Union[ndarray, Tensor]) – The target data for helping evaluate the predictions.
masks (Union[ndarray, Tensor, None]) – The masks for filtering the specific values in inputs and target from evaluation.
When given, only values at corresponding positions where values ==1 in masks will be used for evaluation.
Calculate the Root Mean Square Error between predictions and targets.
masks can be used for filtering. For values==0 in masks,
values at their corresponding positions in predictions will be ignored.
Parameters:
predictions (Union[ndarray, Tensor]) – The prediction data to be evaluated.
targets (Union[ndarray, Tensor]) – The target data for helping evaluate the predictions.
masks (Union[ndarray, Tensor, None]) – The masks for filtering the specific values in inputs and target from evaluation.
When given, only values at corresponding positions where values ==1 in masks will be used for evaluation.
Calculate the Mean Relative Error between predictions and targets.
masks can be used for filtering. For values==0 in masks,
values at their corresponding positions in predictions will be ignored.
Parameters:
predictions (Union[ndarray, Tensor]) – The prediction data to be evaluated.
targets (Union[ndarray, Tensor]) – The target data for helping evaluate the predictions.
masks (Union[ndarray, Tensor, None]) – The masks for filtering the specific values in inputs and target from evaluation.
When given, only values at corresponding positions where values ==1 in masks will be used for evaluation.
Continuous rank probability score for distributional predictions.
Parameters:
predictions (Union[ndarray, Tensor]) – The prediction data to be evaluated.
targets (Union[ndarray, Tensor]) – The target data for helping evaluate the predictions.
masks (Union[ndarray, Tensor]) – The masks for filtering the specific values in inputs and target from evaluation.
Only values at corresponding positions where values ==1 in masks will be used for evaluation.
scaler_mean – Mean value of the scaler used to scale the data.
scaler_stddev – Standard deviation value of the scaler used to scale the data.
Sum continuous rank probability score for distributional predictions.
Parameters:
predictions (Union[ndarray, Tensor]) – The prediction data to be evaluated.
targets (Union[ndarray, Tensor]) – The target data for helping evaluate the predictions.
masks (Union[ndarray, Tensor]) – The masks for filtering the specific values in inputs and target from evaluation.
Only values at corresponding positions where values ==1 in masks will be used for evaluation.
scaler_mean – Mean value of the scaler used to scale the data.
scaler_stddev – Standard deviation value of the scaler used to scale the data.
Calculate the evaluation metrics for the binary classification task,
including accuracy, precision, recall, f1 score, area under ROC curve, and area under Precision-Recall curve.
If targets contains multiple categories, please set the positive category as pos_label.
Parameters:
prob_predictions (ndarray) – Estimated probability predictions returned by a decision function.
targets (ndarray) – Ground truth (correct) classification results.
pos_label (int) – The label of the positive class.
Note that pos_label is also the index used to extract binary prediction probabilities from predictions.
Returns:
A dictionary contains classification metrics and useful results:
predictions: binary categories of the prediction results;
accuracy: prediction accuracy;
precision: prediction precision;
recall: prediction recall;
f1: F1-score;
precisions: precision values of Precision-Recall curve