--- title: Metrics keywords: fastai sidebar: home_sidebar summary: "Metrics should follow the scikit-learn pattern of accepting two arguments: " ---
%load_ext autoreload
%autoreload 2
%matplotlib inline

percent_positive[source]

percent_positive(y_true, y_pred)

Compute the percent of predictions that are positive. This can help us identify when a model is predicting all ones or zeros.

mean_soft_prediction[source]

mean_soft_prediction(y_true, y_score)

Compute the mean predicted probability.

batch_size[source]

batch_size(y_true, y_pred)

Count the number of items in the current batch.