Skip to content

Commit 8783ef8

Browse files
committed
Merge branch 'feature/user_guide_and_docs_improving' into dev
2 parents 3e23567 + ad1e7b8 commit 8783ef8

File tree

16 files changed

+116
-49
lines changed

16 files changed

+116
-49
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team. All
58+
reported by contacting the project team at [email protected]. All
5959
complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

Readme.rst

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,36 @@
3636
scikit-uplift
3737
===============
3838

39-
**scikit-uplift** is a Python module for classic approaches for uplift modeling built on top of scikit-learn.
39+
**scikit-uplift (sklift)** is an uplift modeling python package that provides fast sklearn-style models implementation, evaluation metrics and visualization tools.
4040

41-
Uplift prediction aims to estimate the causal impact of a treatment at the individual level.
41+
Uplift modeling estimates a causal effect of treatment and uses it to effectively target customers that are most likely to respond to a marketing campaign.
42+
43+
**Use cases for uplift modeling:**
44+
45+
* Target customers in the marketing campaign. Quite useful in promotion of some popular product where there is a big part of customers who make a target action by themself without any influence. By modeling uplift you can find customers who are likely to make the target action (for instance, install an app) only when treated (for instance, received a push).
46+
47+
* Combine a churn model and an uplift model to offer some bonus to a group of customers who are likely to churn.
48+
49+
* Select a tiny group of customers in the campaign where a price per customer is high.
4250

4351
Read more about uplift modeling problem in `User Guide <https://scikit-uplift.readthedocs.io/en/latest/user_guide/index.html>`__,
44-
also articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__
52+
53+
Articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__
4554
and `Part 2 <https://habr.com/ru/company/ru_mts/blog/485976/>`__.
4655

4756
**Features**:
4857

49-
* Comfortable and intuitive style of modelling like scikit-learn;
58+
* Сomfortable and intuitive scikit-learn-like API;
5059

51-
* Applying any estimator adheres to scikit-learn conventions;
60+
* Applying any estimator compatible with scikit-learn (e.g. Xgboost, LightGBM, Catboost, etc.);
5261

5362
* All approaches can be used in sklearn.pipeline (see example (`EN <https://nbviewer.jupyter.org/github/maks-sh/scikit-uplift/blob/master/notebooks/pipeline_usage_EN.ipynb>`__ |Open In Colab3|_, `RU <https://nbviewer.jupyter.org/github/maks-sh/scikit-uplift/blob/master/notebooks/pipeline_usage_RU.ipynb>`__ |Open In Colab4|_));
5463

55-
* Almost all implemented approaches solve both the problem of classification and regression;
64+
* Almost all implemented approaches solve classification and regression problem;
5665

57-
* A lot of metrics (Such as *Area Under Uplift Curve* or *Area Under Qini Curve*) are implemented to evaluate your uplift model;
66+
* More uplift metrics that you have ever seen in one place! Include brilliants like *Area Under Uplift Curve* (AUUC) or *Area Under Qini Curve* (Qini coefficient) with ideal cases;
5867

59-
* Useful graphs for analyzing the built model.
68+
* Nice and useful viz for analyzing a performance model.
6069

