Skip to content

Commit

Permalink
Merge branch 'realese/v0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
maks-sh committed Feb 7, 2021
2 parents accaa13 + 056e2f2 commit 7c1e88a
Show file tree
Hide file tree
Showing 47 changed files with 1,219 additions and 320 deletions.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team. All
reported by contacting the project team at team@uplift-modeling.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ So, please make a pull request to the ``dev`` branch.
1. Fork the [project repository](https://github.com/maks-sh/scikit-uplift).
2. Clone your fork of the scikit-uplift repo from your GitHub account to your local disk:
``` bash
$ git clone git@github.com:YourLogin/scikit-uplift.git
$ cd scikit-learn
$ git clone https://github.com/YourName/scikit-uplift
$ cd scikit-uplift
```
3. Add the upstream remote. This saves a reference to the main scikit-uplift repository, which you can use to keep your repository synchronized with the latest changes:
``` bash
Expand All @@ -36,7 +36,7 @@ So, please make a pull request to the ``dev`` branch.
$ git checkout -b feature/my_new_feature
```
and start making changes. Always use a feature branch. It’s a good practice.
6. Develop the feature on your feature branch on your computer, using Git to do the version control. When you’re done editing, add changed files using ``git add`` and then ``git commit``.
6. Develop the feature on your feature branch on your computer, using Git to do the version control. When you’re done editing, add changed files using ``git add .`` and then ``git commit``
Then push the changes to your GitHub account with:

``` bash
Expand All @@ -55,4 +55,4 @@ We follow the PEP8 style guide for Python. Docstrings follow google style.
* Use the present tense ("Add feature" not "Added feature")
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally after the first line
* Reference issues and pull requests liberally after the first line
File renamed without changes.
28 changes: 28 additions & 0 deletions .github/workflows/PyPi_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload to PyPi

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
48 changes: 48 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Python package

on:
push:
branches: [ master ]
pull_request:


jobs:
test:
name: Check tests
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and lints
run: pip install pytest .[tests]
- name: Run PyTest
run: pytest

check_sphinx_build:
name: Check Sphinx build for docs
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install -r docs/requirements.txt
- name: Run Sphinx
run: sphinx-build -b html docs /tmp/_docs_build
29 changes: 20 additions & 9 deletions Readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,36 @@
scikit-uplift
===============

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

Uplift prediction aims to estimate the causal impact of a treatment at the individual level.
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.

**Use cases for uplift modeling:**

* 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).

* Combine a churn model and an uplift model to offer some bonus to a group of customers who are likely to churn.

* Select a tiny group of customers in the campaign where a price per customer is high.

Read more about uplift modeling problem in `User Guide <https://scikit-uplift.readthedocs.io/en/latest/user_guide/index.html>`__,
also articles in russian on habr.com: `Part 1 <https://habr.com/ru/company/ru_mts/blog/485980/>`__

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/>`__.

**Features**:

* Comfortable and intuitive style of modelling like scikit-learn;
* Сomfortable and intuitive scikit-learn-like API;

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

* 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|_));

* Almost all implemented approaches solve both the problem of classification and regression;
* Almost all implemented approaches solve classification and regression problem;

* A lot of metrics (Such as *Area Under Uplift Curve* or *Area Under Qini Curve*) are implemented to evaluate your uplift model;
* 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;

* Useful graphs for analyzing the built model.
* Nice and useful viz for analyzing a performance model.

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

If you have any questions, please contact us at team@uplift-modeling.com

Contributing
~~~~~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions docs/Readme.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. _scikit-uplift.readthedocs.io: https://scikit-uplift.readthedocs.io/en/latest/
.. _uplift-modeling.com: https://www.uplift-modeling.com/en/latest/index.html

Documentation
===============

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

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

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/api/datasets/clear_data_dir.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*****************************************
`sklift.datasets <./>`_.clear_data_dir
*****************************************

.. autofunction:: sklift.datasets.datasets.clear_data_dir
9 changes: 9 additions & 0 deletions docs/api/datasets/fetch_criteo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _Criteo:

**************************************
`sklift.datasets <./>`_.fetch_criteo
**************************************

.. autofunction:: sklift.datasets.datasets.fetch_criteo

.. include:: ../../../sklift/datasets/descr/criteo.rst
9 changes: 9 additions & 0 deletions docs/api/datasets/fetch_hillstrom.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _Hillstrom:

****************************************
`sklift.datasets <./>`_.fetch_hillstrom
****************************************

.. autofunction:: sklift.datasets.datasets.fetch_hillstrom

.. include:: ../../../sklift/datasets/descr/hillstrom.rst
9 changes: 9 additions & 0 deletions docs/api/datasets/fetch_lenta.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _Lenta:

***********************************
`sklift.datasets <./>`_.fetch_lenta
***********************************

.. autofunction:: sklift.datasets.datasets.fetch_lenta

.. include:: ../../../sklift/datasets/descr/lenta.rst
9 changes: 9 additions & 0 deletions docs/api/datasets/fetch_x5.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _X5:

***********************************
`sklift.datasets <./>`_.fetch_x5
***********************************

.. autofunction:: sklift.datasets.datasets.fetch_x5

.. include:: ../../../sklift/datasets/descr/x5.rst
5 changes: 5 additions & 0 deletions docs/api/datasets/get_data_dir.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*****************************************
`sklift.datasets <./>`_.get_data_dir
*****************************************

.. autofunction:: sklift.datasets.datasets.get_data_dir
13 changes: 13 additions & 0 deletions docs/api/datasets/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
************************
`sklift <../>`_.datasets
************************

.. toctree::
:maxdepth: 3

./clear_data_dir
./get_data_dir
./fetch_lenta
./fetch_x5
./fetch_criteo
./fetch_hillstrom
1 change: 1 addition & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ This is the modules reference of scikit-uplift.
./models/index
./metrics/index
./viz/index
./datasets/index
Loading

0 comments on commit 7c1e88a

Please sign in to comment.