Skip to content

ML.EVAL.CLASSIFICATION.TOP_K_ACCURACY

Returns the top-k accuracy classification score.

Syntax

ML.EVAL.CLASSIFICATION.TOP_K_ACCURACY(y_true, y_score, k, normalize, sample_weight, labels)

Arguments

Name Type Default Description
y_true object DataFrame or array object of ground-truth target values.
y_score object DataFrame or array object of predicted probabilities or decision scores (e.g. output of ML.PREDICT_PROBA or ML.PREDICT).
k Any 2 Number of top predicted classes to consider correct. k=1 reduces to standard accuracy.
normalize Any TRUE If TRUE, return the fraction of correctly classified samples. If FALSE, return the raw count.
sample_weight Any None Optional DataFrame or array object of per-sample weights. Omit for uniform weights.
labels object None Optional array of class labels to include in the score, in the order they should appear.

Examples

Examples coming soon

Working Excel formula examples for this function are not yet written.

See also