fortune-uwha / house-price-prediction-app

Web app intended for predicting house prices in Boston, United States: Heroku|Postman

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Boston House Price Prediction App

Python 3.6 Python 3.7 Python 3.8 License: MIT Issues: 0

Table of Contents

General Information

The web app is intended for predicting house prices in Boston, United States. Model was trained on the predefined and cleaned dataset and can predict price by given parameters. Trained model is saved to model.pkl file.

Setup

First, clone the repository and create a virtualenv. Then install the requirements:

  • Run pip install -r requirements.txt to install project requirements
  • Type flask run to start the app

Usage

The API endpoint is a Flask app hosted on heroku https://boston-predictions.herokuapp.com which you can access with any REST API client, such as Postman. There is only one main route:

  • /predict - takes POST requests, predicts price by parameters provided.

Input json format example:

{"inputs": [[6.28807, 0.0, 18.1, 0.0, 0.74, 6.341, 96.4, 2.072, 24.0, 666.0, 20.2, 318.01, 17.79],
            [14.4208, 0.0, 18.1, 0.0, 0.74, 6.461, 93.3, 2.0026, 24.0, 666.0, 20.2, 27.49, 18.05]]}

Postman usage example:

Using Jupyter Notebook

You can also use requests module and use the API in a Jupyter notebook like this:

import json
import requests

predict_url = 'https://boston-predictions.herokuapp.com/predict'
json_input = {"inputs": [[14.4208, 0.0, 18.1, 0.0, 0.74, 6.461,
             93.3, 2.0026, 24.0, 666.0, 20.2, 27.49,
             18.05]]}

response = requests.post(predict_url, data=json.dumps(json_input))
print (f"response: {json.loads(response.content)}")

Project Status

Project is: in progress

Acknowledgements

This project was based on Turing College learning on deploying machine learning models.

Contact

Created by @fortune_uwha - feel free to contact me!

Contributing

Feel free to submit an issue with your ideas or comments. I will be happy to see your way of scaffolding Flask applications.

License

This project is open source and available under the terms of the MIT license.

About

Web app intended for predicting house prices in Boston, United States: Heroku|Postman

License:MIT License


Languages

Language:Jupyter Notebook 46.7%Language:CSS 36.6%Language:Python 8.8%Language:HTML 7.9%