elizabethts / deploy-mlm-flask-heroku

Deploy a ML model with Flask to Heroku

Home Page:https://towardsdatascience.com/create-an-api-to-deploy-machine-learning-models-using-flask-and-heroku-67a011800c50

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy ML model with Flask to Heroku

Click the button below to quickly clone and deploy into your own Heroku acount. If you don't have one it'll prompt you to setup a free one.

Deploy

Once deployed to your Heroku instance run the following:

curl -s -XPOST 'https://<name-of-your-heroku-app>.herokuapp.com/' -d '{"Pclass":3,"Age":2,"SibSp":1,"Fare":50}' -H 'accept-content: application/json'

Alternatively a simple python script:

import requests
import json
url = 'https://<name-of-your-heroku-app>.herokuapp.com/'
data = {"Pclass":3, "Age":2, "SibSp":1, "Fare":50}
response = requests.post(url, json.dumps(data))
print(response.json())

Article

You can read the full article that was published on Towards Data Science

Acknowlegements

Thank you to Josh Peak who added the button for heroku deployment

About

Deploy a ML model with Flask to Heroku

https://towardsdatascience.com/create-an-api-to-deploy-machine-learning-models-using-flask-and-heroku-67a011800c50

License:MIT License


Languages

Language:Jupyter Notebook 94.0%Language:Python 6.0%