Skip to content

Commit 0038e65

Browse files
committed
Merge branch 'release/v0.5.1'
2 parents e132f12 + f114e3e commit 0038e65

File tree

10 files changed

+170
-70
lines changed

10 files changed

+170
-70
lines changed

Readme.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
:align: center
3333
:alt: scikit-uplift: uplift modeling in scikit-learn style in python
3434

35+
.. |Contribs| image:: https://contrib.rocks/image?repo=maks-sh/scikit-uplift
36+
:target: https://github.com/maks-sh/scikit-uplift/graphs/contributors
37+
:alt: Contributors
3538

3639
scikit-uplift
3740
===============
@@ -199,6 +202,10 @@ We welcome new contributors of all experience levels.
199202
- Please see our `Contributing Guide <https://www.uplift-modeling.com/en/latest/contributing.html>`_ for more details.
200203
- By participating in this project, you agree to abide by its `Code of Conduct <https://github.com/maks-sh/scikit-uplift/blob/master/.github/CODE_OF_CONDUCT.md>`__.
201204

205+
Thanks to all our contributors!
206+
207+
|Contribs|
208+
202209
If you have any questions, please contact us at [email protected]
203210

204211
Important links
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
********************************************
2+
`sklift.models <./>`_.ClassTransformationReg
3+
********************************************
4+
5+
.. autoclass:: sklift.models.models.ClassTransformationReg
6+
:members:

docs/api/models/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ See :ref:`Models <models>` section of the User Guide for further details.
99

1010
./SoloModel
1111
./ClassTransformation
12+
./ClassTransformationReg
1213
./TwoModels

docs/changelog.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,26 @@
88
* 🔨 something that previously didn’t work as documented – or according to reasonable expectations – should now work.
99
* ❗️ you will need to change your code to have the same effect in the future; or a feature will be removed in the future.
1010

