Analytics Vidhya
Published in

Analytics Vidhya

Deploy Machine Learning Model using Flask to Heroku — Beginners(Part 3)

This tutorial is part 3 and the final part of the guide on how to deploy Machine Learn Models using Flask to Heroku via GitHub.

  • The first part was a refresher on a logistic regression model on JupyterNotebook.

Step 1: Creating a New App

From your Heroku dashboard click on New and then Create new app as shown below.

Enter your new app name and save changes by clicking on the Create app button.

Step 2: Connecting to GitHub

From the new create app on the Deploy section ,choose GitHub as your deployment method. You will need to allow Heroku to access GitHub when prompted. Once you have successfully connected to GitHub search for your repo-name and click connect on that repo.

Step3 : Deployment

On the manual deployment section, choose your branch, in this case our branch is the main branch, then click on Deploy Branch. This process could take up between 2 and 10 minutes depending on your internet speed. If your app was successfully deployed you will see a View button. In my case, View button takes me to

If the View button gives you the following error, don’t panic :)

Something could have gone wrong. In most cases it’s usually one of the following:

  1. Package versions not matching with those in Heroku. You can always downgrade.

The View logs section will guide you on your error. When you fix your code, redeploy your branch once again.

That is the final part of the guide on how to create and deploy a machine learning model on Heroku using Flask via GitHub. Happy Coding !



Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joan Ngugi

Big Data & Analytics, Data Science, Machine Learning, Data Engineering |