Skip to content

score

Calculate the Accuracy metric for the objects in the given dataset.

Method call format

score(X, y, sample_weight=None)

Parameters

X

Description

Feature values data.

Possible types

  • polars.DataFrame
  • polars.LazyFrame
  • numpy.ndarray of shape (object_count, feature_count)
  • other array-like data of the same shape

Default value

Required parameter

y

Description

The class labels of the objects.

Possible types

  • numpy.ndarray of shape (object_count,)
  • polars.Series
  • list

Default value

Required parameter

sample_weight

Description

The weight of each object. By default, it is set to 1 for all objects.

Possible types

  • numpy.ndarray of shape (object_count,)
  • polars.Series
  • list

Default value

None

Return value

float