This repository shows an example of the usability of SKORCH to train a PyTorch model making use of different capabilities of the scikit-learn framework.
If you want to understand the details about how this model was created, take a look at this very clear and detailed explanation: SKORCH: PyTorch Models Trained with a Scikit-Learn Wrapper
The idea of this repository is to show how to use some of the SKorch functionalities to train a PyTorch model. In this case, a neural network was created to classify the wines dataset. In order to understand better what SKorch is, take a look at the following image:
- data: Here you will find the wines dataset
- src: It contains two files
data_loader.py
andmodel.py
. The filedata_loader.py
contains the functions to load an preprocess the wines dataset. The filemodel.py
contains the PyTorch model. - main.py: This file trigger the different cases explained in the Medium article.
You just need to type
python main.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.