Skip to content

Commit

Permalink
Merge branch 'release/v0.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
maks-sh committed Apr 30, 2021
2 parents 412b490 + ee55b38 commit e9de7ab
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ Uplift modeling estimates a causal effect of treatment and uses it to effectivel

Read more about uplift modeling problem in `User Guide <https://www.uplift-modeling.com/en/latest/user_guide/index.html>`__.

Articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__
and `Part 2 <https://habr.com/ru/company/ru_mts/blog/485976/>`__.
Articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__ ,
`Part 2 <https://habr.com/ru/company/ru_mts/blog/485976/>`__
and `Part 3 <https://habr.com/ru/company/ru_mts/blog/538934/>`__.

**Features**:

Expand Down
Binary file removed docs/_static/images/client_types.png
Binary file not shown.
Binary file removed docs/_static/images/client_types_RU.png
Binary file not shown.
18 changes: 18 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
* 🔨 something that previously didn’t work as documentated – or according to reasonable expectations – should now work.
* ❗️ you will need to change your code to have the same effect in the future; or a feature will be removed in the future.

## Version 0.3.2

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

* 🔨 Fix bug in [fetch_x5](https://www.uplift-modeling.com/en/v0.3.1/api/datasets/fetch_x5.html) function by [@Muhamob](https://github.com/Muhamob).

### [sklift.metrics](https://www.uplift-modeling.com/en/v0.3.1/api/index/metrics.html)

* 📝 Fix docstring in [uplift_by_percentile](https://www.uplift-modeling.com/en/v0.3.1/api/metrics/uplift_by_percentile.html) function by [@ElisovaIra](https://github.com/ElisovaIra).

### [sklift.viz](https://www.uplift-modeling.com/en/v0.3.1/api/viz/index.html)

* 🔨 Fix bug in [plot_uplift_preds](https://www.uplift-modeling.com/en/v0.3.1/api/viz/plot_uplift_preds.html) function by [@bwbelljr](https://github.com/bwbelljr).

### Miscellaneous

* 📝 Change some images in ["RetailHero tutorial"](https://nbviewer.jupyter.org/github/maks-sh/scikit-uplift/blob/master/notebooks/RetailHero_EN.ipynb).

## Version 0.3.1

### [sklift.datasets](https://www.uplift-modeling.com/en/v0.3.1/api/datasets/index.html)
Expand Down
5 changes: 3 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ The main idea is to provide easy-to-use and fast python package for uplift model

Read more about *uplift modeling* problem in `User Guide <https://www.uplift-modeling.com/en/latest/user_guide/index.html>`__,

Articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__
and `Part 2 <https://habr.com/ru/company/ru_mts/blog/485976/>`__.
Articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__ ,
`Part 2 <https://habr.com/ru/company/ru_mts/blog/485976/>`__
and `Part 3 <https://habr.com/ru/company/ru_mts/blog/538934/>`__.

Features
#########
Expand Down
9 changes: 5 additions & 4 deletions notebooks/RetailHero.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
" <b><a href=\"https://scikit-uplift.readthedocs.io/en/latest/\">SCIKIT-UPLIFT DOCS</a> | </b>\n",
" <b><a href=\"https://scikit-uplift.readthedocs.io/en/latest/user_guide/index.html\">USER GUIDE</a></b>\n",
" <br>\n",
" <b><a href=\"https://nbviewer.jupyter.org/github/maks-sh/scikit-uplift/blob/master/notebooks/RetailHero_EN.ipynb\">ENGLISH VERSION</a>\n",
" <b><a href=\"https://nbviewer.jupyter.org/github/maks-sh/scikit-uplift/blob/master/notebooks/RetailHero_EN.ipynb\">ENGLISH VERSION</a></b>\n",
" <br>\n",
" <b><a href=\"https://habr.com/ru/company/ru_mts/blog/485980/\">СТАТЬЯ НА HABR ЧАСТЬ 1</a> | </b>\n",
" <b><a href=\"https://habr.com/ru/company/ru_mts/blog/485976/\">СТАТЬЯ НА HABR ЧАСТЬ 2</a></b>\n",
" <b><a href=\"https://habr.com/ru/company/ru_mts/blog/485976/\">СТАТЬЯ НА HABR ЧАСТЬ 2</a> | </b>\n",
" <b><a href=\"https://habr.com/ru/company/ru_mts/blog/538934/\">СТАТЬЯ НА HABR ЧАСТЬ 3</a></b>\n",
"\n",
"</center>"
]
Expand Down Expand Up @@ -61,10 +62,10 @@
"Исторически, по воздействию коммуникации маркетологи разделяют всех клиентов на 4 категории:\n",
"\n",
"<p align=\"center\">\n",
" <img src=\"https://raw.githubusercontent.com/maks-sh/scikit-uplift/master/docs/_static/images/client_types_RU.png\" alt=\"Категории клиентов\"/>\n",
" <img src=\"https://habrastorage.org/webt/mb/ed/iw/mbediw3l1dh76tk6_0-zgaxz-ss.jpeg\" width='40%' alt=\"Категории клиентов\"/>\n",
"</p>\n",
"\n",
"1. **`Спящая собака`** - человек, который будет реагировать негативно, если с ним прокоммуницировать. Яркий пример: клиенты, которые забыли про платную подписку. Получив напоминание об этом, они обязательно ее отключат. Но если их не трогать, то клиенты по-прежнему будут приносить деньги. В терминах математики: $W_i = 1, Y_i = 0$ или $W_i = 0, Y_i = 1$.\n",
"1. **`Не беспокоить`** - человек, который будет реагировать негативно, если с ним прокоммуницировать. Яркий пример: клиенты, которые забыли про платную подписку. Получив напоминание об этом, они обязательно ее отключат. Но если их не трогать, то клиенты по-прежнему будут приносить деньги. В терминах математики: $W_i = 1, Y_i = 0$ или $W_i = 0, Y_i = 1$.\n",
"2. **`Потерянный`** - человек, который не совершит целевое действие независимо от коммуникаций. Взаимодействие с такими клиентами не приносит дополнительного дохода, но создает дополнительные затраты. В терминах математики: $W_i = 1, Y_i = 0$ или $W_i = 0, Y_i = 0$.\n",
"3. **`Лояльный`** - человек, который будет реагировать положительно, несмотря ни на что - самый лояльный вид клиентов. По аналогии с предыдущим пунктом, такие клиенты также расходуют ресурсы. Однако в данном случае расходы гораздо больше, так как **лояльные** еще и пользуются маркетинговым предложением (скидками, купонами и другое). В терминах математики: $W_i = 1, Y_i = 1$ или $W_i = 0, Y_i = 1$.\n",
"4. **`Убеждаемый`** - это человек, который положительно реагирует на предложение, но при его отсутствии не выполнил бы целевого действия. Это те люди, которых мы хотели бы определить нашей моделью, чтобы с ними прокоммуницировать. В терминах математики: $W_i = 0, Y_i = 0$ или $W_i = 1, Y_i = 1$.\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/RetailHero_EN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"Historically, according to the impact of communication, marketers divide all customers into 4 categories:\n",
"\n",
"<p align=\"center\">\n",
" <img src=\"https://raw.githubusercontent.com/maks-sh/scikit-uplift/master/docs/_static/images/client_types.png\" alt=\"Customer types\"/>\n",
" <img src=\"https://raw.githubusercontent.com/maks-sh/scikit-uplift/master/docs/_static/images/user_guide/ug_clients_types.jpg\" alt=\"Customer types\" width='40%'/>\n",
"</p>\n",
"\n",
"- **`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: $W_i = 1, Y_i = 0$ or $W_i = 0, Y_i = 1$.\n",
Expand Down
2 changes: 1 addition & 1 deletion sklift/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.1'
__version__ = '0.3.2'
2 changes: 1 addition & 1 deletion sklift/datasets/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def fetch_x5(data_home=None, dest_subdir=None, download_if_missing=True):
dest_filename=file_clients,
download_if_missing=download_if_missing)
clients = pd.read_csv(csv_clients_path)
clients_features = list(clients.column)
clients_features = list(clients.columns)

url_purchases = 'https://timds.s3.eu-central-1.amazonaws.com/purchases.csv.gz'
file_purchases = url_purchases.split('/')[-1]
Expand Down
2 changes: 1 addition & 1 deletion sklift/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def uplift_by_percentile(y_true, uplift, treatment, strategy='overall',
std (bool): If True, add columns with the uplift standard deviation and the response rate standard deviation.
Default is False.
total (bool): If True, add the last row with the total values. Default is False.
The total uplift is a weighted average uplift. See :func:`.weighted_average_uplift`.
The total uplift computes as a total response rate treatment - a total response rate control.
The total response rate is a response rate on the full data amount.
bins (int): Determines the number of bins (and the relative percentile) in the data. Default is 10.
string_percentiles (bool): type of percentiles in the index: float or string. Default is True (string).
Expand Down
1 change: 0 additions & 1 deletion sklift/viz/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def plot_uplift_preds(trmnt_preds, ctrl_preds, log=False, bins=100):

# TODO: Add k as parameter: vertical line on plots
check_consistent_length(trmnt_preds, ctrl_preds)
check_is_binary(treatment)

if not isinstance(bins, int) or bins <= 0:
raise ValueError(
Expand Down

0 comments on commit e9de7ab

Please sign in to comment.