--- title: Metrics keywords: fastai sidebar: home_sidebar summary: "Metrics should follow the scikit-learn pattern of accepting two arguments: " ---
{% raw %}

    %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.

#### `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.

#### `batch_size`[source]

> `batch_size`(`y_true`, `y_pred`)

    Count the number of items in the current batch.

{% endraw %}