Following 13 parameters related to city-dwelling, the model predicts the prices for new house based on the user preferences.
Tools used:
Cloud and software used:
Dataset Characteristics:
:Number of Instances: 506
:Number of Attributes: 13 numeric/categorical predictive. Median Value (attribute 14) is usually the target.
:Attribute Information (in order):
- CRIM per capita crime rate by town
- ZN proportion of residential land zoned for lots over 25,000 sq.ft.
- INDUS proportion of non-retail business acres per town
- CHAS Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)
- NOX nitric oxides concentration (parts per 10 million)
- RM average number of rooms per dwelling
- AGE proportion of owner-occupied units built prior to 1940
- DIS weighted distances to five Boston employment centres
- RAD index of accessibility to radial highways
- TAX full-value property-tax rate per $10,000
- PTRATIO pupil-teacher ratio by town
- B 1000(Bk - 0.63)^2 where Bk is the proportion of black people by town
- LSTAT % lower status of the population
- MEDV Median value of owner-occupied homes in $1000's
:Missing Attribute Values: None
Visualizing relationship between each pair of features.
It is observed that, with lower crime rate, the price increases
With increaing number of rooms in the apartment indicates higher rent.
A linear correlation is observed between the Price (dependant) and Room Numbers (independent) features.
When the LSTAT is decreasing, the price is increasing. Features are found to be negatively corralated.
These features are not at all correlated.
There should have some relationships of linearity, either positively or negatively.
Some negative corralation exist with inverse relationship. While PTRATIO increases price decreases.
Prediction model is linear, so the model expects to perform well (y_test vs prediction)
Normally distributed, and there is little error between 10 to 30 (right side)
Scatter plot with respect to prediction and residulas. Uniform distribution.
Model expects to work well, and to make it guaranteed, let's have a look at the:
-
MAE: 3.162709871457406
-
MSE: 21.517444231177212
-
RMSE: 4.638689926172821
-
R-Squared: 0.7112260057484932
-
Adjusted R-Squared: 0.6840226584639308
Here, Adjusted R-Squared is less than R-Squared. Which is expected and looks good.
App Interface
Predicts the price.
Deployed App Link: Webapp Link
.......................................................................................................................................................................................
- Create a new environment
- conda create -p means the venv environment is created within the specified folder location
conda create -p venv python==3.11 -y
- Activate the environment
conda activate venv/
- for python (vs code terminal, specifically for webapp development)
python3 -m venv evn_name
source evn_name/bin/activate
- Installing the requirements
pip install -r requirements.txt
- Git Configuaration between VS Code and GitHub account
git config --global user.name
git config --global user.email
- Commiting files
git status
git add .
git commit -m "commit includes the files"
git push origin main
-
Picked Webservices
-
Selected 'Git Public Repository' (for privet repository, sign-in to GitHub under 'Git Provider' is required)
-
Next, picked a Name as URL, and Python 3 as *Language
-
Branch is main and Region is Oregon as default
-
Keep Root Directory as it is, it will redirect from GitHub
-
Build Command
pip install -r requirements.txt
- Start Command ( gunicorn app_name_used_as_.py_file:app )
gunicorn flask_app:app
- Select Subscription Plan, Free in my case
- Click Deploy Web Service
- The deploy was failing with an error message:
Getting requirements to build wheel: finished with status 'error' error: subprocess-exited-with-error
- Added 'wheel' and modified 'scikit-learn' instead of 'sklearn' in the requirements.txt file
- The flask_app.py file was having error with importing 'numpy' package
- Switched to the environment activated for the project instead of the default/ old environment. This error occured as environemnt where the VS Code was running on was unable to access the packages installed.