Skip to content

decision_function

Apply the model to the given dataset and return the raw score: the prediction on the link (logit) scale, before the sigmoid or the softmax is applied.

Note

The model prediction results will be correct only if the X parameter with feature values contains all the features used in the model. For a polars DataFrame or LazyFrame, the features are matched by name: extra columns are ignored and the order of the columns does not matter (a LazyFrame collects only the columns the model needs). For other types, and for a model trained without feature names, the features must be in the same number and order as the columns provided during the training.

Method call format

decision_function(X, *, offset=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

offset

Description

The link-scale offset to add to the raw score of each object, as passed to the offset parameter of fit. A string names a column of a polars X. If omitted, the objects are scored with a zero offset.

Possible types

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

Default value

None

Return value

As float64:

  • Binary classification — A one-dimensional numpy.ndarray of shape (object_count,) with the logit of the probability of classes_[1].
  • Multiclassification — A two-dimensional numpy.ndarray of shape (object_count, number_of_classes) with the raw score of each class. The model is a joint softmax, not independent one-vs-rest models.