libuplift.meta.dr_learner ========================= .. py:module:: libuplift.meta.dr_learner .. autoapi-nested-parse:: The DR-learner model from Kennedy 2004. .. !! processed by numpydoc !! Classes ------- .. autoapisummary:: libuplift.meta.dr_learner.DRLearnerBase libuplift.meta.dr_learner.DRLearnerUpliftRegressor libuplift.meta.dr_learner.DRLearnerUpliftClassifier Module Contents --------------- .. py:class:: DRLearnerBase(base_estimator=LinearRegression(), mean_estimator=None, cv=2) Bases: :py:obj:`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. .. !! processed by numpydoc !! .. py:method:: predict(X) .. py:method:: fit(X, y, trt, n_trt=None, sample_weight=None, *, y_stratify=None) .. py:class:: DRLearnerUpliftRegressor(base_estimator=LinearRegression(), mean_estimator=None, cv=2) Bases: :py:obj:`libuplift.base.UpliftRegressorMixin`, :py:obj:`DRLearnerBase` Mixin class for all uplift regression estimators in libuplift. .. !! processed by numpydoc !! .. py:class:: DRLearnerUpliftClassifier(base_estimator=LinearRegression(), mean_estimator=None, cv=2) Bases: :py:obj:`libuplift.base.UpliftClassifierMixin`, :py:obj:`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. .. !! processed by numpydoc !! .. py:method:: fit(X, y, trt, n_trt=None, sample_weight=None, *, y_stratify=None) .. py:method:: predict(X)