Skip to content

Commit

Permalink
Merge 55f9cad into 4909830
Browse files Browse the repository at this point in the history
  • Loading branch information
vecxoz committed Aug 12, 2019
2 parents 4909830 + 55f9cad commit 6cce002
Show file tree
Hide file tree
Showing 14 changed files with 502 additions and 92 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
# check if .travis.yml is valid: http://lint.travis-ci.org/
# to skip build for given commit put [ci skip] or [skip ci] in commit message

# required for Python >= 3.7
dist: xenial

language: python

# versions supported by scikit-learn
# versions supported by scikit-learn and some additional versions
python:
- "3.7"
- "3.6"
- "3.5"
- "3.4"
Expand All @@ -16,6 +20,7 @@ branches:
only:
- master
- dev
- py2

install:
- pip install numpy
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Changelog

### v0.4.0 -- August 12, 2019

Since v0.4.0 vecstack provides official support for Python 3.5 and higher only,
but still there is unofficial support for Python 2.7 and Python 3.4.
Please see [details](https://github.com/vecxoz/vecstack/blob/master/PY2.md).

Scikit-learn API:
* Fixed #31. `sklearn.externals.six` deprecation
* Fixed #29. Out-of-memory in `np.random.choice` for very large ranges

Functional API:
* Feature #18. Added support for N-dimensional input. Useful for convolutional nets.
* Added aliases for `mode` parameter values which correspond to respective `variant` parameter values of `StackingTransformer`:
* 'oof_pred_bag' == 'A'
* 'oof_pred' == 'B'

### v0.3.0 -- April 6, 2018

Introducing Scikit-learn API: `StackingTransformer`

* Standard transformer class with `fit` and `transform` methods
* Compatible with `Pipeline` and `FeatureUnion`

### v0.2.2 -- February 23, 2018

* Fixed #5. Wrong behavior during sparse matrix processing
* Improved input data validation
* Improved sparse matrix processing

### v0.2.1 -- January 24, 2018 -- Maintenance release

* Minor modifications

### v0.2 -- January 23, 2018

New features:

* Classification with probabilities
* Modes: compute only what you need (only OOF, only predictions, both, etc.)
* Save resulting arrays and log with model parameters

### v0.1 -- November 22, 2016 -- Initial release

Features:

* Functional stacking API
* Regression
* Classification with class labels
* Ordinary and stratified k-fold split
* User-defined metric
* User-defined transformations for target and prediction
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Vecstack. Python package for stacking (machine learning technique)
Copyright (c) 2016-2018 Igor Ivanov
Copyright (c) 2016-2019 Igor Ivanov
Email: vecxoz@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
23 changes: 23 additions & 0 deletions PY2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### Python 3.x

Since v0.4.0 vecstack provides official support for Python 3.5 and higher only,
but still there is unofficial support for Python 2.7 and Python 3.4. See details below.

The reason for these changes is global movement in Python 3.x direction.
Vecstack depends on scikit-learn which has already stopped support for Python < 3.5.
Scikit-learn v0.20.x is the last version supporting Python 2.7 and Python 3.4.
Vecstack follows this direction as well.
Please see [python3statement.org](https://python3statement.org/) for more details.

### Unofficial support for Python 2.7 and Python 3.4

You can still install and run latest vecstack on Python 2.7 and Python 3.4.
NOTE. It will require legacy versions of the following packages:
* numpy<1.17
* scipy<1.3
* scikit-learn>=0.18,<0.21

There is a dedicated branch on GitHub called `py2` with appropriate requirements in `setup.py`.
Installation:

`pip install https://github.com/vecxoz/vecstack/archive/py2.zip`
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Convenient way to automate OOF computation, prediction and bagging using any num
* Predict [class labels or probabilities](https://github.com/vecxoz/vecstack/blob/master/vecstack/coresk.py#L119) in classification task
* Apply any [user-defined metric](https://github.com/vecxoz/vecstack/blob/master/vecstack/coresk.py#L124)
* Apply any [user-defined transformations](https://github.com/vecxoz/vecstack/blob/master/vecstack/coresk.py#L87) for target and prediction
* Python 2, Python 3
* Python 3.5 and higher, [unofficial support for Python 2.7 and 3.4](https://github.com/vecxoz/vecstack/blob/master/PY2.md)
* Win, Linux, Mac
* [MIT license](https://github.com/vecxoz/vecstack/blob/master/LICENSE.txt)
* Depends on **numpy**, **scipy**, **scikit-learn>=18.0**
* Depends on **numpy**, **scipy**, **scikit-learn>=0.18**

# Get started
* [FAQ](https://github.com/vecxoz/vecstack#stacking-faq)
Expand Down Expand Up @@ -292,14 +292,15 @@ Stacking API comparison:
| Estimator implementation restrictions | Must have only `fit` and `predict` (`predict_proba`) methods | Must be fully scikit-learn compatible |
| `NaN` and `inf` in input data | Allowed | Not allowed |
| Can automatically save OOF and log in files | Yes | No |
| Input dimensionality (`X_train`, `X_test`) | Arbitrary | 2-D |

### 21. How do parameters of `stacking` function and `StackingTransformer` correspond?

| **stacking function** | **StackingTransformer** |
|-------------------------|-----------------------------------|
| `models=[Ridge()]` | `estimators=[('ridge', Ridge())]` |
| `mode='oof_pred_bag'` | `variant='A'` |
| `mode='oof_pred'` | `variant='B'` |
| **stacking function** | **StackingTransformer** |
|---------------------------------------|-----------------------------------|
| `models=[Ridge()]` | `estimators=[('ridge', Ridge())]` |
| `mode='oof_pred_bag'` (alias `'A'`) | `variant='A'` |
| `mode='oof_pred'` (alias `'B'`) | `variant='B'` |

### 22. Why Scikit-learn API was implemented as transformer and not predictor?

Expand Down
4 changes: 2 additions & 2 deletions examples/04_sklearn_api_regression_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@
"source": [
"# 2. Pipeline\n",
"\n",
"StackingTransformer is fully scikit-learn compatible so we can easily implement **arbitrary number of stacking layers** using Pipeline\n"
"StackingTransformer is fully scikit-learn compatible so we can easily implement **arbitrary number of stacking levels** using Pipeline\n"
]
},
{
Expand All @@ -535,7 +535,7 @@
"metadata": {},
"outputs": [],
"source": [
"# If we have several stacking layers our Pipeline steps would be:\n",
"# If we have several stacking levels our Pipeline steps would be:\n",
"# steps = [('stack_L1', stack_L1),\n",
"# ('stack_L2', stack_L2),\n",
"# ('stack_L99', stack_L99), # :-)\n",
Expand Down
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@

from setuptools import setup

long_desc = '''
Python package for stacking (stacked generalization) featuring lightweight functional API and fully compatible scikit-learn API.
Convenient way to automate OOF computation, prediction and bagging using any number of models.
'''

setup(name='vecstack',
version='0.3.0',
version='0.4.0',
description='Python package for stacking (machine learning technique)',
long_description='Convenient way to automate OOF computation, prediction and bagging using any number of models',
long_description=long_desc,
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Information Analysis',
Expand Down

0 comments on commit 6cce002

Please sign in to comment.