Skip to main content

A package which supports the implementation of stacking of machine learning models

Project description

# ModelStacker
ModelStacker implements the stacking of machine learning models and very often, the stacked model is able to perform better than any of its base models. This technique is said to be the most effective when there are vast differences present amongst the base models. More information on this concepts can be found at:

1. [A Kaggler's Guide to Model Stacking in Practice](http://blog.kaggle.com/2016/12/27/a-kagglers-guide-to-model-stacking-in-practice/)

2. [Stacking Models for Improved Predictions](https://www.kdnuggets.com/2017/02/stacking-models-imropved-predictions.html)

## Dependencies
Currently, ModelStacker depends on:
- numpy==1.14.0
- pandas==0.22.0

## Installation
```
pip install -r requirements.txt
```

## Usage
### Initalize ModelStacker
```
from ModelStacker import ModelStacker
stacker = ModelStacker()
```

### Initialize and Add Base Models
```
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC

dtclf = DecisionTreeClassifier()
knnclf = KNeighborsClassifier()
svmclf = SVC()

stacker.add_base_model(dtclf)
stacker.add_base_model(knnclf)
stacker.add_base_model(svmclf)
```

### Initalize and Add Stacked Model
```
from sklearn.linear_model import LogisticRegression
lgclf = LogisticRegression()
stacker.add_stacked_model(lgclf)
```

### Fitting and Predicting
```
stacker.fit(X_train, y_train) # X_train and y_train belongs to training set
predictions = stacker.predict(X_test)
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MLStacker-0.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MLStacker-0.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file MLStacker-0.0.1.tar.gz.

File metadata

  • Download URL: MLStacker-0.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4

File hashes

Hashes for MLStacker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 18651bd26787815b7610ac80544bd21c68389fd55b1c058ae59eb83a9ba78eb0
MD5 9e08429d07773ffd1f8f239a8c5def07
BLAKE2b-256 9510975daabb8e3ffd711180eb5f2a1b9bd049502097b3f24e659062cbeee6f8

See more details on using hashes here.

File details

Details for the file MLStacker-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: MLStacker-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.18.4 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4

File hashes

Hashes for MLStacker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 332e2d2f020ccad2e3c268188232039a58dc85c664817e66c652a8ac80ced780
MD5 8beac896ce4e59f3a592ac84e5cc8d19
BLAKE2b-256 62071e85fa6c097530d1e037f98afa16d118db8c4182d8a5ed08e9fe9513cf54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page