Skip to content

Latest commit

 

History

History
65 lines (29 loc) · 1.86 KB

File metadata and controls

65 lines (29 loc) · 1.86 KB

California-Housing-Price-Prediction

Step1: Import all libraries

Step2: Load the data

Step2.1: Read the “housing.csv” file from the folder into the program

Step2.2: Print first few rows of this data

Step2.3: Extract input (X) and output (y) data from the dataset

Step3: Handle missing values: Fill the missing values with the mean of the respective column

Step4: Encode categorical data: Convert categorical column in the dataset to numerical data

Step5: Split the dataset: Split the data into 80% training dataset and 20% test dataset

Step6: Standardize data: Standardize training and test datasets

Task1: Perform Linear Regression

Task1.1: Perform Linear Regression on training data

Task1.2: Predict output for test dataset using the fitted model

Task1.3: Print root mean squared error (RMSE) from Linear Regression

Task2: Perform Decision Tree Regression

Task2.1: Perform Decision Tree Regression on training data

Task2.2: Predict output for test dataset using the fitted model

Task2.3: Print root mean squared error from Decision Tree Regression

Task3: Perform Random Forest Regression

Task3.1: Perform Random Forest Regression on training data

Task3.2: Predict output for test dataset using the fitted model

Task3.3: Print root mean squared error from Random Forest Regression

Task4: Bonus exercise: Perform Linear Regression with one independent variable

Task4.1: Extract just the median_income column from the independent variables (from X_train and X_test)

Task4.2: Perform Linear Regression to predict housing values based on median_income

Task4.3: Predict output for test dataset using the fitted model

Task4.4: Plot the fitted model for training data as well as for test data to check if the fitted model satisfies the test data

Task4.4.1: let us visualize the Training set

Task4.4.2: let us visualize the Testing set