This repository contains an example of each of the Ensemble Learning methods: Stacking, Blending, and Voting. The examples for Stacking and Blending were made from scratch, the example for Voting was using the scikit-learn utility.
If you want to know more about the theory of each of these models, I recommend you take a look at the blog: Ensemble Learning: Stacking, Blending & Votingr
- stacking.py: Contains an example from scratch about Stacked Generalization method
- blending.py: Contains an example from scratch about Blending, a variation from Stacked Generalization method.
- voting.py: Contains an example about Voting method by using the scikit-learn module.
For running stacking.py
:
python stacking.py
For running blending.py
:
python blending.py
For running voting.py
:
python voting.py
however, I recommend you to work with a virtual environment, in this case I am using pipenv. So in order to install the dependencies located in the Pipfile
you just need to type:
pipenv install
and then
pipenv shell
Feel free to fork the model and add your own suggestiongs.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/YourGreatFeature
) - Commit your Changes (
git commit -m 'Add some YourGreatFeature'
) - Push to the Branch (
git push origin feature/YourGreatFeature
) - Open a Pull Request
If you have any question, feel free to reach me out at:
Distributed under the MIT License. See LICENSE.md
for more information.