Skip to content

Commit 9e4baa6

Browse files
committed
Merge branch 'release/v0.1.2'
2 parents 7854df2 + fd17ee2 commit 9e4baa6

File tree

10 files changed

+309
-228
lines changed

10 files changed

+309
-228
lines changed

docs/changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
* 🔨 something that previously didn’t work as documentated – 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.1.2
12+
13+
### [sklift.models](https://scikit-uplift.readthedocs.io/en/latest/api/models.html)
14+
15+
* 🔨 Fix bugs in [TwoModels](https://scikit-uplift.readthedocs.io/en/latest/api/models.html#sklift.models.models.TwoModels) for regression problem.
16+
* 📝 Minor code refactoring.
17+
18+
### [sklift.metrics](https://scikit-uplift.readthedocs.io/en/latest/api/metrics.html)
19+
20+
* 📝 Minor code refactoring.
21+
22+
### [sklift.viz](https://scikit-uplift.readthedocs.io/en/latest/api/viz.html)
23+
24+
* 💥 Add bar plot in [plot_uplift_by_percentile](https://scikit-uplift.readthedocs.io/en/latest/api/viz.html#sklift.viz.base.plot_uplift_by_percentile) by [@ElisovaIra](https://github.com/ElisovaIra).
25+
* 🔨 Fix bug in [plot_uplift_by_percentile](https://scikit-uplift.readthedocs.io/en/latest/api/viz.html#sklift.viz.base.plot_uplift_by_percentile).
26+
* 📝 Minor code refactoring.
27+
1128
## Version 0.1.1
1229

1330
### [sklift.viz](https://scikit-uplift.readthedocs.io/en/latest/api/viz.html)

docs/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def get_version():
3333
# -- Project information -----------------------------------------------------
3434

3535
project = 'scikit-uplift'
36-
author = 'Maksim Shevchenko'
36+
author = 'Maksim Shevchenko and Contributors'
3737
copyright = "{}, {}".format(datetime.datetime.now().year, author)
3838

3939
# The full version, including alpha/beta/rc tags
@@ -46,8 +46,11 @@ def get_version():
4646
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4747
# ones.
4848
extensions = [
49-
"sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.mathjax", "sphinx.ext.napoleon",
50-
"recommonmark"
49+
"sphinx.ext.autodoc",
50+
"sphinx.ext.viewcode",
51+
"sphinx.ext.mathjax",
52+
"sphinx.ext.napoleon",
53+
"recommonmark",
5154
]
5255

5356
master_doc = 'index'
@@ -58,7 +61,7 @@ def get_version():
5861
# List of patterns, relative to source directory, that match files and
5962
# directories to ignore when looking for source files.
6063
# This pattern also affects html_static_path and html_extra_path.
61-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
64+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'Readme.rst']
6265

6366

6467
# -- Options for HTML output -------------------------------------------------

notebooks/RetailHero.ipynb

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
"execution_count": 1,
108108
"metadata": {
109109
"ExecuteTime": {
110-
"end_time": "2020-04-28T09:24:37.492036Z",
111-
"start_time": "2020-04-28T09:24:37.488584Z"
110+
"end_time": "2020-05-02T17:07:22.372375Z",
111+
"start_time": "2020-05-02T17:07:22.368436Z"
112112
},
113113
"colab": {
114114
"base_uri": "https://localhost:8080/",
@@ -126,7 +126,7 @@
126126
"urllib.request.urlretrieve(url, '/content/retail_hero.zip')\n",
127127
"\n",
128128
"!unzip /content/retail_hero.zip\n",
129-
"!pip install scikit-uplift==0.1.1 catboost=0.22"
129+
"!pip install scikit-uplift==0.1.2 catboost=0.22"
130130
]
131131
},
132132
{
@@ -144,8 +144,8 @@
144144
"execution_count": 2,
145145
"metadata": {
146146
"ExecuteTime": {
147-
"end_time": "2020-04-28T09:24:40.783897Z",
148-
"start_time": "2020-04-28T09:24:37.503470Z"
147+
"end_time": "2020-05-02T17:07:25.384054Z",
148+
"start_time": "2020-05-02T17:07:22.383222Z"
149149
},
150150
"colab": {},
151151
"colab_type": "code",
@@ -196,8 +196,8 @@
196196
"execution_count": 3,
197197
"metadata": {
198198
"ExecuteTime": {
199-
"end_time": "2020-04-28T09:24:42.100096Z",
200-
"start_time": "2020-04-28T09:24:40.786498Z"
199+
"end_time": "2020-05-02T17:07:26.483716Z",
200+
"start_time": "2020-05-02T17:07:25.386480Z"
201201
},
202202
"colab": {},
203203
"colab_type": "code",
@@ -251,8 +251,8 @@
251251
"execution_count": 4,
252252
"metadata": {
253253
"ExecuteTime": {
254-
"end_time": "2020-04-28T09:24:44.483576Z",
255-
"start_time": "2020-04-28T09:24:42.102707Z"
254+
"end_time": "2020-05-02T17:07:28.491581Z",
255+
"start_time": "2020-05-02T17:07:26.486312Z"
256256
},
257257
"colab": {
258258
"base_uri": "https://localhost:8080/",
@@ -313,8 +313,8 @@
313313
"execution_count": 5,
314314
"metadata": {
315315
"ExecuteTime": {
316-
"end_time": "2020-04-28T09:24:44.511016Z",
317-
"start_time": "2020-04-28T09:24:44.486035Z"
316+
"end_time": "2020-05-02T17:07:28.514717Z",
317+
"start_time": "2020-05-02T17:07:28.494500Z"
318318
},
319319
"colab": {
320320
"base_uri": "https://localhost:8080/",
@@ -484,8 +484,8 @@
484484
"execution_count": 6,
485485
"metadata": {
486486
"ExecuteTime": {
487-
"end_time": "2020-04-28T09:24:45.715602Z",
488-
"start_time": "2020-04-28T09:24:44.514353Z"
487+
"end_time": "2020-05-02T17:07:29.570605Z",
488+
"start_time": "2020-05-02T17:07:28.518362Z"
489489
},
490490
"colab": {
491491
"base_uri": "https://localhost:8080/",
@@ -545,8 +545,8 @@
545545
"execution_count": 7,
546546
"metadata": {
547547
"ExecuteTime": {
548-
"end_time": "2020-04-28T09:24:47.941480Z",
549-
"start_time": "2020-04-28T09:24:45.719641Z"
548+
"end_time": "2020-05-02T17:07:31.489869Z",
549+
"start_time": "2020-05-02T17:07:29.572733Z"
550550
},
551551
"colab": {
552552
"base_uri": "https://localhost:8080/",
@@ -632,8 +632,8 @@
632632
"execution_count": 8,
633633
"metadata": {
634634
"ExecuteTime": {
635-
"end_time": "2020-04-28T09:24:50.571779Z",
636-
"start_time": "2020-04-28T09:24:47.944822Z"
635+
"end_time": "2020-05-02T17:07:33.865281Z",
636+
"start_time": "2020-05-02T17:07:31.494251Z"
637637
},
638638
"colab": {
639639
"base_uri": "https://localhost:8080/",
@@ -694,8 +694,8 @@
694694
"execution_count": 9,
695695
"metadata": {
696696
"ExecuteTime": {
697-
"end_time": "2020-04-28T09:24:52.942803Z",
698-
"start_time": "2020-04-28T09:24:50.576741Z"
697+
"end_time": "2020-05-02T17:07:36.709646Z",
698+
"start_time": "2020-05-02T17:07:33.871512Z"
699699
},
700700
"colab": {
701701
"base_uri": "https://localhost:8080/",
@@ -758,8 +758,8 @@
758758
"execution_count": 10,
759759
"metadata": {
760760
"ExecuteTime": {
761-
"end_time": "2020-04-28T09:24:52.964396Z",
762-
"start_time": "2020-04-28T09:24:52.945544Z"
761+
"end_time": "2020-05-02T17:07:36.726223Z",
762+
"start_time": "2020-05-02T17:07:36.712564Z"
763763
},
764764
"colab": {
765765
"base_uri": "https://localhost:8080/",
@@ -858,8 +858,8 @@
858858
"execution_count": 11,
859859
"metadata": {
860860
"ExecuteTime": {
861-
"end_time": "2020-04-28T09:24:56.505700Z",
862-
"start_time": "2020-04-28T09:24:53.019392Z"
861+
"end_time": "2020-05-02T17:07:39.436995Z",
862+
"start_time": "2020-05-02T17:07:36.729508Z"
863863
},
864864
"colab": {
865865
"base_uri": "https://localhost:8080/",
@@ -874,7 +874,7 @@
874874
"name": "stderr",
875875
"output_type": "stream",
876876
"text": [
877-
"/Users/Maksim/Library/Python/3.6/lib/python/site-packages/ipykernel_launcher.py:2: UserWarning: It is recommended to use this approach on treatment balanced data. Current sample size is unbalanced.\n",
877+
"/Users/Maksim/Library/Python/3.6/lib/python/site-packages/ipykernel_launcher.py:6: UserWarning: It is recommended to use this approach on treatment balanced data. Current sample size is unbalanced.\n",
878878
" \n"
879879
]
880880
},
@@ -891,10 +891,15 @@
891891
}
892892
],
893893
"source": [
894-
"cm_full = ClassTransformation(CatBoostClassifier(iterations=20, thread_count=2, random_state=42, silent=True))\n",
895-
"cm_full = cm_full.fit(X_train_full, y_train_full, treat_train_full, estimator_fit_params={'cat_features': [1]})\n",
894+
"ct_full = ClassTransformation(CatBoostClassifier(iterations=20, thread_count=2, random_state=42, silent=True))\n",
895+
"ct_full = ct_full.fit(\n",
896+
" X_train_full, \n",
897+
" y_train_full, \n",
898+
" treat_train_full, \n",
899+
" estimator_fit_params={'cat_features': cat_features}\n",
900+
")\n",
896901
"\n",
897-
"X_test.loc[:, 'uplift'] = cm_full.predict(X_test.values)\n",
902+
"X_test.loc[:, 'uplift'] = ct_full.predict(X_test.values)\n",
898903
"\n",
899904
"sub = X_test[['uplift']].to_csv('sub1.csv')\n",
900905
"\n",
@@ -906,8 +911,8 @@
906911
"execution_count": 12,
907912
"metadata": {
908913
"ExecuteTime": {
909-
"end_time": "2020-04-28T09:24:56.560018Z",
910-
"start_time": "2020-04-28T09:24:56.508541Z"
914+
"end_time": "2020-05-02T17:07:39.478855Z",
915+
"start_time": "2020-05-02T17:07:39.440546Z"
911916
},
912917
"colab": {
913918
"base_uri": "https://localhost:8080/",
@@ -988,12 +993,12 @@
988993
}
989994
],
990995
"source": [
991-
"cm_full_fi = pd.DataFrame({\n",
992-
" 'feature_name': cm_full.estimator.feature_names_,\n",
993-
" 'feature_score': cm_full.estimator.feature_importances_\n",
996+
"ct_full_fi = pd.DataFrame({\n",
997+
" 'feature_name': ct_full.estimator.feature_names_,\n",
998+
" 'feature_score': ct_full.estimator.feature_importances_\n",
994999
"}).sort_values('feature_score', ascending=False).reset_index(drop=True)\n",
9951000
"\n",
996-
"cm_full_fi"
1001+
"ct_full_fi"
9971002
]
9981003
},
9991004
{

0 commit comments

Comments
 (0)