Used Cars Price Prediction¶
Context¶
There is a huge demand for used cars in the Indian Market today. As sales of new cars have slowed down in the recent past, the pre-owned car market has continued to grow over the past years and is larger than the new car market now. Cars4U is a budding tech start-up that aims to find footholes in this market.
In 2018-19, while new car sales were recorded at 3.6 million units, around 4 million second-hand cars were bought and sold. There is a slowdown in new car sales and that could mean that the demand is shifting towards the pre-owned market. In fact, some car owners replace their old cars with pre-owned cars instead of buying new ones. Unlike new cars, where price and supply are fairly deterministic and managed by OEMs (Original Equipment Manufacturer) except for dealership level discounts which come into play only in the last stage of the customer journey. Used cars are very different beasts with huge uncertainty in both pricing and supply. Keeping this in mind, the pricing scheme of these used cars becomes important in order to grow in the market.
Objectives:¶
- Explore and visualize the dataset
- Build a model to predict the prices of used cars
- Generate a set of insights and recommendations that will help the business
Data Dictionary¶
S.No. : Serial Number
Name : Name of the car which includes Brand name and Model name
Location : The location in which the car is being sold or is available for purchase (Cities)
Year : Manufacturing year of the car
Kilometers_driven : The total kilometers car has been driven by the previous owner(s) in KM
Fuel_Type : The type of fuel used by the car. (Petrol, Diesel, Electric, CNG, LPG)
Transmission : The type of transmission used by the car. (Automatic / Manual)
Owner : Type of ownership
Mileage : The standard mileage offered by the car company in kmpl or km/kg
Engine : The displacement volume of the engine in CC
Power : The maximum power of the engine in bhp
Seats : The number of seats in the car
New_Price : The price of a new car of the same model (units in INR 100,000)
Price : The price of the used car (units in INR 100,000) (Target Variable)
Loading libraries¶
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Import libraries to build linear model for statistical analysis and prediction
from Scikit-learn.linear_model import LinearRegression, Ridge, Lasso # Importing Linear Regression, and Regularization methods
from Scikit-learn.tree import DecisionTreeRegressor # Importing Decision Tree Regressor
from Scikit-learn.ensemble import RandomForestRegressor # Importing Random Forest Regressor
from Scikit-learn.model_selection import train_test_split # To split the data into training and test set
# Metrics to evaluate the model
from Scikit-learn import metrics # To calculate the accuracy metrics
# For tuning the model
from Scikit-learn.model_selection import GridSearchCV # For tuning parameters of the model
# To ignore warnings
import warnings
warnings.filterwarnings('ignore')
# Removes the limit from the number of displayed columns and rows
pd.set_option("display.max_columns", None)
pd.set_option("display.max_rows", None)
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
Loading and exploring the data¶
Loading the data into python to explore and understand it
data = pd.read_csv("/content/drive/MyDrive/Colab Notebooks/used_cars_data.csv")
Let us understand the data by observing a few rows¶
First and last 5 rows of the dataset¶
data.head()
S.No. | Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | Maruti Wagon R LXI CNG | Mumbai | 2010 | 72000 | CNG | Manual | First | 26.6 km/kg | 998 CC | 58.16 bhp | 5.0 | NaN | 1.75 |
1 | 1 | Hyundai Creta 1.6 CRDi SX Option | Pune | 2015 | 41000 | Diesel | Manual | First | 19.67 kmpl | 1582 CC | 126.2 bhp | 5.0 | NaN | 12.50 |
2 | 2 | Honda Jazz V | Chennai | 2011 | 46000 | Petrol | Manual | First | 18.2 kmpl | 1199 CC | 88.7 bhp | 5.0 | 8.61 Lakh | 4.50 |
3 | 3 | Maruti Ertiga VDI | Chennai | 2012 | 87000 | Diesel | Manual | First | 20.77 kmpl | 1248 CC | 88.76 bhp | 7.0 | NaN | 6.00 |
4 | 4 | Audi A4 New 2.0 TDI Multitronic | Coimbatore | 2013 | 40670 | Diesel | Automatic | Second | 15.2 kmpl | 1968 CC | 140.8 bhp | 5.0 | NaN | 17.74 |
data.tail()
S.No. | Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7248 | 7248 | Volkswagen Vento Diesel Trendline | Hyderabad | 2011 | 89411 | Diesel | Manual | First | 20.54 kmpl | 1598 CC | 103.6 bhp | 5.0 | NaN | NaN |
7249 | 7249 | Volkswagen Polo GT TSI | Mumbai | 2015 | 59000 | Petrol | Automatic | First | 17.21 kmpl | 1197 CC | 103.6 bhp | 5.0 | NaN | NaN |
7250 | 7250 | Nissan Micra Diesel XV | Kolkata | 2012 | 28000 | Diesel | Manual | First | 23.08 kmpl | 1461 CC | 63.1 bhp | 5.0 | NaN | NaN |
7251 | 7251 | Volkswagen Polo GT TSI | Pune | 2013 | 52262 | Petrol | Automatic | Third | 17.2 kmpl | 1197 CC | 103.6 bhp | 5.0 | NaN | NaN |
7252 | 7252 | Mercedes-Benz E-Class 2009-2013 E 220 CDI Avan... | Kochi | 2014 | 72443 | Diesel | Automatic | First | 10.0 kmpl | 2148 CC | 170 bhp | 5.0 | NaN | NaN |
data.sample(2)
S.No. | Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4687 | 4687 | Land Rover Freelander 2 TD4 SE | Jaipur | 2012 | 119203 | Diesel | Automatic | First | 0.0 kmpl | 2179 CC | 115 bhp | 5.0 | NaN | 16.5 |
2107 | 2107 | Toyota Etios GD | Hyderabad | 2015 | 116000 | Diesel | Manual | Second | 23.59 kmpl | 1364 CC | 67.05 bhp | 5.0 | NaN | 5.8 |
Observations
S.No.
looks like an index for the data entry and such a column would not be useful for our analysis and we can drop itCar names
contain a lot of model information. Let us check how many individual names we have. If they are too many, we can process this column to extract important informationNew_Price
and our target variablePrice
have missing values
# Removing S.No. column from data
data.drop(['S.No.'],axis = 1, inplace = True)
Let us check the data types and and missing values of each column¶
data.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 7253 entries, 0 to 7252 Data columns (total 13 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Name 7253 non-null object 1 Location 7253 non-null object 2 Year 7253 non-null int64 3 Kilometers_Driven 7253 non-null int64 4 Fuel_Type 7253 non-null object 5 Transmission 7253 non-null object 6 Owner_Type 7253 non-null object 7 Mileage 7251 non-null object 8 Engine 7207 non-null object 9 Power 7207 non-null object 10 Seats 7200 non-null float64 11 New_Price 1006 non-null object 12 Price 6019 non-null float64 dtypes: float64(2), int64(2), object(9) memory usage: 736.8+ KB
data.isnull().sum()
Name 0 Location 0 Year 0 Kilometers_Driven 0 Fuel_Type 0 Transmission 0 Owner_Type 0 Mileage 2 Engine 46 Power 46 Seats 53 New_Price 6247 Price 1234 dtype: int64
Observations
Name
,Location
,Year
,Kilometers_Driven
,Fuel_Type
,Transmission
,Owner_Type
columns have no missing valuesMileage
,Engine
,Power
,Seats
,New_Price
,Price
columns have missing values
data.shape # rows and columns
(7253, 13)
Exploratory Data Analysis¶
Preprocessing the Data¶
data.head(2)
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Maruti Wagon R LXI CNG | Mumbai | 2010 | 72000 | CNG | Manual | First | 26.6 km/kg | 998 CC | 58.16 bhp | 5.0 | NaN | 1.75 |
1 | Hyundai Creta 1.6 CRDi SX Option | Pune | 2015 | 41000 | Diesel | Manual | First | 19.67 kmpl | 1582 CC | 126.2 bhp | 5.0 | NaN | 12.50 |
# Some columns, which should have been numerical, are currently of object datatype.
# We will extract only the numerical part from these columns to perform further analysis.
data['Power'] = data['Power'].apply(lambda x: x.split(' ')[0] if pd.notnull(x) else np.nan) # Extract the numerical values from the 'Power' column
data['Power'] = data['Power'].apply(lambda x: float(x) if x!= 'null' else np.nan) # Whenever there is text 'null', then replace with NaN
data['Engine'] = data['Engine'].apply(lambda x: float(x.split(' ')[0]) if pd.notnull(x) else np.nan) # Replace empty strings in the 'Engine' column with NaN and split the remaining text with numbers.
10,000,000 # 1 crore
100,000 # 1 lakh
(100, 0)
# Making unit same across whole column
def mileage_convert(x): # Function to convert km/kg to km per liter
if type(x) == str: # if the data type is string
if x.split()[-1] == 'km/kg': # If the unit is km/kg towards the end of the string, split the string into 'at km/kg' where the number is separated from the text
return float(x.split()[0])*1.40 # Formula for converting km/kg to kmpl for the number part of the text that is already split, by converting text to float type
elif x.split()[-1] == 'kmpl': # If the text is 'kmpl' instead of 'km/kg', then split at 'kmpl'
return float(x.split()[0]) # Then convert that to float type for the data which is separated from 'kmpl'
else:
return x # If there is no 'kmpl' or 'km/kg', then we are good, no action needs to be taken.
def price_convert(x): # Function to extract the numerical price data from the column which has the value of "amount Cr." OR "amount Lakh"
if type(x) == str: # If the data type is string (text data a.k.a. object)
if x.split()[-1] == 'Cr': # Split the value in 'Cr', the last part of the values
return float(x.split()[0])*100 # Formula for converting Crores to Lakhs: divide the data value in index[0] by 100
elif x.split()[-1] == 'Lakh': # If the string contains "Lakh", split the data at the word "Lakh".
return float(x.split()[0]) # Then keep the number part from the splitted data.
else:
return x # If neither "Lakh" nor "Cr." is present, keep the data as it is.
data['Mileage'] = data['Mileage'].apply(mileage_convert) # Using the above defined function in "Mileage" column to clean the data
data['New_Price'] = data['New_Price'].apply(price_convert) # Using the above defined function in "New Price" column to clean the data
Let us now explore the summary statistics of numerical variables¶
It is important to understand the data statistically
# Basic summary stats - Numeric variables
data.describe().T
count | mean | std | min | 25% | 50% | 75% | max | |
---|---|---|---|---|---|---|---|---|
Year | 7253.0 | 2013.365366 | 3.254421 | 1996.00 | 2011.000 | 2014.00 | 2016.0000 | 2019.000 |
Kilometers_Driven | 7253.0 | 58699.063146 | 84427.720583 | 171.00 | 34000.000 | 53416.00 | 73000.0000 | 6500000.000 |
Mileage | 7251.0 | 18.240986 | 4.839919 | 0.00 | 15.260 | 18.20 | 21.1000 | 46.956 |
Engine | 7207.0 | 1616.573470 | 595.285137 | 72.00 | 1198.000 | 1493.00 | 1968.0000 | 5998.000 |
Power | 7078.0 | 112.765214 | 53.493553 | 34.20 | 75.000 | 94.00 | 138.1000 | 616.000 |
Seats | 7200.0 | 5.279722 | 0.811660 | 0.00 | 5.000 | 5.00 | 5.0000 | 10.000 |
New_Price | 1006.0 | 22.779692 | 27.759344 | 3.91 | 7.885 | 11.57 | 26.0425 | 375.000 |
Price | 6019.0 | 9.479468 | 11.187917 | 0.44 | 3.500 | 5.64 | 9.9500 | 160.000 |
Observations
- The Manufacturing year of cars varies from 1996 to 2019
- At least 50% of the cars are 53416 kilometers_driven, however, there are some extreme values, as the minimum value is 171 km and the maximum value is 6500000 km. We should check the extreme values to get a sense of the data
- Average number of seats is around 5
- Average selling price of a used car is 9.47 lakh. At least 50% of cars have been sold for 9.9 lakh or less, with the maximum selling price being 1 Cr 60 lakh
- At least 75% of used cars have Mileage of 21 km or less with the maximum value being 33.5 km. However, the minimum mileage of 0 is also troubling; we need to investigate this.
- The mean of the new_price is 22.77 lakh, whereas the median of the new_price is 11.57 lakh. This indicates that the new_price distribution is skewed towards the right side and explains that there are only a few very high range brands.
Let us also explore the summary statistics of all categorical variables and the number of unique observations in each category¶
# Basic summary stats - Categorical variables
data.describe(include=['object']) # Alternatively, we can also do "exclude = 'number'"
Name | Location | Fuel_Type | Transmission | Owner_Type | |
---|---|---|---|---|---|
count | 7253 | 7253 | 7253 | 7253 | 7253 |
unique | 2041 | 11 | 5 | 2 | 4 |
top | Mahindra XUV500 W8 2WD | Mumbai | Diesel | Manual | First |
freq | 55 | 949 | 3852 | 5204 | 5952 |
Number of unique observations in each category
It is necessary to undersand what are the count of unique values in each category, in the column of categorical data
cat_cols = data.select_dtypes(include=['object']).columns # This variable helps us to create the list of columns that are of non-numerical type, or categorical type
for column in cat_cols: # For each individual column in the variable categorical column (list)
print("For column:",column) # Prints the name of the column joined with "For Column:", we can alternatively do print(f"For Column: {column}")
print(data[column].value_counts()) # Prints the count of the each individual category in the data for a column
print('-'*50) # Prints 50 -s after each column value counts as a divider
For column: Name Name Mahindra XUV500 W8 2WD 55 Maruti Swift VDI 49 Maruti Swift Dzire VDI 42 Honda City 1.5 S MT 39 Maruti Swift VDI BSIV 37 Maruti Ritz VDi 35 Toyota Fortuner 3.0 Diesel 35 Honda Amaze S i-Dtech 32 Hyundai Grand i10 Sportz 32 Honda City 1.5 V MT 32 Honda Brio S MT 32 Hyundai i10 Sportz 31 Maruti Alto LXi 30 Maruti Wagon R LXI 29 Maruti Ertiga VDI 28 Volkswagen Polo 1.2 MPI Highline 26 Maruti Wagon R VXI 25 Hyundai EON Era Plus 25 Hyundai Verna 1.6 SX 25 Toyota Fortuner 4x2 AT 23 Skoda Superb Elegance 1.8 TSI AT 23 BMW 3 Series 320d 23 Maruti Alto 800 LXI 23 Hyundai i10 Sportz 1.2 23 Hyundai Creta 1.6 CRDi SX 22 Volkswagen Vento Diesel Highline 22 Maruti Celerio VXI AT 22 Hyundai i10 Magna 22 Audi A4 2.0 TDI 22 Hyundai i10 Magna 1.2 21 Honda Amaze S i-Vtech 21 Maruti Alto K10 VXI 20 Ford Figo Diesel ZXI 20 Maruti Swift Dzire VXI 20 Audi A6 2011-2015 2.0 TDI Premium Plus 20 Maruti Ertiga ZDI 20 Mahindra XUV500 W6 2WD 20 Renault Duster 110PS Diesel RxZ 20 Maruti Swift Dzire VDi 20 Hyundai i20 Sportz 1.2 19 Hyundai i20 1.2 Magna 19 Volkswagen Polo 1.5 TDI Highline 19 Hyundai Santro Xing GLS 19 Hyundai Grand i10 AT Asta 19 Volkswagen Polo Diesel Comfortline 1.2L 19 Ford Figo Diesel EXI 18 Ford Ecosport 1.5 DV5 MT Titanium Optional 18 Maruti Alto 800 2016-2019 LXI 18 Mahindra XUV500 W8 4WD 18 Ford Figo Diesel Titanium 18 Renault KWID RXT 18 Maruti Wagon R LXI CNG 18 Jaguar XF 2.2 Litre Luxury 17 Renault Duster 85PS Diesel RxL 17 Hyundai Verna 1.6 SX VTVT 17 Ford Ecosport 1.5 DV5 MT Titanium 17 Maruti Swift Dzire VXi 17 Volkswagen Polo Petrol Comfortline 1.2L 17 Toyota Fortuner 4x2 Manual 16 Honda City i VTEC CVT VX 16 Hyundai i20 Magna 16 Toyota Innova 2.5 G (Diesel) 8 Seater 15 Hyundai i20 1.2 Sportz 15 Toyota Innova Crysta 2.8 ZX AT 15 Volkswagen Vento Petrol Highline 15 BMW 3 Series 320d Luxury Line 15 Hyundai Creta 1.6 CRDi SX Option 15 BMW X1 sDrive20d 15 Volkswagen Polo Petrol Highline 1.2L 15 Honda City i VTEC V 15 Maruti Wagon R LXI BS IV 15 Chevrolet Beat LT 15 Toyota Innova 2.5 V Diesel 7-seater 15 BMW 5 Series 2013-2017 520d Luxury Line 15 Volkswagen Vento 1.5 TDI Highline 15 Honda City i VTEC SV 15 Hyundai EON D Lite Plus 15 Audi A4 2.0 TDI 177 Bhp Premium Plus 15 Volkswagen Polo Diesel Highline 1.2L 14 Hyundai Grand i10 CRDi Magna 14 Mahindra XUV500 W10 2WD 14 Maruti Swift VXI BSIV 14 Hyundai Grand i10 CRDi Sportz 14 Hyundai Grand i10 Asta 14 Maruti Wagon R VXI BS IV 14 Mercedes-Benz New C-Class C 220d Avantgarde Edition C 14 Maruti Alto K10 2010-2014 VXI 14 Hyundai i10 Era 14 Honda City i DTEC SV 14 BMW 5 Series 520d Luxury Line 14 Hyundai i20 Asta Option 1.2 13 Honda Amaze VX i-DTEC 13 Nissan Micra Diesel XV 13 Hyundai i20 Asta 1.4 CRDi 13 Toyota Etios G 13 Maruti Celerio VXI 13 Volkswagen Polo Diesel Trendline 1.2L 13 Chevrolet Cruze LTZ 13 Maruti Swift ZDi 13 Maruti Vitara Brezza ZDi Plus Dual Tone 13 Hyundai i20 Asta 1.2 13 Hyundai Creta 1.6 SX Plus Dual Tone Petrol 13 Hyundai i20 Sportz 1.4 CRDi 13 Audi Q7 3.0 TDI Quattro Premium Plus 13 Hyundai Creta 1.6 CRDi AT SX Plus 13 Maruti Swift Dzire Tour LDI 13 Honda City V MT 13 Hyundai Verna 1.6 SX CRDi (O) 13 Maruti Ertiga VXI 12 Maruti Alto LXi BSIII 12 Mercedes-Benz New C-Class C 220 CDI Avantgarde 12 Maruti Vitara Brezza ZDi 12 BMW 3 Series Luxury Line 12 Maruti Ritz LDi 12 Hyundai i20 1.2 Spotz 12 Hyundai Accent GLE 12 Chevrolet Beat LS 12 Toyota Innova 2.5 VX (Diesel) 7 Seater 12 Hyundai Grand i10 Asta Option 12 Hyundai Grand i10 1.2 Kappa Sportz 12 Renault Duster 110PS Diesel RxL 12 Maruti Swift Dzire LDI 12 Maruti A-Star Vxi 12 Ford Figo Petrol ZXI 12 Toyota Etios Liva GD 12 Hyundai Verna 1.6 SX VTVT (O) 12 Toyota Innova 2.5 G4 Diesel 8-seater 11 Honda City i DTEC VX 11 Toyota Innova 2.5 V Diesel 8-seater 11 Honda City ZX GXi 11 Mercedes-Benz New C-Class 220 CDI AT 11 Ford EcoSport 1.5 TDCi Titanium 11 Volkswagen Polo GT TSI 11 Audi A4 2.0 TDI Multitronic 11 Maruti Swift VXI 11 Mahindra Ssangyong Rexton RX7 11 Mercedes-Benz E-Class 2015-2017 E250 CDI Avantgarde 11 Hyundai Elantra CRDi SX 11 Hyundai Creta 1.6 SX Plus Petrol Automatic 11 Chevrolet Beat Diesel LT 10 Mercedes-Benz E-Class E250 CDI Avantgrade 10 Hyundai i20 1.4 CRDi Magna 10 Honda City 1.5 V AT 10 BMW 3 Series 320d Highline 10 Honda City 1.5 E MT 10 Toyota Corolla Altis G 10 Hyundai Santro Xing GL 10 Volkswagen Vento Petrol Highline AT 10 BMW 5 Series 2013-2017 530d M Sport 10 Hyundai i10 Era 1.1 10 Toyota Etios GD 10 Maruti Swift Dzire Vdi BSIV 10 Hyundai Xcent 1.1 CRDi Base 10 Mercedes-Benz M-Class ML 350 4Matic 10 Toyota Innova 2.5 GX (Diesel) 7 Seater 10 Ford Endeavour 3.2 Titanium AT 4X4 10 Honda Brio VX AT 10 Hyundai EON Magna Plus 10 Chevrolet Cruze LTZ AT 10 Toyota Innova 2.5 G (Diesel) 7 Seater BS IV 10 Maruti Eeco 7 Seater Standard 10 Hyundai Xcent 1.1 CRDi S 10 Honda Jazz 1.2 V CVT i VTEC 10 Chevrolet Beat Diesel LS 10 Maruti Baleno Zeta 1.2 10 Volkswagen Polo 1.2 MPI Comfortline 10 Mercedes-Benz New C-Class C 220 CDI Elegance AT 10 Skoda Superb Style 1.8 TSI AT 9 Toyota Fortuner 4x4 MT 9 Hyundai Grand i10 Magna 9 Mercedes-Benz GLE 350d 9 Maruti Vitara Brezza VDi Option 9 Hyundai Grand i10 1.2 Kappa Magna 9 Honda Civic 2006-2010 1.8 V MT 9 BMW 5 Series 2003-2012 520d 9 Ford Ikon 1.3 Flair 9 Mercedes-Benz GLA Class 200 CDI SPORT 9 Volkswagen Vento Diesel Comfortline 9 Hyundai i10 Magna 1.1 9 Honda Brio V MT 9 Hyundai Grand i10 1.2 Kappa Asta 9 Maruti Ciaz ZDi Plus SHVS 9 Hyundai i10 Sportz AT 9 Mahindra Bolero ZLX 9 Mercedes-Benz E-Class 280 CDI 8 Maruti Swift Dzire ZXi 8 Honda City i VTEC VX Option 8 Tata Nano XTA 8 Volkswagen Vento Diesel Trendline 8 Hyundai i20 1.2 Magna Executive 8 Nissan Micra XV CVT 8 Maruti Swift ZXI 8 Hyundai Elite i20 Petrol Asta 8 Audi A6 2011-2015 2.0 TDI 8 Mercedes-Benz GL-Class 2007 2012 350 CDI Luxury 8 Audi A4 New 2.0 TDI Multitronic 8 Honda Amaze SX i-VTEC 8 Maruti Alto K10 LXI 8 Jaguar XF 3.0 Litre S Premium Luxury 8 Hyundai i20 Magna 1.2 8 BMW X5 xDrive 30d 8 Maruti Ritz VXi 8 Honda Civic 2006-2010 1.8 S MT 8 Mercedes-Benz E-Class 2009-2013 E250 CDI Elegance 8 Maruti Swift Dzire ZDI 8 Volkswagen Polo Petrol Trendline 1.2L 8 Ford Ecosport 1.5 DV5 MT Ambiente 8 Mercedes-Benz E-Class 2009-2013 E250 CDI Blue Efficiency 8 Maruti Alto K10 VXI AGS 8 Hyundai Verna 1.6 VTVT 8 Volkswagen Jetta 2013-2015 2.0L TDI Highline AT 8 Maruti Wagon R AMT VXI 8 Maruti Vitara Brezza ZDi Plus 8 Hyundai Creta 1.6 SX Plus Diesel 8 Land Rover Freelander 2 SE 8 Maruti Swift 1.3 VXi 8 Hyundai i10 Magna AT 8 Hyundai i20 Magna 1.4 CRDi 8 Hyundai EON Era 8 Mahindra XUV500 AT W10 FWD 8 Maruti Ciaz VXi Plus 8 Nissan Sunny 2011-2014 Diesel XL 8 Volkswagen Vento 1.5 TDI Highline AT 8 Hyundai Xcent 1.2 Kappa S Option 8 Maruti Swift LDI 8 Toyota Innova 2.5 G (Diesel) 7 Seater 8 Maruti Omni 8 Seater BSIV 7 Maruti SX4 ZXI MT BSIV 7 Renault KWID RXL 7 Mercedes-Benz GL-Class 350 CDI Blue Efficiency 7 Toyota Corolla Altis 2008-2013 1.8 VL AT 7 Hyundai Santro Xing XL 7 Hyundai Verna SX CRDi AT 7 Maruti Swift Vdi BSIII 7 Ford Endeavour 3.0L 4X4 AT 7 Honda Jazz 1.2 SV i VTEC 7 Hyundai i20 1.2 Asta 7 Audi Q3 35 TDI Quattro Premium Plus 7 Hyundai Verna 1.6 CRDI 7 BMW 3 Series 320d Sport Line 7 Maruti Wagon R LXI BSIII 7 Hyundai Verna CRDi SX 7 Toyota Innova Crysta 2.4 VX MT 7 Toyota Fortuner 4x2 4 Speed AT 7 Honda City i DTEC V 7 Mercedes-Benz M-Class ML 250 CDI 7 Skoda Octavia Elegance 2.0 TDI AT 7 Maruti Baleno Zeta Automatic 7 BMW 5 Series 520d Sedan 7 Chevrolet Spark 1.0 LS 7 Mercedes-Benz B Class B180 7 Maruti Ertiga SHVS VDI 7 Toyota Etios Liva G 7 Honda City i VTEC VX 7 Hyundai i20 1.2 Asta Option 7 Honda Accord 2.4 AT 7 Honda City i-VTEC CVT VX 7 Honda Amaze SX i-DTEC 7 Honda City 1.5 S AT 7 Hyundai i20 1.4 CRDi Sportz 7 Renault Duster 85PS Diesel RxL Optional 7 Hyundai Creta 1.6 VTVT S 7 Maruti Alto 800 VXI 7 Hyundai Verna 1.6 SX CRDI (O) AT 7 Toyota Innova Crysta 2.4 ZX MT 7 Hyundai i20 1.2 Sportz Option 7 Tata Nano Twist XT 7 Honda Jazz 1.2 VX i VTEC 7 Audi Q5 2008-2012 2.0 TDI 7 Chevrolet Spark 1.0 LT 7 Hyundai Santro Xing XL eRLX Euro III 7 Toyota Innova Crysta 2.8 GX AT 7 Toyota Innova 2.5 G (Diesel) 8 Seater BS IV 7 Toyota Innova 2.5 G4 Diesel 7-seater 7 Mercedes-Benz CLA 200 CDI Sport 7 Mahindra Scorpio SLE BSIV 7 Maruti Ciaz VDi Plus SHVS 7 Maruti Dzire VDI 7 Hyundai i20 Magna Optional 1.2 7 Hyundai Verna 1.6 SX VTVT (O) AT 6 Audi A4 35 TDI Premium 6 Hyundai Santro Xing GL Plus 6 Toyota Corolla Altis Diesel D4DG 6 Audi A6 2011-2015 35 TDI Technology 6 Maruti Wagon R VXI 1.2 6 Ford Ecosport 1.5 Ti VCT MT Titanium 6 Ford Ecosport 1.5 DV5 MT Trend 6 Toyota Fortuner 2.8 2WD AT 6 Mercedes-Benz E-Class 2009-2013 E 220 CDI Avantgarde 6 Maruti Wagon R VXI AMT 6 Jaguar XF Diesel 6 Mercedes-Benz E-Class 2015-2017 E250 Edition E 6 Nissan Sunny 2011-2014 Diesel XV 6 Maruti Ertiga ZXI 6 Honda Amaze E i-Vtech 6 Maruti Swift VXi BSIV 6 Hyundai EON Sportz 6 Volkswagen Passat Diesel Highline 2.0 TDI 6 Audi Q5 2.0 TDI Premium Plus 6 Maruti Eeco 5 STR With AC Plus HTR CNG 6 Renault Duster 110PS Diesel RxZ AMT 6 Honda CR-V 2.4 AT 6 Chevrolet Aveo U-VA 1.2 LS 6 Maruti Alto 800 2016-2019 VXI 6 BMW 3 Series 320d Prestige 6 Maruti Baleno Alpha 1.3 6 Honda Brio S Option MT 6 Honda Mobilio S i DTEC 6 Maruti Swift VXI BSIII 6 Audi Q7 4.2 TDI Quattro Technology 6 Mercedes-Benz A Class A180 CDI 6 Maruti Ciaz ZXi 6 Ford EcoSport 1.5 Diesel Titanium 6 Maruti Swift VDI BSIV W ABS 6 Hyundai Xcent 1.2 Kappa S 6 Audi Q5 30 TDI quattro Premium Plus 6 Honda Jazz 1.5 S i DTEC 6 Renault KWID RXT Optional 6 Maruti Ritz LXi 6 Audi Q3 2012-2015 2.0 TDI Quattro Premium Plus 6 Tata Indigo CS eVX 6 Mercedes-Benz New C-Class C 220 CDI Style 6 Maruti SX4 Vxi BSIV 6 Toyota Innova 2.5 GX (Diesel) 8 Seater 6 Hyundai i10 Sportz 1.1L 6 Hyundai Verna CRDi 1.6 SX Option 6 Tata Indica V2 eLS 6 Mahindra Scorpio VLX 6 Honda Brio E MT 6 Tata Zest Quadrajet 1.3 75PS XE 6 Audi A6 2.7 TDI 6 Volkswagen Vento 1.6 Highline 6 Skoda Superb Elegance 2.0 TDI CR AT 6 Mitsubishi Pajero Sport 4X4 6 Mitsubishi Pajero Sport 4X2 AT 6 Hyundai i20 1.4 Sportz 6 Ford Fiesta Classic 1.4 Duratorq CLXI 6 Honda City 1.5 GXI 5 Hyundai Santro Xing XP 5 Honda BRV i-VTEC V CVT 5 Mercedes-Benz New C-Class C 250 CDI Elegance 5 Mini Cooper 5 DOOR D 5 Nissan Sunny 2011-2014 XL 5 Honda City V AT 5 Toyota Corolla Altis VL AT 5 Hyundai Elantra CRDi SX AT 5 Mini Cooper Convertible S 5 BMW X5 2014-2019 xDrive 30d Design Pure Experience 7 Seater 5 Maruti Baleno Alpha 5 Maruti Zen Estilo LXI BS IV 5 Mercedes-Benz E-Class 2009-2013 E250 CDI Avantgarde 5 BMW X1 sDrive 20d Exclusive 5 Honda City i-VTEC V 5 Maruti Swift Dzire 1.2 Vxi BSIV 5 Skoda Rapid 1.6 TDI Ambition 5 Hyundai Creta 1.6 SX 5 Hyundai Verna CRDi 5 Maruti Wagon R LXI Minor 5 Hyundai i20 Sportz AT 1.4 5 Hyundai i20 Magna Optional 1.4 CRDi 5 Skoda Laura 1.9 TDI AT Ambiente 5 Audi Q7 3.0 TDI Quattro Technology 5 Mitsubishi Pajero 2.8 SFX 5 Mahindra TUV 300 2015-2019 T8 5 Maruti Wagon R LX BSIII 5 Audi A6 35 TDI Matrix 5 Ford Figo Petrol Titanium 5 Audi Q7 35 TDI Quattro Technology 5 Maruti Swift Ldi BSIII 5 BMW X3 xDrive20d 5 Maruti Swift VXI Optional 5 Maruti Baleno Delta 1.2 5 Audi A6 3.0 TDI quattro 5 Datsun redi-GO T Option 5 Toyota Camry Hybrid 5 Maruti SX4 S Cross DDiS 320 Zeta 5 Hyundai Elantra 2.0 SX Option AT 5 Volkswagen Ameo 1.2 MPI Comfortline 5 Nissan Terrano XL 5 Honda City 1.5 EXI 5 Mercedes-Benz New C-Class C 220 CDI BE Avantgare 5 Land Rover Freelander 2 TD4 SE 5 Land Rover Range Rover 2.2L Pure 5 Toyota Fortuner 2.8 4WD MT 5 Tata Indica Vista Quadrajet LS 5 Maruti Swift Dzire VDI Optional 5 Honda City ZX CVT 5 Maruti Swift Lxi BSIII 5 Mini Cooper 3 DOOR D 5 Ford EcoSport 1.5 Ti VCT AT Titanium 5 Hyundai i20 Asta 5 Hyundai Santro Xing XO eRLX Euro II 5 Toyota Fortuner 4x4 AT 5 Honda Civic 2006-2010 1.8 V AT 5 Honda City i-VTEC VX 5 Ford Endeavour 3.2 Trend AT 4X4 5 Toyota Innova 2.5 VX (Diesel) 8 Seater 5 Maruti Wagon R CNG LXI 5 Tata Indica Vista Quadrajet VX 5 Maruti Celerio ZXI 5 Hyundai Santro Xing XO 5 Tata Zest Revotron 1.2T XE 5 Hyundai Santa Fe 4WD AT 5 Hyundai i10 Sportz 1.2 AT 5 Mercedes-Benz GLE 250d 5 Maruti Swift Dzire LXI 5 BMW X5 3.0d 5 Mahindra XUV500 W10 AWD 5 Renault Pulse RxL 5 Maruti Ciaz ZDi Plus 5 BMW 5 Series 525d Sedan 5 Honda Amaze S AT i-Vtech 5 Mercedes-Benz E-Class E 220 d 5 Maruti Baleno Alpha 1.2 5 Hyundai i20 1.4 CRDi Asta 5 Maruti Alto LX 5 Nissan Micra Diesel XV Premium 5 Renault Duster 85PS Diesel RxL Option 5 Maruti 800 AC 5 Skoda Laura Ambiente 2.0 TDI CR AT 5 Honda City 1.5 V MT Exclusive 5 BMW 3 Series 320d Sport 5 Honda Brio 1.2 VX MT 5 Mercedes-Benz S Class 2005 2013 S 350 CDI 5 Jeep Compass 2.0 Longitude 5 Hyundai i20 Sportz Option 1.2 5 BMW X6 xDrive30d 5 Hyundai Grand i10 1.2 CRDi Sportz 5 Porsche Panamera Diesel 5 Toyota Corolla H4 5 Maruti Celerio VXI AMT 4 Hyundai i10 Era 1.1 iTech SE 4 Maruti Zen Estilo LXI BSIII 4 Honda CR-V 2.4 4WD AT 4 Volkswagen Polo Petrol Highline 1.6L 4 Maruti SX4 S Cross DDiS 200 Zeta 4 Nissan Terrano XV D Pre 4 Nissan Micra XL 4 Audi A6 2.0 TDI Design Edition 4 Hyundai Verna CRDi ABS 4 Chevrolet Optra Magnum 2.0 LT 4 Hyundai Creta 1.6 SX Option Diesel 4 Ford Fiesta 1.4 SXi TDCi 4 BMW 5 Series 2003-2012 525d 4 Maruti Ritz VXI 4 Tata Zest Revotron 1.2T XM 4 Hyundai Xcent 1.2 Kappa AT SX Option 4 Volkswagen Vento 1.6 Comfortline 4 Renault Duster 110PS Diesel RxZ Plus 4 Toyota Innova Crysta 2.4 VX MT 8S 4 Mercedes-Benz M-Class ML 320 CDI 4 Honda Jazz 1.2 V i VTEC 4 Maruti Dzire AMT ZDI Plus 4 Skoda Rapid 1.5 TDI Elegance 4 Hyundai Santro GLS II - Euro II 4 Mercedes-Benz E-Class E250 CDI Launch Edition 4 Hyundai Verna VTVT 1.6 SX 4 Skoda Rapid 1.5 TDI Ambition 4 Renault Duster 85PS Diesel RxE 4 Hyundai Elite i20 Petrol Sportz 4 Hyundai Grand i10 Asta Option AT 4 Maruti SX4 VDI 4 Land Rover Range Rover HSE Dynamic 4 Nissan Terrano XV Premium 110 PS 4 BMW 6 Series Gran Coupe 4 BMW 7 Series 730Ld 4 Skoda Rapid 1.5 TDI AT Elegance 4 Audi A4 35 TDI Premium Plus 4 Hyundai Creta 1.4 CRDi S Plus 4 Maruti SX4 ZDI 4 Maruti Alto LXI 4 Toyota Corolla Altis VL 4 Mercedes-Benz GLA Class 200 CDI 4 Fiat Avventura MULTIJET Emotion 4 Audi Q5 2008-2012 2.0 TFSI Quattro 4 Honda WRV i-VTEC VX 4 Tata Tiago 1.2 Revotron XZ 4 Skoda Rapid 1.5 TDI AT Ambition 4 Maruti Wagon R LX 4 Toyota Etios V 4 BMW 3 Series 320d Sedan 4 Honda Jazz 1.5 VX i DTEC 4 Maruti Swift Dzire AMT ZDI 4 Maruti A-Star Lxi 4 Toyota Innova Crysta 2.8 GX AT 8S 4 Hyundai i20 Magna 1.4 CRDi (Diesel) 4 Honda Jazz V 4 Audi Q3 2.0 TDI 4 Mahindra Thar CRDe AC 4 Volkswagen Ameo 1.5 TDI Highline 4 Mahindra Xylo D4 4 Toyota Innova 2.5 ZX Diesel 7 Seater 4 Tata Nano XT 4 Toyota Fortuner 2.8 2WD MT 4 Volkswagen Ameo 1.2 MPI Highline 4 Honda Jazz 1.5 V i DTEC 4 Maruti Alto 800 2016-2019 CNG LXI 4 Maruti Baleno Sigma 1.2 4 Mercedes-Benz New C-Class C 200 CGI Avantgarde 4 Toyota Corolla 1.8 J 4 Volkswagen Vento 2013-2015 1.6 Comfortline 4 Hyundai Xcent 1.2 CRDi S 4 Tata Indica Vista TDI LS 4 Toyota Corolla Altis 1.8 VL CVT 4 Maruti Dzire VXI 4 Maruti Alto LXi BSII 4 Hyundai i10 Asta 4 Audi Q3 35 TDI Quattro Premium 4 Toyota Innova 2.5 VX (Diesel) 8 Seater BS IV 4 Maruti Vitara Brezza LDi 4 Mercedes-Benz B Class B200 CDI 4 Honda City ZX VTEC 4 Hyundai i20 Sportz Option 4 BMW 3 Series 320i Sedan 4 Hyundai Santa Fe 4X4 4 Tata Indigo LS 4 Skoda Laura Ambiente 4 Hyundai Grand i10 1.2 Kappa Sportz Option 4 Honda Accord 2.4 MT 4 Ford EcoSport 1.0 Ecoboost Titanium Plus 4 Toyota Corolla H2 4 Hyundai Verna 1.6 EX VTVT 4 Mercedes-Benz New C-Class C250 Avantgarde 4 Honda Mobilio V i DTEC 4 Hyundai Verna 1.6 CRDi SX 4 BMW X1 sDrive 20d xLine 4 BMW X1 xDrive 20d xLine 4 Maruti Celerio ZDi 4 Maruti Swift VDI Optional 4 Hyundai Getz GLE 4 Renault Duster Petrol RxL 4 Audi Q5 3.0 TDI Quattro Technology 4 Hyundai EON Magna 4 Mercedes-Benz New C-Class C 220 CDI CLASSIC 4 Audi Q5 2.0 TDI 4 Honda Accord 2.4 A/T 4 Mercedes-Benz S Class 2005 2013 S 350 L 4 Maruti Ciaz 1.3 Alpha 4 BMW X1 sDrive 20d Sportline 4 Hyundai Santa Fe 4x4 AT 4 Maruti Ciaz AT ZXi 4 Maruti Ritz ZXi 4 Volkswagen CrossPolo 1.5 TDI 4 Hyundai Creta 1.6 SX Option 4 Volkswagen Polo 1.5 TDI Comfortline 4 Tata Indica DLS 4 Honda Brio 1.2 S MT 4 Skoda Rapid 1.6 MPI AT Style 4 Mercedes-Benz New C-Class C 250 CDI Avantgarde 4 Ford Ikon 1.4 TDCi DuraTorq 4 Skoda Octavia Classic 1.9 TDI MT 4 Maruti Ciaz 1.4 Zeta 4 Maruti Swift Dzire ZXI 4 Maruti Ertiga VXI CNG 4 Honda Amaze VX i-Vtech 4 Honda Mobilio S i VTEC 4 Maruti Ignis 1.2 Alpha 4 Mahindra Xylo D4 BSIV 3 Hyundai Xcent 1.2 Kappa SX 3 Hyundai Verna VTVT 1.6 AT SX Option 3 Toyota Corolla Altis 1.8 GL 3 Audi A4 2.0 TDI 177 Bhp Technology Edition 3 Chevrolet Beat Diesel 3 BMW 7 Series 730Ld Sedan 3 Maruti Ciaz ZXi Plus 3 Maruti Baleno Delta 1.3 3 Honda Civic 2010-2013 1.8 S MT 3 Honda CR-V 2.0L 2WD MT 3 Hyundai i20 Active 1.4 SX 3 Honda City i-VTEC S 3 Tata Indigo CS LX (TDI) BS III 3 Toyota Corolla H5 3 Toyota Corolla Altis 1.4 DG 3 Mahindra XUV500 W4 3 Hyundai Getz GLS 3 Tata Sumo EX 3 Hyundai Verna VTVT 1.6 SX Option 3 BMW 3 Series 2005-2011 325i Sedan 3 Audi Q3 2.0 TDI Quattro 3 Toyota Etios Cross 1.4L VD 3 Volvo XC90 2007-2015 D5 AWD 3 Hyundai EON D Lite Plus Option 3 BMW X5 xDrive 30d M Sport 3 Honda Mobilio RS Option i DTEC 3 Mahindra Xylo E4 3 Tata Zest Revotron 1.2 XT 3 Ford Fiesta 1.4 SXi TDCi ABS 3 Hyundai Verna 1.4 CRDi 3 Maruti Estilo LXI 3 Skoda Superb L&K 2.0 TDI AT 3 Nissan Terrano XL D Option 3 Ford EcoSport 1.5 Petrol Titanium Plus AT 3 Hyundai Verna 1.6 CRDi S 3 Maruti A-Star AT VXI 3 Nissan Sunny Diesel XV 3 Maruti Swift VDi BSIII W/ ABS 3 Tata Indica V2 eLX 3 Jaguar XE 2.0L Diesel Prestige 3 Renault KWID Climber 1.0 AMT 3 Maruti Swift Dzire ZDi 3 Honda City i DTec VX 3 Audi A4 35 TDI Technology 3 Renault Duster Adventure Edition 3 Honda Jazz S 3 Honda Amaze S Petrol 3 Maruti Wagon R VXI BSIII 3 Renault Scala Diesel RxL 3 Maruti Alto K10 LXI CNG 3 Mercedes-Benz New C-Class C 200 CGI Elegance 3 Mercedes-Benz CLA 200 D Sport Edition 3 Jeep Compass 2.0 Limited Option 4X4 3 Hyundai Elite i20 Asta Option 3 Honda Amaze E i-Dtech 3 Maruti Swift Dzire 1.2 Lxi BSIV 3 Hyundai Creta 1.6 SX Automatic Diesel 3 Mini Cooper Countryman D 3 Maruti 800 Std BSIII 3 Maruti Celerio ZXI AT 3 Skoda Rapid 1.6 TDI Elegance 3 ISUZU D-MAX V-Cross 4X4 3 Toyota Corolla Altis 1.8 G 3 Maruti SX4 Green Vxi (CNG) 3 Hyundai Verna 1.6 VTVT EX AT 3 Maruti Baleno RS 1.0 Petrol 3 Skoda Rapid 1.6 MPI Ambition 3 Mercedes-Benz E-Class 2009-2013 E350 Petrol 3 Ford Endeavour 2.2 Titanium AT 4X2 3 Volkswagen Polo 1.2 MPI Trendline 3 Nissan Teana 230jM 3 Honda Amaze S i-VTEC 3 Hyundai Santro GLS I - Euro II 3 Hyundai i20 Asta Option 1.4 CRDi 3 Honda Amaze VX AT i-Vtech 3 Volkswagen Jetta 2007-2011 2.0 TDI Trendline 3 Audi Q3 30 TDI Premium FWD 3 Mahindra Thar CRDe 3 Audi A4 2.0 TDI Premium Sport Limited Edition 3 Honda Accord 2.4 Elegance M/T 3 Maruti Dzire LDI 3 Tata Manza Aura Quadrajet BS IV 3 Ford Figo Aspire 1.2 Ti-VCT Titanium 3 Chevrolet Sail 1.2 LS 3 Skoda Laura Ambition 2.0 TDI CR AT 3 Nissan Terrano XL 110 PS 3 Maruti S Cross DDiS 320 Alpha 3 Audi Q7 3.0 TDI quattro 3 Volkswagen Polo 1.5 TDI Trendline 3 Ford Ecosport 1.0 Ecoboost Platinum Edition 3 Honda City V MT Exclusive 3 Maruti Ciaz VDi Plus 3 Mini Cooper S Carbon Edition 3 Maruti Ignis 1.2 Delta 3 Ford Fiesta 1.4 Duratec EXI 3 Honda City 1.3 EXI 3 Hyundai Verna 1.6 SX VTVT AT 3 Tata Nano Lx 3 Toyota Camry 2.5 G 3 Volkswagen Polo GT TDI 3 Audi Q3 2012-2015 35 TDI Quattro Premium 3 Fiat Linea Emotion (Diesel) 3 Honda City i DTec SV 3 Porsche Cayenne Diesel 3 Maruti Omni E MPI STD BS IV 3 Nissan Micra Active XV 3 Hyundai Santa Fe 2WD AT 3 Maruti Baleno Delta 3 Toyota Etios Liva V 3 Mahindra Xylo E8 ABS BS IV 3 Jeep Compass 2.0 Sport 3 Mitsubishi Pajero Sport 4X4 AT 3 Honda Accord 2.4 Inspire M/T 3 Hyundai Grand i10 1.2 Kappa Magna AT 3 Nissan Terrano XV 110 PS 3 Mercedes-Benz R-Class R350 4Matic Long 3 Chevrolet Aveo 1.4 LS 3 Ford Ecosport 1.0 Ecoboost Titanium 3 Mercedes-Benz New C-Class C 200 Kompressor Elegance AT 3 Mahindra Ssangyong Rexton RX5 3 Tata Tiago 1.2 Revotron XT 3 Volvo S60 D4 KINETIC 3 Mercedes-Benz M-Class ML 350 CDI Corporate 3 Maruti SX4 Zxi BSIII 3 Skoda Laura 1.8 TSI Ambiente 3 Honda City i-DTEC SV 3 Toyota Fortuner 4x2 AT TRD Sportivo 3 Mercedes-Benz E-Class 200 Kompressor Elegance 3 Land Rover Range Rover 2.2L Dynamic 3 Maruti Baleno Zeta 1.3 3 Volkswagen Vento 1.5 TDI Comfortline AT 3 Ford EcoSport 1.5 Ti VCT MT Titanium BE 3 Mercedes-Benz SLC 43 AMG 3 Ford Fiesta 1.4 Duratorq ZXI 3 Fiat Linea Emotion 3 Volkswagen Jetta 2007-2011 1.9 Highline TDI 3 Hyundai Grand i10 1.2 CRDi Magna 3 Honda City i DTec V 3 Audi Q3 2012-2015 35 TDI Quattro Premium Plus 3 BMW 3 Series 320d Corporate Edition 3 Maruti Dzire AMT ZXI Plus 3 Skoda Octavia Elegance 1.8 TSI AT 3 Hyundai Xcent 1.2 Kappa SX Option 3 Honda Amaze S Diesel 3 Renault Koleos 2.0 Diesel 3 Honda CR-V 2.4 MT 3 Honda City 1.5 V MT Sunroof 3 Maruti Vitara Brezza VDi 3 Hyundai i20 1.4 Asta 3 Volvo V40 Cross Country D3 3 Maruti Eeco 5 Seater AC 3 Mahindra Xylo H4 3 Toyota Etios Liva 1.2 G 3 Hyundai Verna 1.6 CRDi EX AT 3 Audi A4 3.0 TDI Quattro Premium 3 Audi A6 2011-2015 35 TDI Premium 3 Volkswagen Vento 1.5 TDI Comfortline 3 Maruti Zen LXi - BS III 3 Renault KWID 1.0 RXT Optional 3 Hyundai Creta 1.4 E Plus Diesel 3 Mercedes-Benz C-Class Progressive C 220d 3 Audi A8 L 3.0 TDI quattro 3 Mahindra Verito 1.5 D4 BSIV 3 Skoda Superb 1.8 TSI MT 3 Mercedes-Benz GLC 220d 4MATIC Style 3 Ford Figo 2015-2019 1.2P Titanium MT 3 Mercedes-Benz New C-Class 220 CDI MT 3 Toyota Fortuner 4x4 MT TRD Sportivo 3 Mercedes-Benz E-Class 2009-2013 E 250 Elegance 3 Maruti Swift Dzire LDi 3 Honda Civic 2006-2010 1.8 S AT 3 Maruti Ciaz RS ZDi Plus SHVS 3 Land Rover Range Rover 2.2L Prestige 3 Honda City i DTEC VX Option 3 Tata Xenon XT EX 4X2 3 Hyundai Verna Transform VTVT 3 Maruti Zen LX 3 Tata Manza Club Class Quadrajet90 LS 3 Maruti Omni 8 Seater BSII 3 Audi Q7 45 TDI Quattro Technology 3 Hyundai Accent CRDi 3 Mahindra Xylo E8 3 Ford Fiesta EXi 1.4 TDCi Ltd 3 Maruti Esteem Vxi - BSIII 3 Tata Indica Vista Aura 1.3 Quadrajet 3 Tata Indigo LX 3 Honda City i-VTEC CVT ZX 3 Audi A6 2011-2015 2.0 TDI Technology 3 Hyundai i10 Magna 1.2 iTech SE 3 Volkswagen Jetta 2007-2011 2.0 TDI Comfortline 3 Honda Jazz VX 3 Toyota Corolla Executive (HE) 3 Maruti Ritz ZDi 3 Toyota Innova 2.5 VX (Diesel) 7 Seater BS IV 3 Maruti Ciaz VDI SHVS 3 Mercedes-Benz New C-Class C 200 CGI 3 Honda CR-V 2.4L 4WD AT 3 Jeep Compass 2.0 Limited 4X4 3 Honda Jazz VX Diesel 3 Maruti SX4 Vxi BSIII 3 Maruti Ciaz ZDi SHVS 3 Honda Civic 2010-2013 1.8 V MT 3 Maruti Swift Ldi BSIV 3 Maruti Swift DDiS VDI 3 Maruti Zen Estilo VXI BSIII 3 Maruti Baleno Alpha Diesel 3 Volvo XC60 D5 3 Mercedes-Benz M-Class ML 350 CDI 3 Mercedes-Benz A Class A180 Sport 3 Tata Indigo eCS eLX BS IV 3 Hyundai i20 Sportz Diesel 3 Maruti Ciaz Zeta 3 Renault Duster 110PS Diesel RxZ Pack 3 Honda CR-V RVi MT 2 Hyundai Grand i10 CRDi Asta 2 Ford Fiesta 1.4 TDCi EXI 2 Renault Duster 85PS Diesel RxL Explore 2 Tata Tiago AMT 1.2 Revotron XZA 2 Mini Clubman Cooper S 2 Hyundai Elantra SX 2 Honda Civic 2006-2010 1.8 (E) MT 2 Hyundai Santro Xing XG eRLX Euro III 2 Chevrolet Tavera LS B3 10 Seats BSIII 2 Mahindra Scorpio VLX 2WD BSIV 2 Volvo S80 D5 2 Maruti Zen Estilo LXI Green (CNG) 2 Honda Accord 2.4 M/T 2 Skoda Octavia Ambiente 1.9 TDI MT 2 Tata Hexa XTA 2 Honda Accord 2001-2003 2.3 VTi L AT 2 Ford Fiesta Classic 1.4 Duratorq LXI 2 Maruti Swift Dzire VXi AT 2 Hyundai Grand i10 CRDi SportZ Edition 2 Honda City 1.5 V AT Sunroof 2 Tata Manza ELAN Quadrajet BS IV 2 BMW X6 xDrive 40d M Sport 2 Tata Indica Vista Aqua 1.3 Quadrajet 2 Mahindra Scorpio VLX 2WD Airbag BSIII 2 Skoda Octavia 2.0 TDI AT Style Plus 2 Maruti Swift Dzire VXI Optional 2 Ford Fiesta 1.4 Duratec EXI Limited Edition 2 Audi A4 1.8 TFSI 2 Ford Fiesta 1.4 ZXi TDCi ABS 2 Renault KWID 1.0 RXT Optional AMT 2 BMW X5 X5 M 2 Hyundai Verna CRDi 1.6 SX 2 Renault Fluence Diesel E4 2 Hyundai i20 Active 1.2 S 2 Ford Ecosport 1.5 Ti VCT MT Trend 2 Maruti Wagon R LX BSII 2 Renault Duster 110PS Diesel RXZ Option 2 Mahindra Scorpio 2009-2014 SLE 7S BSIV 2 BMW X3 xDrive30d M Sport 2 Maruti Zen VXI BSII 2 Mahindra Scorpio VLX 2.2 mHawk Airbag BSIV 2 Maruti Alto LX BSIII 2 Mahindra Scorpio 2.6 SLX CRDe 2 Maruti Baleno Alpha CVT 2 Toyota Innova Crysta 2.4 G MT 8S 2 Tata Indigo CS eGLX BS IV 2 Audi A6 2011-2015 35 TFSI Technology 2 Maruti S Cross DDiS 200 Alpha 2 Toyota Etios VX 2 Honda Amaze V Petrol 2 Hyundai Tucson CRDi 2 Maruti Celerio CNG VXI MT 2 Mahindra KUV 100 mFALCON G80 K2 2 Ford Figo Diesel LXI 2 Volvo XC60 D4 SUMMUM 2 Skoda Superb 3.6 V6 FSI 2 Maruti Omni 5 Seater BSIV 2 Maruti Alto 800 CNG LXI 2 Volkswagen Vento Petrol Comfortline 2 Honda Amaze S i-DTEC 2 Mercedes-Benz GLC 220d 4MATIC Sport 2 Toyota Corolla Altis D-4D GL 2 Mitsubishi Cedia Sports 2 Hyundai EON 1.0 Kappa Magna Plus 2 Honda Mobilio V i VTEC 2 Maruti Ciaz 1.3 S 2 Tata Manza Aqua Quadrajet BS IV 2 Mahindra Bolero SLE BSIII 2 Hyundai Xcent 1.1 CRDi S Celebration Edition 2 Datsun GO T Petrol 2 Tata Indigo CS Emax CNG GLX 2 Hyundai EON D Lite 2 Hyundai Santro GLS I - Euro I 2 Maruti Wagon R LXI BSII 2 Maruti Omni MPI STD BSIV 2 Mercedes-Benz E-Class E270 CDI 2 Renault Captur 1.5 Diesel RXL 2 Renault Pulse RxZ 2 Skoda Yeti Ambition 4X2 2 Hyundai Xcent 1.2 CRDi E Plus 2 Land Rover Range Rover Evoque 2.0 TD4 Pure 2 Hyundai Verna 1.6 CRDi EX MT 2 Mahindra Scorpio VLX 2WD AIRBAG BSIV 2 Toyota Innova 2.5 G3 2 Mahindra Scorpio 2.6 CRDe 2 Mahindra Scorpio S4 7 Seater 2 Hyundai Sonata Embera 2.0L CRDi MT 2 Hyundai Verna 1.4 VTVT 2 Hyundai Elantra SX AT 2 Mahindra TUV 300 T8 2 Hyundai Accent GLE 1 2 Maruti Swift 1.3 LXI 2 Tata Zest Revotron 1.2T XMS 2 Skoda Octavia Ambition 1.4 TSI MT 2 Mahindra Quanto C8 2 Maruti Baleno Alpha Automatic 2 Hyundai i20 1.2 Era 2 Toyota Corolla Altis D-4D G 2 Maruti Wagon R Stingray LXI 2 Mercedes-Benz CLA 200 Sport Edition 2 Maruti Grand Vitara 2.4 MT 2 Mahindra XUV500 W8 1.99 mHawk 2 Audi A3 35 TDI Attraction 2 Audi Q3 30 TDI S Edition 2 Mini Cooper 3 DOOR S 2 Skoda Laura Elegance 2.0 TDI CR AT 2 Skoda Rapid 1.6 MPI AT Elegance 2 Ford Endeavour 2.2 Trend MT 4X4 2 Honda Jazz V CVT 2 Maruti Ciaz VXi 2 Jaguar XE Portfolio 2 Jaguar XJ 3.0L Portfolio 2 Maruti Wagon R Stingray VXI 2 Mercedes-Benz GLA Class 200 Sport Edition 2 Chevrolet Enjoy 1.3 TCDi LTZ 8 2 Mahindra Scorpio S10 4WD 2 Maruti Celerio LXI 2 Hyundai i10 Asta Sunroof AT 2 Honda BR-V i-VTEC S MT 2 Tata Safari DICOR 2.2 LX 4x2 2 Maruti Ciaz Alpha 2 Maruti Ciaz VDi 2 Hyundai Santro Xing GLS LPG 2 Honda BRV i-DTEC V MT 2 Hyundai Grand i10 SportZ Edition 2 Maruti Swift LXI Option 2 Honda City i-DTEC ZX 2 Audi A6 35 TFSI Matrix 2 Maruti Celerio ZXI MT 2 Toyota Etios VD 2 BMW X3 xDrive 20d Luxury Line 2 Ford Figo 1.5D Trend MT 2 Chevrolet Sail Hatchback LS ABS 2 Nissan X-Trail SLX MT 2 Hyundai Elantra CRDi 2 Honda City ZX EXi 2 Hyundai i20 2015-2017 1.2 Magna 2 Honda Civic 2010-2013 1.8 V AT Sunroof 2 Nissan Sunny 2011-2014 XL AT Special Edition 2 Mahindra Xylo E4 ABS BS III 2 Ford Endeavour 2.5L 4X2 2 Hyundai i20 Active 1.4 SX Dual Tone 2 Maruti Alto Std 2 Tata Tiago 1.2 Revotron XT Option 2 Hyundai Verna Xi (Petrol) 2 Honda Accord VTi-L AT 2 Mercedes-Benz S-Class 320 L 2 Hyundai Xcent 1.2 VTVT E 2 Maruti Esteem Vxi 2 Maruti Alto 800 2016-2019 LXI Optional 2 Chevrolet Captiva LT 2 Tata Safari Storme 2012-2015 VX 2 Honda Brio VX 2 Maruti SX4 Zxi with Leather BSIII 2 Hyundai i20 2015-2017 Sportz AT 1.4 2 BMW 5 Series 2010-2013 525i 2 BMW 7 Series 2007-2012 730Ld 2 Ford Fiesta 1.4 Duratec ZXI 2 Ford Figo 2015-2019 1.5D Titanium MT 2 Land Rover Discovery Sport TD4 S 2 Skoda Rapid 1.6 MPI Ambition With Alloy Wheel 2 Mahindra Scorpio S6 Plus 7 Seater 2 Land Rover Discovery Sport SD4 HSE Luxury 7S 2 Mercedes-Benz New C-Class 200 K AT 2 Maruti Dzire AMT VDI 2 Renault KWID AMT RXL 2 Hyundai i20 Asta Optional with Sunroof 1.2 2 BMW X3 xDrive20d xLine 2 Tata Tiago 1.2 Revotron XZ WO Alloy 2 Audi A4 35 TDI Technology Edition 2 Mercedes-Benz New C-Class 200 CDI Classic 2 Toyota Innova 2.5 GX (Diesel) 7 Seater BS IV 2 Maruti Zen Estilo 1.1 VXI BSIII 2 Tata Nano Cx BSIV 2 Toyota Etios VXD 2 Skoda Superb 2.8 V6 AT 2 Datsun GO Plus T Petrol 2 BMW 3 Series GT 320d Luxury Line 2 Ford EcoSport 1.5 Ti VCT MT Titanium 2 Ford Figo Petrol EXI 2 Toyota Innova Crysta 2.4 GX MT 8S 2 Tata Indica V2 DLS BSIII 2 Skoda Superb Style 2.0 TDI AT 2 Honda Civic 2006-2010 1.8 MT Sport 2 Hyundai i10 Magna 1.1L 2 Mercedes-Benz E-Class 230 E AT 2 Renault Duster 110PS Diesel RxL AMT 2 Hyundai Santro Xing XG 2 Honda City V MT AVN 2 Honda City 1.5 V AT Exclusive 2 Volkswagen Vento 1.2 TSI Highline AT 2 Mercedes-Benz New C-Class C 220 CDI Celebration Edition 2 Mercedes-Benz S-Class 280 AT 2 BMW 6 Series 650i Coupe 2 Hyundai Verna 1.6 CRDi AT SX 2 Toyota Camry Hybrid 2.5 2 Audi A4 3.0 TDI Quattro 2 Maruti Baleno RS Petrol 2 Hyundai Verna Transform SX VGT CRDi 2 Toyota Etios Cross 1.4 GD 2 Hyundai Verna 1.4 EX 2 Fiat Punto 1.4 Emotion 2 Maruti Swift VXI BSIII W/ ABS 2 Skoda Fabia 1.2 MPI Classic 2 Tata Tigor 1.2 Revotron XT 2 Hyundai Verna CRDi 1.6 AT SX Plus 2 Land Rover Discovery Sport TD4 HSE 2 Chevrolet Enjoy Petrol LS 7 Seater 2 Chevrolet Aveo 1.6 LT 2 Hyundai Verna CRDi SX ABS 2 Mahindra NuvoSport N6 2 BMW 5 Series 530d M Sport 2 Mahindra Scorpio S8 8 Seater 2 Chevrolet Enjoy TCDi LS 8 Seater 2 Toyota Innova Crysta 2.4 GX MT 2 Maruti Alto K10 LXI CNG Optional 2 Tata Manza Aqua Safire 2 Volkswagen Vento Sport 1.2 TSI AT 2 Skoda Laura Ambiente 2.0 TDI CR MT 2 Toyota Etios Liva GD SP 2 Nissan Terrano XL Plus 85 PS 2 BMW 3 Series 330d Convertible 2 Ford EcoSport 1.5 TDCi Trend 2 Hyundai i20 Active 1.2 SX 2 BMW X3 xDrive20d Advantage Edition 2 Honda Jazz 1.5 SV i DTEC 2 Mahindra Thar DI 4X4 2 Toyota Innova 2.5 Z Diesel 7 Seater 2 Tata Nexon 1.5 Revotorq XZ Plus Dual Tone 2 Ford Endeavour 2.5L 4X2 MT 2 Hyundai Elantra 1.6 SX 2 Maruti Swift Dzire Ldi BSIV 2 Fiat Grande Punto 1.4 Emotion 2 Mercedes-Benz B Class 2012-2015 B200 Sport CDI 2 Maruti Omni MPI CARGO BSIV 2 Volkswagen Polo 1.2 MPI Highline Plus 2 Maruti Zen LXI 2 Mercedes-Benz E-Class 220 CDI 2 Honda Brio S Option AT 2 Mahindra KUV 100 mFALCON G80 K6 Plus 2 Audi A3 35 TDI Premium Plus 2 Honda Brio EX MT 2 Maruti Ertiga SHVS ZDI Plus 2 Hyundai Sonata Transform 2.4 GDi AT 2 Volkswagen Passat 1.8 TSI MT 2 Mahindra Xylo D4 BS III 2 Hyundai Verna VTVT 1.6 AT SX Plus 2 Ford Figo Aspire 1.2 Ti-VCT Ambiente 2 Honda CR-V 2.0 AT 2 Force One LX 4x4 2 Nissan Micra XV 2 Hyundai i20 Sportz Option Diesel 2 Hyundai Getz GVS 2 Hyundai Verna 1.6 CRDI AT SX Option 2 Renault Lodgy 110PS RxZ 8 Seater 2 BMW 1 Series 118d Base 2 Maruti Swift VVT VXI 2 Mitsubishi Pajero 2.8 GLX CRZ 2 Audi RS5 Coupe 2 Toyota Innova 2.5 GX 7 STR 2 Maruti Baleno Delta CVT 2 Datsun GO NXT 2 Ford Freestyle Titanium Plus Petrol 2 Volkswagen Vento 1.5 Highline Plus AT 16 Alloy 2 Land Rover Range Rover Vogue SE 4.4 SDV8 2 Maruti Dzire ZDI 2 Mercedes-Benz GLC 220 2 Maruti 800 Std 2 Toyota Corolla Altis GL MT 2 Honda Jazz Select Edition 2 Ford Ecosport Signature Edition Diesel 2 Skoda Laura 1.9 TDI MT Ambiente 2 BMW X1 M Sport sDrive 20d 2 Volkswagen Vento IPL II Petrol Highline AT 2 Honda Amaze EX i-Vtech 2 Mahindra Bolero VLX CRDe 2 Hyundai Xcent 1.2 Kappa AT S Option 2 Chevrolet Sail Hatchback 1.2 LS 2 Land Rover Discovery Sport TD4 HSE 7S 2 Mahindra Quanto C2 2 Mitsubishi Outlander 2.4 2 BMW 3 Series 320d M Sport 2 Maruti Swift LDI Optional 2 Renault KWID Climber 1.0 MT 2 Mahindra Verito 1.5 D6 BSIV 2 BMW 5 Series 2003-2012 530d Highline 2 Maruti Baleno Vxi - BSIII 2 Hyundai Grand i10 1.2 CRDi Sportz Option 2 Maruti Zen Estilo 1.1 LX BSIII 2 Volkswagen Jetta 2012-2014 2.0L TDI Comfortline 2 Chevrolet Beat Diesel PS 2 Tata Indigo GLE 2 Skoda Fabia 1.2 MPI Ambiente Petrol 2 Maruti Wagon R LXI Optional 2 Volkswagen Vento Petrol Trendline 2 Maruti Ciaz 1.4 AT Alpha 2 Audi TT 2.0 TFSI 2 Ford EcoSport 1.5 Diesel Titanium Plus 2 Tata Zest Quadrajet 1.3 XT 2 Audi Q5 30 TDI quattro Premium 2 Hyundai Accent GLS 2 Tata Hexa XT 2 Hyundai i10 Magna Optional 1.1L 2 Maruti Ciaz ZXi Option 2 Tata Indica GLS BS IV 2 Ford Aspire Titanium Diesel 2 Mahindra Renault Logan 1.5 DLE Diesel 2 Hyundai i20 Sportz Petrol 2 Honda City i VTEC S 2 Jeep Compass 2.0 Limited 2 Tata Bolt Quadrajet XE 2 Maruti Wagon R LXI DUO BSIII 2 Skoda Yeti Elegance 2 Honda Amaze EX i-Dtech 2 Nissan Terrano XL 85 PS 2 Hyundai i20 1.4 Asta CRDi with AVN 2 Hyundai Grand i10 1.2 Kappa Sportz AT 2 Maruti A-Star AT Vxi Aktiv 2 Chevrolet Aveo U-VA 1.2 LT 2 Tata New Safari DICOR 2.2 EX 4x2 2 Toyota Innova 2.5 GX (Diesel) 8 Seater BS IV 2 Maruti Ciaz 1.4 Delta 2 Maruti Wagon R VXI Minor 2 Mercedes-Benz E-Class 2009-2013 E350 CDI Avantgarde 2 Mahindra Scorpio 2.6 DX 2 Mercedes-Benz New C-Class C 200 Avantgarde Edition C 2 Ford Ecosport 1.5 Ti VCT AT Titanium 2 Land Rover Range Rover Evoque 2.0 TD4 HSE Dynamic 2 Honda Accord 2.4 Elegance A/T 2 Maruti Baleno LXI 2 Renault Captur 1.5 Diesel Platine Mono 2 Hyundai Santro LS zipPlus 2 Nissan Sunny 2011-2014 XV 2 Maruti Omni E 8 Str STD 2 BMW 5 Series 523i Sedan 2 Skoda Octavia Ambition 2.0 TDI AT 2 Mercedes-Benz E-Class 2009-2013 E200 CGI Blue Efficiency 2 Skoda Rapid 1.6 MPI AT Style Plus 2 Tata Indica V2 DLS 2 Toyota Etios G Safety 2 Jaguar XF 2.2 Litre Executive 2 Maruti Baleno Delta Automatic 2 Land Rover Range Rover 3.0 D 2 BMW 3 Series 320d GT Luxury Line 2 Honda Amaze V CVT Petrol 2 Tata Nano Lx BSIV 2 Volkswagen Jetta 2013-2015 2.0L TDI Highline 2 Maruti Swift LXI 2 Ford Endeavour 4x2 XLT Limited Edition 2 BMW 5 Series 520d Sport Line 2 Ford Endeavour XLT TDCi 4X2 2 Fiat Punto EVO 1.2 Emotion 2 Hyundai i20 Asta (o) 1.4 CRDi (Diesel) 2 Ford EcoSport 1.5 Ti VCT AT Titanium BE 2 Audi A7 2011-2015 3.0 TDI Quattro 2 Hyundai Xcent 1.2 Kappa S Option CNG 2 Chevrolet Aveo 1.4 2 Volkswagen Ameo 1.5 TDI Comfortline 2 Hyundai Verna 1.6 VTVT S 2 Honda Accord VTi-L (AT) 2 Land Rover Freelander 2 HSE 2 Hyundai Xcent 1.2 Kappa Base 2 Honda Mobilio RS i DTEC 2 Mercedes-Benz E-Class 2015-2017 E350 CDI Avantgrade 2 BMW 5 Series 2007-2010 525d Sedan 2 Land Rover Range Rover Sport SE 2 Volvo S60 D4 Momentum 2 Toyota Qualis FS B3 2 Hyundai Xcent 1.2 VTVT S 2 Chevrolet Optra Magnum 1.6 LT ABS BS3 2 Tata Indigo eCS LX BSIV 2 Mercedes-Benz New C-Class 200 Kompressor 2 Audi Q5 3.0 TDI Quattro 2 Honda City i VTEC CVT SV 2 Hyundai i20 1.4 Asta (AT) 2 BMW 7 Series 740Li 2 Mahindra Scorpio S6 7 Seater 2 Maruti Vitara Brezza ZDi Plus AMT Dual Tone 2 Mahindra Scorpio VLX 2.2 mHawk BSIII 2 Mercedes-Benz A Class A200 CDI Sport 2 Maruti 800 DX BSII 2 Hyundai i20 Asta 1.4 CRDi (Diesel) 2 Maruti Swift DDiS ZDI Plus 2 BMW X5 xDrive 30d Design Pure Experience 5 Seater 2 Ford Figo 1.2P Titanium MT 2 Audi Q7 35 TDI Quattro Premium Plus 2 Toyota Innova 2.0 GX 8 STR 2 Mercedes-Benz GLA Class 200 d Sport 2 Mini Cooper S 2 Mercedes-Benz E-Class Facelift 2 Honda Jazz 1.2 S i VTEC 2 Ford Figo Aspire 1.2 Ti-VCT Trend 2 Honda CR-V 2.0L 2WD AT 2 Volkswagen Ameo 1.5 TDI Highline AT 2 Mercedes-Benz SLK-Class SLK 350 2 Mahindra Scorpio 2.6 LX 2 Ford Figo 2015-2019 1.2P Titanium Opt MT 2 Ford EcoSport 1.5 Petrol Titanium 2 Maruti Alto Green LXi (CNG) 2 Honda City i DTEC S 2 Maruti Vitara Brezza LDi Option 2 Skoda Rapid 1.6 MPI Elegance 2 Ford Endeavour 2.2 Trend AT 4X2 2 Volkswagen Polo GTI 2 Mini Cooper Countryman D High 2 Fiat Linea Emotion Pack (Diesel) 2 Hyundai Grand i10 CRDi Sportz Celebration Edition 2 Mahindra Logan Petrol 1.4 GLE 1 Mahindra XUV500 W10 1.99 mHawk 1 Maruti Versa DX2 BS II 1 Hyundai Elantra CRDi S 1 Mercedes-Benz E-Class 230 1 BMW 7 Series 2007-2012 740Li 1 BMW X3 xDrive 20d Expedition 1 Maruti Ritz VDI (ABS) BS IV 1 Skoda Laura L n K 1.9 PD AT 1 Hyundai i20 2015-2017 Sportz 1.2 1 Mahindra KUV 100 mFALCON D75 K8 Dual Tone 1 Honda WR-V Edge Edition i-VTEC S 1 BMW X3 xDrive 20d xLine 1 Toyota Corolla Altis G AT 1 Mahindra XUV300 W8 Diesel 1 Tata New Safari DICOR 2.2 VX 4x4 1 Hyundai Verna XXi ABS (Petrol) 1 Maruti Swift LXI BSIV 1 Land Rover Freelander 2 TD4 HSE 1 Volkswagen Ameo 1.2 MPI Highline 16 Alloy 1 Maruti Dzire AMT VXI 1 Volkswagen Jetta 2012-2014 2.0L TDI Highline AT 1 BMW 5 Series 2010-2013 530d 1 BMW 3 Series Sport 1 Ford Endeavour XLT TDCi 4X4 1 Ford EcoSport 1.5 Ti VCT MT Signature 1 Nissan Sunny XL CVT 1 Maruti Swift Dzire LXi 1 Tata Indigo LX BSII 1 Ford Fiesta 1.6 ZXi ABS 1 Porsche Cayenne S Diesel 1 Renault Pulse Petrol RxL 1 BMW 5 Series 2013-2017 525d Luxury Line 1 Force One LX ABS 7 Seating 1 Tata Nano LX SE 1 Hyundai i20 Active SX Dual Tone Petrol 1 Honda Accord 2001-2003 2.0 AT 1 Mercedes-Benz GLC 220d Celebration Edition 1 BMW 3 Series 320d Dynamic 1 Audi A4 1.8 TFSI Technology Edition 1 Tata Indica V2 2001-2011 eLS 1 Skoda Fabia 1.4 TDI Active 1 Maruti Zen VXi - BS III 1 BMW Z4 2009-2013 35i 1 Tata Safari Storme 2012-2015 EX 1 Mahindra KUV 100 mFALCON G80 K6 5str AW 1 Tata Indica V2 DL BSIII 1 Honda Amaze VX i-VTEC 1 Hyundai Sonata 2.4 GDI 1 Ford Fiesta Diesel Trend 1 Hyundai Getz 1.3 GLS 1 Toyota Corolla Altis D-4D J 1 Porsche Boxster S tiptronic 1 Maruti Celerio LXI MT 1 Mercedes-Benz E-Class E 200 CGI 1 Tata Tiago 1.2 Revotron XM Option 1 Ford EcoSport 1.5 Diesel Trend 1 Tata New Safari Dicor EX 4X2 1 Renault Pulse Petrol RxZ 1 Maruti Celerio ZXI Optional AMT 1 BMW 3 Series 330 Ci Convertible 1 Jaguar XJ 5.0 L V8 Supercharged 1 Mahindra KUV 100 mFALCON D75 K6 1 Hyundai i10 Asta AT 1 Tata Indica V2 DLX 1 Maruti Wagon R LXI LPG BSIV 1 Volkswagen Jetta 2012-2014 2.0L TDI Trendline 1 Volvo XC60 D4 Summum 1 Datsun Redi GO Sport 1 Hyundai Verna 1.6 CRDi AT S 1 Mahindra E Verito D4 1 Ford Mustang V8 1 Hyundai Verna CRDi 1.6 AT SX Option 1 Honda Mobilio E i DTEC 1 Ford Fusion Plus 1.4 TDCi Diesel 1 Hyundai Xcent 1.1 CRDi SX Option 1 Mahindra Scorpio LX 2.6 Turbo 1 BMW 5 Series 530i Sedan 1 Volvo XC60 D5 Inscription 1 Volvo XC90 2007-2015 D5 AT AWD 1 BMW 3 Series 320i 1 Volkswagen Jetta 2007-2011 1.9 TDI Trendline 1 Maruti Grand Vitara MT 1 Tata Indigo eCS GLE BSIII 1 Hyundai i20 2015-2017 1.2 Asta with AVN 1 Honda Jazz Active 1 Maruti Ritz ZXI 1 Toyota Fortuner TRD Sportivo 2.8 2WD AT 1 Skoda Superb Ambition 2.0 TDI CR AT 1 Tata Tigor 1.05 Revotorq XT 1 Mahindra Scorpio SLX 1 Mercedes-Benz E-Class 2009-2013 E250 CDI Classic 1 Toyota Etios GD SP 1 Ford Endeavour 4x2 XLT 1 Mercedes-Benz New C-Class C220 CDI Executive Edition 1 Maruti Swift ZXI Plus 1 Skoda Rapid 1.5 TDI Ambition Plus 1 Honda Accord V6 AT 1 Mahindra Xylo E2 1 Hyundai Verna Transform Xxi ABS 1 Ambassador Classic Nova Diesel 1 Volkswagen Ameo 1.2 MPI Anniversary Edition 1 Honda CR-V 2.4L 4WD AT AVN 1 Maruti Grand Vitara AT 1 BMW X1 xDrive 20d M Sport 1 Mahindra KUV 100 mFALCON D75 K8 1 Honda Jazz Mode 1 Maruti Esteem LX BSII 1 Hyundai Accent Executive CNG 1 Tata Manza Aura Safire 1 Skoda Laura RS 1 Honda City i DTec S 1 Tata New Safari 4X4 EX 1 Renault KWID 1.0 RXL 1 Maruti Ciaz RS ZXi Plus 1 Audi TT 40 TFSI 1 Maruti Ritz LXI 1 Toyota Corolla Altis 1.8 Limited Edition 1 Maruti Swift ZDI 1 Volkswagen Polo 1.0 MPI Trendline 1 Hyundai Grand i10 1.2 CRDi Asta 1 Toyota Corolla Altis Diesel D4DJ 1 Skoda Superb 2009-2014 Elegance 2.0 TDI MT 1 Skoda Fabia 1.2 Petrol Active 1 Volkswagen Jetta 2012-2014 2.0L TDI Highline 1 BMW 5 Series 2003-2012 540i Sedan 1 Datsun redi-GO T 1 BMW 6 Series 630i Coupe 1 Maruti Alto Vxi 1.1 1 Datsun GO Plus A 1 Nissan Micra XV Primo 1 Mahindra Scorpio VLX 2WD AT BSIV 1 Hyundai Santro D Lite 1 Land Rover Range Rover 3.6 TDV8 Vogue SE 1 Mercedes-Benz GLA Class 200 d Style 1 Tata Nexon 1.2 Revotron XZ Plus 1 Hyundai Santro Xing XL AT eRLX Euro II 1 BMW Z4 2009-2013 Roadster 2.5i 1 Hyundai Santro Xing XL AT eRLX Euro III 1 Toyota Prius 2009-2016 Z4 1 Chevrolet Optra Magnum 1.6 LS Petrol 1 Hyundai Xcent 1.1 CRDi SX 1 Nissan Micra Active XV S 1 Maruti Zen Estilo 1.1 LXI BSIII 1 Hyundai Creta 1.6 SX Option Executive 1 Skoda Rapid 1.6 TDI Active 1 Mahindra Scorpio 2009-2014 VLX 2WD 7S BSIV 1 Tata Indica V2 DLE BSIII 1 Tata Nano STD SE 1 Mitsubishi Lancer GLXD 1 Volvo V40 D3 R Design 1 Audi A3 35 TDI Premium 1 Jaguar XF Aero Sport Edition 1 Fiat Siena 1.2 ELX 1 Ford Fiesta 1.6 ZXi Duratec 1 Tata Indica Vista Quadrajet 90 ZX Plus 1 Smart Fortwo CDI AT 1 Ford EcoSport 1.5 TDCi Trend Plus BE 1 Nissan X-Trail SLX AT 1 Mercedes-Benz SLK-Class 55 AMG 1 Tata Tigor 1.2 Revotron XTA 1 Toyota Innova Crysta 2.7 GX MT 1 Fiat Punto 1.2 Dynamic 1 Mercedes-Benz E-Class 2015-2017 E 200 CGI 1 Maruti 1000 AC 1 Mercedes-Benz E-Class 2009-2013 E 200 CGI Avantgarde 1 Ford Fiesta 1.5 TDCi Titanium 1 Mercedes-Benz SL-Class SL 500 1 Tata Sumo DX 1 Skoda Rapid 1.6 MPI AT Ambition Plus 1 Volkswagen Vento TSI 1 Ford Ikon 1.6 CLXI 1 Porsche Cayman 2009-2012 S 1 Hyundai Santa Fe 4X2 1 Hyundai Elite i20 Sportz Plus 1 Mahindra Xylo E8 BS IV 1 Mercedes-Benz S-Class S 350 d 1 Toyota Camry W2 (AT) 1 Skoda Rapid Ultima 1.6 MPI Ambition Plus 1 Maruti Wagon R VXI AMT1.2 1 Nissan Sunny 2011-2014 XV Special Edition 1 Tata Manza Aura Safire BS IV 1 Chevrolet Enjoy 1.3 TCDi LTZ 7 1 Hyundai Verna 1.4 CX 1 Mahindra KUV 100 D75 K8 5Str 1 Hyundai EON 1.0 Era Plus 1 Toyota Innova 2.0 V 1 Mahindra Xylo H9 1 Mahindra TUV 300 P4 1 Maruti Ritz VDi ABS 1 Volvo S60 D5 Kinetic 1 Chevrolet Enjoy TCDi LS 7 Seater 1 Mahindra Scorpio S10 8 Seater 1 Honda WRV i-DTEC VX 1 Mahindra Scorpio SLX 2.6 Turbo 8 Str 1 Hyundai Accent GLX 1 Mahindra KUV 100 G80 K4 Plus 5Str 1 Tata Indica Vista Terra 1.2 Safire BS IV 1 Volkswagen Vento 1.5 TDI Highline Plus 1 Volkswagen CrossPolo 1.2 TDI 1 Ford Ikon 1.4 ZXi 1 Hyundai Verna Transform SX VGT CRDi BS III 1 Volkswagen Vento 1.5 TDI Highline Plus AT 1 Maruti 800 DX 1 Maruti Ertiga VXI Petrol 1 Fiat Avventura Urban Cross 1.3 Multijet Emotion 1 Skoda Octavia 2.0 TDI MT Style 1 BMW X3 2.5si 1 Hyundai i20 new Sportz AT 1.4 1 Ford Figo 2015-2019 1.5D Trend MT 1 Honda City i DTec VX Option BL 1 Honda Accord 2001-2003 2.3 VTI L MT 1 Land Rover Freelander 2 S Business Edition 1 Ford Endeavour 3.0L AT 4x2 1 Hyundai Santro Xing GLS CNG 1 Toyota Land Cruiser Prado VX L 1 Hyundai Tucson 2.0 e-VGT 4WD AT GLS 1 Toyota Innova 2.5 GX 8 STR 1 Maruti Wagon R VXI AMT Opt 1 Skoda Laura L and K MT 1 Land Rover Range Rover HSE 1 Volkswagen Polo ALLSTAR 1.2 MPI 1 Land Rover Discovery 4 SDV6 SE 1 Hyundai Santro LS zipDrive Euro I 1 Maruti SX4 ZXI AT 1 Hyundai EON LPG Era Plus Option 1 Hyundai Creta 1.6 SX Diesel 1 Isuzu MU 7 4x2 HIPACK 1 Hyundai Elantra GT 1 Mercedes-Benz B Class B180 Sport 1 Mahindra Bolero SLX 1 Hyundai Xcent 1.2 CRDi SX 1 BMW 5 Series 530i Sport Line 1 Honda Jazz VX CVT 1 Tata Indica Vista Aqua 1.2 Safire 1 Toyota Etios Liva Diesel TRD Sportivo 1 Skoda Rapid Ultima 1.6 TDI Ambition Plus 1 Renault Duster 85PS Diesel RxZ 1 Jaguar XF 2.0 Petrol Portfolio 1 Honda Civic 2010-2013 1.8 V AT 1 Chevrolet Spark 1.0 PS 1 Maruti Ignis 1.2 AMT Delta 1 Ford Fiesta Classic 1.6 Duratec LXI 1 Toyota Corolla Altis GL 1 OpelCorsa 1.4Gsi 1 Volkswagen Vento 1.2 TSI Comfortline AT 1 Hyundai Santro Xing XG AT eRLX Euro III 1 Mahindra KUV 100 mFALCON D75 K6 5str AW 1 Mahindra Scorpio VLX 2WD BSIII 1 Chevrolet Enjoy Petrol LTZ 7 Seater 1 Hyundai i20 2015-2017 Magna Optional 1.4 CRDi 1 Mercedes-Benz CLA 45 AMG 1 Audi Q5 2008-2012 3.0 TDI Quattro 1 Chevrolet Enjoy 1.4 LTZ 8 1 Nissan 370Z AT 1 Maruti Vitara Brezza ZDi AMT 1 Mercedes-Benz A Class Edition 1 1 BMW 7 Series 740i Sedan 1 Mercedes-Benz S Class 2005 2013 320 L 1 Maruti Alto XCITE 1 Land Rover Discovery 4 TDV6 Auto Diesel 1 Hyundai Verna Transform VTVT with Audio 1 Maruti Vitara Brezza ZDi Plus AMT 1 Skoda Superb Petrol Ambition 1 Tata Tiago 1.05 Revotorq XT Option 1 Ford EcoSport 1.5 Petrol Ambiente 1 Jeep Compass 1.4 Sport 1 Hyundai Creta 1.6 VTVT Base 1 Hyundai i20 2015-2017 1.4 CRDi Sportz 1 Mahindra TUV 300 2015-2019 T8 AMT 1 Nissan Terrano XE 85 PS 1 Ford Classic 1.4 Duratorq CLXI 1 Renault Koleos 4X2 MT 1 Honda Amaze E i-DTEC 1 Maruti Ciaz VDi Option SHVS 1 Tata Indica Vista Terra Quadrajet 1.3L BS IV 1 Mercedes-Benz GLA Class 220 d 4MATIC 1 Mahindra Bolero Power Plus ZLX 1 Fiat Linea Classic 1.3 Multijet 1 Mahindra Scorpio VLS 2.2 mHawk 1 Ford Freestyle Titanium Plus Diesel 1 Maruti Swift VVT ZXI 1 Fiat Punto EVO 1.3 Emotion 1 Fiat Abarth 595 Competizione 1 Hyundai Accent Executive LPG 1 Honda BR-V i-VTEC VX MT 1 Volkswagen Vento 1.6 Trendline 1 Maruti Versa DX2 1 Hyundai Sonata Embera 2.4L MT 1 Honda Amaze VX CVT i-VTEC 1 Honda Jazz 2020 Petrol 1 Hyundai i20 1.4 Asta AT (O) with Sunroof 1 Renault Lodgy 110PS RxL 1 Mercedes-Benz E-Class 250 D W 124 1 Toyota Innova 2.5 LE 2014 Diesel 8 Seater 1 Mercedes-Benz E-Class E240 V6 AT 1 Tata Tigor 1.2 Revotron XZ Option 1 Bentley Flying Spur W12 1 Mahindra KUV 100 mFALCON D75 K2 1 Honda Amaze VX Petrol 1 Maruti Baleno Zeta 1 Maruti S-Cross Zeta DDiS 200 SH 1 Mitsubishi Pajero Sport Anniversary Edition 1 Mercedes-Benz S Class 2005 2013 S 300 L 1 Volkswagen Ameo 1.5 TDI Comfortline AT 1 Honda City i-VTEC CVT V 1 Mahindra KUV 100 G80 K8 Dual Tone 1 Tata New Safari EX 4x2 1 Nissan Terrano XL Plus ICC WT20 SE 1 Honda Brio 1.2 S Option MT 1 Volkswagen Vento Konekt Diesel Highline 1 Lamborghini Gallardo Coupe 1 Mahindra KUV 100 mFALCON G80 K8 1 Skoda Laura Classic 1.8 TSI 1 Skoda Superb 1.8 TSI 1 Ford Figo Aspire 1.5 TDCi Titanium 1 Maruti Swift ZXI ABS 1 Tata Indigo XL Grand Petrol 1 Volkswagen Vento Magnific 1.6 Comfortline 1 Renault Duster 85PS Diesel RxL Plus 1 Audi A4 2.0 TDI Celebration Edition 1 Hyundai i20 Diesel Asta Option 1 Skoda Rapid 1.6 MPI Ambition Plus 1 Renault Duster 110PS Diesel RXZ Optional with Nav 1 Skoda Octavia Elegance 1.9 TDI 1 Jaguar F Type 5.0 V8 S 1 Toyota Etios VD SP 1 Ford Figo Aspire 1.5 Ti-VCT Titanium 1 Toyota Qualis Fleet A3 1 Chevrolet Optra 1.6 LT Royale 1 Mahindra Scorpio S10 7 Seater 1 Tata Nano CX 1 Volkswagen Vento IPL II Petrol Trendline 1 Honda City Corporate Edition 1 Maruti Wagon R Duo LX BSIII 1 Skoda Laura Elegance MT 1 Porsche Cayenne 2009-2014 Diesel 1 Bentley Continental Flying Spur 1 Mercedes-Benz New C-Class C 200 Kompressor Elegance MT 1 Hyundai Santro LP - Euro II 1 Land Rover Discovery Sport SD4 HSE Luxury 1 Mitsubishi Pajero 2.8 SFX 7Str 1 Tata New Safari DICOR 2.2 EX 4x4 1 Honda CR-V Petrol 2WD 1 Renault Duster 110PS Diesel RxZ AWD 1 Hyundai Accent GLS 1.6 1 Mahindra XUV500 W4 1.99 mHawk 1 Hyundai Verna 1.6 i ABS 1 Porsche Panamera 2010 2013 Diesel 1 Nissan Sunny XV D 1 Maruti Wagon R ZXI AMT 1.2 1 Hyundai i20 1.4 Asta Optional With Sunroof 1 Tata Tigor XE Diesel 1 Toyota Etios 1.4 VXD 1 Hyundai Elite i20 Diesel Asta Option 1 Mahindra Scorpio 1.99 S4 Plus 1 Jeep Compass 1.4 Limited Option 1 Volkswagen Jetta 2007-2011 1.6 Trendline 1 Tata Indica Vista Aqua TDI BSIII 1 Tata Indica V2 DiCOR DLG BS-III 1 Tata Indica Vista Quadrajet LX 1 BMW X1 sDrive 18i 1 BMW 3 Series GT 320d Sport Line 1 Toyota Etios Liva VD 1 Maruti A-Star Zxi 1 Mahindra KUV 100 mFALCON G80 K4 5str 1 Ford Fiesta 1.4 SXI Duratorq 1 Fiat Avventura FIRE Dynamic 1 Honda CR-V Diesel 1 Mahindra Xylo E9 1 Hyundai Creta 1.6 SX Automatic 1 Skoda Laura 1.9 TDI MT Elegance 1 Ford Figo Aspire 1.5 TDCi Titanium Plus 1 Honda City ZX VTEC Plus 1 BMW 7 Series 730Ld DPE Signature 1 Hindustan Motors Contessa 2.0 DSL 1 Fiat Linea Dynamic 1 Tata Sumo EX 10/7 Str BSII 1 Fiat Grande Punto 1.2 Emotion 1 Toyota Etios Cross 1.2L G 1 Mahindra Thar 4X4 1 Hyundai i20 Active SX Diesel 1 Honda BR-V i-DTEC S MT 1 Toyota Camry MT with Moonroof 1 Mahindra Verito Vibe 1.5 dCi D6 1 Nissan Micra XL CVT 1 Mercedes-Benz B Class B180 Sports 1 Ford Fiesta Classic 1.6 SXI Duratec 1 Tata Manza Club Class Safire90 LX 1 Mahindra Jeep MM 540 DP 1 Maruti Ertiga VXI AT Petrol 1 Skoda Laura L and K AT 1 Toyota Corolla Altis 1.8 G CVT 1 Mercedes-Benz New C-Class C 200 AVANTGARDE 1 Skoda Rapid Ultima 1.6 TDI Elegance 1 Mercedes-Benz GLA Class 200 Sport 1 Tata Indica LEI 1 Hyundai i20 2015-2017 Magna 1 Tata New Safari DICOR 2.2 VX 4x2 1 Land Rover Range Rover TDV8 (Diesel) 1 Maruti Wagon R Duo Lxi 1 Volkswagen Polo IPL II 1.2 Petrol Highline 1 Tata Bolt Revotron XT 1 Nissan Micra XE 1 Toyota Innova Crysta Touring Sport 2.4 MT 1 Maruti Swift AMT ZXI 1 Skoda Laura 1.8 TSI Ambition 1 Honda Civic 2010-2013 1.8 S MT Inspire 1 Toyota Etios Liva 1.4 VXD 1 Maruti Celerio X VXI Option 1 Chevrolet Sail Hatchback 1.2 1 Mahindra Scorpio VLX Special Edition BS-IV 1 Tata Tiago AMT 1.2 Revotron XTA 1 Nissan Teana XL 1 Maruti Zen VX 1 Mahindra Renault Logan 1.4 GLX Petrol 1 Mahindra Scorpio 2009-2014 LX 2WD 7S 1 Hyundai Verna Transform SX VTVT 1 Mitsubishi Montero 3.2 GLS 1 Mahindra Bolero ZLX BSIII 1 Hyundai i20 2015-2017 Magna 1.2 1 BMW 6 Series 640d Gran Coupe 1 Mahindra Bolero DI BSII 1 Tata Xenon XT EX 4X4 1 Tata Nano Cx 1 Renault Scala RxL 1 Maruti Ertiga Paseo VXI 1 Hyundai i10 Magna(O) with Sun Roof 1 Skoda Fabia 1.2 TDI Ambition 1 Hyundai Getz GLS ABS 1 Skoda Octavia Rider 1.9 TDI MT 1 Tata Indigo LS Dicor 1 Ford Figo 2015-2019 1.2P Sports Edition MT 1 Honda BRV i-VTEC V MT 1 Audi Q5 2.0 TDI Technology 1 Audi A6 2.8 FSI 1 Tata Sumo Delux 1 Mahindra Bolero mHAWK D70 ZLX 1 Mahindra Scorpio 2009-2014 VLX 4WD AT 7S BSIV 1 Maruti Wagon R VXi BSII 1 Honda Mobilio E i VTEC 1 Tata Safari Storme VX Varicor 400 1 Mahindra Scorpio S4 Plus 1 Mitsubishi Pajero 2.8 GLX Sports 1 Maruti Celerio ZXI Optional 1 Hyundai i20 2015-2017 1.2 Asta 1 Nissan Teana XV 1 Mahindra TUV 300 2015-2019 mHAWK100 T8 1 Maruti Alto VXi 1 Mitsubishi Pajero 2.8 SFX BSIV Dual Tone 1 Mercedes-Benz CLA 200 CDI Style 1 Fiat Grande Punto 1.3 Emotion (Diesel) 1 Toyota Etios Petrol TRD Sportivo 1 Nissan Sunny XL 1 Audi A4 35 TDI Premium Sport 1 Toyota Corolla DX 1 Ford Figo 1.5D Titanium Plus MT 1 Tata Indica V2 DLS TC 1 Toyota Innova 2.5 EV Diesel MS 8 Str BSIII 1 Skoda Superb L&K 1.8 TSI AT 1 Hyundai Santro Xing XO CNG 1 Land Rover Discovery SE 3.0 TD6 1 Mercedes-Benz New C-Class 230 Avantgarde 1 Jaguar XF 2.0 Diesel Portfolio 1 Skoda Octavia RS 1 Mahindra TUV 300 2015-2019 mHAWK100 T8 AMT 1 BMW 3 Series 318i Sedan 1 Mahindra NuvoSport N8 1 Skoda Octavia Ambition Plus 2.0 TDI AT 1 Nissan Micra Diesel 1 Honda BR-V i-DTEC VX MT 1 Chevrolet Captiva LTZ VCDi 1 Maruti Wagon R AMT VXI Option 1 Ford Figo Aspire 1.5 TDCi Trend 1 Nissan Sunny XV CVT 1 Audi Q5 2008-2012 3.0 TDI 1 Tata Zest Quadrajet 1.3 1 Hyundai Tucson 2.0 e-VGT 2WD AT GLS 1 Volkswagen Polo GT 1.5 TDI 1 Skoda Rapid 1.5 TDI AT Style 1 Mahindra Scorpio VLX 4WD 1 Tata Bolt Quadrajet XM 1 Skoda Rapid Leisure 1.6 TDI MT 1 Hyundai Grand i10 CRDi Era 1 Tata Tigor 1.05 Revotorq XZ Option 1 Tata Venture EX 1 Chevrolet Optra 1.6 Elite 1 Honda Jazz 1.2 E i VTEC 1 Isuzu MUX 4WD 1 Maruti Ignis 1.2 AMT Alpha 1 Ford Figo Diesel Celebration Edition 1 Toyota Platinum Etios 1.4 GXD 1 Volkswagen Passat Highline DSG 1 Tata Indica V2 DLS BSII 1 Mercedes-Benz New C-Class 200 CDI Elegance 1 Hyundai Santro Xing GL Plus LPG 1 Tata Manza Aura Quadrajet 1 Tata Manza Aura Plus Quadrajet BS IV 1 Maruti Omni MPI CARGO BSIII W/ IMMOBILISER 1 Toyota Innova 2.5 GX 7 STR BSIV 1 Volvo S60 D3 1 Audi Q7 45 TDI Quattro Premium Plus 1 Mahindra TUV 300 T8 AMT 1 Maruti 800 AC BSIII 1 Mahindra Scorpio DX 2.6 Turbo 8 Str 1 Ford Ikon 1.3 CLXi 1 Porsche Panamera Diesel 250hp 1 Audi Q7 4.2 FSI quattro 1 Hyundai i20 Active 1.2 SX Dual Tone 1 Maruti Swift AMT DDiS VDI 1 Maruti Wagon R VXI BS IV with ABS 1 Skoda Rapid 1.6 MPI Elegance Black Package 1 Maruti Wagon R VXI Minor ABS 1 Hyundai i20 Active S Diesel 1 Maruti SX4 ZDI Leather 1 Honda CR-V 2.4L 4WD MT 1 Maruti Wagon R Vx 1 Volkswagen Tiguan 2.0 TDI Highline 1 Chevrolet Beat Option Pack 1 Maruti Wagon R LX BS IV 1 Jaguar XJ 2.0L Portfolio 1 Maruti Swift AMT VDI 1 Fiat Grande Punto 1.3 Emotion Pack (Diesel) 1 Hyundai i20 1.4 Magna ABS 1 Skoda Superb Elegance 1.8 TSI MT 1 Toyota Innova 2.5 ZX Diesel 7 Seater BSIII 1 BMW X6 xDrive 40d 1 Mercedes-Benz New C-Class 220 1 Ford Ikon 1.6 ZXI NXt 1 Land Rover Discovery HSE Luxury 3.0 TD6 1 Ford Freestyle Titanium Petrol 1 Maruti Dzire ZDI Plus 1 Ford Fiesta 1.6 SXI ABS Duratec 1 Fiat Linea T Jet 1 Honda Amaze VX O i VTEC 1 Mitsubishi Pajero 2.8 SFX BSIII Dual Tone 1 Hyundai i20 2015-2017 Asta 1.2 1 Maruti S-Cross Delta DDiS 200 SH 1 Maruti Celerio LDi 1 Mahindra Scorpio SLE BSIII 1 Mercedes-Benz New C-Class 250 CDI Classic 1 Chevrolet Enjoy TCDi LTZ 7 Seater 1 Mahindra Scorpio 1.99 S10 1 Hyundai Tucson 2.0 Dual VTVT 2WD AT GL 1 Audi A4 2.0 TFSI 1 Mercedes-Benz New C-Class Progressive C 200 1 Chevrolet Enjoy 1.4 LS 8 1 Volvo S60 D4 SUMMUM 1 Volvo V40 D3 1 BMW 5 Series 2003-2012 GT 530d LE 1 Ford Fiesta Titanium 1.5 TDCi 1 Mercedes-Benz GLS 350d Grand Edition 1 Ford Fiesta 1.4 Duratorq EXI 1 Mahindra Scorpio S10 AT 4WD 1 Maruti Zen VXI 1 Toyota Fortuner 4x2 MT TRD Sportivo 1 Maruti SX4 ZXI AT Leather 1 Ford Endeavour Hurricane Limited Edition 1 Hyundai Xcent 1.2 VTVT SX 1 Volkswagen Polo 1.0 MPI Comfortline 1 Mercedes-Benz GLS 350d 4MATIC 1 Maruti Zen LXi BSII 1 Mercedes-Benz E-Class 2009-2013 E 200 CGI Elegance 1 Mahindra Bolero SLE 1 BMW 5 Series 2003-2012 523i 1 Maruti Ritz AT 1 Toyota Camry A/T 1 Mahindra Jeep MM 550 PE 1 BMW 7 Series 730Ld Eminence 1 Ford Fiesta 1.6 ZXI Duratec 1 Skoda Fabia 1.2L Diesel Classic 1 Mahindra XUV500 AT W8 FWD 1 Skoda Fabia 1.6 MPI Elegance 1 Audi A3 35 TDI Technology 1 Ford Aspire Titanium Plus Diesel 1 Fiat Linea 1.3 Dynamic 1 BMW X3 xDrive20d Expedition 1 BMW 6 Series 640d Coupe 1 Hyundai Santro LP zipPlus 1 Porsche Cayenne Turbo S 1 Mahindra Scorpio 1.99 S8 1 Mahindra KUV 100 mFALCON D75 K4 1 Chevrolet Enjoy 1.3 TCDi LS 8 1 Toyota Camry W4 (AT) 1 Hyundai i10 Magna LPG 1 Tata Safari Storme Explorer Edition 1 Chevrolet Tavera LT 9 Str BS IV 1 Volkswagen Vento 1.5 TDI Trendline 1 Mercedes-Benz E-Class E 350 d 1 Maruti Swift 1.3 VXI ABS 1 Skoda Fabia 1.2 MPI Ambition Plus 1 Mitsubishi Pajero Sport 4X2 AT DualTone BlackTop 1 Hyundai Santro AT 1 Mahindra Xylo D2 BSIV 1 Toyota Etios Liva 1.2 VX Dual Tone 1 Toyota Corolla Altis 1.8 Sport 1 Mahindra Xylo D2 Maxx 1 Toyota Corolla Altis G MT 1 Land Rover Range Rover Sport 2005 2012 HSE 1 Volkswagen Ameo 1.2 MPI Trendline 1 Ford Ikon 1.3 LXi NXt 1 Skoda Rapid 1.6 MPI AT Ambition 1 Hyundai EON 1.0 Kappa Magna Plus Optional 1 Hyundai i20 2015-2017 1.4 Magna ABS 1 Ford EcoSport 1.5 Petrol Trend 1 BMW 3 Series 330i 1 Datsun GO T Option 1 Mahindra Scorpio S2 7 Seater 1 Mini Cooper Convertible 1.6 1 Ford Figo Diesel EXI Option 1 Skoda Laura 1.9 TDI AT Elegance 1 Porsche Cayman 2009-2012 S tiptronic 1 BMW 5 Series 2013-2017 520d M Sport 1 Nissan Evalia 2013 XL 1 Chevrolet Sail Hatchback 1.2 LS ABS 1 Skoda Superb 2.5 TDi AT 1 Toyota Innova 2.5 LE 2014 Diesel 7 Seater 1 Chevrolet Optra Magnum 2.0 LT BS3 1 Honda Brio 1.2 VX AT 1 Toyota Etios Cross 1.4L GD 1 Hyundai Santro DX 1 Volkswagen Jetta 2007-2011 1.9 L TDI 1 Chevrolet Aveo 1.4 LT 1 Honda City 1.5 EXI S 1 Fiat Linea T-Jet Active 1 Toyota Innova Crysta 2.4 G MT 1 Mahindra KUV 100 mFALCON D75 K4 Plus 5str 1 Mercedes-Benz GLC 43 AMG Coupe 1 Toyota Qualis RS E2 1 Hyundai i20 Active SX Petrol 1 Volvo S80 2006-2013 D5 1 Skoda Rapid 1.5 TDI Style 1 Mahindra Logan Diesel 1.5 DLS 1 Jeep Compass 2.0 Limited Option Black 1 Ford Figo 2015-2019 1.2P Trend MT 1 BMW 1 Series 118d Sport Line 1 Hyundai Elantra 1.6 SX Option AT 1 Mahindra Scorpio VLX 4WD AIRBAG BSIV 1 Tata Indigo eCS LS (TDI) BS-III 1 Hyundai Grand i10 Era 1 Ford Figo Diesel 1 Skoda Octavia Ambiente 1.9 TDI 1 Mercedes-Benz E-Class 250 D W 210 1 Land Rover Range Rover Sport HSE 1 Maruti 800 AC Uniq 1 Toyota Etios Liva Diesel 1 Land Rover Discovery 4 TDV6 SE 1 Hyundai i20 1.4 Asta Option 1 Skoda Octavia Ambition 1.8 TSI AT 1 Hyundai Creta 1.4 CRDi S 1 Hyundai Verna 1.6 CRDI SX Option 1 Ford Fiesta 1.6 ZXi Leather 1 Ford Endeavour Hurricane LE 1 Ford EcoSport 1.0 Ecoboost Titanium Plus BE 1 Hyundai Verna CRDi 1.4 E 1 Honda CR-V AT With Sun Roof 1 Volkswagen Ameo 1.2 MPI Highline Plus 16 1 Renault Fluence 2.0 1 Honda City 1.3 DX 1 Fiat Linea 1.3 Emotion 1 Land Rover Discovery 3 TDV6 Diesel Automatic 1 Maruti Dzire New 1 Maruti Ertiga ZDI Plus 1 Hyundai Sonata GOLD 1 Ford Figo Petrol LXI 1 Chevrolet Optra Magnum 2.0 LS BSIII 1 Volkswagen Beetle 2.0 1 Maruti Celerio ZXI AMT 1 Nissan Terrano XV 110 PS Limited Edition 1 Hyundai Verna 1.4 CRDi GL 1 Mahindra KUV 100 G80 K8 1 Honda City i DTec E 1 Maruti Baleno Zeta CVT 1 Maruti Swift LXi BSIV 1 Mercedes-Benz CLS-Class 2006-2010 350 CDI 1 Hyundai Sonata Embera 2.0L CRDi AT 1 Maruti Wagon R LX DUO BSIII 1 Hyundai Xcent 1.2 VTVT E Plus 1 Maruti Alto 800 LXI Airbag 1 Honda Amaze VX Diesel 1 Toyota Qualis FS B2 1 Ford Figo Aspire 1.5 TDCi Ambiente 1 Volvo S60 D5 Summum 1 Hyundai Verna VTVT 1.6 AT EX 1 Honda CR-V Sport 1 Maruti Swift 1.3 ZXI 1 Maruti S-Cross Alpha DDiS 200 SH 1 Fiat Petra 1.2 EL 1 BMW 5 Series 530d Highline Sedan 1 Ford Fiesta 1.4 ZXi Duratec 1 Renault Fluence 1.5 1 Honda Mobilio V Option i DTEC 1 Chevrolet Aveo 1.4 LT ABS BSIV 1 Fiat Linea Classic Plus 1.3 Multijet 1 Maruti Omni 5 Str STD 1 Fiat Grande Punto 1.2 Dynamic 1 Nissan Terrano XV Premium 110 PS Anniversary Edition 1 Maruti Wagon R VXI Plus 1 Land Rover Range Rover 3.0 Diesel LWB Vogue 1 Maruti Ertiga VDI Limited Edition 1 Maruti Celerio VXI AT Optional 1 Ford Classic 1.4 Duratorq Titanium 1 Maruti Ciaz ZDi 1 Toyota Camry 2.5 Hybrid 1 Mahindra Bolero VLX BS IV 1 Toyota Corolla Altis JS MT 1 Datsun redi-GO S 1 Skoda Yeti Ambition 4WD 1 Hyundai i20 1.2 Asta with AVN 1 Honda City i VTEC E 1 Tata Indica V2 DLG TC 1 Fiat Grande Punto EVO 1.3 Active 1 Toyota Innova 2.5 VX 7 STR BSIV 1 Maruti Eeco Smiles 5 Seater AC 1 Mahindra KUV 100 mFALCON D75 K4 Plus 1 Mahindra Scorpio VLX AT AIRBAG BSIV 1 Toyota Innova 2.0 G1 1 BMW 3 Series 328i Sport Line 1 Maruti Celerio VXI Optional AMT 1 Renault Duster RXZ AWD 1 Porsche Cayenne 2009-2014 Turbo 1 Ford Figo 2015-2019 1.5D Titanium Plus MT 1 Maruti Baleno LXI - BSIII 1 Skoda Rapid 1.5 TDI AT Elegance Plus 1 Maruti Ertiga LXI 1 Ford Figo 2015-2019 1.5D Ambiente MT 1 Toyota Corolla Altis 1.8 G CNG 1 Maruti Ignis 1.3 Zeta 1 Tata Indigo CS eGVX 1 Maruti Alto K10 LXI Optional 1 Honda Jazz Exclusive CVT 1 Maruti Celerio ZXI AT Optional 1 Mitsubishi Lancer 1.5 SFXi 1 Nissan Sunny XE P 1 Nissan Micra Diesel XL 1 Hyundai Verna 1.6 VTVT AT SX 1 Skoda Octavia 1.9 TDI 1 Nissan Micra Diesel XV Primo 1 Mercedes-Benz E-Class E350 CDI 1 Skoda Octavia Style Plus 2.0 TDI AT 1 Audi A4 3.2 FSI Tiptronic Quattro 1 Hyundai i20 2015-2017 Asta 1 Fiat Punto 1.3 Emotion 1 Maruti Swift RS VDI 1 Volkswagen Passat 2.0 PD DSG 1 Mercedes-Benz CLA 200 CGI Sport 1 Land Rover Freelander 2 TD4 S 1 Hyundai Accent Executive 1 Tata Indica Vista TDI LX 1 Skoda Octavia Rider Classic 1.9 TDI 1 Maruti S Cross DDiS 200 Delta 1 Mahindra XUV500 W9 AT 1 Hyundai Verna 1.4 CX VTVT 1 Audi A4 30 TFSI Premium Plus 1 Land Rover Range Rover Sport 2005 2012 Sport 1 Tata Nano LX 1 Skoda Yeti Elegance 4X2 1 Maruti S Cross DDiS 200 Sigma Option 1 Mahindra Xylo D2 BS III 1 Porsche Cayenne Base 1 Mercedes-Benz New C-Class C 220CDIBE Avantgarde Command 1 Tata Safari Storme VX 1 Mahindra Scorpio 1.99 S10 4WD 1 Volkswagen Jetta 2012-2014 1.4 TSI 1 Ford Fiesta Diesel Style 1 Ford Endeavour Titanium 4X2 1 Maruti Swift LDI BSIV 1 Chevrolet Optra Magnum 1.6 LS BS3 1 Ford Fiesta 1.4 TDCi EXI Limited Edition 1 Mini Countryman Cooper D 1 Maruti Eeco CNG 5 Seater AC 1 Hyundai Santro GS zipDrive - Euro II 1 Mahindra XUV500 W7 1 BMW 7 Series 730Ld Design Pure Excellence CBU 1 Mercedes-Benz E-Class 280 Elegance 1 Nissan Micra XV D 1 Nissan Micra Active XL Petrol 1 Toyota Corolla Altis G HV AT 1 Maruti Ertiga Paseo VDI 1 Ford EcoSport 1.5 TDCi Trend Plus 1 Maruti Baleno Vxi 1 Mercedes-Benz S Class 2005 2013 320 CDI 1 Hyundai i20 Asta (o) 1 Tata Zest Quadrajet 1.3 75PS XM 1 Skoda Rapid 1.6 MPI AT Style Black Package 1 Porsche Panamera 2010 2013 4S 1 Mahindra KUV 100 G80 K6 Plus 5Str 1 Jaguar XJ 3.0L Portfolio LWB 1 Tata New Safari DICOR 2.2 EX 4x4 BS IV 1 Tata Indigo eCS eLS BS IV 1 Honda City 1.3 EXI S 1 Tata Manza Club Class Quadrajet90 LX 1 Chevrolet Sail LT ABS 1 Skoda Rapid 1.6 MPI Active 1 Ford Fiesta 1.4 ZXi Leather 1 Hyundai Santro GS 1 Toyota Corolla Altis Aero D 4D J 1 Tata Indigo eCS GLX 1 Audi A6 2011-2015 3.0 TDI Quattro Premium Plus 1 Honda City 1.5 EXI AT 1 Skoda Laura Ambition 2.0 TDI CR MT 1 Tata Tiago Wizz 1.05 Revotorq 1 Skoda Fabia 1.4 MPI Ambiente 1 BMW 3 Series 320d Luxury Plus 1 Chevrolet Optra 1.6 LS 1 Audi A7 2011-2015 Sportback 1 Tata Safari Storme 2012-2015 LX 1 Toyota Etios G SP 1 Ford Figo 2015-2019 1.5P Titanium AT 1 Honda Accord VTi-L MT 1 Ford Figo Titanium Diesel 1 Mahindra XUV500 AT W10 AWD 1 Mahindra Bolero SLX 2WD 1 Renault Scala RxL AT 1 Land Rover Freelander 2 HSE SD4 1 Tata Indigo XL Classic Dicor 1 Hyundai Getz 1.5 CRDi GVS 1 Mercedes-Benz E-Class 2015-2017 E350 Edition E 1 Hyundai i20 Era 1.4 CRDi 1 Toyota Innova 2.0 E 1 BMW 5 Series 2003-2012 530d 1 Skoda Rapid 1.6 MPI AT Ambition Plus Alloy 1 Honda Jazz 1.2 V AT i VTEC Privilege 1 Mahindra Quanto C4 1 Hyundai Creta 1.6 VTVT E Plus 1 Hyundai Xcent 1.1 CRDi S Option 1 Mitsubishi Pajero 4X4 LHD 1 Tata Manza Aqua Quadrajet 1 Maruti Ritz VXI ABS 1 Jaguar XJ 3.0L Premium Luxury 1 Land Rover Range Rover 3.6 TDV8 Vogue SE Diesel 1 Mahindra Scorpio LX BS IV 1 Mahindra Scorpio VLX 4WD AIRBAG AT BSIV 1 Datsun GO Plus T 1 Skoda Octavia L and K 1.9 TDI MT 1 Hyundai i10 Sportz Option 1 Mercedes-Benz R-Class R350 CDI 4MATIC 1 Renault Duster 85PS Diesel RxL Optional with Nav 1 Skoda Rapid 2013-2016 1.6 MPI Ambition 1 Skoda Rapid 1.5 TDI AT Elegance Plus Black Package 1 Mercedes-Benz E-Class E400 Cabriolet 1 Ford Fiesta Diesel Titanium Plus 1 Hyundai Grand i10 Magna AT 1 Mercedes-Benz S Class 2005 2013 S 500 1 Nissan Micra XL Primo 1 Ford Aspire Ambiente Diesel 1 Hyundai Verna Transform CRDi VGT SX ABS 1 Hyundai Sonata Transform 2.4 GDi MT 1 Skoda Superb 1.8 TFSI MT 1 Maruti Swift LDI SP Limited Edition 1 Volkswagen Vento Diesel Breeze 1 Mahindra Quanto C6 1 Hyundai i10 Asta 1.2 AT with Sunroof 1 Toyota Etios Liva 1.4 GD 1 Maruti Ciaz 1.4 Alpha 1 BMW 7 Series 2007-2012 750Li 1 Hyundai EON 1.0 Magna Plus Option O 1 Chevrolet Beat LT Option 1 Skoda Rapid 1.6 MPI AT Elegance Plus 1 Ford EcoSport 1.5 TDCi Ambiente 1 Hyundai i10 Magna 1.1 iTech SE 1 Hyundai Elite i20 Magna Plus 1 Name: count, dtype: int64 -------------------------------------------------- For column: Location Location Mumbai 949 Hyderabad 876 Coimbatore 772 Kochi 772 Pune 765 Delhi 660 Kolkata 654 Chennai 591 Jaipur 499 Bangalore 440 Ahmedabad 275 Name: count, dtype: int64 -------------------------------------------------- For column: Fuel_Type Fuel_Type Diesel 3852 Petrol 3325 CNG 62 LPG 12 Electric 2 Name: count, dtype: int64 -------------------------------------------------- For column: Transmission Transmission Manual 5204 Automatic 2049 Name: count, dtype: int64 -------------------------------------------------- For column: Owner_Type Owner_Type First 5952 Second 1152 Third 137 Fourth & Above 12 Name: count, dtype: int64 --------------------------------------------------
Observations
- There are 2041 unique cars in our data.
- Most cars are from Mumbai and Hyderabad.
- Most of the cars have manual transmission.
- Most cars are first-owner vehicles.
- Very few cars use CNG, LPG, Electric Fuel_Type.
Check Kilometers_Driven extreme values
We observed from summary statistics that kilometers_driven column has extreme values . Let us check that column
data.sort_values(by=["Kilometers_Driven"], ascending = False).head(10)
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2328 | BMW X5 xDrive 30d M Sport | Chennai | 2017 | 6500000 | Diesel | Automatic | First | 15.97 | 2993.0 | 258.00 | 5.0 | NaN | 65.00 |
340 | Skoda Octavia Ambition Plus 2.0 TDI AT | Kolkata | 2013 | 775000 | Diesel | Automatic | First | 19.30 | 1968.0 | 141.00 | 5.0 | NaN | 7.50 |
1860 | Volkswagen Vento Diesel Highline | Chennai | 2013 | 720000 | Diesel | Manual | First | 20.54 | 1598.0 | 103.60 | 5.0 | NaN | 5.90 |
358 | Hyundai i10 Magna 1.2 | Chennai | 2009 | 620000 | Petrol | Manual | First | 20.36 | 1197.0 | 78.90 | 5.0 | NaN | 2.70 |
2823 | Volkswagen Jetta 2013-2015 2.0L TDI Highline AT | Chennai | 2015 | 480000 | Diesel | Automatic | First | 16.96 | 1968.0 | 138.03 | 5.0 | NaN | 13.00 |
3092 | Honda City i VTEC SV | Kolkata | 2015 | 480000 | Petrol | Manual | First | 17.40 | 1497.0 | 117.30 | 5.0 | NaN | 5.00 |
4491 | Hyundai i20 Magna Optional 1.2 | Bangalore | 2013 | 445000 | Petrol | Manual | First | 18.50 | 1197.0 | 82.90 | 5.0 | NaN | 4.45 |
6921 | Maruti Swift Dzire Tour LDI | Jaipur | 2012 | 350000 | Diesel | Manual | First | 23.40 | 1248.0 | 74.00 | 5.0 | NaN | NaN |
3649 | Tata Indigo LS | Jaipur | 2008 | 300000 | Diesel | Manual | First | 17.00 | 1405.0 | 70.00 | 5.0 | NaN | 1.00 |
1528 | Toyota Innova 2.5 G (Diesel) 8 Seater BS IV | Hyderabad | 2005 | 299322 | Diesel | Manual | First | 12.80 | 2494.0 | 102.00 | 8.0 | NaN | 4.00 |
Observations
In the first row, a car manufactured as recently as 2017 having been driven 6500000 km is almost impossible. It can be considered as data entry error, so we can remove this value/entry from the data
The other observations that follow are also on a higher-end but kilometers driven by these cars are still reasonable as they are quite old. There is a good chance that these are outliers. We will look at this further while doing the univariate analysis
# Removing this specific row from the above observation
data.drop(2328, inplace = True)
Check Mileage extreme values
We also observed from summary statistics that minimum mileage is zero. Let us check that column
data.sort_values(by = ['Mileage'], ascending = True).head(10)
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4234 | Mercedes-Benz M-Class ML 350 4Matic | Chennai | 2012 | 63000 | Diesel | Automatic | First | 0.0 | 2987.0 | 165.0 | 5.0 | NaN | 26.00 |
2053 | Mahindra Jeep MM 550 PE | Hyderabad | 2009 | 26000 | Diesel | Manual | First | 0.0 | 2498.0 | NaN | 6.0 | NaN | 6.99 |
6177 | Mercedes-Benz M-Class ML 350 4Matic | Bangalore | 2012 | 37000 | Diesel | Automatic | First | 0.0 | 2987.0 | 165.0 | 5.0 | NaN | NaN |
2542 | Hyundai Santro GLS II - Euro II | Bangalore | 2011 | 65000 | Petrol | Manual | Second | 0.0 | NaN | NaN | NaN | NaN | 3.15 |
262 | Hyundai Santro Xing XL | Hyderabad | 2006 | 99000 | Petrol | Manual | First | 0.0 | 1086.0 | NaN | 5.0 | NaN | 1.75 |
5426 | Hyundai Santro Xing XL | Chennai | 2006 | 85000 | Petrol | Manual | Third | 0.0 | 1086.0 | NaN | 5.0 | NaN | 1.30 |
5943 | Mahindra Jeep MM 540 DP | Chennai | 2002 | 75000 | Diesel | Manual | First | 0.0 | 2112.0 | NaN | 6.0 | NaN | 1.70 |
4152 | Land Rover Range Rover 3.0 D | Mumbai | 2003 | 75000 | Diesel | Automatic | Second | 0.0 | NaN | NaN | NaN | NaN | 16.11 |
6633 | Mahindra TUV 300 P4 | Kolkata | 2016 | 27000 | Diesel | Manual | First | 0.0 | NaN | NaN | NaN | NaN | NaN |
2096 | Hyundai Santro LP zipPlus | Coimbatore | 2004 | 52146 | Petrol | Manual | First | 0.0 | NaN | NaN | NaN | NaN | 1.93 |
Observations
- Mileage of cars can not be 0
- we should treat 0's as missing values
Univariate Analysis¶
Univariate analysis is used to explore each variable in a data set, separately. It looks at the range of values, as well as the central tendency of the values. It can be done for both numerical and categorical variables
1.Univariate analysis - Numerical data¶
Histograms and box plots help to visualize and describe numerical data. We will use these to analyse the following numerical columns: Kilometers_driven
, power
, price
, mileage
.
# Function to plot a boxplot and a histogram along the same scale
def histogram_boxplot(data, feature, figsize = (12, 7), kde = False, bins = None):
"""
Boxplot and histogram combined
data: dataframe
feature: dataframe column
figsize: size of figure (default (12,7))
kde: whether to show density curve (default False)
bins: number of bins for histogram (default None)
"""
f2, (ax_box2, ax_hist2) = plt.subplots(
nrows = 2, # Number of rows of the subplot grid = 2
sharex = True, # x-axis will be shared among all subplots
gridspec_kw = {"height_ratios": (0.25, 0.75)},
figsize = figsize) # Creating the 2 subplots
sns.boxplot(data = data, x = feature, ax = ax_box2, showmeans = True, color = "violet") # Boxplot will be created and a Triangle will indicate the mean value of the column
sns.histplot(data = data, x = feature, kde = kde, ax = ax_hist2, bins = bins, palette = "winter") if bins else sns.histplot(data = data, x = feature, kde = kde, ax = ax_hist2) # To create histogram
ax_hist2.axvline(data[feature].mean(), color = "green", linestyle = "--") # Add mean to the histogram
ax_hist2.axvline(data[feature].median(), color = "black", linestyle = "-") # Add median to the histogram
Box plot and Histogram for Kilometers Driven¶
# Plot histogram and box-plot for 'Kilometers_Driven'
histogram_boxplot(data, 'Kilometers_Driven')
- Kilometers_Driven is highly right-skewed. It is very difficult to interpret. Log transformation can be used to reduce/remove the skewness. Log transformed value can be used for analysis
sns.histplot(np.log(data["Kilometers_Driven"]), kde=True)
plt.xlabel('Log(Kilometers_Driven)')
Text(0.5, 0, 'Log(Kilometers_Driven)')
Observations
- Log transformation of data has reduced the extreme skewness
- From box-plot we can see the outliers, as we discussed in summary statistics
# Adding a transformed kilometers_driven feature to the data.
data["kilometers_driven_log"] = np.log(data["Kilometers_Driven"])
Box plot and Histogram for Mileage¶
histogram_boxplot(data, 'Mileage')
Observations
- The distribution of mileage looks fairly normally distributed if we ignore the cars with 0 mileage.
- From box plot also it is visible that the extreme values can be seen as outliers
Box plot and Histogram for Power¶
histogram_boxplot(data, 'Power')
Observations
- Most cars have Power of engines between 90-100 bhp
- From the boxplot, we can see that there are many outliers in this variable - cars with more than 250 bhp are being considered as outliers in data
Box plot and Histogram for Price¶
histogram_boxplot(data, 'Price')
- The distribution of Price is highly skewed, we can use log transformation on this column to see if that helps normalize the distribution.
sns.histplot(np.log(data["Price"]), kde=True)
plt.xlabel('Log(Price)')
Text(0.5, 0, 'Log(Price)')
Observations
- Log transformation helps to normalize the distribution
- It is observed that few extreme price values are there, as seen in summary statistics
# Log Transformation has definitely helped in reducing the skew
# Creating a new column with the transformed variable.
data["price_log"] = np.log(data["Price"])
2.Univariate analysis - Categorical data¶
# Let us write a function that will help us create barplots that indicate the percentage for each category.
# This function takes the categorical column as the input and returns the barplots for the variable.
def perc_on_bar(data, z):
'''
plot
data: DataFrame or Series
z: categorical feature
the function won't work if a column is passed in hue parameter
'''
total = len(data[z]) # Length of the column
plt.figure(figsize=(15, 5))
ax = sns.countplot(data=data, x=z, palette='Paired', order=data[z].value_counts().index)
for p in ax.patches:
percentage = '{:.1f}%'.format(100 * p.get_height() / total) # Percentage of each class of the category
x = p.get_x() + p.get_width() / 2 - 0.05 # Width of the plot
y = p.get_y() + p.get_height() # Height of the plot
ax.annotate(percentage, (x, y), size=12, ha='center') # Annotate the percentage with center alignment
plt.show()
Barplot for Location¶
# % values has to have offset
perc_on_bar(data, 'Location')
Observation
- 13.1% of the cars are from Mumbai followed by 12.1% of the cars from Hyderabad
Barplot for Year¶
perc_on_bar(data, 'Year')
Observation
- About 38% of the cars in the data are from the year 2014 - 2016
Barplot for Fuel_Type¶
perc_on_bar(data, 'Fuel_Type')
Observations
- Approximately 99% of cars are powered by Diesel and Petrol, while the remaining 1% use alternative fuels such as CNG, LPG, and electricity.
Barplot for Transmission¶
perc_on_bar(data, 'Transmission')
Observations
- 71.8% of the cars have a manual transmission
Barplot for Owner_Type¶
perc_on_bar(data, 'Owner_Type')
Observations
- 82.1% of the cars have first owners followed by 15.9% of the cars with second owners
Bivariate Analysis¶
1. Pair plot¶
A pair plot allows us to see both distribution of single variables and relationships between two variables
Note: Use log transformed values 'kilometers_driven_log' and 'price_log'
# Let us plot pair plot for the variables. We can include the log transformation values and drop the original skewed data columns
sns.set(style='ticks', color_codes=True)
sns.set(rc={'figure.figsize':(15,15)}) # Designing the size of the pairplot to accomodate the visualization of all the columns properly
sns.set_style("whitegrid")
sns.pairplot(data.drop(['Kilometers_Driven','Price'],axis = 1), kind = 'reg', plot_kws={'line_kws':{'color': 'red'}}, hue="Transmission", corner=True)
plt.show()
Observations
Zooming into these plots gives us a lot of information -
- Contrary to intuition, Kilometers Driven have no relationship with price
- Price has a positive relationship with Year. Newer the car, the higher the price
- 2 seater cars are all luxury variants. Cars with 8-10 seats are exclusively mid to high range
- Mileage does not seem to show much relationship with the price of used cars
- Engine displacement and Power of the car have a positive relationship with the price
- New Price and Used Car Price are also positively correlated, which is expected
- Kilometers Driven has a peculiar relationship with the Year variable. Generally, the newer the car lesser the distance it has traveled, but this is not always true
- Mileage and power of newer cars is increasing owing to advancement in technology
- Mileage has a negative correlation with engine displacement and power. More powerful the engine, the more fuel it consumes in general
2. Heat map¶
Heat map shows a 2D correlation matrix between two discrete features.
# We can include the log transformation values and drop the original skewed data columns
plt.figure(figsize = (12, 7))
sns.set_style("whitegrid")
# limits the values for 2 decimals
pd.set_option('display.float_format', lambda x: '%.2f' % x)
sns.heatmap(data.drop(['Kilometers_Driven','Price'],axis = 1).corr(numeric_only = True), annot = True, vmin = -1,vmax = 1)
plt.show()
- Power and engine are important predictors of price
- New_price is also a significant predictor of price
3. Box plot¶
Performing Bi-variate analysis using Boxplot
# Function to plot boxplot w.r.t Price
def boxplot(z): # Here, z is the name of the column that you want to visualize against the price of the car.
# Boxplot with outliers
plt.figure(figsize = (12, 5)) # setting size of boxplot
# Put color legend on the column z
plt.title('Boxplot With Outliers')
sns.boxplot(x = z, y = data['Price'], hue=z) # Defining x and y
plt.show()
# Boxplot without outliers
plt.figure(figsize = (12, 5))
plt.title('Boxplot Without Outliers')
sns.boxplot(x = z, y = data['Price'], showfliers = False, hue=z) # Turning off the outliers
plt.show()
Box Plot : Price vs Location¶
boxplot(data['Location'])
Observation
- Price of used cars has a large IQR in Coimbatore and Bangalore
Box Plot : Price vs Fuel_Type¶
boxplot(data['Fuel_Type'])
Observations
- Diesel cars are costlier than Petrol cars
- Electric cars are costlier than CNG and LPG cars
Box Plot : Price vs Transmission¶
boxplot(data['Transmission'])
Observation
- Automatic transmission cars are very costly as compared to cars with manual transmission
Box Plot : Price vs Owner_Type¶
boxplot(data['Owner_Type'])
Observation
- Cars with fewer previous owners tend to have higher prices. Notably, third-owner cars might exhibit outliers in price due to the presence of luxury vehicles in this category.
Feature engineering¶
The Name
column, which includes both the brand name and model name of each vehicle, contains too many unique values. This high level of uniqueness limits its usefulness for predictive analysis.
data["Name"].nunique()
2041
- The 'car names' column contains 2041 unique names, making it a poor predictor of price in our current dataset. To improve this, we can process the column to extract meaningful information, which should help reduce the number of unique levels and potentially enhance the predictive power of this feature.
1. Car Brand Name
data.head(2)
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | kilometers_driven_log | price_log | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Maruti Wagon R LXI CNG | Mumbai | 2010 | 72000 | CNG | Manual | First | 37.24 | 998.00 | 58.16 | 5.00 | NaN | 1.75 | 11.18 | 0.56 |
1 | Hyundai Creta 1.6 CRDi SX Option | Pune | 2015 | 41000 | Diesel | Manual | First | 19.67 | 1582.00 | 126.20 | 5.00 | NaN | 12.50 | 10.62 | 2.53 |
# Extract Brand Names
data["Brand"] = data["Name"].apply(lambda x: x.split(" ")[0].lower()) # The brand name is at the very beginning of the vehicle name, and we are making it lowercase.
# Check the data
data["Brand"].value_counts()
Brand maruti 1444 hyundai 1340 honda 743 toyota 507 mercedes-benz 380 volkswagen 374 ford 351 mahindra 331 bmw 311 audi 285 tata 228 skoda 202 renault 170 chevrolet 151 nissan 117 land 67 jaguar 48 fiat 38 mitsubishi 36 mini 31 volvo 28 porsche 19 jeep 19 datsun 17 isuzu 5 force 3 bentley 2 smart 1 ambassador 1 lamborghini 1 hindustan 1 opelcorsa 1 Name: count, dtype: int64
Checking the brand of vehicle that appears most frequently in the dataset
plt.figure(figsize = (15, 7))
sns.countplot(y = "Brand", data = data, order = data["Brand"].value_counts().index, hue='Brand') # Plotting a countplot based on the number of vehicles per brand.
plt.show()
Observation
- Most frequent brands in our data are Maruti and Hyundai
2. Car Model Name
When we look at the name of the vehicle, first word in the sentence is the brand, second word is the model, etc., so we need to capture the second word which is the model of the vehicle. Python index starts at 0, so the split value 1 will be the model of the vehicle
# Extract Model Names
data["Model"] = data["Name"].apply(lambda x: x.split(" ")[1].lower()) # Extracting the model name and converting it to lowercase.
# Check the data
data["Model"].value_counts()
Model swift 418 city 318 i20 303 innova 203 verna 200 alto 183 grand 183 i10 181 wagon 178 polo 178 xuv500 131 vento 129 amaze 127 new 119 creta 118 fortuner 118 ecosport 117 figo 112 3 109 e-class 108 duster 97 santro 95 a4 90 5 86 ertiga 86 corolla 83 ciaz 83 brio 80 etios 80 eon 79 ritz 78 baleno 75 jazz 70 scorpio 69 xcent 68 rover 67 celerio 66 a6 66 rapid 58 superb 58 vitara 55 indica 54 beat 54 fiesta 49 micra 45 sx4 44 kwid 44 endeavour 43 q7 39 civic 39 q5 38 laura 36 indigo 36 x1 36 xf 36 accord 35 q3 35 zen 33 octavia 33 elantra 32 sunny 32 cr-v 31 nano 31 xylo 30 terrano 30 pajero 29 jetta 28 dzire 28 cooper 28 m-class 27 zest 24 accent 24 x5 24 mobilio 24 cruze 23 omni 23 ameo 22 a-star 22 eeco 21 bolero 21 s 20 gla 20 kuv 20 manza 19 compass 19 elite 18 ikon 18 7 17 santa 17 x3 17 tiago 17 aveo 17 800 15 spark 15 linea 15 cla 15 camry 15 gl-class 15 b 15 ssangyong 14 gle 14 enjoy 13 optra 13 a 12 tuv 12 getz 12 fabia 11 ignis 10 passat 10 thar 10 sail 10 6 9 go 9 s60 9 safari 9 glc 9 pulse 9 sonata 9 panamera 8 brv 8 cayenne 8 x6 8 redi-go 7 xc60 7 punto 7 grande 7 tigor 7 avventura 6 xj 6 quanto 6 esteem 6 sumo 6 a3 6 yeti 6 verito 6 teana 5 br-v 5 qualis 5 wrv 5 xe 5 s-class 5 v40 5 scala 5 crosspolo 5 tucson 5 r-class 4 captur 4 aspire 4 hexa 4 fluence 4 koleos 4 xenon 4 bolt 4 xc90 4 freestyle 4 captiva 3 a7 3 1 3 classic 3 slc 3 s80 3 a8 3 renault 3 tt 3 one 3 slk-class 3 lodgy 3 nuvosport 3 c-class 3 d-max 3 x-trail 3 s-cross 3 nexon 3 tavera 3 estilo 3 lancer 2 z4 2 clubman 2 versa 2 jeep 2 logan 2 gls 2 rs5 2 cedia 2 outlander 2 cayman 2 continental 1 prius 1 countryman 1 wr-v 1 gallardo 1 1000 1 f 1 motors 1 flying 1 land 1 mu 1 370z 1 abarth 1 sl-class 1 fusion 1 siena 1 mux 1 tiguan 1 montero 1 petra 1 beetle 1 venture 1 xuv300 1 platinum 1 evalia 1 boxster 1 cls-class 1 fortwo 1 redi 1 e 1 mustang 1 1.4gsi 1 Name: count, dtype: int64
Creating countplot for a clearer and more understandable view of the information
plt.figure(figsize = (15, 7))
sns.countplot(y = "Model", data = data, order = data["Model"].value_counts().index[1:30], hue="Model"); # Plotting a countplot based on the number of vehicles per model for the top 30 models based on count.
plt.show()
Observations
- It is clear from the above charts that our dataset contains used cars from luxury as well as budget-friendly brands
- We have extracted brand name and model name, we get a better understanding of the cars we have in our data
We need to also understand, on an average, what's the price of the vehicle for a specific brand for better understanding of the data
# Grouping the data based on the brand to find the average price of cars per brand.
data.groupby(["Brand"])["Price"].mean().sort_values(ascending = False)
Brand lamborghini 120.00 bentley 59.00 porsche 48.35 land 39.26 jaguar 37.63 mini 26.90 mercedes-benz 26.81 audi 25.54 bmw 25.09 volvo 18.80 jeep 18.72 isuzu 14.70 toyota 11.58 mitsubishi 11.06 force 9.33 mahindra 8.05 skoda 7.56 ford 6.89 renault 5.80 honda 5.41 hyundai 5.34 volkswagen 5.31 nissan 4.74 maruti 4.52 tata 3.56 fiat 3.27 datsun 3.05 chevrolet 3.04 smart 3.00 ambassador 1.35 hindustan NaN opelcorsa NaN Name: Price, dtype: float64
Observations
The output closely matches our expectations in terms of brand ranking. The average price of a used Lamborghini is 120 Lakhs, with other luxury brands following in descending order.
Towards the lower end, we observe more affordable brands.
We notice some missing data, which we will handle in subsequent steps.
Missing value treatment¶
# Summing up the number of rows with missing values for each column.
data.isnull().sum()
Name 0 Location 0 Year 0 Kilometers_Driven 0 Fuel_Type 0 Transmission 0 Owner_Type 0 Mileage 2 Engine 46 Power 175 Seats 53 New_Price 6246 Price 1234 kilometers_driven_log 0 price_log 1234 Brand 0 Model 0 dtype: int64
Observations
- Engine displacement information of 46 observations is missing and a maximum power of 175 entries is missing
- Information about the number of seats is not available for 53 entries
- New Price as we saw earlier has a huge missing count
- Price is also missing for 1234 entries. Since price is the response variable that we want to predict, we will have to drop these rows while building the model
Missing values in Seats
# Checking the actual rows where the Seats column has missing values.
data[data['Seats'].isnull()]
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | kilometers_driven_log | price_log | Brand | Model | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
194 | Honda City 1.5 GXI | Ahmedabad | 2007 | 60006 | Petrol | Manual | First | 0.00 | NaN | NaN | NaN | NaN | 2.95 | 11.00 | 1.08 | honda | city |
208 | Maruti Swift 1.3 VXi | Kolkata | 2010 | 42001 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 2.11 | 10.65 | 0.75 | maruti | swift |
229 | Ford Figo Diesel | Bangalore | 2015 | 70436 | Diesel | Manual | First | 0.00 | 1498.00 | 99.00 | NaN | NaN | 3.60 | 11.16 | 1.28 | ford | figo |
733 | Maruti Swift 1.3 VXi | Chennai | 2006 | 97800 | Petrol | Manual | Third | 16.10 | NaN | NaN | NaN | NaN | 1.75 | 11.49 | 0.56 | maruti | swift |
749 | Land Rover Range Rover 3.0 D | Mumbai | 2008 | 55001 | Diesel | Automatic | Second | 0.00 | NaN | NaN | NaN | NaN | 26.50 | 10.92 | 3.28 | land | rover |
1294 | Honda City 1.3 DX | Delhi | 2009 | 55005 | Petrol | Manual | First | 12.80 | NaN | NaN | NaN | NaN | 3.20 | 10.92 | 1.16 | honda | city |
1327 | Maruti Swift 1.3 ZXI | Hyderabad | 2015 | 50295 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 5.80 | 10.83 | 1.76 | maruti | swift |
1385 | Honda City 1.5 GXI | Pune | 2004 | 115000 | Petrol | Manual | Second | 0.00 | NaN | NaN | NaN | NaN | 1.50 | 11.65 | 0.41 | honda | city |
1460 | Land Rover Range Rover Sport 2005 2012 Sport | Coimbatore | 2008 | 69078 | Petrol | Manual | First | 0.00 | NaN | NaN | NaN | NaN | 40.88 | 11.14 | 3.71 | land | rover |
1917 | Honda City 1.5 EXI | Jaipur | 2005 | 88000 | Petrol | Manual | Second | 13.00 | 1493.00 | 100.00 | NaN | NaN | 1.70 | 11.39 | 0.53 | honda | city |
2074 | Maruti Swift 1.3 LXI | Pune | 2011 | 24255 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 3.15 | 10.10 | 1.15 | maruti | swift |
2096 | Hyundai Santro LP zipPlus | Coimbatore | 2004 | 52146 | Petrol | Manual | First | 0.00 | NaN | NaN | NaN | NaN | 1.93 | 10.86 | 0.66 | hyundai | santro |
2264 | Toyota Etios Liva V | Pune | 2012 | 24500 | Petrol | Manual | Second | 18.30 | NaN | NaN | NaN | NaN | 2.95 | 10.11 | 1.08 | toyota | etios |
2325 | Maruti Swift 1.3 VXI ABS | Pune | 2015 | 67000 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 4.70 | 11.11 | 1.55 | maruti | swift |
2335 | Maruti Swift 1.3 VXi | Mumbai | 2007 | 55000 | Petrol | Manual | Second | 16.10 | NaN | NaN | NaN | NaN | 1.75 | 10.92 | 0.56 | maruti | swift |
2369 | Maruti Estilo LXI | Chennai | 2008 | 56000 | Petrol | Manual | Second | 19.50 | 1061.00 | NaN | NaN | NaN | 1.50 | 10.93 | 0.41 | maruti | estilo |
2530 | BMW 5 Series 520d Sedan | Kochi | 2014 | 64158 | Diesel | Automatic | First | 18.48 | NaN | NaN | NaN | NaN | 17.89 | 11.07 | 2.88 | bmw | 5 |
2542 | Hyundai Santro GLS II - Euro II | Bangalore | 2011 | 65000 | Petrol | Manual | Second | 0.00 | NaN | NaN | NaN | NaN | 3.15 | 11.08 | 1.15 | hyundai | santro |
2623 | BMW 5 Series 520d Sedan | Pune | 2012 | 95000 | Diesel | Automatic | Second | 18.48 | NaN | NaN | NaN | NaN | 18.00 | 11.46 | 2.89 | bmw | 5 |
2668 | Maruti Swift 1.3 VXi | Kolkata | 2014 | 32986 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 4.24 | 10.40 | 1.44 | maruti | swift |
2737 | Maruti Wagon R Vx | Jaipur | 2001 | 200000 | Petrol | Manual | First | 12.00 | NaN | NaN | NaN | NaN | 0.70 | 12.21 | -0.36 | maruti | wagon |
2780 | Hyundai Santro GLS II - Euro II | Pune | 2009 | 100000 | Petrol | Manual | First | 0.00 | NaN | NaN | NaN | NaN | 1.60 | 11.51 | 0.47 | hyundai | santro |
2842 | Hyundai Santro GLS II - Euro II | Bangalore | 2012 | 43000 | Petrol | Manual | First | 0.00 | NaN | NaN | NaN | NaN | 3.25 | 10.67 | 1.18 | hyundai | santro |
3272 | BMW 5 Series 520d Sedan | Mumbai | 2008 | 81000 | Diesel | Automatic | Second | 18.48 | NaN | NaN | NaN | NaN | 10.50 | 11.30 | 2.35 | bmw | 5 |
3404 | Maruti Swift 1.3 VXi | Jaipur | 2006 | 125000 | Petrol | Manual | Fourth & Above | 16.10 | NaN | NaN | NaN | NaN | 2.35 | 11.74 | 0.85 | maruti | swift |
3520 | BMW 5 Series 520d Sedan | Delhi | 2012 | 90000 | Diesel | Automatic | First | 18.48 | NaN | NaN | NaN | NaN | 14.50 | 11.41 | 2.67 | bmw | 5 |
3522 | Hyundai Santro GLS II - Euro II | Kochi | 2012 | 66400 | Petrol | Manual | First | 0.00 | NaN | NaN | NaN | NaN | 2.66 | 11.10 | 0.98 | hyundai | santro |
3800 | Ford Endeavour Hurricane LE | Mumbai | 2012 | 129000 | Diesel | Automatic | First | 12.80 | 2953.00 | NaN | NaN | NaN | 7.00 | 11.77 | 1.95 | ford | endeavour |
3810 | Honda CR-V AT With Sun Roof | Kolkata | 2013 | 27000 | Petrol | Automatic | First | 14.00 | NaN | NaN | NaN | NaN | 11.99 | 10.20 | 2.48 | honda | cr-v |
3882 | Maruti Estilo LXI | Kolkata | 2010 | 40000 | Petrol | Manual | Second | 19.50 | 1061.00 | NaN | NaN | NaN | 2.50 | 10.60 | 0.92 | maruti | estilo |
4011 | Fiat Punto 1.3 Emotion | Pune | 2011 | 45271 | Diesel | Manual | First | 20.30 | NaN | NaN | NaN | NaN | 2.60 | 10.72 | 0.96 | fiat | punto |
4152 | Land Rover Range Rover 3.0 D | Mumbai | 2003 | 75000 | Diesel | Automatic | Second | 0.00 | NaN | NaN | NaN | NaN | 16.11 | 11.23 | 2.78 | land | rover |
4229 | Hyundai Santro Xing XG | Bangalore | 2005 | 79000 | Petrol | Manual | Second | 17.00 | NaN | NaN | NaN | NaN | 1.65 | 11.28 | 0.50 | hyundai | santro |
4577 | BMW 5 Series 520d Sedan | Delhi | 2012 | 72000 | Diesel | Automatic | Third | 18.48 | NaN | NaN | NaN | NaN | 13.85 | 11.18 | 2.63 | bmw | 5 |
4604 | Honda Jazz Select Edition | Pune | 2011 | 98000 | Petrol | Manual | First | 16.70 | NaN | NaN | NaN | NaN | 3.15 | 11.49 | 1.15 | honda | jazz |
4697 | Fiat Punto 1.2 Dynamic | Kochi | 2017 | 17941 | Petrol | Manual | First | 15.70 | NaN | NaN | NaN | NaN | 3.93 | 9.79 | 1.37 | fiat | punto |
4712 | Hyundai Santro Xing XG | Pune | 2003 | 80000 | Petrol | Manual | Second | 17.00 | NaN | NaN | NaN | NaN | 0.90 | 11.29 | -0.11 | hyundai | santro |
4952 | Fiat Punto 1.4 Emotion | Kolkata | 2010 | 47000 | Petrol | Manual | First | 14.60 | NaN | NaN | NaN | NaN | 1.49 | 10.76 | 0.40 | fiat | punto |
5015 | Maruti Swift 1.3 VXi | Delhi | 2006 | 63000 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 1.60 | 11.05 | 0.47 | maruti | swift |
5185 | Maruti Swift 1.3 LXI | Delhi | 2012 | 52000 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | 3.65 | 10.86 | 1.29 | maruti | swift |
5270 | Honda City 1.5 GXI | Bangalore | 2002 | 53000 | Petrol | Manual | Second | 0.00 | NaN | NaN | NaN | NaN | 1.85 | 10.88 | 0.62 | honda | city |
5893 | Maruti Estilo LXI | Chennai | 2008 | 51000 | Petrol | Manual | Second | 19.50 | 1061.00 | NaN | NaN | NaN | 1.75 | 10.84 | 0.56 | maruti | estilo |
6042 | Skoda Laura 1.8 TSI Ambition | Bangalore | 2009 | 72000 | Petrol | Manual | Second | 17.50 | NaN | NaN | NaN | NaN | NaN | 11.18 | NaN | skoda | laura |
6541 | Toyota Etios Liva Diesel TRD Sportivo | Bangalore | 2012 | 56600 | Diesel | Manual | First | 23.59 | NaN | NaN | NaN | NaN | NaN | 10.94 | NaN | toyota | etios |
6544 | Hyundai i20 new Sportz AT 1.4 | Bangalore | 2012 | 58000 | Petrol | Automatic | Second | 15.00 | NaN | NaN | NaN | NaN | NaN | 10.97 | NaN | hyundai | i20 |
6633 | Mahindra TUV 300 P4 | Kolkata | 2016 | 27000 | Diesel | Manual | First | 0.00 | NaN | NaN | NaN | NaN | NaN | 10.20 | NaN | mahindra | tuv |
6643 | BMW 5 Series 520d Sedan | Bangalore | 2009 | 150000 | Diesel | Automatic | Second | 18.48 | NaN | NaN | NaN | NaN | NaN | 11.92 | NaN | bmw | 5 |
6651 | Maruti Swift 1.3 VXi | Kolkata | 2015 | 36009 | Petrol | Manual | First | 16.10 | NaN | NaN | NaN | NaN | NaN | 10.49 | NaN | maruti | swift |
6677 | Fiat Punto 1.4 Emotion | Jaipur | 2010 | 65000 | Petrol | Manual | Third | 14.60 | NaN | NaN | NaN | NaN | NaN | 11.08 | NaN | fiat | punto |
6685 | Maruti Swift 1.3 VXi | Pune | 2010 | 115000 | Petrol | Manual | Second | 16.10 | NaN | NaN | NaN | NaN | NaN | 11.65 | NaN | maruti | swift |
6880 | BMW 5 Series 520d Sedan | Chennai | 2009 | 95000 | Diesel | Automatic | Second | 18.48 | NaN | NaN | NaN | NaN | NaN | 11.46 | NaN | bmw | 5 |
6902 | Toyota Etios Liva V | Kochi | 2012 | 59311 | Petrol | Manual | First | 18.30 | NaN | NaN | NaN | NaN | NaN | 10.99 | NaN | toyota | etios |
6957 | Honda Jazz 2020 Petrol | Kochi | 2019 | 11574 | Petrol | Manual | First | 0.00 | 1199.00 | 88.70 | NaN | NaN | NaN | 9.36 | NaN | honda | jazz |
# We will impute these missing values one by one by taking the median number of seats for the particular car,
# using the brand and model name.
data.groupby(["Brand", "Model"], as_index = False)["Seats"].median() # Checking MEDIAN number of seats for each model of the brands so that we can impute the most appropriate values in missing seats
Brand | Model | Seats | |
---|---|---|---|
0 | ambassador | classic | 5.00 |
1 | audi | a3 | 5.00 |
2 | audi | a4 | 5.00 |
3 | audi | a6 | 5.00 |
4 | audi | a7 | 5.00 |
5 | audi | a8 | 5.00 |
6 | audi | q3 | 5.00 |
7 | audi | q5 | 5.00 |
8 | audi | q7 | 7.00 |
9 | audi | rs5 | 4.00 |
10 | audi | tt | 2.00 |
11 | bentley | continental | 4.00 |
12 | bentley | flying | 5.00 |
13 | bmw | 1 | 5.00 |
14 | bmw | 3 | 5.00 |
15 | bmw | 5 | 5.00 |
16 | bmw | 6 | 4.00 |
17 | bmw | 7 | 5.00 |
18 | bmw | x1 | 5.00 |
19 | bmw | x3 | 5.00 |
20 | bmw | x5 | 5.00 |
21 | bmw | x6 | 4.00 |
22 | bmw | z4 | 2.00 |
23 | chevrolet | aveo | 5.00 |
24 | chevrolet | beat | 5.00 |
25 | chevrolet | captiva | 7.00 |
26 | chevrolet | cruze | 5.00 |
27 | chevrolet | enjoy | 8.00 |
28 | chevrolet | optra | 5.00 |
29 | chevrolet | sail | 5.00 |
30 | chevrolet | spark | 5.00 |
31 | chevrolet | tavera | 10.00 |
32 | datsun | go | 5.00 |
33 | datsun | redi | 5.00 |
34 | datsun | redi-go | 5.00 |
35 | fiat | abarth | 4.00 |
36 | fiat | avventura | 5.00 |
37 | fiat | grande | 5.00 |
38 | fiat | linea | 5.00 |
39 | fiat | petra | 5.00 |
40 | fiat | punto | 5.00 |
41 | fiat | siena | 5.00 |
42 | force | one | 7.00 |
43 | ford | aspire | 5.00 |
44 | ford | classic | 5.00 |
45 | ford | ecosport | 5.00 |
46 | ford | endeavour | 7.00 |
47 | ford | fiesta | 5.00 |
48 | ford | figo | 5.00 |
49 | ford | freestyle | 5.00 |
50 | ford | fusion | 5.00 |
51 | ford | ikon | 5.00 |
52 | ford | mustang | 4.00 |
53 | hindustan | motors | 5.00 |
54 | honda | accord | 5.00 |
55 | honda | amaze | 5.00 |
56 | honda | br-v | 7.00 |
57 | honda | brio | 5.00 |
58 | honda | brv | 7.00 |
59 | honda | city | 5.00 |
60 | honda | civic | 5.00 |
61 | honda | cr-v | 5.00 |
62 | honda | jazz | 5.00 |
63 | honda | mobilio | 7.00 |
64 | honda | wr-v | 5.00 |
65 | honda | wrv | 5.00 |
66 | hyundai | accent | 5.00 |
67 | hyundai | creta | 5.00 |
68 | hyundai | elantra | 5.00 |
69 | hyundai | elite | 5.00 |
70 | hyundai | eon | 5.00 |
71 | hyundai | getz | 5.00 |
72 | hyundai | grand | 5.00 |
73 | hyundai | i10 | 5.00 |
74 | hyundai | i20 | 5.00 |
75 | hyundai | santa | 7.00 |
76 | hyundai | santro | 5.00 |
77 | hyundai | sonata | 5.00 |
78 | hyundai | tucson | 5.00 |
79 | hyundai | verna | 5.00 |
80 | hyundai | xcent | 5.00 |
81 | isuzu | d-max | 5.00 |
82 | isuzu | mu | 7.00 |
83 | isuzu | mux | 7.00 |
84 | jaguar | f | 2.00 |
85 | jaguar | xe | 5.00 |
86 | jaguar | xf | 5.00 |
87 | jaguar | xj | 4.50 |
88 | jeep | compass | 5.00 |
89 | lamborghini | gallardo | 2.00 |
90 | land | rover | 5.00 |
91 | mahindra | bolero | 7.00 |
92 | mahindra | e | 5.00 |
93 | mahindra | jeep | 6.00 |
94 | mahindra | kuv | 6.00 |
95 | mahindra | logan | 5.00 |
96 | mahindra | nuvosport | 7.00 |
97 | mahindra | quanto | 7.00 |
98 | mahindra | renault | 5.00 |
99 | mahindra | scorpio | 8.00 |
100 | mahindra | ssangyong | 7.00 |
101 | mahindra | thar | 6.00 |
102 | mahindra | tuv | 7.00 |
103 | mahindra | verito | 5.00 |
104 | mahindra | xuv300 | 5.00 |
105 | mahindra | xuv500 | 7.00 |
106 | mahindra | xylo | 7.50 |
107 | maruti | 1000 | 5.00 |
108 | maruti | 800 | 4.00 |
109 | maruti | a-star | 5.00 |
110 | maruti | alto | 5.00 |
111 | maruti | baleno | 5.00 |
112 | maruti | celerio | 5.00 |
113 | maruti | ciaz | 5.00 |
114 | maruti | dzire | 5.00 |
115 | maruti | eeco | 5.00 |
116 | maruti | ertiga | 7.00 |
117 | maruti | esteem | 5.00 |
118 | maruti | estilo | NaN |
119 | maruti | grand | 5.00 |
120 | maruti | ignis | 5.00 |
121 | maruti | omni | 5.00 |
122 | maruti | ritz | 5.00 |
123 | maruti | s | 5.00 |
124 | maruti | s-cross | 5.00 |
125 | maruti | swift | 5.00 |
126 | maruti | sx4 | 5.00 |
127 | maruti | versa | 8.00 |
128 | maruti | vitara | 5.00 |
129 | maruti | wagon | 5.00 |
130 | maruti | zen | 5.00 |
131 | mercedes-benz | a | 5.00 |
132 | mercedes-benz | b | 5.00 |
133 | mercedes-benz | c-class | 5.00 |
134 | mercedes-benz | cla | 5.00 |
135 | mercedes-benz | cls-class | 4.00 |
136 | mercedes-benz | e-class | 5.00 |
137 | mercedes-benz | gl-class | 7.00 |
138 | mercedes-benz | gla | 5.00 |
139 | mercedes-benz | glc | 5.00 |
140 | mercedes-benz | gle | 5.00 |
141 | mercedes-benz | gls | 7.00 |
142 | mercedes-benz | m-class | 5.00 |
143 | mercedes-benz | new | 5.00 |
144 | mercedes-benz | r-class | 7.00 |
145 | mercedes-benz | s | 5.00 |
146 | mercedes-benz | s-class | 5.00 |
147 | mercedes-benz | sl-class | 2.00 |
148 | mercedes-benz | slc | 2.00 |
149 | mercedes-benz | slk-class | 2.00 |
150 | mini | clubman | 5.00 |
151 | mini | cooper | 4.00 |
152 | mini | countryman | 5.00 |
153 | mitsubishi | cedia | 5.00 |
154 | mitsubishi | lancer | 5.00 |
155 | mitsubishi | montero | 7.00 |
156 | mitsubishi | outlander | 5.00 |
157 | mitsubishi | pajero | 6.00 |
158 | nissan | 370z | 2.00 |
159 | nissan | evalia | 7.00 |
160 | nissan | micra | 5.00 |
161 | nissan | sunny | 5.00 |
162 | nissan | teana | 5.00 |
163 | nissan | terrano | 5.00 |
164 | nissan | x-trail | 5.00 |
165 | opelcorsa | 1.4gsi | 5.00 |
166 | porsche | boxster | 2.00 |
167 | porsche | cayenne | 5.00 |
168 | porsche | cayman | 2.00 |
169 | porsche | panamera | 4.00 |
170 | renault | captur | 5.00 |
171 | renault | duster | 5.00 |
172 | renault | fluence | 5.00 |
173 | renault | koleos | 5.00 |
174 | renault | kwid | 5.00 |
175 | renault | lodgy | 8.00 |
176 | renault | pulse | 5.00 |
177 | renault | scala | 5.00 |
178 | skoda | fabia | 5.00 |
179 | skoda | laura | 5.00 |
180 | skoda | octavia | 5.00 |
181 | skoda | rapid | 5.00 |
182 | skoda | superb | 5.00 |
183 | skoda | yeti | 5.00 |
184 | smart | fortwo | 2.00 |
185 | tata | bolt | 5.00 |
186 | tata | hexa | 7.00 |
187 | tata | indica | 5.00 |
188 | tata | indigo | 5.00 |
189 | tata | manza | 5.00 |
190 | tata | nano | 4.00 |
191 | tata | new | 7.00 |
192 | tata | nexon | 5.00 |
193 | tata | safari | 7.00 |
194 | tata | sumo | 7.00 |
195 | tata | tiago | 5.00 |
196 | tata | tigor | 5.00 |
197 | tata | venture | 8.00 |
198 | tata | xenon | 5.00 |
199 | tata | zest | 5.00 |
200 | toyota | camry | 5.00 |
201 | toyota | corolla | 5.00 |
202 | toyota | etios | 5.00 |
203 | toyota | fortuner | 7.00 |
204 | toyota | innova | 7.00 |
205 | toyota | land | 7.00 |
206 | toyota | platinum | 5.00 |
207 | toyota | prius | 5.00 |
208 | toyota | qualis | 10.00 |
209 | volkswagen | ameo | 5.00 |
210 | volkswagen | beetle | 4.00 |
211 | volkswagen | crosspolo | 5.00 |
212 | volkswagen | jetta | 5.00 |
213 | volkswagen | passat | 5.00 |
214 | volkswagen | polo | 5.00 |
215 | volkswagen | tiguan | 5.00 |
216 | volkswagen | vento | 5.00 |
217 | volvo | s60 | 5.00 |
218 | volvo | s80 | 5.00 |
219 | volvo | v40 | 5.00 |
220 | volvo | xc60 | 5.00 |
221 | volvo | xc90 | 7.00 |
It looks appropriate to fill the missing values in the 'seats' column with the median number of seats for each model
# Impute missing Seats with the median of each model
data["Seats"] = data.groupby(["Brand", "Model"])["Seats"].transform(lambda x: x.fillna(x.median()))
Checking how many missing and non-missing rows do we have in the seat column by now
print(f"{data['Seats'].isnull().value_counts()[0]} rows have non-missing values in Seats column \n{data['Seats'].isnull().value_counts()[1]} rows have missing values in Seats column")
7249 rows have non-missing values in Seats column 3 rows have missing values in Seats column
Now it's time to investigate why there are still missing rows in the 'Seats' column
data[data['Seats'].isnull()]
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | kilometers_driven_log | price_log | Brand | Model | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2369 | Maruti Estilo LXI | Chennai | 2008 | 56000 | Petrol | Manual | Second | 19.50 | 1061.00 | NaN | NaN | NaN | 1.50 | 10.93 | 0.41 | maruti | estilo |
3882 | Maruti Estilo LXI | Kolkata | 2010 | 40000 | Petrol | Manual | Second | 19.50 | 1061.00 | NaN | NaN | NaN | 2.50 | 10.60 | 0.92 | maruti | estilo |
5893 | Maruti Estilo LXI | Chennai | 2008 | 51000 | Petrol | Manual | Second | 19.50 | 1061.00 | NaN | NaN | NaN | 1.75 | 10.84 | 0.56 | maruti | estilo |
Based on the domain knowledge, we can fill out the most appropriate value for the missing seats for those 3 rows
# Maruti Estilo can accomodate 5
data["Seats"] = data["Seats"].fillna(5.0)
data.isnull().sum()
Name 0 Location 0 Year 0 Kilometers_Driven 0 Fuel_Type 0 Transmission 0 Owner_Type 0 Mileage 2 Engine 46 Power 175 Seats 0 New_Price 6246 Price 1234 kilometers_driven_log 0 price_log 1234 Brand 0 Model 0 dtype: int64
Above info shows that there is no more missing data in seat column, however, we got some other columns with the missing values
Missing values for Mileage
data[data['Mileage'].isnull()]
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | kilometers_driven_log | price_log | Brand | Model | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4446 | Mahindra E Verito D4 | Chennai | 2016 | 50000 | Electric | Automatic | First | NaN | 72.00 | 41.00 | 5.00 | 13.58 | 13.00 | 10.82 | 2.56 | mahindra | e |
4904 | Toyota Prius 2009-2016 Z4 | Mumbai | 2011 | 44000 | Electric | Automatic | First | NaN | 1798.00 | 73.00 | 5.00 | NaN | 12.75 | 10.69 | 2.55 | toyota | prius |
It is possible that if the Vehicle is ELECTRIC vehicle, then we will not have a Fuel Mileage, so let's check if the missing mileage column is for the electric vehicle
data[data['Fuel_Type']=='Electric']
Name | Location | Year | Kilometers_Driven | Fuel_Type | Transmission | Owner_Type | Mileage | Engine | Power | Seats | New_Price | Price | kilometers_driven_log | price_log | Brand | Model | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4446 | Mahindra E Verito D4 | Chennai | 2016 | 50000 | Electric | Automatic | First | NaN | 72.00 | 41.00 | 5.00 | 13.58 | 13.00 | 10.82 | 2.56 | mahindra | e |
4904 | Toyota Prius 2009-2016 Z4 | Mumbai | 2011 | 44000 | Electric | Automatic | First | NaN | 1798.00 | 73.00 | 5.00 | NaN | 12.75 | 10.69 | 2.55 | toyota | prius |
Observation
- 2 Electric car variants don't have entries for Mileage
In this case, we can either drop those two rows, or we can adjust the number for now, just for the analysis. Let's proceed with putting median mileage so that we can keep the record in the dataset
# Impute missing Mileage
data["Mileage"].fillna(data['Mileage'].median(), inplace = True)
Let's now, further validate the missing data
data.isnull().sum()
Name 0 Location 0 Year 0 Kilometers_Driven 0 Fuel_Type 0 Transmission 0 Owner_Type 0 Mileage 0 Engine 46 Power 175 Seats 0 New_Price 6246 Price 1234 kilometers_driven_log 0 price_log 1234 Brand 0 Model 0 dtype: int64
Looks like Mileage also no longer has missing values. We can continue working on the rest of the columns with missing values
Missing values for Engine
# Impute missing Engine values with the median value.
data["Engine"].fillna(data['Engine'].median(), inplace = True)
Missing values for Power
# Impute missing Power value with median value as well
data["Power"].fillna(data['Power'].median(), inplace = True)
Missing values for New_price
# Impute missing New_price with the Median price as well, as the mean can be impacted by the outlier in the data
data["New_Price"].fillna(data['New_Price'].median(), inplace = True)
data.isnull().sum()
Name 0 Location 0 Year 0 Kilometers_Driven 0 Fuel_Type 0 Transmission 0 Owner_Type 0 Mileage 0 Engine 0 Power 0 Seats 0 New_Price 0 Price 1234 kilometers_driven_log 0 price_log 1234 Brand 0 Model 0 dtype: int64
We have got the price and price log column still has the missing value, however, we are responsible to predict the price, so it would not be a good idea to fill the missing values with any statistical number, instead for now, we will drop the rows with the missing values
# Drop the rows where 'Price' == NaN
cars_data = data[data["Price"].notna()]
Let's now perform the final validation of the missing rows in all the columns
cars_data.isnull().sum()
Name 0 Location 0 Year 0 Kilometers_Driven 0 Fuel_Type 0 Transmission 0 Owner_Type 0 Mileage 0 Engine 0 Power 0 Seats 0 New_Price 0 Price 0 kilometers_driven_log 0 price_log 0 Brand 0 Model 0 dtype: int64
Observation
- All missing values have been treated.
Important Insights from EDA and Data Preprocessing¶
- Kilometers_Driven and Price is highly right-skewed. Log transformation can be used to reduce/remove the skewness and helps to normalize the distribution
- Kilometers Driven has a peculiar relationship with the Year variable. Generally, the newer the car lesser the distance it has traveled, but this is not always true
- From box-plots we can see the outliers
- The distribution of mileage looks fairly normally distributed if we ignore the cars with 0 mileage
- About 99% of the cars run on Diesel and Petrol while the rest 1% cars run on CNG, LPG and electric
- About 38% of the cars are in the data are for the year 2014 - 2016
- 71.7% of the cars have a manual transmission
- Automatic transmission cars are very costly as compared to cars with manual transmission
- Price of used cars has a large IQR in Coimbatore and Bangalore
- Price has a positive relationship with Year. Newer the car, the higher the price
- Power and engine are important predictors of price
- New_price is also a significant predictor of price
- New Price and Used Car Price are also positively correlated, which is expected
- 2 seater cars are all luxury variants. Cars with 8-10 seats are exclusively mid to high range
- Mileage does not seem to show much relationship with the price of used cars
- Mileage and power of newer cars is increasing owing to advancement in technology
- Mileage has a negative correlation with engine displacement and power. More powerful the engine, the more fuel it consumes in general
- Most cars have Power of engines between 90-100 bhp
- Engine displacement and Power of the car have a positive relationship with the price
- 82% of the cars have first owners followed by 15.9% of the cars with second owners
- Cars with fewer owners have higher prices, outliers in third owner cars these might be the luxury cars
Building Various Models¶
- What we want to predict is "Price". We will use the normalized version 'price_log' for modeling.
- Before we proceed to the model, we'll have to encode categorical features. We will drop categorical features like Name.
- We'll split the data into train and test, to be able to evaluate the model that we build on the train data.
- Build Regression models using train data.
- Evaluate the model performance.
Split the Data¶
For the final validation and understanding of the data types, to ensure that the correct columns are used for encoding, let's check the information about the data using .info
.
cars_data.info()
<class 'pandas.core.frame.DataFrame'> Index: 6018 entries, 0 to 6018 Data columns (total 17 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Name 6018 non-null object 1 Location 6018 non-null object 2 Year 6018 non-null int64 3 Kilometers_Driven 6018 non-null int64 4 Fuel_Type 6018 non-null object 5 Transmission 6018 non-null object 6 Owner_Type 6018 non-null object 7 Mileage 6018 non-null float64 8 Engine 6018 non-null float64 9 Power 6018 non-null float64 10 Seats 6018 non-null float64 11 New_Price 6018 non-null float64 12 Price 6018 non-null float64 13 kilometers_driven_log 6018 non-null float64 14 price_log 6018 non-null float64 15 Brand 6018 non-null object 16 Model 6018 non-null object dtypes: float64(8), int64(2), object(7) memory usage: 846.3+ KB
Time to split the training variables (X), and target feature (y)
X = cars_data.drop(['Name','Price','price_log','Kilometers_Driven'],axis = 1)
"""
- Dropping the name (not necessary for the ML model as it is an identity feature).
- Dropping the Price and Price Log columns. Price Log is the target variable, and we have created the Price Log column from the Price column, so the Price column is no longer needed.
- We have also created the "kilometers_driven_log" column from the "Kilometers_Driven" column, so the "Kilometers_Driven" column is no longer needed.
"""
X = pd.get_dummies(X, columns = X.select_dtypes(include = ["object", "category"]).columns.tolist(), dtype=int, drop_first = True)
"""
Further, we are creating dummy variables for the categorical variables in the data as defined in the above line of code for "object" and "category" types.
Additionally, we will remove the first column of dummies for each categorical variable to avoid the dummy variable trap.
"""
y = cars_data[["price_log", "Price"]] # Target variable
We have already performed the X and y (training features and target variable) split above, now it is good time to split the data into training and test set using scikit-learn framework's Train Test Split function
# Splitting data into training and test set:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3, random_state = 1)
"""
random_state=1 (or any number) is a seed value for the random number generator. This seed ensures that the random shuffling and splitting of the data are reproducible,
producing the same results every time you run the code. This reproducibility is important because machine learning experiments must be comparable and replicable. If you don't
set the random_state, you will get different results each time you run the code, making it difficult to compare the outcomes of different experiments.
"""
print(X_train.shape, X_test.shape)
(4212, 264) (1806, 264)
Just to validate:
print(f"{round(X_train.shape[0] / X.shape[0] * 100, 0)}% of the data is in training set, and {round(X_test.shape[0] / X.shape[0] * 100, 0)}% of the data is in test set")
70.0% of the data is in training set, and 30.0% of the data is in test set
# Let us write a function for calculating r2_score and RMSE on train and test data.
# This function takes model as an input on which we have trained particular algorithm.
def get_model_score(model, flag = True):
'''
model : regressor to predict values of X
'''
# Defining an empty list to store train and test results
score_list = []
pred_train = model.predict(X_train) # Predict the y values of the training set
pred_train_ = np.exp(pred_train) # Predict exponentiated value of price as we have log transformed the values earlier due to high difference in price of the vehicles (e.g. Lamborghini)
pred_test = model.predict(X_test) # Predict price for the unseen data
pred_test_ = np.exp(pred_test) # Predict exponentiated value of price for unseen data as we have log transformed the values earlier due to high difference in price of the vehicles (e.g. Lamborghini)
train_r2 = metrics.r2_score(y_train['Price'], pred_train_) # Getting training R^2 values, while comparing Actual price and predicted price (training set)
test_r2 = metrics.r2_score(y_test['Price'], pred_test_) # Getting test R^2 values, while comparing Actual price and predicted price (test set)
"""
What is R^2 (R-squared)?
R-squared is a statistical measure (Goodness of the fit of the Model) that represents the proportion of the variance for a dependent variable
that's explained by an independent variable or variables in a regression model. It is also known as the coefficient of determination.
It is calculated as the ratio of the explained variance to the total variance, as the formula is:
R^2 = Explained Variance / Total Variance
- Explained variance is the variance of the dependent variable that is predictable from the independent variable(s). Explained variance is calculated as the
sum of squared differences between the actual values and the predicted values divided by the total sum of squared differences.
- Total Variance is the variance of the dependent variable due to its mean. It is calculated as the sum of squared differences between the actual values and the mean.
- Value of R^2 ranges from 0 to 1, where 0 represents that the model explains none of the variability of the response data (or dependent variable) around its mean, and 1
represents that the model explains all the variability of the response data around its mean.
"""
train_rmse = metrics.mean_squared_error(y_train['Price'], pred_train_, squared = False) # Training RMSE tells us what is the average squared error on prediction on training data, it can range from 0 to positive infinity.
test_rmse = metrics.mean_squared_error(y_test['Price'], pred_test_, squared = False) # Test RMSE tells us what is the average squared error on prediction on test data, it can range from 0 to positive infinity.
#Adding all scores in the list
score_list.extend((train_r2, test_r2, train_rmse, test_rmse))
# If the flag is set to True then only the following print statements will be dispayed, the default value is True
if flag == True:
print("R-square on training set : ", metrics.r2_score(y_train['Price'], pred_train_))
print("R-square on test set : ", metrics.r2_score(y_test['Price'], pred_test_))
print("RMSE on training set : ", np.sqrt(metrics.mean_squared_error(y_train['Price'], pred_train_)))
print("RMSE on test set : ", np.sqrt(metrics.mean_squared_error(y_test['Price'], pred_test_)))
# Returning the list with train and test scores
return score_list
Fitting a linear model¶
Linear Regression can be implemented using:
1) Scikit-learn: https://scikit-learn.org/stable/modules/generated/Scikit-learn.linear_model.LinearRegression.html
2) Statsmodels: https://www.statsmodels.org/stable/regression.html
# Initiating th linear regression model
lr = LinearRegression()
Fitting the data to train on the Linear Regression Model
lr.fit(X_train,y_train['price_log'])
LinearRegression()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
LinearRegression()
Getting the training and test scores that we defined above for the Linear Regression Model
LR_score = get_model_score(lr)
R-square on training set : 0.9400073865055051 R-square on test set : 0.8691021319136581 RMSE on training set : 2.7365296566447803 RMSE on test set : 4.032233968840713
Observation
- Linear regression has performed well on training and test set with no overfitting
Important variables of Linear Regression
X_train1 = X_train.astype(float) # Converting all the training features into float (decimal) type
y_train1 = y_train.astype(float) # Converting target variable as float type as well
Quick Notes:
The constant (also known as the intercept or bias term) is the value at which the regression line crosses the y-axis.
It represents the predicted value of the dependent variable (y) when all the independent variables (x) are equal to zero.
Mathematically, in a simple linear regression model, the equation is:
- x is the independent variable,
- b0 is the intercept (constant), and,
- b1 is the slope.
For example, if you are modeling the relationship between temperature (x) and energy consumption (y), the constant might represent the base level of energy consumption when the temperature is zero.
Ordinary Least Squares (OLS) model is a method used to estimate the unknown parameters (coefficients) in a linear regression model. Its goal is to find the best-fitting line (or hyperplane in multiple dimensions) that minimizes the sum of the squared differences between the observed values (actual data points) and the predicted values (values on the regression line).
# Import Statsmodels
import statsmodels.api as sm
# Statsmodel api does not add a constant by default. We need to add it explicitly
x_train = sm.add_constant(X_train1)
# Add constant to test data
x_test = sm.add_constant(X_test)
def build_ols_model(train):
# Create the model
olsmodel = sm.OLS(y_train1["price_log"], train)
return olsmodel.fit()
# Fit linear model on new dataset
olsmodel1 = build_ols_model(x_train)
print(olsmodel1.summary())
OLS Regression Results ============================================================================== Dep. Variable: price_log R-squared: 0.959 Model: OLS Adj. R-squared: 0.956 Method: Least Squares F-statistic: 406.8 Date: Tue, 04 Jun 2024 Prob (F-statistic): 0.00 Time: 06:44:20 Log-Likelihood: 1322.8 No. Observations: 4212 AIC: -2188. Df Residuals: 3983 BIC: -734.3 Df Model: 228 Covariance Type: nonrobust ============================================================================================= coef std err t P>|t| [0.025 0.975] --------------------------------------------------------------------------------------------- const -204.7993 2.869 -71.375 0.000 -210.425 -199.174 Year 0.1074 0.001 72.963 0.000 0.105 0.110 Mileage 0.0003 0.001 0.226 0.821 -0.003 0.003 Engine -8.439e-05 2.22e-05 -3.808 0.000 -0.000 -4.09e-05 Power 0.0025 0.000 10.448 0.000 0.002 0.003 Seats -0.0108 0.014 -0.791 0.429 -0.038 0.016 New_Price -0.0008 0.000 -2.218 0.027 -0.002 -9.53e-05 kilometers_driven_log -0.0740 0.006 -13.154 0.000 -0.085 -0.063 Location_Bangalore 0.1844 0.019 9.817 0.000 0.148 0.221 Location_Chennai 0.0590 0.018 3.290 0.001 0.024 0.094 Location_Coimbatore 0.1522 0.017 8.906 0.000 0.119 0.186 Location_Delhi -0.0818 0.017 -4.730 0.000 -0.116 -0.048 Location_Hyderabad 0.1472 0.017 8.844 0.000 0.115 0.180 Location_Jaipur -0.0195 0.018 -1.066 0.287 -0.055 0.016 Location_Kochi -0.0175 0.017 -1.027 0.304 -0.051 0.016 Location_Kolkata -0.2204 0.018 -12.584 0.000 -0.255 -0.186 Location_Mumbai -0.0508 0.017 -3.064 0.002 -0.083 -0.018 Location_Pune -0.0245 0.017 -1.431 0.153 -0.058 0.009 Fuel_Type_Diesel 0.0696 0.038 1.839 0.066 -0.005 0.144 Fuel_Type_Electric -0.2919 0.088 -3.324 0.001 -0.464 -0.120 Fuel_Type_LPG -0.0401 0.077 -0.520 0.603 -0.191 0.111 Fuel_Type_Petrol -0.0453 0.041 -1.092 0.275 -0.127 0.036 Transmission_Manual -0.1178 0.010 -11.526 0.000 -0.138 -0.098 Owner_Type_Fourth & Above -0.1149 0.087 -1.324 0.186 -0.285 0.055 Owner_Type_Second -0.0548 0.008 -6.506 0.000 -0.071 -0.038 Owner_Type_Third -0.1370 0.022 -6.205 0.000 -0.180 -0.094 Brand_audi -6.9896 0.112 -62.386 0.000 -7.209 -6.770 Brand_bentley -3.3775 0.111 -30.323 0.000 -3.596 -3.159 Brand_bmw -8.2878 0.157 -52.668 0.000 -8.596 -7.979 Brand_chevrolet -8.3980 0.113 -74.113 0.000 -8.620 -8.176 Brand_datsun -7.4485 0.108 -68.770 0.000 -7.661 -7.236 Brand_fiat -8.1528 0.112 -73.011 0.000 -8.372 -7.934 Brand_force -4.2311 0.090 -46.758 0.000 -4.409 -4.054 Brand_ford -7.9653 0.112 -70.957 0.000 -8.185 -7.745 Brand_honda -8.2572 0.115 -72.084 0.000 -8.482 -8.033 Brand_hyundai -9.2683 0.169 -54.974 0.000 -9.599 -8.938 Brand_isuzu -5.7130 0.114 -50.284 0.000 -5.936 -5.490 Brand_jaguar -5.5929 0.105 -53.193 0.000 -5.799 -5.387 Brand_jeep -4.2215 0.068 -61.884 0.000 -4.355 -4.088 Brand_lamborghini -3.2359 0.114 -28.484 0.000 -3.459 -3.013 Brand_land -3.7833 0.064 -58.834 0.000 -3.909 -3.657 Brand_mahindra -8.4656 0.121 -69.799 0.000 -8.703 -8.228 Brand_maruti -8.5984 0.134 -64.263 0.000 -8.861 -8.336 Brand_mercedes-benz -7.3640 0.131 -56.227 0.000 -7.621 -7.107 Brand_mini -5.9229 0.111 -53.168 0.000 -6.141 -5.704 Brand_mitsubishi -6.7043 0.113 -59.378 0.000 -6.926 -6.483 Brand_nissan -7.7197 0.114 -67.791 0.000 -7.943 -7.496 Brand_porsche -5.4476 0.106 -51.627 0.000 -5.654 -5.241 Brand_renault -8.1252 0.113 -71.616 0.000 -8.348 -7.903 Brand_skoda -7.6154 0.105 -72.810 0.000 -7.820 -7.410 Brand_smart -4.5567 0.110 -41.395 0.000 -4.773 -4.341 Brand_tata -8.4660 0.147 -57.617 0.000 -8.754 -8.178 Brand_toyota -7.2644 0.112 -64.743 0.000 -7.484 -7.044 Brand_volkswagen -7.7860 0.112 -69.658 0.000 -8.005 -7.567 Brand_volvo -6.7937 0.113 -60.068 0.000 -7.015 -6.572 Model_1000 -1.823e-14 5.5e-16 -33.117 0.000 -1.93e-14 -1.71e-14 Model_3 0.1230 0.108 1.140 0.254 -0.088 0.335 Model_5 0.4142 0.109 3.808 0.000 0.201 0.628 Model_6 0.8131 0.154 5.271 0.000 0.511 1.116 Model_7 0.8413 0.124 6.764 0.000 0.597 1.085 Model_800 -1.4007 0.092 -15.159 0.000 -1.582 -1.220 Model_a -0.8401 0.107 -7.824 0.000 -1.051 -0.630 Model_a-star -0.8171 0.086 -9.527 0.000 -0.985 -0.649 Model_a3 -1.2074 0.089 -13.610 0.000 -1.381 -1.033 Model_a4 -1.1067 0.040 -27.784 0.000 -1.185 -1.029 Model_a6 -0.9714 0.042 -23.039 0.000 -1.054 -0.889 Model_a7 -1.68e-16 5.54e-16 -0.303 0.762 -1.25e-15 9.18e-16 Model_a8 -0.0516 0.166 -0.311 0.756 -0.377 0.274 Model_accent -0.2909 0.135 -2.162 0.031 -0.555 -0.027 Model_accord -0.5406 0.049 -11.000 0.000 -0.637 -0.444 Model_alto -1.0874 0.064 -16.966 0.000 -1.213 -0.962 Model_amaze -1.0072 0.033 -30.918 0.000 -1.071 -0.943 Model_ameo -1.4926 0.056 -26.690 0.000 -1.602 -1.383 Model_aspire -1.1755 0.090 -13.013 0.000 -1.353 -0.998 Model_aveo -1.1875 0.061 -19.542 0.000 -1.307 -1.068 Model_avventura -1.0241 0.102 -10.009 0.000 -1.225 -0.823 Model_b -0.9202 0.102 -8.985 0.000 -1.121 -0.719 Model_baleno -0.5884 0.067 -8.808 0.000 -0.719 -0.457 Model_beat -1.2267 0.044 -27.780 0.000 -1.313 -1.140 Model_beetle 1.612e-15 5.86e-16 2.750 0.006 4.63e-16 2.76e-15 Model_bolero -0.3633 0.065 -5.574 0.000 -0.491 -0.236 Model_bolt -1.0922 0.142 -7.704 0.000 -1.370 -0.814 Model_boxster -1.69e-14 1.71e-15 -9.879 0.000 -2.03e-14 -1.35e-14 Model_br-v -0.7631 0.122 -6.247 0.000 -1.003 -0.524 Model_brio -1.1123 0.038 -29.314 0.000 -1.187 -1.038 Model_brv -0.6689 0.081 -8.223 0.000 -0.828 -0.509 Model_c-class -0.7099 0.148 -4.789 0.000 -1.001 -0.419 Model_camry -0.9666 0.078 -12.348 0.000 -1.120 -0.813 Model_captiva -0.5826 0.167 -3.495 0.000 -0.909 -0.256 Model_captur -0.7756 0.120 -6.482 0.000 -1.010 -0.541 Model_cayenne -2.6297 0.082 -31.878 0.000 -2.791 -2.468 Model_cayman -1.2372 0.149 -8.331 0.000 -1.528 -0.946 Model_cedia -6.29e-16 2.24e-16 -2.806 0.005 -1.07e-15 -1.89e-16 Model_celerio -0.8901 0.067 -13.241 0.000 -1.022 -0.758 Model_ciaz -0.3791 0.066 -5.709 0.000 -0.509 -0.249 Model_city -0.6959 0.027 -25.631 0.000 -0.749 -0.643 Model_civic -0.7800 0.040 -19.272 0.000 -0.859 -0.701 Model_cla -0.6842 0.087 -7.848 0.000 -0.855 -0.513 Model_classic -9.0467 0.211 -42.848 0.000 -9.461 -8.633 Model_cls-class -0.1079 0.192 -0.563 0.574 -0.484 0.268 Model_clubman -1.7932 0.148 -12.113 0.000 -2.083 -1.503 Model_compass -4.2215 0.068 -61.884 0.000 -4.355 -4.088 Model_continental -3.3775 0.111 -30.323 0.000 -3.596 -3.159 Model_cooper -1.9036 0.079 -23.953 0.000 -2.059 -1.748 Model_corolla -1.4742 0.041 -35.978 0.000 -1.555 -1.394 Model_countryman -2.2261 0.148 -14.992 0.000 -2.517 -1.935 Model_cr-v -0.1752 0.044 -3.969 0.000 -0.262 -0.089 Model_creta 0.5782 0.126 4.598 0.000 0.332 0.825 Model_crosspolo -1.4659 0.117 -12.546 0.000 -1.695 -1.237 Model_cruze -0.7163 0.063 -11.422 0.000 -0.839 -0.593 Model_d-max -3.1574 0.114 -27.755 0.000 -3.380 -2.934 Model_duster -0.8022 0.043 -18.733 0.000 -0.886 -0.718 Model_dzire -0.4962 0.082 -6.045 0.000 -0.657 -0.335 Model_e 3.575e-15 3.99e-16 8.951 0.000 2.79e-15 4.36e-15 Model_e-class -0.5518 0.072 -7.675 0.000 -0.693 -0.411 Model_ecosport -1.0022 0.043 -23.297 0.000 -1.086 -0.918 Model_eeco -0.9966 0.084 -11.831 0.000 -1.162 -0.831 Model_elantra 0.5944 0.132 4.508 0.000 0.336 0.853 Model_elite 0.1870 0.133 1.409 0.159 -0.073 0.447 Model_endeavour -0.2945 0.060 -4.910 0.000 -0.412 -0.177 Model_enjoy -0.9363 0.073 -12.790 0.000 -1.080 -0.793 Model_eon -0.4045 0.124 -3.251 0.001 -0.648 -0.161 Model_ertiga -0.2712 0.073 -3.694 0.000 -0.415 -0.127 Model_esteem -1.1211 0.101 -11.051 0.000 -1.320 -0.922 Model_estilo -0.8232 0.121 -6.809 0.000 -1.060 -0.586 Model_etios -1.9397 0.044 -43.647 0.000 -2.027 -1.853 Model_evalia -1.6157 0.163 -9.941 0.000 -1.934 -1.297 Model_f -1.6843 0.148 -11.417 0.000 -1.974 -1.395 Model_fabia -1.7994 0.060 -30.047 0.000 -1.917 -1.682 Model_fiesta -1.3316 0.049 -27.082 0.000 -1.428 -1.235 Model_figo -1.4478 0.043 -33.662 0.000 -1.532 -1.363 Model_fluence -1.0464 0.099 -10.520 0.000 -1.241 -0.851 Model_fortuner -0.6911 0.041 -16.747 0.000 -0.772 -0.610 Model_fortwo -4.5567 0.110 -41.395 0.000 -4.773 -4.341 Model_freestyle -0.4140 0.167 -2.473 0.013 -0.742 -0.086 Model_fusion -1.0844 0.167 -6.495 0.000 -1.412 -0.757 Model_gallardo -3.2359 0.114 -28.484 0.000 -3.459 -3.013 Model_getz -0.2862 0.136 -2.099 0.036 -0.554 -0.019 Model_gl-class 0.0659 0.095 0.691 0.490 -0.121 0.253 Model_gla -0.5936 0.090 -6.582 0.000 -0.770 -0.417 Model_glc -0.2582 0.097 -2.673 0.008 -0.448 -0.069 Model_gle -0.0682 0.092 -0.742 0.458 -0.248 0.112 Model_gls 0.0771 0.197 0.391 0.696 -0.309 0.463 Model_go -2.2815 0.100 -22.814 0.000 -2.478 -2.085 Model_grand -0.0851 0.121 -0.703 0.482 -0.322 0.152 Model_grande -1.3268 0.102 -13.007 0.000 -1.527 -1.127 Model_hexa -0.1296 0.200 -0.647 0.518 -0.523 0.263 Model_i10 -0.0728 0.123 -0.593 0.553 -0.314 0.168 Model_i20 0.1182 0.123 0.962 0.336 -0.123 0.359 Model_ignis -0.9215 0.121 -7.646 0.000 -1.158 -0.685 Model_ikon -1.5584 0.063 -24.543 0.000 -1.683 -1.434 Model_indica -1.4375 0.101 -14.196 0.000 -1.636 -1.239 Model_indigo -1.3363 0.104 -12.888 0.000 -1.540 -1.133 Model_innova -1.0172 0.041 -25.069 0.000 -1.097 -0.938 Model_jazz -0.9166 0.037 -25.075 0.000 -0.988 -0.845 Model_jeep -0.1972 0.125 -1.576 0.115 -0.443 0.048 Model_jetta -0.8783 0.051 -17.159 0.000 -0.979 -0.778 Model_koleos -0.4908 0.101 -4.870 0.000 -0.688 -0.293 Model_kuv -1.0072 0.082 -12.271 0.000 -1.168 -0.846 Model_kwid -1.6637 0.049 -34.047 0.000 -1.759 -1.568 Model_lancer -1.9836 0.119 -16.667 0.000 -2.217 -1.750 Model_laura -1.2952 0.040 -32.360 0.000 -1.374 -1.217 Model_linea -1.2098 0.074 -16.310 0.000 -1.355 -1.064 Model_lodgy -0.8662 0.169 -5.137 0.000 -1.197 -0.536 Model_logan -1.1625 0.125 -9.291 0.000 -1.408 -0.917 Model_m-class -0.2968 0.084 -3.519 0.000 -0.462 -0.131 Model_manza -1.1427 0.110 -10.385 0.000 -1.358 -0.927 Model_micra -1.6429 0.057 -28.909 0.000 -1.754 -1.532 Model_mobilio -0.7984 0.062 -12.937 0.000 -0.919 -0.677 Model_montero -1.3707 0.156 -8.760 0.000 -1.677 -1.064 Model_mustang 0.3428 0.177 1.938 0.053 -0.004 0.690 Model_mux -2.5557 0.137 -18.628 0.000 -2.825 -2.287 Model_nano -1.8457 0.113 -16.384 0.000 -2.067 -1.625 Model_new -0.6929 0.071 -9.821 0.000 -0.831 -0.555 Model_nexon -0.5170 0.203 -2.540 0.011 -0.916 -0.118 Model_nuvosport -0.8309 0.124 -6.683 0.000 -1.075 -0.587 Model_octavia -1.1232 0.040 -28.272 0.000 -1.201 -1.045 Model_omni -1.2057 0.079 -15.268 0.000 -1.360 -1.051 Model_one -4.2311 0.090 -46.758 0.000 -4.409 -4.054 Model_optra -0.9481 0.058 -16.227 0.000 -1.063 -0.834 Model_outlander -1.8888 0.155 -12.175 0.000 -2.193 -1.585 Model_pajero -1.4611 0.078 -18.783 0.000 -1.614 -1.309 Model_panamera -1.5807 0.086 -18.384 0.000 -1.749 -1.412 Model_passat -0.9590 0.079 -12.191 0.000 -1.113 -0.805 Model_petra -1.5907 0.161 -9.873 0.000 -1.907 -1.275 Model_platinum 1.898e-16 7.58e-17 2.503 0.012 4.11e-17 3.39e-16 Model_polo -1.4389 0.039 -37.349 0.000 -1.514 -1.363 Model_prius -0.2919 0.088 -3.324 0.001 -0.464 -0.120 Model_pulse -1.2751 0.089 -14.386 0.000 -1.449 -1.101 Model_punto -1.4477 0.102 -14.212 0.000 -1.647 -1.248 Model_q3 -1.0791 0.052 -20.934 0.000 -1.180 -0.978 Model_q5 -0.7773 0.050 -15.619 0.000 -0.875 -0.680 Model_q7 -0.5579 0.055 -10.086 0.000 -0.666 -0.449 Model_qualis -0.8837 0.127 -6.975 0.000 -1.132 -0.635 Model_quanto -0.9081 0.090 -10.082 0.000 -1.085 -0.732 Model_r-class -0.3644 0.127 -2.872 0.004 -0.613 -0.116 Model_rapid -1.4737 0.038 -38.721 0.000 -1.548 -1.399 Model_redi -2.6634 0.144 -18.553 0.000 -2.945 -2.382 Model_redi-go -2.5036 0.086 -28.969 0.000 -2.673 -2.334 Model_renault -0.7532 0.173 -4.347 0.000 -1.093 -0.413 Model_ritz -0.7469 0.067 -11.166 0.000 -0.878 -0.616 Model_rover -3.7833 0.064 -58.834 0.000 -3.909 -3.657 Model_rs5 -0.6967 0.131 -5.312 0.000 -0.954 -0.440 Model_s -0.3133 0.064 -4.923 0.000 -0.438 -0.189 Model_s-class -0.2231 0.112 -1.988 0.047 -0.443 -0.003 Model_s-cross -0.4576 0.190 -2.412 0.016 -0.830 -0.086 Model_s60 -1.3785 0.081 -16.944 0.000 -1.538 -1.219 Model_s80 -1.8788 0.158 -11.902 0.000 -2.188 -1.569 Model_safari -0.4758 0.120 -3.974 0.000 -0.711 -0.241 Model_sail -1.0273 0.070 -14.642 0.000 -1.165 -0.890 Model_santa 0.7828 0.142 5.530 0.000 0.505 1.060 Model_santro -0.2319 0.126 -1.847 0.065 -0.478 0.014 Model_scala -1.2052 0.088 -13.678 0.000 -1.378 -1.032 Model_scorpio -0.2138 0.043 -5.010 0.000 -0.297 -0.130 Model_siena -1.5538 0.163 -9.535 0.000 -1.873 -1.234 Model_sl-class 0.1680 0.198 0.847 0.397 -0.221 0.557 Model_slc -0.2620 0.153 -1.714 0.087 -0.562 0.038 Model_slk-class -0.0643 0.130 -0.494 0.622 -0.320 0.191 Model_sonata 0.6524 0.150 4.349 0.000 0.358 0.947 Model_spark -1.3214 0.074 -17.796 0.000 -1.467 -1.176 Model_ssangyong -0.0126 0.063 -0.199 0.843 -0.137 0.112 Model_sumo -0.5744 0.122 -4.722 0.000 -0.813 -0.336 Model_sunny -1.4551 0.057 -25.477 0.000 -1.567 -1.343 Model_superb -0.9511 0.036 -26.388 0.000 -1.022 -0.880 Model_swift -0.5651 0.062 -9.086 0.000 -0.687 -0.443 Model_sx4 -0.5337 0.070 -7.623 0.000 -0.671 -0.396 Model_tavera -0.4519 0.133 -3.391 0.001 -0.713 -0.191 Model_teana -1.0554 0.162 -6.523 0.000 -1.373 -0.738 Model_terrano -1.2352 0.057 -21.599 0.000 -1.347 -1.123 Model_thar -0.4506 0.082 -5.462 0.000 -0.612 -0.289 Model_tiago -1.1624 0.117 -9.933 0.000 -1.392 -0.933 Model_tigor -1.0043 0.133 -7.562 0.000 -1.265 -0.744 Model_tiguan -0.2602 0.162 -1.605 0.109 -0.578 0.058 Model_tt -0.5414 0.122 -4.437 0.000 -0.781 -0.302 Model_tucson 0.7237 0.165 4.394 0.000 0.401 1.047 Model_tuv -0.6637 0.071 -9.344 0.000 -0.803 -0.524 Model_v40 -1.2900 0.102 -12.658 0.000 -1.490 -1.090 Model_vento -1.2911 0.039 -33.337 0.000 -1.367 -1.215 Model_venture -0.9705 0.202 -4.800 0.000 -1.367 -0.574 Model_verito -0.9264 0.104 -8.926 0.000 -1.130 -0.723 Model_verna 0.2474 0.124 1.988 0.047 0.003 0.491 Model_versa -0.5017 0.195 -2.573 0.010 -0.884 -0.119 Model_vitara -0.3659 0.070 -5.212 0.000 -0.504 -0.228 Model_wagon -0.8371 0.064 -13.106 0.000 -0.962 -0.712 Model_wr-v 0 0 nan nan 0 0 Model_wrv -0.7992 0.168 -4.749 0.000 -1.129 -0.469 Model_x-trail -0.7154 0.118 -6.048 0.000 -0.947 -0.483 Model_x1 0.1037 0.112 0.924 0.356 -0.116 0.324 Model_x3 0.4509 0.119 3.781 0.000 0.217 0.685 Model_x5 0.7195 0.117 6.169 0.000 0.491 0.948 Model_x6 0.9304 0.136 6.858 0.000 0.664 1.196 Model_xc60 -1.3175 0.086 -15.330 0.000 -1.486 -1.149 Model_xc90 -0.9290 0.161 -5.785 0.000 -1.244 -0.614 Model_xcent -0.0695 0.126 -0.552 0.581 -0.316 0.177 Model_xe 0 0 nan nan 0 0 Model_xenon -0.9033 0.139 -6.507 0.000 -1.175 -0.631 Model_xf -2.2291 0.068 -32.760 0.000 -2.362 -2.096 Model_xj -1.6795 0.083 -20.155 0.000 -1.843 -1.516 Model_xuv300 -0.1859 0.173 -1.071 0.284 -0.526 0.154 Model_xuv500 -0.1080 0.036 -3.021 0.003 -0.178 -0.038 Model_xylo -0.6824 0.058 -11.714 0.000 -0.797 -0.568 Model_yeti -0.9727 0.068 -14.293 0.000 -1.106 -0.839 Model_z4 0.8272 0.216 3.825 0.000 0.403 1.251 Model_zen -0.9383 0.074 -12.758 0.000 -1.082 -0.794 Model_zest -0.9637 0.107 -8.987 0.000 -1.174 -0.753 ============================================================================== Omnibus: 1870.207 Durbin-Watson: 2.019 Prob(Omnibus): 0.000 Jarque-Bera (JB): 100382.388 Skew: -1.336 Prob(JB): 0.00 Kurtosis: 26.766 Cond. No. 7.49e+19 ============================================================================== Notes: [1] Standard Errors assume that the covariance matrix of the errors is correctly specified. [2] The smallest eigenvalue is 5.15e-30. This might indicate that there are strong multicollinearity problems or that the design matrix is singular.
# Calculate Odds Ratio and probability.
# Create a data frame to collate Odds ratio, probability, and p-value of the coefficients.
olsmod = pd.DataFrame(olsmodel1.params, columns = ['coef'])
olsmod['pval'] = olsmodel1.pvalues
# Filter by significant p-value (pval <0.05) and sort descending by Odds ratio
olsmod = olsmod.sort_values(by = "pval", ascending = False)
pval_filter = olsmod['pval']<= 0.05
olsmod[pval_filter]
coef | pval | |
---|---|---|
Model_s-class | -0.22 | 0.05 |
Model_verna | 0.25 | 0.05 |
Model_getz | -0.29 | 0.04 |
Model_accent | -0.29 | 0.03 |
New_Price | -0.00 | 0.03 |
Model_s-cross | -0.46 | 0.02 |
Model_freestyle | -0.41 | 0.01 |
Model_platinum | 0.00 | 0.01 |
Model_nexon | -0.52 | 0.01 |
Model_versa | -0.50 | 0.01 |
Model_glc | -0.26 | 0.01 |
Model_beetle | 0.00 | 0.01 |
Model_cedia | -0.00 | 0.01 |
Model_r-class | -0.36 | 0.00 |
Model_xuv500 | -0.11 | 0.00 |
Location_Mumbai | -0.05 | 0.00 |
Model_eon | -0.40 | 0.00 |
Location_Chennai | 0.06 | 0.00 |
Model_prius | -0.29 | 0.00 |
Fuel_Type_Electric | -0.29 | 0.00 |
Model_tavera | -0.45 | 0.00 |
Model_captiva | -0.58 | 0.00 |
Model_m-class | -0.30 | 0.00 |
Model_ertiga | -0.27 | 0.00 |
Model_x3 | 0.45 | 0.00 |
Model_5 | 0.41 | 0.00 |
Engine | -0.00 | 0.00 |
Model_z4 | 0.83 | 0.00 |
Model_cr-v | -0.18 | 0.00 |
Model_safari | -0.48 | 0.00 |
Model_renault | -0.75 | 0.00 |
Model_sonata | 0.65 | 0.00 |
Model_tucson | 0.72 | 0.00 |
Model_tt | -0.54 | 0.00 |
Model_elantra | 0.59 | 0.00 |
Model_creta | 0.58 | 0.00 |
Model_sumo | -0.57 | 0.00 |
Location_Delhi | -0.08 | 0.00 |
Model_wrv | -0.80 | 0.00 |
Model_c-class | -0.71 | 0.00 |
Model_venture | -0.97 | 0.00 |
Model_koleos | -0.49 | 0.00 |
Model_endeavour | -0.29 | 0.00 |
Model_s | -0.31 | 0.00 |
Model_scorpio | -0.21 | 0.00 |
Model_lodgy | -0.87 | 0.00 |
Model_vitara | -0.37 | 0.00 |
Model_6 | 0.81 | 0.00 |
Model_rs5 | -0.70 | 0.00 |
Model_thar | -0.45 | 0.00 |
Model_santa | 0.78 | 0.00 |
Model_bolero | -0.36 | 0.00 |
Model_ciaz | -0.38 | 0.00 |
Model_xc90 | -0.93 | 0.00 |
Model_dzire | -0.50 | 0.00 |
Model_x-trail | -0.72 | 0.00 |
Model_x5 | 0.72 | 0.00 |
Owner_Type_Third | -0.14 | 0.00 |
Model_br-v | -0.76 | 0.00 |
Model_captur | -0.78 | 0.00 |
Model_fusion | -1.08 | 0.00 |
Owner_Type_Second | -0.05 | 0.00 |
Model_xenon | -0.90 | 0.00 |
Model_teana | -1.06 | 0.00 |
Model_gla | -0.59 | 0.00 |
Model_nuvosport | -0.83 | 0.00 |
Model_7 | 0.84 | 0.00 |
Model_estilo | -0.82 | 0.00 |
Model_x6 | 0.93 | 0.00 |
Model_qualis | -0.88 | 0.00 |
Model_tigor | -1.00 | 0.00 |
Model_sx4 | -0.53 | 0.00 |
Model_ignis | -0.92 | 0.00 |
Model_e-class | -0.55 | 0.00 |
Model_bolt | -1.09 | 0.00 |
Model_a | -0.84 | 0.00 |
Model_cla | -0.68 | 0.00 |
Model_brv | -0.67 | 0.00 |
Model_cayman | -1.24 | 0.00 |
Model_montero | -1.37 | 0.00 |
Model_baleno | -0.59 | 0.00 |
Location_Hyderabad | 0.15 | 0.00 |
Location_Coimbatore | 0.15 | 0.00 |
Model_verito | -0.93 | 0.00 |
Model_e | 0.00 | 0.00 |
Model_b | -0.92 | 0.00 |
Model_zest | -0.96 | 0.00 |
Model_swift | -0.57 | 0.00 |
Model_logan | -1.16 | 0.00 |
Model_tuv | -0.66 | 0.00 |
Model_a-star | -0.82 | 0.00 |
Model_siena | -1.55 | 0.00 |
Location_Bangalore | 0.18 | 0.00 |
Model_new | -0.69 | 0.00 |
Model_petra | -1.59 | 0.00 |
Model_boxster | -0.00 | 0.00 |
Model_tiago | -1.16 | 0.00 |
Model_evalia | -1.62 | 0.00 |
Model_avventura | -1.02 | 0.00 |
Model_quanto | -0.91 | 0.00 |
Model_q7 | -0.56 | 0.00 |
Model_manza | -1.14 | 0.00 |
Power | 0.00 | 0.00 |
Model_fluence | -1.05 | 0.00 |
Model_accord | -0.54 | 0.00 |
Model_esteem | -1.12 | 0.00 |
Model_ritz | -0.75 | 0.00 |
Model_f | -1.68 | 0.00 |
Model_cruze | -0.72 | 0.00 |
Transmission_Manual | -0.12 | 0.00 |
Model_xylo | -0.68 | 0.00 |
Model_eeco | -1.00 | 0.00 |
Model_s80 | -1.88 | 0.00 |
Model_clubman | -1.79 | 0.00 |
Model_outlander | -1.89 | 0.00 |
Model_passat | -0.96 | 0.00 |
Model_kuv | -1.01 | 0.00 |
Model_camry | -0.97 | 0.00 |
Model_crosspolo | -1.47 | 0.00 |
Location_Kolkata | -0.22 | 0.00 |
Model_v40 | -1.29 | 0.00 |
Model_zen | -0.94 | 0.00 |
Model_enjoy | -0.94 | 0.00 |
Model_indigo | -1.34 | 0.00 |
Model_mobilio | -0.80 | 0.00 |
Model_grande | -1.33 | 0.00 |
Model_aspire | -1.18 | 0.00 |
Model_wagon | -0.84 | 0.00 |
kilometers_driven_log | -0.07 | 0.00 |
Model_celerio | -0.89 | 0.00 |
Model_a3 | -1.21 | 0.00 |
Model_scala | -1.21 | 0.00 |
Model_indica | -1.44 | 0.00 |
Model_punto | -1.45 | 0.00 |
Model_yeti | -0.97 | 0.00 |
Model_pulse | -1.28 | 0.00 |
Model_sail | -1.03 | 0.00 |
Model_countryman | -2.23 | 0.00 |
Model_800 | -1.40 | 0.00 |
Model_omni | -1.21 | 0.00 |
Model_xc60 | -1.32 | 0.00 |
Model_q5 | -0.78 | 0.00 |
Model_optra | -0.95 | 0.00 |
Model_linea | -1.21 | 0.00 |
Model_nano | -1.85 | 0.00 |
Model_lancer | -1.98 | 0.00 |
Model_fortuner | -0.69 | 0.00 |
Model_s60 | -1.38 | 0.00 |
Model_alto | -1.09 | 0.00 |
Model_jetta | -0.88 | 0.00 |
Model_spark | -1.32 | 0.00 |
Model_panamera | -1.58 | 0.00 |
Model_redi | -2.66 | 0.00 |
Model_mux | -2.56 | 0.00 |
Model_duster | -0.80 | 0.00 |
Model_pajero | -1.46 | 0.00 |
Model_civic | -0.78 | 0.00 |
Model_aveo | -1.19 | 0.00 |
Model_xj | -1.68 | 0.00 |
Model_q3 | -1.08 | 0.00 |
Model_terrano | -1.24 | 0.00 |
Model_go | -2.28 | 0.00 |
Model_a6 | -0.97 | 0.00 |
Model_ecosport | -1.00 | 0.00 |
Model_cooper | -1.90 | 0.00 |
Model_ikon | -1.56 | 0.00 |
Model_innova | -1.02 | 0.00 |
Model_jazz | -0.92 | 0.00 |
Model_sunny | -1.46 | 0.00 |
Model_city | -0.70 | 0.00 |
Model_superb | -0.95 | 0.00 |
Model_ameo | -1.49 | 0.00 |
Model_fiesta | -1.33 | 0.00 |
Model_d-max | -3.16 | 0.00 |
Model_beat | -1.23 | 0.00 |
Model_a4 | -1.11 | 0.00 |
Model_octavia | -1.12 | 0.00 |
Brand_lamborghini | -3.24 | 0.00 |
Model_gallardo | -3.24 | 0.00 |
Model_micra | -1.64 | 0.00 |
Model_redi-go | -2.50 | 0.00 |
Model_brio | -1.11 | 0.00 |
Model_fabia | -1.80 | 0.00 |
Brand_bentley | -3.38 | 0.00 |
Model_continental | -3.38 | 0.00 |
Model_amaze | -1.01 | 0.00 |
Model_cayenne | -2.63 | 0.00 |
Model_laura | -1.30 | 0.00 |
Model_xf | -2.23 | 0.00 |
Model_1000 | -0.00 | 0.00 |
Model_vento | -1.29 | 0.00 |
Model_figo | -1.45 | 0.00 |
Model_kwid | -1.66 | 0.00 |
Model_corolla | -1.47 | 0.00 |
Model_polo | -1.44 | 0.00 |
Model_rapid | -1.47 | 0.00 |
Brand_smart | -4.56 | 0.00 |
Model_fortwo | -4.56 | 0.00 |
Brand_ford | -7.97 | 0.00 |
Brand_force | -4.23 | 0.00 |
Brand_fiat | -8.15 | 0.00 |
Brand_datsun | -7.45 | 0.00 |
Brand_chevrolet | -8.40 | 0.00 |
Brand_audi | -6.99 | 0.00 |
Brand_bmw | -8.29 | 0.00 |
Brand_toyota | -7.26 | 0.00 |
Brand_volkswagen | -7.79 | 0.00 |
Brand_volvo | -6.79 | 0.00 |
Model_etios | -1.94 | 0.00 |
Year | 0.11 | 0.00 |
Brand_honda | -8.26 | 0.00 |
Brand_tata | -8.47 | 0.00 |
Brand_hyundai | -9.27 | 0.00 |
Brand_mercedes-benz | -7.36 | 0.00 |
Brand_skoda | -7.62 | 0.00 |
Brand_renault | -8.13 | 0.00 |
Brand_porsche | -5.45 | 0.00 |
Model_classic | -9.05 | 0.00 |
Brand_nissan | -7.72 | 0.00 |
Brand_mitsubishi | -6.70 | 0.00 |
Brand_mini | -5.92 | 0.00 |
Brand_maruti | -8.60 | 0.00 |
Brand_isuzu | -5.71 | 0.00 |
Brand_mahindra | -8.47 | 0.00 |
Brand_land | -3.78 | 0.00 |
Model_one | -4.23 | 0.00 |
Model_rover | -3.78 | 0.00 |
Model_compass | -4.22 | 0.00 |
Brand_jeep | -4.22 | 0.00 |
Brand_jaguar | -5.59 | 0.00 |
const | -204.80 | 0.00 |
# We are looking for overall significant variables.
pval_filter = olsmod['pval']<= 0.05
imp_vars = olsmod[pval_filter].index.tolist()
# We are going to retrieve the original variables (non-one-hot encoded variables) from categorical variables.
sig_var = []
for col in imp_vars:
if '' in col:
first_part = col.split('_')[0]
for c in data.columns:
if first_part in c and c not in sig_var :
sig_var.append(c)
start = '\033[1m'
end = '\033[95m'
print(start+'Most overall significant categorical varaibles of LINEAR REGRESSION are '+end,':\n',sig_var)
Most overall significant categorical varaibles of LINEAR REGRESSION are : ['Model', 'New_Price', 'Location', 'Fuel_Type', 'Engine', 'Owner_Type', 'Power', 'Transmission', 'kilometers_driven_log', 'Brand', 'Year']
Ridge Regression¶
Also Known as L2 Regularization, shrinks the coefficients evenly but does not necessarily bring them to zero. This means that less significant features will still have some influence on the final prediction. L2 regularization can help reduce model complexity but may be less robust to outliers.
Initializing the Ridge Regression Model
rdg = Ridge()
Fitting the training data into Ridge Regression Model
rdg.fit(X_train,y_train['price_log'])
Ridge()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
Ridge()
Looking at the performance scores from Ridge Regression
Ridge_score = get_model_score(rdg)
R-square on training set : 0.930779949829479 R-square on test set : 0.8945228764084663 RMSE on training set : 2.9394577553162953 RMSE on test set : 3.6195833034782705
Observation
- Ridge regression is able to generalize well compared to Linear Regression
Decision Tree¶
Initializing the Decision Tree Regressor Machine Learning model
dtree = DecisionTreeRegressor(random_state = 1)
Fitting the data into a DecisionTree regressor model
dtree.fit(X_train,y_train['price_log'])
DecisionTreeRegressor(random_state=1)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
DecisionTreeRegressor(random_state=1)
Getting the Performance Score for Decision Tree Model
Dtree_model = get_model_score(dtree)
R-square on training set : 0.9999965696959587 R-square on test set : 0.8169104136392586 RMSE on training set : 0.020692719736775493 RMSE on test set : 4.768823610637629
Observation
- Decision Tree is overfitting on the training set and hence not able to generalize well on the test set
# Importance of features in the tree building ( The importance of a feature is computed as the
# (normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance )
print(pd.DataFrame(dtree.feature_importances_, columns = ["Imp"], index = X_train.columns).sort_values(by = 'Imp', ascending = False))
Imp Power 0.61 Year 0.23 Engine 0.04 Mileage 0.02 kilometers_driven_log 0.01 New_Price 0.01 Transmission_Manual 0.00 Brand_tata 0.00 Location_Kolkata 0.00 Brand_honda 0.00 Brand_audi 0.00 Brand_mini 0.00 Brand_skoda 0.00 Location_Hyderabad 0.00 Brand_land 0.00 Fuel_Type_Petrol 0.00 Location_Coimbatore 0.00 Brand_mahindra 0.00 Location_Delhi 0.00 Owner_Type_Second 0.00 Brand_volkswagen 0.00 Model_5 0.00 Brand_toyota 0.00 Brand_hyundai 0.00 Seats 0.00 Location_Mumbai 0.00 Model_creta 0.00 Brand_mercedes-benz 0.00 Location_Bangalore 0.00 Owner_Type_Third 0.00 Model_swift 0.00 Location_Jaipur 0.00 Brand_bmw 0.00 Model_innova 0.00 Location_Chennai 0.00 Fuel_Type_Diesel 0.00 Location_Pune 0.00 Location_Kochi 0.00 Brand_chevrolet 0.00 Model_ertiga 0.00 Model_freestyle 0.00 Model_city 0.00 Model_xuv500 0.00 Model_i20 0.00 Model_nano 0.00 Model_scorpio 0.00 Model_q5 0.00 Fuel_Type_Electric 0.00 Model_3 0.00 Model_beat 0.00 Model_amaze 0.00 Model_ikon 0.00 Model_santa 0.00 Model_i10 0.00 Brand_ford 0.00 Model_800 0.00 Model_manza 0.00 Brand_maruti 0.00 Model_compass 0.00 Model_elantra 0.00 Model_figo 0.00 Model_new 0.00 Model_xenon 0.00 Model_fabia 0.00 Model_x5 0.00 Model_brio 0.00 Model_indica 0.00 Model_indigo 0.00 Model_esteem 0.00 Model_cruze 0.00 Model_getz 0.00 Model_punto 0.00 Model_ecosport 0.00 Model_sx4 0.00 Model_celerio 0.00 Model_xcent 0.00 Model_polo 0.00 Model_a4 0.00 Model_s 0.00 Model_rover 0.00 Model_etios 0.00 Model_grand 0.00 Model_accord 0.00 Model_eeco 0.00 Model_m-class 0.00 Model_elite 0.00 Model_sunny 0.00 Model_sail 0.00 Model_zen 0.00 Model_fiesta 0.00 Brand_volvo 0.00 Model_superb 0.00 Brand_renault 0.00 Model_ritz 0.00 Model_omni 0.00 Model_s80 0.00 Model_alto 0.00 Model_octavia 0.00 Model_grande 0.00 Model_fluence 0.00 Model_terrano 0.00 Model_corolla 0.00 Brand_nissan 0.00 Model_x6 0.00 Model_baleno 0.00 Model_santro 0.00 Model_wagon 0.00 Model_wrv 0.00 Model_jetta 0.00 Model_x1 0.00 Brand_fiat 0.00 Model_r-class 0.00 Model_glc 0.00 Model_vento 0.00 Model_a6 0.00 Brand_mitsubishi 0.00 Model_verna 0.00 Model_ignis 0.00 Model_pajero 0.00 Fuel_Type_LPG 0.00 Model_mobilio 0.00 Model_go 0.00 Model_scala 0.00 Model_sonata 0.00 Model_gl-class 0.00 Model_e-class 0.00 Owner_Type_Fourth & Above 0.00 Model_x3 0.00 Model_q3 0.00 Model_rapid 0.00 Model_tigor 0.00 Model_zest 0.00 Model_ciaz 0.00 Model_lodgy 0.00 Model_linea 0.00 Model_civic 0.00 Model_jeep 0.00 Model_duster 0.00 Model_fortuner 0.00 Model_jazz 0.00 Model_bolero 0.00 Model_camry 0.00 Model_tt 0.00 Model_ameo 0.00 Model_micra 0.00 Model_petra 0.00 Model_a-star 0.00 Model_xc60 0.00 Model_xf 0.00 Model_cls-class 0.00 Model_sumo 0.00 Model_laura 0.00 Model_gls 0.00 Model_ssangyong 0.00 Model_gle 0.00 Model_gla 0.00 Model_aspire 0.00 Brand_porsche 0.00 Model_accent 0.00 Model_kwid 0.00 Model_dzire 0.00 Model_passat 0.00 Model_endeavour 0.00 Model_xj 0.00 Model_b 0.00 Model_spark 0.00 Model_cooper 0.00 Model_cr-v 0.00 Model_7 0.00 Model_eon 0.00 Model_xylo 0.00 Model_countryman 0.00 Model_avventura 0.00 Model_vitara 0.00 Model_q7 0.00 Model_optra 0.00 Model_nuvosport 0.00 Model_cla 0.00 Model_thar 0.00 Model_pulse 0.00 Model_teana 0.00 Model_tiago 0.00 Model_a 0.00 Model_a3 0.00 Model_slk-class 0.00 Model_tiguan 0.00 Model_a7 0.00 Model_a8 0.00 Model_tavera 0.00 Model_wr-v 0.00 Model_tucson 0.00 Model_tuv 0.00 Brand_bentley 0.00 Model_z4 0.00 Model_yeti 0.00 Brand_datsun 0.00 Model_xuv300 0.00 Brand_force 0.00 Model_xe 0.00 Brand_isuzu 0.00 Model_xc90 0.00 Brand_jaguar 0.00 Brand_jeep 0.00 Brand_lamborghini 0.00 Model_x-trail 0.00 Brand_smart 0.00 Model_sl-class 0.00 Model_1000 0.00 Model_versa 0.00 Model_6 0.00 Model_verito 0.00 Model_venture 0.00 Model_v40 0.00 Model_slc 0.00 Model_renault 0.00 Model_siena 0.00 Model_outlander 0.00 Model_cedia 0.00 Model_nexon 0.00 Model_mux 0.00 Model_mustang 0.00 Model_montero 0.00 Model_classic 0.00 Model_clubman 0.00 Model_logan 0.00 Model_lancer 0.00 Model_kuv 0.00 Model_koleos 0.00 Model_continental 0.00 Model_crosspolo 0.00 Model_d-max 0.00 Model_hexa 0.00 Model_e 0.00 Model_enjoy 0.00 Model_estilo 0.00 Model_evalia 0.00 Model_gallardo 0.00 Model_fusion 0.00 Model_one 0.00 Model_cayman 0.00 Model_aveo 0.00 Model_panamera 0.00 Model_beetle 0.00 Model_safari 0.00 Model_s60 0.00 Model_s-cross 0.00 Model_s-class 0.00 Model_bolt 0.00 Model_rs5 0.00 Model_boxster 0.00 Model_br-v 0.00 Model_f 0.00 Model_redi-go 0.00 Model_redi 0.00 Model_brv 0.00 Model_c-class 0.00 Model_quanto 0.00 Model_qualis 0.00 Model_captiva 0.00 Model_captur 0.00 Model_prius 0.00 Model_cayenne 0.00 Model_platinum 0.00 Model_fortwo 0.00
Observation
- Power, Year and Engine are the top 3 important features of decision tree model
Random Forest¶
RandomForest Regressor is a powerful ensemble learning method used for regression tasks in machine learning. It combines the predictions of multiple decision trees into a single, more accurate and robust prediction.
How it Works:
Initializing the RandomForest Regressor Model
rf = RandomForestRegressor(random_state = 1,oob_score = True)
"""
oob_score (Out-of-Bag score) is a way to estimate the model's performance without the need for cross-validation.
It leverages the way Random Forests are constructed to provide a built-in evaluation mechanism.
"""
"\noob_score (Out-of-Bag score) is a way to estimate the model's performance without the need for cross-validation.\nIt leverages the way Random Forests are constructed to provide a built-in evaluation mechanism.\n"
Fitting the data to the model
rf.fit(X_train,y_train['price_log'])
RandomForestRegressor(oob_score=True, random_state=1)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
RandomForestRegressor(oob_score=True, random_state=1)
Getting the performance scores with the RandomForest Regressor
RandomForest_model = get_model_score(rf)
R-square on training set : 0.9763606681935696 R-square on test set : 0.848507692326137 RMSE on training set : 1.7177852388358554 RMSE on test set : 4.337851973403107
Observation
- Random Forest model has performed well on training and test set
Feature Importance
# Importance of features in the model ( The importance of a feature is computed as the
# (normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance )
print(pd.DataFrame(rf.feature_importances_, columns = ["Imp"], index = X_train.columns).sort_values(by = 'Imp', ascending = False))
Imp Power 0.61 Year 0.23 Engine 0.04 kilometers_driven_log 0.02 Mileage 0.01 New_Price 0.01 Location_Kolkata 0.00 Transmission_Manual 0.00 Brand_tata 0.00 Seats 0.00 Brand_honda 0.00 Location_Hyderabad 0.00 Model_rover 0.00 Brand_land 0.00 Brand_mahindra 0.00 Brand_mercedes-benz 0.00 Location_Coimbatore 0.00 Brand_mini 0.00 Owner_Type_Second 0.00 Fuel_Type_Diesel 0.00 Brand_skoda 0.00 Location_Bangalore 0.00 Brand_audi 0.00 Model_creta 0.00 Fuel_Type_Petrol 0.00 Brand_bmw 0.00 Location_Delhi 0.00 Location_Mumbai 0.00 Model_5 0.00 Model_swift 0.00 Brand_toyota 0.00 Location_Pune 0.00 Brand_hyundai 0.00 Location_Jaipur 0.00 Owner_Type_Third 0.00 Model_innova 0.00 Brand_volkswagen 0.00 Model_a4 0.00 Location_Kochi 0.00 Location_Chennai 0.00 Brand_chevrolet 0.00 Model_cayenne 0.00 Model_cooper 0.00 Model_polo 0.00 Model_nano 0.00 Model_accord 0.00 Brand_maruti 0.00 Model_ertiga 0.00 Model_amaze 0.00 Model_indica 0.00 Model_beat 0.00 Model_superb 0.00 Model_q5 0.00 Model_i20 0.00 Model_figo 0.00 Brand_ford 0.00 Model_e-class 0.00 Model_new 0.00 Model_corolla 0.00 Model_elantra 0.00 Model_city 0.00 Model_etios 0.00 Model_ssangyong 0.00 Model_cruze 0.00 Fuel_Type_Electric 0.00 Brand_porsche 0.00 Model_i10 0.00 Model_sonata 0.00 Model_xylo 0.00 Model_verna 0.00 Model_b 0.00 Model_xenon 0.00 Model_santa 0.00 Model_m-class 0.00 Model_baleno 0.00 Model_passat 0.00 Model_3 0.00 Model_alto 0.00 Model_cayman 0.00 Model_manza 0.00 Model_getz 0.00 Model_celerio 0.00 Brand_nissan 0.00 Model_ikon 0.00 Model_xcent 0.00 Brand_renault 0.00 Model_800 0.00 Model_ritz 0.00 Model_prius 0.00 Model_7 0.00 Brand_fiat 0.00 Model_brio 0.00 Model_zen 0.00 Model_x1 0.00 Model_scorpio 0.00 Model_santro 0.00 Model_grand 0.00 Model_indigo 0.00 Model_compass 0.00 Brand_mitsubishi 0.00 Model_duster 0.00 Model_s 0.00 Model_jazz 0.00 Model_fabia 0.00 Model_ecosport 0.00 Model_wagon 0.00 Model_x5 0.00 Model_laura 0.00 Model_gl-class 0.00 Model_gallardo 0.00 Model_jetta 0.00 Model_sx4 0.00 Brand_jeep 0.00 Model_punto 0.00 Model_xuv500 0.00 Model_elite 0.00 Model_fiesta 0.00 Brand_jaguar 0.00 Model_a6 0.00 Model_x3 0.00 Model_vento 0.00 Model_xf 0.00 Model_accent 0.00 Model_octavia 0.00 Model_endeavour 0.00 Model_bolero 0.00 Model_koleos 0.00 Owner_Type_Fourth & Above 0.00 Model_s80 0.00 Model_micra 0.00 Brand_lamborghini 0.00 Model_terrano 0.00 Model_pajero 0.00 Brand_volvo 0.00 Model_glc 0.00 Model_fortuner 0.00 Model_civic 0.00 Model_tigor 0.00 Model_sunny 0.00 Model_optra 0.00 Model_zest 0.00 Model_quanto 0.00 Model_x6 0.00 Model_cr-v 0.00 Model_fluence 0.00 Model_gle 0.00 Model_a8 0.00 Model_ciaz 0.00 Model_sail 0.00 Model_esteem 0.00 Model_panamera 0.00 Model_q3 0.00 Model_logan 0.00 Model_continental 0.00 Model_s-class 0.00 Model_linea 0.00 Model_freestyle 0.00 Model_eeco 0.00 Model_aveo 0.00 Model_s60 0.00 Model_grande 0.00 Model_spark 0.00 Model_cla 0.00 Model_camry 0.00 Model_rapid 0.00 Model_omni 0.00 Model_q7 0.00 Model_teana 0.00 Model_a 0.00 Model_safari 0.00 Model_enjoy 0.00 Model_go 0.00 Model_gla 0.00 Model_6 0.00 Model_eon 0.00 Model_yeti 0.00 Model_kuv 0.00 Brand_datsun 0.00 Model_v40 0.00 Model_sumo 0.00 Model_estilo 0.00 Model_vitara 0.00 Model_dzire 0.00 Model_rs5 0.00 Model_outlander 0.00 Model_tt 0.00 Brand_isuzu 0.00 Brand_smart 0.00 Model_aspire 0.00 Model_xc60 0.00 Model_wrv 0.00 Model_mobilio 0.00 Model_kwid 0.00 Model_lancer 0.00 Model_scala 0.00 Model_siena 0.00 Model_fortwo 0.00 Model_thar 0.00 Fuel_Type_LPG 0.00 Model_r-class 0.00 Model_ameo 0.00 Model_captur 0.00 Model_qualis 0.00 Model_pulse 0.00 Model_ignis 0.00 Model_bolt 0.00 Model_d-max 0.00 Model_a3 0.00 Model_xj 0.00 Model_a-star 0.00 Model_hexa 0.00 Model_countryman 0.00 Model_tiguan 0.00 Model_venture 0.00 Model_montero 0.00 Model_cls-class 0.00 Model_x-trail 0.00 Model_xuv300 0.00 Model_tiago 0.00 Model_tavera 0.00 Model_versa 0.00 Model_redi-go 0.00 Model_classic 0.00 Model_tucson 0.00 Brand_bentley 0.00 Brand_force 0.00 Model_mux 0.00 Model_avventura 0.00 Model_jeep 0.00 Model_brv 0.00 Model_captiva 0.00 Model_fusion 0.00 Model_petra 0.00 Model_slk-class 0.00 Model_one 0.00 Model_z4 0.00 Model_xc90 0.00 Model_clubman 0.00 Model_nexon 0.00 Model_renault 0.00 Model_f 0.00 Model_slc 0.00 Model_crosspolo 0.00 Model_tuv 0.00 Model_verito 0.00 Model_lodgy 0.00 Model_nuvosport 0.00 Model_mustang 0.00 Model_redi 0.00 Model_gls 0.00 Model_evalia 0.00 Model_s-cross 0.00 Model_br-v 0.00 Model_sl-class 0.00 Model_c-class 0.00 Model_1000 0.00 Model_boxster 0.00 Model_platinum 0.00 Model_xe 0.00 Model_wr-v 0.00 Model_cedia 0.00 Model_e 0.00 Model_a7 0.00 Model_beetle 0.00
# Plotting the first 10 important features from RandomForest in the descending order
plt.figure(figsize = (10, 5))
sns.barplot(x = rf.feature_importances_[0:10], y = X_train.columns[0:10], hue=X_train.columns[0:10])
plt.title("Feature Importance by RandomForest")
plt.show()
Observation
- Power, Year and Engine are the top 3 important features of decision tree model
Hyperparameter Tuning - Decision Tree¶
# Choose the type of regressor.
dtree_tuned = DecisionTreeRegressor(random_state = 1)
# Grid of parameters to choose from
parameters = {'max_depth': [None],
'min_samples_leaf': [1, 3, 5, 7],
'max_leaf_nodes' : [2, 5, 7] + [None],
}
# Type of scoring used to compare parameter combinations
scorer = metrics.make_scorer(metrics.r2_score)
# Run the grid search
grid_obj = GridSearchCV(dtree_tuned, parameters, scoring = scorer,cv = 5)
grid_obj = grid_obj.fit(X_train, y_train['price_log'])
# Set the model to the best combination of parameters
dtree_tuned = grid_obj.best_estimator_
# Fit the best algorithm to the data.
dtree_tuned.fit(X_train, y_train['price_log'])
DecisionTreeRegressor(min_samples_leaf=7, random_state=1)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
DecisionTreeRegressor(min_samples_leaf=7, random_state=1)
dtree_tuned_score = get_model_score(dtree_tuned)
R-square on training set : 0.9058722277131451 R-square on test set : 0.8051893832488712 RMSE on training set : 3.4277580417926696 RMSE on test set : 4.919101093413935
Observation
- Overfitting in decision tree is not there now.
Feature Importance
# Importance of features in the tree building ( The importance of a feature is computed as the
#(normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance )
print(pd.DataFrame(dtree_tuned.feature_importances_, columns = ["Imp"], index = X_train.columns).sort_values(by = 'Imp', ascending = False))
Imp Power 0.64 Year 0.24 Engine 0.05 Mileage 0.02 kilometers_driven_log 0.01 Transmission_Manual 0.01 Brand_honda 0.00 Brand_tata 0.00 Location_Kolkata 0.00 New_Price 0.00 Fuel_Type_Diesel 0.00 Brand_audi 0.00 Brand_mahindra 0.00 Seats 0.00 Location_Hyderabad 0.00 Location_Coimbatore 0.00 Model_innova 0.00 Model_swift 0.00 Model_creta 0.00 Location_Jaipur 0.00 Brand_toyota 0.00 Fuel_Type_Petrol 0.00 Brand_ford 0.00 Model_q5 0.00 Location_Kochi 0.00 Model_amaze 0.00 Model_scorpio 0.00 Location_Pune 0.00 Location_Mumbai 0.00 Brand_jeep 0.00 Location_Delhi 0.00 Model_i20 0.00 Brand_maruti 0.00 Brand_hyundai 0.00 Location_Bangalore 0.00 Brand_skoda 0.00 Model_brio 0.00 Model_sunny 0.00 Model_polo 0.00 Model_celerio 0.00 Model_xuv500 0.00 Model_verna 0.00 Owner_Type_Second 0.00 Model_baleno 0.00 Model_new 0.00 Model_wagon 0.00 Model_i10 0.00 Model_city 0.00 Model_sx4 0.00 Model_qualis 0.00 Model_quanto 0.00 Model_outlander 0.00 Model_renault 0.00 Model_pajero 0.00 Model_panamera 0.00 Model_redi-go 0.00 Model_passat 0.00 Model_redi 0.00 Model_petra 0.00 Model_platinum 0.00 Model_rapid 0.00 Model_prius 0.00 Model_pulse 0.00 Model_punto 0.00 Model_q3 0.00 Model_optra 0.00 Model_r-class 0.00 Model_q7 0.00 Model_xc60 0.00 Model_omni 0.00 Model_one 0.00 Model_logan 0.00 Model_jazz 0.00 Model_yeti 0.00 Model_jeep 0.00 Model_jetta 0.00 Model_koleos 0.00 Model_kuv 0.00 Model_kwid 0.00 Model_lancer 0.00 Model_laura 0.00 Model_linea 0.00 Model_lodgy 0.00 Model_m-class 0.00 Model_rover 0.00 Model_manza 0.00 Model_micra 0.00 Model_xylo 0.00 Model_mobilio 0.00 Model_montero 0.00 Model_mustang 0.00 Model_mux 0.00 Model_nano 0.00 Model_nexon 0.00 Model_nuvosport 0.00 Model_octavia 0.00 Model_ritz 0.00 Model_s-class 0.00 Model_rs5 0.00 Model_s 0.00 Model_tiago 0.00 Model_tigor 0.00 Model_tiguan 0.00 Model_tt 0.00 Model_tucson 0.00 Model_tuv 0.00 Model_v40 0.00 Model_vento 0.00 Model_venture 0.00 Model_verito 0.00 Model_versa 0.00 Model_xenon 0.00 Model_zen 0.00 Model_vitara 0.00 Model_xe 0.00 Model_wr-v 0.00 Model_wrv 0.00 Model_x-trail 0.00 Model_x1 0.00 Model_x3 0.00 Model_xcent 0.00 Model_xc90 0.00 Model_x5 0.00 Model_thar 0.00 Model_terrano 0.00 Model_teana 0.00 Model_xuv300 0.00 Model_x6 0.00 Model_s-cross 0.00 Model_s60 0.00 Model_s80 0.00 Model_safari 0.00 Model_sail 0.00 Model_santa 0.00 Model_santro 0.00 Model_scala 0.00 Model_z4 0.00 Model_siena 0.00 Model_tavera 0.00 Model_sl-class 0.00 Model_slc 0.00 Model_slk-class 0.00 Model_sonata 0.00 Model_indigo 0.00 Model_ssangyong 0.00 Model_sumo 0.00 Model_superb 0.00 Model_xj 0.00 Model_xf 0.00 Model_spark 0.00 Model_fortwo 0.00 Model_indica 0.00 Model_captiva 0.00 Model_7 0.00 Model_800 0.00 Model_a 0.00 Model_a-star 0.00 Model_a3 0.00 Model_a4 0.00 Model_a6 0.00 Model_a7 0.00 Model_a8 0.00 Model_accent 0.00 Model_accord 0.00 Model_alto 0.00 Model_ameo 0.00 Model_aspire 0.00 Model_aveo 0.00 Model_avventura 0.00 Model_b 0.00 Model_beat 0.00 Model_beetle 0.00 Model_bolero 0.00 Model_bolt 0.00 Model_boxster 0.00 Model_br-v 0.00 Model_brv 0.00 Model_c-class 0.00 Model_6 0.00 Model_5 0.00 Model_3 0.00 Brand_isuzu 0.00 Location_Chennai 0.00 Fuel_Type_Electric 0.00 Fuel_Type_LPG 0.00 Owner_Type_Fourth & Above 0.00 Owner_Type_Third 0.00 Brand_bentley 0.00 Brand_bmw 0.00 Brand_chevrolet 0.00 Brand_datsun 0.00 Brand_fiat 0.00 Brand_force 0.00 Brand_jaguar 0.00 Model_1000 0.00 Brand_lamborghini 0.00 Brand_land 0.00 Brand_mercedes-benz 0.00 Brand_mini 0.00 Brand_mitsubishi 0.00 Brand_nissan 0.00 Brand_porsche 0.00 Brand_renault 0.00 Brand_smart 0.00 Brand_volkswagen 0.00 Brand_volvo 0.00 Model_camry 0.00 Model_captur 0.00 Model_ikon 0.00 Model_cayenne 0.00 Model_ertiga 0.00 Model_esteem 0.00 Model_estilo 0.00 Model_etios 0.00 Model_evalia 0.00 Model_f 0.00 Model_fabia 0.00 Model_fiesta 0.00 Model_figo 0.00 Model_fluence 0.00 Model_fortuner 0.00 Model_freestyle 0.00 Model_fusion 0.00 Model_gallardo 0.00 Model_getz 0.00 Model_gl-class 0.00 Model_gla 0.00 Model_glc 0.00 Model_gle 0.00 Model_gls 0.00 Model_go 0.00 Model_grand 0.00 Model_grande 0.00 Model_hexa 0.00 Model_ignis 0.00 Model_eon 0.00 Model_enjoy 0.00 Model_endeavour 0.00 Model_corolla 0.00 Model_cayman 0.00 Model_cedia 0.00 Model_ciaz 0.00 Model_civic 0.00 Model_cla 0.00 Model_classic 0.00 Model_cls-class 0.00 Model_clubman 0.00 Model_compass 0.00 Model_continental 0.00 Model_cooper 0.00 Model_countryman 0.00 Model_elite 0.00 Model_cr-v 0.00 Model_crosspolo 0.00 Model_cruze 0.00 Model_d-max 0.00 Model_duster 0.00 Model_dzire 0.00 Model_e 0.00 Model_e-class 0.00 Model_ecosport 0.00 Model_eeco 0.00 Model_elantra 0.00 Model_zest 0.00
Observation
- Power, Year and Engine are the top 3 important features of decision tree model
Hyperparameter Tuning - Random Forest¶
# Choose the type of regressor
rf_tuned = RandomForestRegressor(random_state = 1,oob_score = True)
# Grid of parameters to choose from
parameters = {
'max_depth':[5,7,None],
'max_features': ['sqrt','log2'],
'n_estimators': [250,500,800,900]
}
# Type of scoring used to compare parameter combinations
scorer = metrics.make_scorer(metrics.r2_score)
# Run the grid search
grid_obj = GridSearchCV(rf_tuned, parameters, scoring=scorer,cv=5)
grid_obj = grid_obj.fit(X_train, y_train['price_log'])
# Set the model to the best combination of parameters
rf_tuned = grid_obj.best_estimator_
# Fit the best algorithm to the data.
rf_tuned.fit(X_train, y_train['price_log'])
RandomForestRegressor(max_features='sqrt', n_estimators=500, oob_score=True, random_state=1)In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
RandomForestRegressor(max_features='sqrt', n_estimators=500, oob_score=True, random_state=1)
rf_tuned_score = get_model_score(rf_tuned)
R-square on training set : 0.9697949688565876 R-square on test set : 0.8613847228821614 RMSE on training set : 1.941739261922651 RMSE on test set : 4.149396975474581
Observation
- The Random Forest model does not perform any better after tuning.
Feature Importance
# Importance of features in the tree building ( The importance of a feature is computed as the
# (normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance )
print(pd.DataFrame(rf_tuned.feature_importances_, columns = ["Imp"], index = X_train.columns).sort_values(by = 'Imp', ascending = False))
Imp Power 0.17 Engine 0.14 Year 0.11 Transmission_Manual 0.10 Mileage 0.05 kilometers_driven_log 0.05 Fuel_Type_Petrol 0.04 Fuel_Type_Diesel 0.03 New_Price 0.03 Brand_mercedes-benz 0.02 Seats 0.02 Brand_bmw 0.02 Brand_audi 0.02 Brand_maruti 0.01 Location_Coimbatore 0.01 Owner_Type_Second 0.01 Brand_tata 0.01 Location_Kolkata 0.01 Model_creta 0.01 Owner_Type_Third 0.00 Model_santro 0.00 Brand_hyundai 0.00 Model_rover 0.00 Brand_land 0.00 Brand_jaguar 0.00 Brand_toyota 0.00 Model_q7 0.00 Brand_chevrolet 0.00 Location_Pune 0.00 Brand_honda 0.00 Model_alto 0.00 Location_Jaipur 0.00 Location_Kochi 0.00 Location_Hyderabad 0.00 Brand_mahindra 0.00 Model_indica 0.00 Location_Mumbai 0.00 Model_5 0.00 Model_new 0.00 Model_fortuner 0.00 Model_wagon 0.00 Location_Bangalore 0.00 Location_Delhi 0.00 Location_Chennai 0.00 Model_i10 0.00 Model_e-class 0.00 Brand_porsche 0.00 Brand_skoda 0.00 Model_zen 0.00 Brand_mini 0.00 Model_3 0.00 Model_innova 0.00 Brand_volkswagen 0.00 Model_nano 0.00 Brand_ford 0.00 Model_cooper 0.00 Model_accent 0.00 Model_swift 0.00 Model_a4 0.00 Model_city 0.00 Model_indigo 0.00 Model_verna 0.00 Model_xuv500 0.00 Model_xf 0.00 Model_gle 0.00 Model_a6 0.00 Model_ciaz 0.00 Model_figo 0.00 Model_corolla 0.00 Model_800 0.00 Model_7 0.00 Model_i20 0.00 Model_x5 0.00 Model_superb 0.00 Model_beat 0.00 Model_ikon 0.00 Model_scorpio 0.00 Model_accord 0.00 Model_baleno 0.00 Model_esteem 0.00 Model_ecosport 0.00 Model_cayenne 0.00 Brand_renault 0.00 Model_panamera 0.00 Model_octavia 0.00 Model_getz 0.00 Model_q5 0.00 Model_xj 0.00 Model_laura 0.00 Model_ritz 0.00 Model_cruze 0.00 Model_cr-v 0.00 Model_celerio 0.00 Model_vitara 0.00 Model_polo 0.00 Model_xylo 0.00 Model_ertiga 0.00 Model_grand 0.00 Model_vento 0.00 Model_gl-class 0.00 Model_fiesta 0.00 Model_slk-class 0.00 Model_optra 0.00 Brand_fiat 0.00 Model_civic 0.00 Model_amaze 0.00 Model_aveo 0.00 Model_duster 0.00 Model_m-class 0.00 Model_eon 0.00 Model_jetta 0.00 Model_omni 0.00 Model_cla 0.00 Model_endeavour 0.00 Model_manza 0.00 Model_x3 0.00 Model_etios 0.00 Model_brio 0.00 Brand_nissan 0.00 Model_elantra 0.00 Model_x1 0.00 Model_compass 0.00 Model_glc 0.00 Model_x6 0.00 Model_slc 0.00 Brand_jeep 0.00 Model_bolero 0.00 Brand_mitsubishi 0.00 Model_spark 0.00 Model_sx4 0.00 Brand_volvo 0.00 Model_s 0.00 Model_gallardo 0.00 Model_rapid 0.00 Model_camry 0.00 Owner_Type_Fourth & Above 0.00 Brand_lamborghini 0.00 Model_q3 0.00 Model_micra 0.00 Model_kwid 0.00 Model_ssangyong 0.00 Model_santa 0.00 Model_gla 0.00 Model_elite 0.00 Model_passat 0.00 Model_f 0.00 Model_s-class 0.00 Model_xcent 0.00 Model_b 0.00 Model_jazz 0.00 Model_cayman 0.00 Model_continental 0.00 Model_sonata 0.00 Model_sumo 0.00 Model_siena 0.00 Model_pajero 0.00 Model_terrano 0.00 Model_fabia 0.00 Model_6 0.00 Brand_bentley 0.00 Model_sunny 0.00 Model_zest 0.00 Model_tucson 0.00 Model_ameo 0.00 Model_tt 0.00 Model_eeco 0.00 Model_yeti 0.00 Model_a 0.00 Model_captur 0.00 Model_jeep 0.00 Model_koleos 0.00 Model_sail 0.00 Model_petra 0.00 Model_captiva 0.00 Model_a-star 0.00 Model_quanto 0.00 Brand_datsun 0.00 Model_safari 0.00 Model_linea 0.00 Model_dzire 0.00 Model_punto 0.00 Model_xenon 0.00 Model_grande 0.00 Model_enjoy 0.00 Model_rs5 0.00 Model_lancer 0.00 Model_clubman 0.00 Model_tigor 0.00 Model_prius 0.00 Model_r-class 0.00 Model_xc60 0.00 Fuel_Type_LPG 0.00 Fuel_Type_Electric 0.00 Model_s60 0.00 Model_versa 0.00 Model_thar 0.00 Model_estilo 0.00 Model_xc90 0.00 Model_scala 0.00 Model_qualis 0.00 Model_classic 0.00 Model_mustang 0.00 Model_v40 0.00 Model_gls 0.00 Model_tiago 0.00 Model_mobilio 0.00 Model_tuv 0.00 Model_logan 0.00 Model_bolt 0.00 Model_a8 0.00 Brand_isuzu 0.00 Model_freestyle 0.00 Model_go 0.00 Brand_smart 0.00 Model_fortwo 0.00 Model_a3 0.00 Model_brv 0.00 Model_s80 0.00 Model_kuv 0.00 Model_pulse 0.00 Model_d-max 0.00 Model_c-class 0.00 Model_tiguan 0.00 Model_nexon 0.00 Model_x-trail 0.00 Model_redi-go 0.00 Model_teana 0.00 Model_renault 0.00 Model_aspire 0.00 Brand_force 0.00 Model_venture 0.00 Model_countryman 0.00 Model_tavera 0.00 Model_fluence 0.00 Model_montero 0.00 Model_one 0.00 Model_z4 0.00 Model_sl-class 0.00 Model_verito 0.00 Model_hexa 0.00 Model_wrv 0.00 Model_outlander 0.00 Model_cls-class 0.00 Model_br-v 0.00 Model_ignis 0.00 Model_crosspolo 0.00 Model_avventura 0.00 Model_xuv300 0.00 Model_evalia 0.00 Model_mux 0.00 Model_fusion 0.00 Model_nuvosport 0.00 Model_s-cross 0.00 Model_lodgy 0.00 Model_redi 0.00 Model_platinum 0.00 Model_wr-v 0.00 Model_e 0.00 Model_a7 0.00 Model_cedia 0.00 Model_1000 0.00 Model_boxster 0.00 Model_beetle 0.00 Model_xe 0.00
Observation
- Power, Year and Engine are the top 3 important variables in predicting car price according to Random Forest
Conclusions and Recommendations¶
1. Comparison of various techniques and their relative performance based on chosen Metric (Measure of success):
Measures of success :
R-squared and RMSE can be used as a measure of success.
R-squared: This will tell us how much variation our predictive model can explain in data.
RMSE: This will give us a measure of how far off the model is predicting the original values on average.
# Defining list of models
models = [lr,rdg,dtree, dtree_tuned, rf, rf_tuned]
# Defining empty lists to add train and test results
r2_train = []
r2_test = []
rmse_train= []
rmse_test= []
# Looping through all the models to get the rmse and r2 scores
for model in models:
# Accuracy score
j = get_model_score(model, False)
r2_train.append(j[0])
r2_test.append(j[1])
rmse_train.append(j[2])
rmse_test.append(j[3])
comparison_frame = pd.DataFrame({'Model':['Linear Regression', 'Ridge Regression', 'Decision Tree', 'Tuned Decision Tree', 'Random Forest',
'Tuned Random Forest'],
'Train_r2' : r2_train,'Test_r2' : r2_test,
'Train_RMSE' : rmse_train,'Test_RMSE' : rmse_test})
comparison_frame
Model | Train_r2 | Test_r2 | Train_RMSE | Test_RMSE | |
---|---|---|---|---|---|
0 | Linear Regression | 0.94 | 0.87 | 2.74 | 4.03 |
1 | Ridge Regression | 0.93 | 0.89 | 2.94 | 3.62 |
2 | Decision Tree | 1.00 | 0.82 | 0.02 | 4.77 |
3 | Tuned Decision Tree | 0.91 | 0.81 | 3.43 | 4.92 |
4 | Random Forest | 0.98 | 0.85 | 1.72 | 4.34 |
5 | Tuned Random Forest | 0.97 | 0.86 | 1.94 | 4.15 |
- Ridge Regression and Linear Regression have performed very well on data. However, Ridge Regression has given a more generalized model on training and test set
- There's still scope for improvement with tuning the hyperparameters of the Random Forest
2. Refined insights: Name:
- The
Name
column has 2041 unique values and this column would not be very useful in our analysis. But the name contains both the brand name and the model name of the vehicle and we can process this column to extract Brand and Model names to reduce the number of levels
Extracting the car brands:
- After extracting the car brands from the name column we find that the most frequent brand in our data is Maruti and Hyundai
Extracting car model name:
- After extracting the car name it gets clear that our dataset contains used cars from luxury as well as budget-friendly brands
- The mean price of a used Lamborghini is 120 Lakhs and that of cars from other luxury brands follow in descending order and this output is very close to our expectation (domain knowledge), in terms of brand order. Towards the bottom end, we have more budget friendly brands
Important variable with Linear Regression:
- According to the Linear Regresion model the most significant predictors of the price of used cars are -
- Year
- Power
- New_price
- Location
- Kilometers_Driven
- Fuel_Type
- Owner_Type
- Transmission
Important variable with Random Forest:
- According to the Random Forest model the most significant predictors of the price of used cars are
- Power of the engine -The year of manufacturing -Engine -Mileage
3. Proposal for the final solution design:
Overall solution design :
The potential solution design would look like:
- Checking the data description to get the idea of basic statistics or summary of data
- Univariate analysis to see how data is spread out, getting to know about the outliers
- Bivariate analysis to see how different attributes vary with the dependent variable
- Outlier treatment if needed - In this case, outlier treatment is not necessary as outliers are the luxurious cars and in real world scenarios such cars would appear in data and we would want our predictive model to capture the underlying pattern for them
- Missing value treatment using appropriate techniques
- Feature engineering - transforming features, creating new features if possible
- Choosing the model evaluation technique - 1) R Squared 2) RMSE can be any other metrics related to regression analysis
- Splitting the data and proceeding with modeling
- Model tuning to see if the performance of the model can be improved further
- Since it is a regression problem we will first start with the parametric model - linear regression,Ridge Regression followed by the non-parametric models - Decision Tree and Random Forest
Best Model:
- The best solution can be determined by considering the combination of R-square and RMSE values for each model on both the training and test datasets. A higher R-square indicates a better fit of the model to the data, while a lower RMSE indicates a lower error in the model's predictions. The model with the highest R-square and lowest RMSE on both the training and test sets would be considered the best solution
- Our final Ridge Regression model has an R-squared of ~0.89 on The test data, which means that our model can explain 89% variation in our data also the RMSE on test data is ~3.62 which means we can predict very closely to the original values. This is a very good model and we can use this model in production
- The model we should adopt is the Ridge Regression model since it had a very good performance with both the train data and the test data
- Business can benefit by getting more cars under the hood:
- From Tier 1 cities
- First owner cars
- Automatic transmission cars
- High engine powered cars
- Some southern markets tend to have higher prices. It might be a good strategy to plan growth in southern cities using this information. Markets like Kolkata are very risky and we need to be careful about investments in these areas
- We will have to analyze the cost side of things before we can talk about profitability in the business. We should gather data regarding that
- The next step post that would be to cluster different sets of data and see if we should make multiple models for different locations/car types
- Now Car4U can price their cars competitively and maximize profit by predicting the optimal price for each car with the Ridge Regression model