In this article, we will explore a data build a machine learning model and build an API using Flask.

You can download the dataset and code available on my Github. Let’s start building our project.

Note that this will be a very long article as we are trying to cover many things here.

About Data

The data we are going to use is the California Housing Prices dataset from the StatLib repository. We will try to predict the median housing value at a particular location.

Features present in the dataset are:

  • longitude
  • latitude
  • housing_median_age
  • total_rooms
  • total_bedrooms
  • population
  • households
  • median_income
  • median_house_value
  • ocean_proximity

We will not get into details of each feature, as they are understandable, if you do not understand please search it online.

Note that we have a median value of house price, the number of rooms, and bedrooms. These are not values of one house, but several houses in an area.

Importing Libraries

These are the libraries that we are going to use in building our model. We might import some other libraries afterward as we continue.

Data Downloading function

Previously I have given the link to download the data from my GitHub account, if you wish to download it from the original user’s account i.e. **ageron, **here is the function for it.

DOWNLOAD_ROOT holds the URL of the GitHub repository where data available, HOUSING_URL is an extension of DOWNLOAD_ROOT to the location where data is exactly in the repository and HOUSING_PATH holds the path where we want to store the data.

  • fetch_housing_data downloads the data from the URL using urllib, extract it using a tarfile extractor and saves it to the location we gave.

#deep-learning #machine-learning #random-forest #data-science #project

End to End Machine Learning Project -1
1.40 GEEK