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

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.
{% endraw %} {% raw %}
{% endraw %} {% raw %}

mean_soft_prediction[source]

mean_soft_prediction(y_true, y_score)

Compute the mean predicted probability.
{% endraw %} {% raw %}
{% endraw %} {% raw %}

std_soft_prediction[source]

std_soft_prediction(y_true, y_score)

Compute the standard deviation of the predicted
probabilities. This helps us identify if the model is
always predicting roughly the same probability.
{% endraw %} {% raw %}
{% endraw %} {% raw %}

batch_size[source]

batch_size(y_true, y_pred)

Count the number of items in the current batch.
{% endraw %}