Link Search Menu Expand Document

accuracyScore()

Get accuracy score for classification task.

In multilabel classification, this function computes subset accuracy: the set of labels predicted for a sample must exactly match the corresponding set of labels in y_true.

Import

import * as datacook from '@pipcook/datacook';
const { accuracyScore } = datacook.Metrics;

Syntax

accuracyScore(yTrue: Tensor | string[] | number[], yPred: Tensor | string[] | number[]): number

Parameters

Parametertypedescription
yTureTensor | string[] | number[]True labels
yPredTensor | string[] | number[]Predicted labels

Returns

score: number, the fraction of correctly classified samples