libuplift.classifiers.classifier_as_regressor#

Use a classifier as a regressor.

By default return predicted probabilities as numeric predictions.

Classes#

ClassifierAsRegressor

Wraps a classifier such that it behaves like a regressor.

Module Contents#

class libuplift.classifiers.classifier_as_regressor.ClassifierAsRegressor(estimator, response_method='predict_proba', pos_label=1)[source]#

Bases: sklearn.base.MetaEstimatorMixin, sklearn.base.RegressorMixin, sklearn.base.BaseEstimator

Wraps a classifier such that it behaves like a regressor.

The predict method returns by default predicted probability for class specified by pos_label (default 1). The method used for prediction can be changed by passing the response_method argument.

If response_method returns a vector (e.g. decision_function) pos_label will be ignored.

Parameters:
estimatora scikit-klearn classifier

Classifier to wrap in a regessor interface.

response_methodstring, default=’predict_proba’

Classifier’s method to use for making predictions.

pos_labelinteger, default=1

Label whose probability should be returned by regressor’s predict method.

fit(*args, **kwargs)[source]#
predict(*args, **kwargs)[source]#