Stacked generalization framework
Project description
|build-status| |docs| |package-status|
Wolpert, a stacked generalization framework
===========================================
Wolpert is a `scikit-learn <http://scikit-learn.org>`_ compatible framework for easily building stacked ensembles. It supports:
* Different stacking strategies
* Multi-layer models
* Different weights for each transformer
* Easy to make it distributed
Quickstart
==========
Install
-------
The easiest way to install is using pip. Just run ``pip install wolpert`` and you're ready to go.
Building a simple model
-----------------------
First we need the layers of our model. The simplest way is using the helper function `make_stack_layer <http://wolpert.readthedocs.io/en/latest/generated/wolpert.pipeline.html#wolpert.pipeline.make_stack_layer>`_::
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from wolpert import make_stack_layer, StackingPipeline
layer0 = make_stack_layer(SVC(), KNeighborsClassifier(),
RandomForestClassifier(),
blending_wrapper='holdout')
clf = StackingPipeline([('l0', layer0),
('l1', LogisticRegression())])
And that's it! And ``StackingPipeline`` inherits a scikit learn class: the `Pipeline <http://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html>`_, so it works just the same::
clf.fit(Xtrain, ytrain)
ypreds = clf.predict_proba(Xtest)
This is just the basic example, but there are several ways of building a stacked ensemble with this framework. Make sure to check the `User Guide <http://wolpert.readthedocs.io/en/latest/user_guide.html>`_ to know more.
.. |build-status| image:: https://circleci.com/gh/caioaao/wolpert.png?style=shield
:alt: CircleCI
:scale: 100%
:target: https://circleci.com/gh/caioaao/wolpert
.. |docs| image:: https://readthedocs.org/projects/wolpert/badge/?verion=latest
:alt: Documentation status
:scale: 100%
:target: https://wolpert.readthedocs.io/en/latest/?badge=latest
.. |package-status| image:: https://badge.fury.io/py/wolpert.svg
:alt: PyPI version
:scale: 100%
:target: https://badge.fury.io/py/wolpert
Wolpert, a stacked generalization framework
===========================================
Wolpert is a `scikit-learn <http://scikit-learn.org>`_ compatible framework for easily building stacked ensembles. It supports:
* Different stacking strategies
* Multi-layer models
* Different weights for each transformer
* Easy to make it distributed
Quickstart
==========
Install
-------
The easiest way to install is using pip. Just run ``pip install wolpert`` and you're ready to go.
Building a simple model
-----------------------
First we need the layers of our model. The simplest way is using the helper function `make_stack_layer <http://wolpert.readthedocs.io/en/latest/generated/wolpert.pipeline.html#wolpert.pipeline.make_stack_layer>`_::
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from wolpert import make_stack_layer, StackingPipeline
layer0 = make_stack_layer(SVC(), KNeighborsClassifier(),
RandomForestClassifier(),
blending_wrapper='holdout')
clf = StackingPipeline([('l0', layer0),
('l1', LogisticRegression())])
And that's it! And ``StackingPipeline`` inherits a scikit learn class: the `Pipeline <http://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html>`_, so it works just the same::
clf.fit(Xtrain, ytrain)
ypreds = clf.predict_proba(Xtest)
This is just the basic example, but there are several ways of building a stacked ensemble with this framework. Make sure to check the `User Guide <http://wolpert.readthedocs.io/en/latest/user_guide.html>`_ to know more.
.. |build-status| image:: https://circleci.com/gh/caioaao/wolpert.png?style=shield
:alt: CircleCI
:scale: 100%
:target: https://circleci.com/gh/caioaao/wolpert
.. |docs| image:: https://readthedocs.org/projects/wolpert/badge/?verion=latest
:alt: Documentation status
:scale: 100%
:target: https://wolpert.readthedocs.io/en/latest/?badge=latest
.. |package-status| image:: https://badge.fury.io/py/wolpert.svg
:alt: PyPI version
:scale: 100%
:target: https://badge.fury.io/py/wolpert
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wolpert-0.1.1.tar.gz
(20.6 kB
view details)
Built Distribution
wolpert-0.1.1-py2-none-any.whl
(28.1 kB
view details)
File details
Details for the file wolpert-0.1.1.tar.gz
.
File metadata
- Download URL: wolpert-0.1.1.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de0916e6b265ce46b4482a20997cebb7c95bcf5db81856c007681636559fdca3 |
|
MD5 | 3648c7cd029cd9a3fca7a284a91449da |
|
BLAKE2b-256 | e227cebc085db7f6b12253568bdc7f2857d66b5a11cdfdb4e7f463185c736873 |
File details
Details for the file wolpert-0.1.1-py2-none-any.whl
.
File metadata
- Download URL: wolpert-0.1.1-py2-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1bc56d021e3778959cced78be6ce690ab69e48ebee2c0125bd071bfe7d6aa97 |
|
MD5 | e93a06af810881fce93127f197a1f0bc |
|
BLAKE2b-256 | 2b69227b93d4bc6442250cb4c1f910cc34c7783e8024828d9428274781a04e98 |