Linear - Regression - Assignment: Problem Statement
Linear - Regression - Assignment: Problem Statement
Problem Statement:
You are hired by a company Gem Stones co ltd, which is a cubic
zirconia manufacturer. You are provided with the dataset containing
the prices and other attributes of almost 27,000 cubic zirconia
(which is an inexpensive diamond alternative with many of the same
qualities as a diamond). The company is earning different profits on
different prize slots. You have to help the company in predicting the
price for the stone on the bases of the details given in the dataset
so it can distinguish between higher profitable stones and lower
profitable stones so as to have better profit share. Also, provide
them with the best 5 attributes that are most important.
Reading the data and do exploratory data analysis. Describing the
data briefly. (Check the null values, Data types, shape, EDA).
Performing Univariate and Bivariate Analysis.
Data Head:
Data Tail:
The distribution of data in carat seems to positively skewed, as there are multiple
peaks points in the distribution there could multimode and the box plot of carat
seems to have large number of outliers. In the range of 0 to 1 where majority of data
lies.
The distribution of Y (Width of the cubic zirconia in mm.) is positively skewed The
box plot also consists of outliers
The distribution too much positively skewed.
The skewness may be due to the diamonds are always made in specific shape.
There might not be too much sizes in the market
Price – Histogram:
Skew of Data:
Bivariate Analysis:
Cut:
Quality is increasing order Fair, Good, Very Good, Premium, Ideal.
The reason for the most preferred cut ideal is because those diamonds are priced
lower than other cuts.
Color:
D is the best and J is the worst
We have 7 colours in the data, The G seems to be the preferred colour,
We see the G is priced in the middle of the seven colours, whereas J being the worst
colour price seems too high.
Clarity:
Best to Worst, FL = flawless, I3= level 3 inclusions) FL, IF, VVS1, VVS2, VS1, VS2,
SI1, SI2, I1, I2, I3
The clarity VS2 seems to be preferred by people.
The data has No FL diamonds, from this we can clearly understand the flawless
diamonds are not bringing any profits to the store.
Carat vs Price:
Depth vs Price:
X vs Price:
Y vs Price:
Z vs Price:
Data Distribution:
Correlation Matrix:
This matrix clearly shows the presence of multi collinearity in the dataset.
Scaling:
Scaling can be useful to reduce or check the multi collinearity in the data, so if
scaling is not applied I find the VIF – variance inflation factor values very high. Which
indicates presence of multi collinearity
These values are calculated after building the model of linear regression.
To understand the multi collinearity in the model The scaling had no impact in model
score or coefficients of attributes nor the intercept.
Linear Model:
VIF – Values:
We still find we have multi collinearity in the dataset, to drop these values to Lower
level we can drop columns after doing stats model.
From stats model we can understand the features that do not contribute to the Model
We can remove those features after that the Vif Values will be reduced
Ideal value of VIF is less tha 5%.
Stats Model:
Insights:
We had a business problem to predict the price of the stone and provide insights for
the company on the profits on different prize slots. From the EDA analysis we could
understand the cut, ideal cut had number profits to the company. The colours H, I, J
have bought profits for the company. In clarity if we could see there were no flawless
stones and they were no profits coming from l1, l2, l3 stones. The ideal, premium
and very good types of cuts were bringing profits where as fair and good are not
bringing profits.
The predictions were able to capture 95% variations in the price and it is explained
by the predictors in the training set.
Using stats model if we could run the model again, we can have P values and
coefficients which will give us better understanding of the relationship, so that values
more 0.05 we can drop those variables and re run the model again for better results.
For better accuracy dropping depth column in iteration for better results.
Recommendations:
1.The ideal, premium, very good cut types are the one which are bringing profits so
that we could use marketing for these to bring in more profits.
2.The clarity of the diamond is the next important attributes the more the clear is the
stone the profits are more
--------------------------------------The END----------------------------------------