6170
Installation
6271
-------------
@@ -149,7 +158,7 @@ See the **RetailHero tutorial notebook** (`EN <https://nbviewer.jupyter.org/gith
149158
# import vizualisation tools
150159
from sklift.viz import plot_qini_curve
151160
152-
plot_qini_curve(y_true=y_val, uplift=uplift_preds, treatment=treat_val)
161+
plot_qini_curve(y_true=y_val, uplift=uplift_preds, treatment=treat_val, negative_effect=True)
153162
154163
.. image:: docs/_static/images/Readme_qini_curve.png
155164
:width: 514px
@@ -164,6 +173,8 @@ We welcome new contributors of all experience levels.
164173
- Please see our `Contributing Guide <https://scikit-uplift.readthedocs.io/en/latest/contributing.html>`_ for more details.
165174
- 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>`__.
166175

176+
If you have any questions, please contact us at [email protected]
177+
167178
Contributing
168179
~~~~~~~~~~~~~~~
169180

docs/Readme.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. _scikit-uplift.readthedocs.io: https://scikit-uplift.readthedocs.io/en/latest/
1+
.. _uplift-modeling.com: https://www.uplift-modeling.com/en/latest/index.html
22

33
Documentation
44
===============
55

6-
The full documentation is available at `scikit-uplift.readthedocs.io`_.
6+
The full documentation is available at `uplift-modeling.com`_.
77

88
Or you can build the documentation locally using `Sphinx <http://sphinx-doc.org/>`_ 1.4 or later:
99

109 KB
Loading

docs/hall_of_fame.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ Hall of Fame
44

55
Here are the links to the competitions, names of the winners and to their solutions, where scikit-uplift was used.
66

7-
`X5 RetailHero Uplift Modeling contest <https://retailhero.ai/c/uplift_modeling/overview>`_
8-
=============================================================================================
7+
`X5 Retail Hero: Uplift Modeling for Promotional Campaign <https://ods.ai/competitions/x5-retailhero-uplift-modeling>`_
8+
========================================================================================================================
9+
10+
Predict how much the purchase probability could increase as a result of sending an advertising SMS.
11+
912
2. `Kirill Liksakov <https://github.com/kirrlix1994>`_
1013
`solution <https://github.com/kirrlix1994/Retail_hero>`_

docs/index.rst

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,39 @@
88
scikit-uplift
99
**************
1010

11-
**scikit-uplift (sklift)** is a Python module for basic approaches of uplift modeling built on top of scikit-learn.
11+
**scikit-uplift (sklift)** is an uplift modeling python package that provides fast sklearn-style models implementation, evaluation metrics and visualization tools.
1212

13-
Uplift prediction aims to estimate the causal impact of a treatment at the individual level.
13+
The main idea is to provide easy-to-use and fast python package for uplift modeling. It delivers the model interface with the familiar scikit-learn API. One can use any popular estimator (for instance, from the Catboost library).
1414

15-
Read more about uplift modeling problem in :ref:`User Guide <user_guide>`,
16-
also articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__
15+
*Uplift modeling* estimates a causal effect of treatment and uses it to effectively target customers that are most likely to respond to a marketing campaign.
16+
17+
**Use cases for uplift modeling:**
18+
19+
* Target customers in the marketing campaign. Quite useful in promotion of some popular product where there is a big part of customers who make a target action by themself without any influence. By modeling uplift you can find customers who are likely to make the target action (for instance, install an app) only when treated (for instance, received a push).
20+
21+
* Combine a churn model and an uplift model to offer some bonus to a group of customers who are likely to churn.
22+
23+
* Select a tiny group of customers in the campaign where a price per customer is high.
24+
25+
Read more about *uplift modeling* problem in `User Guide <https://scikit-uplift.readthedocs.io/en/latest/user_guide/index.html>`__,
26+
27+
Articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__
1728
and `Part 2 <https://habr.com/ru/company/ru_mts/blog/485976/>`__.
1829

1930
Features
2031
#########
2132

22-
- Comfortable and intuitive style of modelling like scikit-learn;
33+
- Сomfortable and intuitive scikit-learn-like API;
2334

24-
- Applying any estimator adheres to scikit-learn conventions;
35+
- Applying any estimator compatible with scikit-learn (e.g. Xgboost, LightGBM, Catboost, etc.);
2536

26-
- All approaches can be used in sklearn.pipeline. See example of usage: |Open In Colab3|_;
37+
- All approaches can be used in `sklearn.pipeline`. See the example of usage: |Open In Colab3|_;
2738

28-
- Almost all implemented approaches solve both the problem of classification and regression;
39+
- Almost all implemented approaches solve classification and regression problem;
2940

30-
- A lot of metrics (Such as *Area Under Uplift Curve* or *Area Under Qini Curve*) are implemented to evaluate your uplift model;
41+
- More uplift metrics that you have ever seen in one place! Include brilliants like *Area Under Uplift Curve* (AUUC) or *Area Under Qini Curve* (Qini coefficient) with ideal cases;
3142

32-
- Useful graphs for analyzing the built model.
43+
- Nice and useful viz for analyzing a performance model.
3344

3445

3546
**The package currently supports the following methods:**
@@ -50,18 +61,20 @@ Project info
5061

5162
* GitHub repository: https://github.com/maks-sh/scikit-uplift
5263
* Github examples: https://github.com/maks-sh/scikit-uplift/tree/master/notebooks
53-
* Documentation: https://scikit-uplift.readthedocs.io/en/latest/
54-
* Contributing guide: https://scikit-uplift.readthedocs.io/en/latest/contributing.html
64+
* Documentation: https://www.uplift-modeling.com/en/latest/index.html
65+
* Contributing guide: https://www.uplift-modeling.com/en/latest/contributing.html
5566
* License: `MIT <https://github.com/maks-sh/scikit-uplift/blob/master/LICENSE>`__
5667

5768
Community
5869
#############
5970

60-
We welcome new contributors of all experience levels.
71+
Sklift is being actively maintained and welcomes new contributors of all experience levels.
6172

62-
- Please see our `Contributing Guide <https://scikit-uplift.readthedocs.io/en/latest/contributing.html>`_ for more details.
73+
- Please see our `Contributing Guide <https://www.uplift-modeling.com/en/latest/contributing.html>`_ for more details.
6374
- 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>`__.
6475

76+
If you have any questions, please contact us at [email protected]
77+
6578
.. image:: https://sourcerer.io/fame/maks-sh/maks-sh/scikit-uplift/images/0
6679
:target: https://sourcerer.io/fame/maks-sh/maks-sh/scikit-uplift/links/0
6780
:alt: Top contributor 1

docs/quick_start.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ Quick Start
1313

1414
See the **RetailHero tutorial notebook** (`EN`_ |Open In Colab1|_, `RU`_ |Open In Colab2|_) for details.
1515

16-
**Train and predict your uplift model**
16+
Train and predict your uplift model
17+
====================================
18+
19+
Use the intuitive python API to train uplift models.
1720

1821
.. code-block:: python
1922
:linenos:
@@ -38,7 +41,8 @@ See the **RetailHero tutorial notebook** (`EN`_ |Open In Colab1|_, `RU`_ |Open I
3841
# predict uplift
3942
uplift_preds = tm.predict(X_val)
4043
41-
**Evaluate your uplift model**
44+
Evaluate your uplift model
45+
===========================
4246

4347
.. code-block:: python
4448
:linenos:
@@ -66,14 +70,15 @@ See the **RetailHero tutorial notebook** (`EN`_ |Open In Colab1|_, `RU`_ |Open I
6670
tm_wau = weighted_average_uplift(y_true=y_val, uplift=uplift_preds,
6771
treatment=treat_val)
6872
69-
**Vizualize the results**
73+
Vizualize the results
74+
======================
7075

7176
.. code-block:: python
7277
:linenos:
7378
7479
from sklift.viz import plot_qini_curve
7580
76-
plot_qini_curve(y_true=y_val, uplift=uplift_preds, treatment=treat_val)
81+
plot_qini_curve(y_true=y_val, uplift=uplift_preds, treatment=treat_val, negative_effect=True)
7782
7883
.. image:: _static/images/quick_start_qini.png
7984
:width: 514px

docs/user_guide/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ User Guide
77
.. image:: https://habrastorage.org/webt/hf/7i/nu/hf7inuu3agtnwl1yo0g--mznzno.jpeg
88
:alt: Cover of User Guide for uplift modeling and causal inference
99

10-
Uplift modeling estimates the effect of communication action on some customer outcome and gives an opportunity to efficiently target customers which are most likely to respond to a marketing campaign.
10+
Uplift modeling estimates the effect of communication action on some customer outcomes and gives an opportunity to efficiently target customers which are most likely to respond to a marketing campaign.
1111
It is relatively easy to implement, but surprisingly poorly covered in the machine learning courses and literature.
1212
This guide is going to shed some light on the essentials of causal inference estimating and uplift modeling.
1313

@@ -44,5 +44,5 @@ If you find this User Guide useful for your research, please consider citing:
4444
year = {2020},
4545
publisher = {GitHub},
4646
journal = {GitHub repository},
47-
howpublished = {\url{https://scikit-uplift.readthedocs.io/en/latest/user_guide/index.html}}
47+
howpublished = {\url{https://www.uplift-modeling.com/en/latest/user_guide/index.html}}
4848
}

docs/user_guide/introduction/cate.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Causal Inference: Basics
33
******************************************
44

5-
In a perfect world, we want to calculate a difference in a person's reaction received communication and the reaction without receiving any communication.
5+
In a perfect world, we want to calculate a difference in a person's reaction received communication, and the reaction without receiving any communication.
66
But there is a problem: we can not make a communication (send an e-mail) and do not make a communication (no e-mail) at the same time.
77

88
.. image:: https://habrastorage.org/webt/fl/fi/dz/flfidz416o7of5j0nmgdjqqkzfe.jpeg
@@ -29,8 +29,8 @@ But we can estimate CATE or *uplift* of an object:
2929
3030
Where:
3131

32-
- :math:`W_i \in {0, 1}` - a binary variable: 1 if person :math:`i` receives the treatment :guilabel:`treatment group`, and 0 if person :math:`i` receives no treatment :guilabel:`control group`;
33-
- :math:`Y_i` - person :math:`i`’s observed outcome, which is actually equal:
32+
- :math:`W_i \in {0, 1}` - a binary variable: 1 if person :math:`i` receives the :guilabel:`treatment group`, and 0 if person :math:`i` receives no treatment :guilabel:`control group`;
33+
- :math:`Y_i` - person :math:`i`’s observed outcome, which is equal:
3434

3535
.. math::
3636
Y_i = W_i * Y_i^1 + (1 - W_i) * Y_i^0 = \
@@ -41,12 +41,12 @@ Where:
4141
4242
This won’t identify the CATE unless one is willing to assume that :math:`W_i` is independent of :math:`Y_i^1` and :math:`Y_i^0` conditional on :math:`X_i`. This assumption is the so-called *Unconfoundedness Assumption* or the *Conditional Independence Assumption* (CIA) found in the social sciences and medical literature.
4343
This assumption holds true when treatment assignment is random conditional on :math:`X_i`.
44-
Briefly this can be written as:
44+
Briefly, this can be written as:
4545

4646
.. math::
4747
CIA : \{Y_i^0, Y_i^1\} \perp \!\!\! \perp W_i \vert X_i
4848
49-
Also introduce additional useful notation.
49+
Also, introduce additional useful notation.
5050
Let us define the :guilabel:`propensity score`, :math:`p(X_i) = P(W_i = 1| X_i)`, i.e. the probability of treatment given :math:`X_i`.
5151

5252
References

docs/user_guide/introduction/clients.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
Types of customers
33
******************************************
44

5-
We can determine 4 types of customers based on a response to a treatment:
5+
We can determine 4 types of customers based on a response to treatment:
66

77
.. image:: ../../_static/images/user_guide/ug_clients_types.jpg
88
:alt: Classification of customers based on their response to a treatment
99
:width: 268 px
1010
:height: 282 px
1111
:align: center
1212

13-
- :guilabel:`Do-Not-Disturbs` *(a.k.a. Sleeping-dogs)* have a strong negative response to a marketing communication. They are going to purchase if *NOT* treated and will *NOT* purchase *IF* treated. It is not only a wasted marketing budget but also a negative impact. For instance, customers targeted could result in rejecting current products or services. In terms of math: :math:`W_i = 1, Y_i = 0` or :math:`W_i = 0, Y_i = 1`.
13+
- :guilabel:`Do-Not-Disturbs` *(a.k.a. Sleeping-dogs)* have a strong negative response to marketing communication. They are going to purchase if *NOT* treated and will *NOT* purchase *IF* treated. It is not only a wasted marketing budget but also a negative impact. For instance, customers targeted could result in rejecting current products or services. In terms of math: :math:`W_i = 1, Y_i = 0` or :math:`W_i = 0, Y_i = 1`.
1414
- :guilabel:`Lost Causes` will *NOT* purchase the product *NO MATTER* they are contacted or not. The marketing budget in this case is also wasted because it has no effect. In terms of math: :math:`W_i = 1, Y_i = 0` or :math:`W_i = 0, Y_i = 0`.
1515
- :guilabel:`Sure Things` will purchase *ANYWAY* no matter they are contacted or not. There is no motivation to spend the budget because it also has no effect. In terms of math: :math:`W_i = 1, Y_i = 1` or :math:`W_i = 0, Y_i = 1`.
16-
- :guilabel:`Persuadables` will always respond *POSITIVE* to the marketing communication. They is going to purchase *ONLY* if contacted (or sometimes they purchase *MORE* or *EARLIER* only if contacted). This customer's type should be the only target for the marketing campaign. In terms of math: :math:`W_i = 0, Y_i = 0` or :math:`W_i = 1, Y_i = 1`.
16+
- :guilabel:`Persuadables` will always respond *POSITIVE* to marketing communication. They are going to purchase *ONLY* if contacted (or sometimes they purchase *MORE* or *EARLIER* only if contacted). This customer's type should be the only target for the marketing campaign. In terms of math: :math:`W_i = 0, Y_i = 0` or :math:`W_i = 1, Y_i = 1`.
1717

1818
Because we can't communicate and not communicate with the customer at the same time, we will never be able to observe exactly which type a particular customer belongs to.
1919

0 commit comments

Comments
 (0)