In-order to understand the machine learning work flow, I followed the tutorials from the 2nd chapter of Hands-on-ML using Scikit-learn and Tensorflow by Aurelien Geron.
We will use the California Housing Prices dataset from the StatLib repository. This dataset is based on data from the 1990 California census.
- Look at the big picture.
- Get the data.
- Discover and visualize the data to gain insights.
- Prepare the data for Machine Learning algorithms.
- Select a model and train it.
- Fine-tune your model.
- Present your solution.
- Launch, monitor, and maintain your system.
The first seven steps are performed in this Jupyter Notebook
- app.py contains the Flask API which gets the features as an input through an API call and request from HTML page.
- utils/price_calculator.py is the python file which does the preprocessing of the inputs from the HTML page and calculate the median housing price of the house.
- templates/main.html allows user to enter the inputs and display the results.
- Flask
- NumPy
- Pandas
- Scikit-Learn
- After cloning this repository, run app.py using the following command to start the flask API
- python app.py
- Navigate to URL http://localhost:5000
- By default, flask will run on port 5000.
- You can see the HTML page as below
- You can use the sample_test_input.json for entering the input variables.
- After submitting, the calculated median house price is shown like below.