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.pyandmodel.py. The filedata_loader.pycontains the functions to load an preprocess the wines dataset. The filemodel.pycontains the PyTorch model. - main.py: This file trigger the different cases explained in the Medium article.
You just need to type
python main.pyhowever, 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 installand then
pipenv shellFeel 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.
