Quaternary Class Transformation¶
The Quaternary Class Transformation Approach (Response Transformation Approach).
- 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.
Kane, K., Lo, VSY., and Zheng, J. (2014). “Mining for the truly responsive customers and prospects using truelift modeling: Comparison of new and existing methods”. In:Journal of Marketing Analytics 2(4), 218–238. URL: https://link.springer.com/article/10.1057/jma.2014.18
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
- QuaternaryTransformation Class
_quaternary_transformation, _quaternary_regularization, fit, predict (not available at this time), predict_proba
- class causeinfer.standard_algorithms.quaternary_transformation.QuaternaryTransformation(model=None, regularize=False)[source]¶
- _quaternary_transformation(y, w)[source]¶
Assigns known quaternary (TP, CP, CN, TN) classes to units.
- Parameters:
- ynumpy.ndarray(num_units,)int, float
Vector of unit responses.
- wnumpy.ndarray(num_units,)int, float
Vector of original treatment allocations across units.
- Returns:
- np.array(y_transformed)np.array
an array of transformed unit classes.
- _quaternary_regularization(y=None, w=None)[source]¶
Regularization of quaternary classes is based on their treatment assignment.
- Parameters:
- ynumpy.ndarray(num_units,)int, float
Vector of unit responses.
- wnumpy.ndarray(num_units,)int, float
Vector of original treatment allocations across units.
- Returns:
- control_count, treatment_countint
Regularized amounts of control and treatment classes.
- 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:
- selfcauseinfer.standard_algorithms.QuaternaryTransformation
A trained model.
- 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 probabilities for being a favorable class and an unfavorable class.