11+
## Version 0.5.1
12+
13+
### [sklift.models](https://www.uplift-modeling.com/en/v0.5.1/api/models/index.html)
14+
15+
* 📝 Add docs page for [ClassTransformationReg](https://www.uplift-modeling.com/en/v0.5.1/api/models/ClassTransformationReg.html) model.
16+
17+
### [sklift.datasets](https://www.uplift-modeling.com/en/v0.5.1/api/datasets/index.html)
18+
19+
* 🔨 Fix bug in [fetch_x5](https://www.uplift-modeling.com/en/v0.5.1/api/datasets/fetch_x5.html) func.
20+
21+
### [User Guide](https://www.uplift-modeling.com/en/v0.5.1/user_guide/index.html)
22+
23+
* 📝 Add page for [Transformed Outcome](https://www.uplift-modeling.com/en/v0.5.1/user_guide/models/transformed_outcome.html) approach.
24+
25+
1126
## Version 0.5.0
1227

1328
### [sklift.models](https://www.uplift-modeling.com/en/v0.5.0/api/models/index.html)
1429

15-
* 🔥 Add [ClassTransformationReg](https://www.uplift-modeling.com/en/v0.5.0/api/models.html#sklift.models.models.TwoModels) model by [@mcullan](https://github.com/mcullan) and [@ElisovaIra](https://github.com/ElisovaIra).
30+
* 🔥 Add ClassTransformationReg model by [@mcullan](https://github.com/mcullan) and [@ElisovaIra](https://github.com/ElisovaIra).
1631
* 🔨 Add the ability to process a series with different indexes in the [TwoModels](https://www.uplift-modeling.com/en/v0.5.0/api/models.html#sklift.models.models.TwoModels) by [@flashlight101](https://github.com/flashlight101).
1732

1833
### [sklift.metrics](https://www.uplift-modeling.com/en/v0.5.0/api/index/metrics.html)
@@ -21,11 +36,11 @@
2136

2237
### [sklift.datasets](https://www.uplift-modeling.com/en/v0.5.0/api/datasets/index.html)
2338

24-
* 💥 Add cheker based on hash for all datasets by [@flashlight101](https://github.com/flashlight101)
39+
* 💥 Add checker based on hash for all datasets by [@flashlight101](https://github.com/flashlight101)
2540
* 📝 Add [scheme](https://www.uplift-modeling.com/en/v0.5.0/api/datasets/fetch_x5.html) of x5 dataframes.
2641

2742
### Miscellaneous
28-
* 📝 Improve Chinise tags by [@00helloworld](https://github.com/00helloworld)
43+
* 📝 Improve Chinese tags by [@00helloworld](https://github.com/00helloworld)
2944

3045
## Version 0.4.1
3146

docs/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
.. |Open In Colab4| image:: https://colab.research.google.com/assets/colab-badge.svg
55
.. _Open In Colab4: https://colab.research.google.com/github/maks-sh/scikit-uplift/blob/master/notebooks/uplift_model_selection_tutorial.ipynb
66

7+
.. |Contribs| image:: https://contrib.rocks/image?repo=maks-sh/scikit-uplift
8+
:target: https://github.com/maks-sh/scikit-uplift/graphs/contributors
9+
:alt: Contributors
10+
711
**************
812
scikit-uplift
913
**************
@@ -76,6 +80,10 @@ Sklift is being actively maintained and welcomes new contributors of all experie
7680
- Please see our `Contributing Guide <https://www.uplift-modeling.com/en/latest/contributing.html>`_ for more details.
7781
- By participating in this project, you agree to abide by its `Code of Conduct <https://github.com/maks-sh/scikit-uplift/blob/master/.github/CODE_OF_CONDUCT.md>`__.
7882

83+
Thanks to all our contributors!
84+
85+
|Contribs|
86+
7987
If you have any questions, please contact us at [email protected]
8088

8189
.. toctree::

docs/user_guide/models/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ Models
1616
./classification
1717
./solo_model
1818
./revert_label
19+
./transformed_outcome
1920
./two_models
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.. _ClassTransformationReg:
2+
3+
********************
4+
Transformed Outcome
5+
********************
6+
7+
Let's redefine target variable, which indicates that treatment make some impact on target or
8+
did target is negative without treatment:
9+
10+
.. math::
11+
Z = Y * \frac{(W - p)}{(p * (1 - p))}
12+
13+
* :math:`Y` - target vector,
14+
* :math:`W` - vector of binary communication flags, and
15+
* :math:`p` is a *propensity score* (the probabilty that each :math:`y_i` is assigned to the treatment group.).
16+
17+
It is important to note here that it is possible to estimate :math:`p` as the proportion of objects with :math:`W = 1`
18+
in the sample. Or use the method from [2], in which it is proposed to evaluate math:`p` as a function of :math:`X` by
19+
training the classifier on the available data :math:`X = x`, and taking the communication flag vector math:`W` as
20+
the target variable.
21+
22+
.. image:: https://habrastorage.org/r/w1560/webt/35/d2/z_/35d2z_-3yhyqhwtw-mt-npws6xk.png
23+
:align: center
24+
:alt: Transformation of the target in Transformed Outcome approach
25+
26+
After applying the formula, we get a new target variable :math:`Z_i` and can train a regression model with the error
27+
functional :math:`MSE= \frac{1}{n}\sum_{i=0}^{n} (Z_i - \hat{Z_i})^2`. Since it is precisely when using MSE that the
28+
predictions of the model are the conditional mathematical expectation of the target variable.
29+
30+
It can be proved that the conditional expectation of the transformed target :math:`Z_i` is the desired causal effect:
31+
32+
.. math::
33+
E[Z_i| X_i = x] = Y_i^1 - Y_i^0 = \tau_i
34+
35+
.. hint::
36+
In sklift this approach corresponds to the :class:`.ClassTransformationReg` class.
37+
38+
References
39+
==========
40+
41+
1️⃣ Susan Athey and Guido W Imbens. Machine learning methods for estimating heterogeneouscausal effects. stat, 1050:5, 2015.
42+
43+
2️⃣ P. Richard Hahn, Jared S. Murray, and Carlos Carvalho. Bayesian regression tree models for causal inference: regularization, confounding, and heterogeneous effects. 2019.

sklift/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.5.0'
1+
__version__ = '0.5.1'

0 commit comments

Comments
 (0)