0% found this document useful (0 votes)
2 views5 pages

ML_4_15-06-2023

The document discusses a Machine Learning session focused on Linear Regression using a SalaryData dataset, which correlates years of experience with salary predictions. It explains the roles of dependent and independent variables, the importance of bias in the regression formula, and the concept of a best fit line. Additionally, it highlights the challenges in measuring accuracy due to varying errors in predictions.

Uploaded by

saifsiddqui003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

ML_4_15-06-2023

The document discusses a Machine Learning session focused on Linear Regression using a SalaryData dataset, which correlates years of experience with salary predictions. It explains the roles of dependent and independent variables, the importance of bias in the regression formula, and the concept of a best fit line. Additionally, it highlights the challenges in measuring accuracy due to varying errors in predictions.

Uploaded by

saifsiddqui003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Summer Day 5 - Machine Learning #BETHECREATOR

Machine Learning Session


Summary 15-06-2023

● Linear Regression on Dataset – SalaryData

⮚ This data set is basically based on years of experience and how much
salary can company pay to an employee who wants to join the
company.

● According to this, we can build a model based on historical data to predict


how much salary, a company should pay to newly joined Persons.

Summer Industrial Training 2023 1


Summer Day 5 - Machine Learning #BETHECREATOR

➢ Y variable is called as dependent variable (Target Variable)

➢ X is called an independent variable (Features)

● We have converted X into Numpy Array.

Summer Industrial Training 2023 2


Summer Day 5 - Machine Learning #BETHECREATOR

● Now we need to import Linear Regression Model

● Creating a model or training a model means finding the coefficient for the
model.

● [Link]() – basically finds c in y=cx

● Here we have input X as 2D because we have converted X to 2D in earlier


steps.

Summer Industrial Training 2023 3


Summer Day 5 - Machine Learning #BETHECREATOR

● Checking coefficient for Model


■ model.coef_

● If we multiply this coefficient with a sample in X, then we will not get the
actual value we wanted as compared to the previous exercise done on
Student’s Marks dataset.

● This reflects that there is something called a constant that needs to be added
to the formula y=cx. This constant is called Bias.

● Thus we need to consider bias in the above formula, as a person with zero
years of experience has to be given some amount as a salary ideally. This
amount is called Bias/Constant.

● Thus formula becomes - y = b + cx


Where b is constant or bias
c is weight or coefficient

● A line connecting all the data points is called a Best fit line.

● The line is not passing through the origin but is intercepting the y-axis at
some point which is called a y-intercept or constant.

● Visualizing the model:

Summer Industrial Training 2023 4


Summer Day 5 - Machine Learning #BETHECREATOR

● If we try to draw a line consisting of all data points on the line for real data
points, we will not be able to do so. But we will be somewhere close to all
data points.

● Error / Cost / Residual

➢ If we try to find the target value given the input features or input, we
will get a value that might be near to actual value.

➢ This difference between actual and predicted value is called an Error


or Cost, Residual.

➢ For example. The actual salary is 60000 for 2 years of experience and
the Model predicted 50500. Thus, the error is 9500

➢ Finding accuracy for the linear model is quite difficult as the error for
each data point is different.

Summer Industrial Training 2023 5

You might also like