Learn practical skills, build real-world projects, and advance your career

Objective

  • Surprise Housing, a US-based housing company has decided to enter the Australian market.
    The company wants to use data analytics to purchase houses at a price below their actual values and flip them on at a higher price.

  • The company is looking at prospective properties to buy to enter the market.
    We need to build a regression model using regularisation in order to predict the actual value of the prospective properties and decide whether to invest in them or not.

  • The company wants to know:

    • Which variables are significant in predicting the price of a house, and

    • How well those variables describe the price of a house

      [The model should be regualrized using Ridge/Lasso methods]

  • Business Goal

    Prepared model will be used by the management to understand how exactly the prices vary with the variables.Accordingly the strategy of the firm would be manupilated and concentrate on areas that will yield high returns. Further, the model will be a good way for management to understand the pricing dynamics of a new market.

# importing the required libraries

import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import jovian
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from sklearn.feature_selection import RFE
from sklearn.metrics import r2_score
from sklearn.linear_model import Ridge
from sklearn.linear_model import Lasso
from sklearn.model_selection import GridSearchCV

I. Reading & Understanding Data

# import the dataset
path =r"F:\ML & AI\upGrad\PGDM\Main_Course\Machine Learning - 2\Assignment_Advanced Regression"

df=pd.read_csv(path+r"\train.csv")
df.head()