Skip to content

SklearnPredictConfig

SklearnPredictConfig

Configuration for scikit-learn prediction parameters.

This class encapsulates parameters for prediction with scikit-learn models. Additional keyword arguments for the estimator's prediction methods can be passed as attributes of this configuration.

Parameters:

Name Type Description Default
predict_method SklearnPredictMethod

The prediction method to use:

  • AUTO: Automatically selects predict_proba if available, otherwise predict.
  • PREDICT: Uses the predict method (returns class labels or regression values).
  • PREDICT_PROBA: Uses the predict_proba method (returns probability estimates).
SklearnPredictMethod.AUTO
See Also

SklearnPredictMethod : Enum of available prediction methods.

Examples:

>>> from factrainer.sklearn import SklearnPredictConfig, SklearnPredictMethod
>>> # Default configuration (auto-selects method)
>>> config = SklearnPredictConfig()
>>> # Force using predict method
>>> config = SklearnPredictConfig(predict_method=SklearnPredictMethod.PREDICT)
>>> # Use predict_proba for probability estimates
>>> config = SklearnPredictConfig(predict_method=SklearnPredictMethod.PREDICT_PROBA)

Attributes

predict_method class-attribute instance-attribute

predict_method: SklearnPredictMethod = AUTO