An Wrapper for performing ensembling techniques on deep learning models
Project description
DEEP ENSEMBLE
Description
In the context of deep learning, This library is a wrapper, It allows one to perform ensembling techniques such as Stacked Ensembling, Weighted Ensembling, Ensembling based on Votes. This library get in an array of predictions made by different models on which the user wants to perform ensembling and it performs either of the three ensembling technique based on user choice.
-
What this does?
- Gets array of predictions(probabilities)
- Performs ensembling
- Returns Score of the metrics(user prefers)
- Returns Y_predicted resulting due to ensembling
-
Ensembling Techniques included
- Weighted Ensembling
- Ensembling by Voting
- Stacked Ensembling
Deep Ensemble
Deep Ensemble is a python package for ensembling the prediciton results.
How to use:
Step 1: Install the libaray
pip install DeepEnsemble
Step 2:
Import the library, and specify the path of the csv file.
from DeepEnsemble.DeepEnsemble import DeepEnsembler
Ensembler = DeepEnsembler(Y_pred, Y_actual, type=None, predThreshold=0.5, metrics="accuracy_score")
score,Y_pred_ensembled = Ensembler.WeightedEnsembling()
Note:
- Y_pred - Array of predictions made by models
- Y_actual - Array of actual Class
There are some optional parameters that you can specify as listed below,
Usage:
from DeepEnsemble.DeepEnsemble import DeepEnsembler
Y_Pred = np.array([results of model1],
[results of model2],
[results of model3],
....)
Y_actual = np.array([actual class])
---Example1:
Ensembler = DeepEnsembler(Y_Pred, Y_actual, type="Weighted", predThreshold=0.6, metrics="cohen_kappa_score")
score,Y_pred_ensembled = Ensembler.WeightedClassifier()
---Example2:
Ensembler = DeepEnsembler(Y_Pred, Y_actual, type="Voting", predThreshold=0.6, metrics="cohen_kappa_score")
score,Y_pred_ensembled = Ensembler.VotingClassifier()
---Example3:
Ensembler = DeepEnsembler(Y_Pred, Y_actual, type="Stacking", predThreshold=0.6, metrics="cohen_kappa_score")
score,Y_pred_ensembled = Ensembler.StackingClassifier()
Parameters
Parameter | Default Value | Limit | Example |
---|---|---|---|
Y_pred | none | Provide a array with results of different models. | np.array([results of model1],[results of model2],[results of model3],....) |
Y_actual | , | Provide a array with actual class | np.array([actual class]) |
type | Weighted | Weighted, Voted, Stacked | |
predThreshold | 0.5 | 0 to 1 | 0.5 |
metrics | Sklearn Classification metrics | specify any valid classificaiton metrics from sklearn | "accuracy_score" |
--- THANK YOU, CHEERS ---
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
Built Distribution
Hashes for DeepEnsemble-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b8ea2b5bf2d12addc0035a6306c1da12b26920a924f0adcf86053f16510f54 |
|
MD5 | ce4f8cc09d3dc0ed3162310e5812fb6b |
|
BLAKE2b-256 | 28f175725a2309ac6f630db0a712e2de8a5ab5643f887c065a3be2e1323382b0 |