DEV Community

Cover image for Build your ML models automatically using GitHub actions

Build your ML models automatically using GitHub actions

haimantika profile image haimantika mitra ・2 min read

Machine Learning Model training made easy! I have made a GitHub action using the package autofeat, that automates our classification model.
This action is an entry to the GitHub actions hackathon submission, under the DIY Deployment category.

What does the GitHub action do? 📢

It automates your Machine Learning model training, with the help of autofeat python package. This GitHub action makes use of AutoFeatClassifier() to build to the classification model.

Disclaimer: For models with very low samples, they might overfit on noise in the dataset, i.e., find some new features that lead to a good prediction on the training set but result in poor performance on new test samples.

How to use? 💁

You will find my "Automated ML Models using Autofeat package" action in the marketplace.
Then follow these simple steps:

  • Click on Use latest version, a prompt will be displayed. We need to copy the code and use it in our workflow as shown below. Alt Text
  • Make your workflow as shown below. (I have used the Iris dataset as an example)
name: Iris Dataset Classifier
on: [push]
    runs-on: ubuntu-latest
    - name: Train the model
      id: model
      uses: Haimantika/random@master
        myInput: "[5.1,3.5,1.4,2.1,1.8,0.2]"
    - name: Upload artifact
      uses: actions/upload-artifact@v2
        name: my-artifact
        path: model.pkl
  • Create a repository and upload the dataset to train the model. The name of the dataset file must be dataset.csv
  • Go to Actions on GitHub Console and click on Set up a workflow yourself. Alt Text
  • Click on Start commit, give a commit message (optional) and click on Commit new file. The workflow begins soon after this.
  • Click on the workflow and you’ll get the console output. You can click on Artifacts and download the model file keep it for later use.

Find the entire code here.

Working demo:

P.S- This is my first ever GitHub action! Let me know your views on it! ✌️


Editor guide