libuplift.meta.multi_model#

Uplift models based on multiple classification/regression models.

Classes#

MultimodelUpliftRegressor

Multimodel uplift regressor.

TLearnerUpliftRegressor

Multimodel uplift regressor.

MultimodelUpliftClassifier

Multimodel uplift classifier.

TLearnerUpliftClassifier

Multimodel uplift classifier.

MultimodelUpliftLinearRegressor

Uplift regressor with coef_ and intercept_ fields.

MultimodelUpliftLinearRegressorJamesSeparate

Multimodel uplift regressor.

MultimodelUpliftLinearRegressorJamesU

Multimodel uplift regressor.

MultimodelUpliftLinearRegressorMSESeparate

Multimodel uplift regressor.

MultimodelUpliftLinearRegressorMSEU

Multimodel uplift regressor.

Module Contents#

class libuplift.meta.multi_model.MultimodelUpliftRegressor(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: libuplift.base.UpliftRegressorMixin, _MultimodelUpliftModel

Multimodel uplift regressor.

Build separate models for control and all treatments, subtract control predictions from treatment predictions.

Parameters:
base_estimatora sklearn regressor or list of (name, regressor)

tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

predict(X)[source]#
class libuplift.meta.multi_model.TLearnerUpliftRegressor(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: MultimodelUpliftRegressor

Multimodel uplift regressor.

Build separate models for control and all treatments, subtract control predictions from treatment predictions.

Parameters:
base_estimatora sklearn regressor or list of (name, regressor)

tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

class libuplift.meta.multi_model.MultimodelUpliftClassifier(base_estimator=LogisticRegression())[source]#

Bases: _MultimodelUpliftClassifierBase

Multimodel uplift classifier.

Build separate models for control and all treatments, subtract control predicted probs from treatment predicted probs.

Parameters:
base_estimatora sklearn classifier supporting predict_proba or

list of (name, regressor) tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

class libuplift.meta.multi_model.TLearnerUpliftClassifier(base_estimator=LogisticRegression())[source]#

Bases: MultimodelUpliftClassifier

Multimodel uplift classifier.

Build separate models for control and all treatments, subtract control predicted probs from treatment predicted probs.

Parameters:
base_estimatora sklearn classifier supporting predict_proba or

list of (name, regressor) tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

class libuplift.meta.multi_model.MultimodelUpliftLinearRegressor(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: MultimodelUpliftRegressor, sklearn.linear_model._base.LinearModel

Uplift regressor with coef_ and intercept_ fields.

fit(*args, **kwargs)[source]#
predict(X)[source]#
class libuplift.meta.multi_model.MultimodelUpliftLinearRegressorJamesSeparate(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: MultimodelUpliftRegressor, sklearn.linear_model._base.LinearModel

Multimodel uplift regressor.

Build separate models for control and all treatments, subtract control predictions from treatment predictions.

Parameters:
base_estimatora sklearn regressor or list of (name, regressor)

tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

fit(*args, **kwargs)[source]#
predict(X)[source]#
class libuplift.meta.multi_model.MultimodelUpliftLinearRegressorJamesU(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: MultimodelUpliftRegressor, sklearn.linear_model._base.LinearModel

Multimodel uplift regressor.

Build separate models for control and all treatments, subtract control predictions from treatment predictions.

Parameters:
base_estimatora sklearn regressor or list of (name, regressor)

tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

fit(*args, **kwargs)[source]#
predict(X)[source]#
class libuplift.meta.multi_model.MultimodelUpliftLinearRegressorMSESeparate(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: MultimodelUpliftRegressor, sklearn.linear_model._base.LinearModel

Multimodel uplift regressor.

Build separate models for control and all treatments, subtract control predictions from treatment predictions.

Parameters:
base_estimatora sklearn regressor or list of (name, regressor)

tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

fit(*args, **kwargs)[source]#
predict(X)[source]#
class libuplift.meta.multi_model.MultimodelUpliftLinearRegressorMSEU(base_estimator=LinearRegression(), ignore_control=False)[source]#

Bases: MultimodelUpliftRegressor, sklearn.linear_model._base.LinearModel

Multimodel uplift regressor.

Build separate models for control and all treatments, subtract control predictions from treatment predictions.

Parameters:
base_estimatora sklearn regressor or list of (name, regressor)

tuples. If a list is provided the first model is used for control, successive one for treatments. If different parameters are to be used per each model, the list version must be given. If a single estimator is given it will be cloned for every treatment.

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