libuplift.meta.dr_learner#

The DR-learner model from Kennedy 2004.

Classes#

DRLearnerBase

Base class for uplift meta estimators.

DRLearnerUpliftRegressor

Mixin class for all uplift regression estimators in

DRLearnerUpliftClassifier

The classifier works by treating the class variable as 0/1 real

Module Contents#

class libuplift.meta.dr_learner.DRLearnerBase(base_estimator=LinearRegression(), mean_estimator=None, cv=2)[source]#

Bases: libuplift.meta.base.UpliftMetaModelBase

Base class for uplift meta estimators.

Checks input consistency, builds classifiers on subsets of data.

Derived classess need to overwride the _get_model_names_list and _iter_training_subsets methods. The predict method needs to be implemented as well.

predict(X)[source]#
fit(X, y, trt, n_trt=None, sample_weight=None, *, y_stratify=None)[source]#
class libuplift.meta.dr_learner.DRLearnerUpliftRegressor(base_estimator=LinearRegression(), mean_estimator=None, cv=2)[source]#

Bases: libuplift.base.UpliftRegressorMixin, DRLearnerBase

Mixin class for all uplift regression estimators in libuplift.

class libuplift.meta.dr_learner.DRLearnerUpliftClassifier(base_estimator=LinearRegression(), mean_estimator=None, cv=2)[source]#

Bases: libuplift.base.UpliftClassifierMixin, DRLearnerBase

The classifier works by treating the class variable as 0/1 real target and using a DRLearnerUpliftRegressor.

The main difference is that stratification takes the target variable into account.

fit(X, y, trt, n_trt=None, sample_weight=None, *, y_stratify=None)[source]#
predict(X)[source]#