Two Model¶
The Two Model Approach (Double Model, Separate Model).
- Based on
Kuchumov, A. pyuplift: Lightweight uplift modeling framework for Python. (2019). URL: https://github.com/duketemon/pyuplift. License: https://github.com/duketemon/pyuplift/blob/master/LICENSE.
Hansotia, B. and B. Rukstales (2002). “Incremental value modeling”. In: Journal of Interactive Marketing 16(3), pp. 35–46. URL: https://search.proquest.com/openview/1f86b52432f7d80e46101b2b4b7629c0/1?cbl=32002& pq-origsite=gscholar
Devriendt, F. et al. (2018). A Literature Survey and Experimental Evaluation of the State-of-the-Art in Uplift Modeling: A Stepping Stone Toward the Development of Prescriptive Analytics. Big Data, Vol. 6, No. 1, March 1, 2018, pp. 1-29. Codes found at: data-lab.be/downloads.php.
- Contents
- TwoModel Class
fit, predict, predict_proba
- class causeinfer.standard_algorithms.two_model.TwoModel(control_model=None, treatment_model=None)[source]¶
- fit(X, y, w)[source]¶
Trains a model given covariates, responses and assignments.
- Parameters:
- Xnumpy.ndarray(num_units, num_features)int, float
Matrix of covariates.
- ynumpy.ndarray(num_units,)int, float
Vector of unit responses.
- wnumpy.ndarray(num_units,)int, float
Vector of original treatment allocations across units.
- Returns:
- treatment_model, control_modelcauseinfer.standard_algorithms.TwoModel
Two trained models (one for training group, one for control).
- predict(X)[source]¶
Predicts a causal effect given covariates.
- Parameters:
- Xnumpy.ndarray(num_units, num_features)int, float
New data on which to make predictions.
- Returns:
- predictionsnumpy.ndarray(num_units, 2)float
Predicted causal effects for all units given treatment model and control.
- predict_proba(X)[source]¶
Predicts the probability that a subject will be a given class given covariates.
- Parameters:
- Xnumpy.ndarray(num_units, num_features)int, float
New data on which to make predictions.
- Returns:
- probasnumpy.ndarray(num_units, 2)float
Predicted probability to respond for all units given treatment and control models.