Professional Documents
Culture Documents
Data Science Algorithms
Data Science Algorithms
outcome.
It’s this level which machine will try to predict based on information available with training
data.
#cylinders bore horsepower peak-rpm price
CLUSTERING MODEL
A N O M A LY D E T E C T I O N
CLUSTERING MODEL
3000
2500
Crub weight
2000
1500
1000
500
0
86 88 90 92 94 96 98 100 102 104 106 108
Wheel base
K MEANS CLUSTERING
3500
3000
2500
Crub weight
2000
1500
1000
500
0
85 90 95 100 105 110
Wheel base
LINEAR REGRESSION
Algorithm to predict the value of
dependent variable with value of
one or more independent variables.
6
GRADES Y
5
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY X
Single independent variable
9
6
GRADES Y
5
1
C
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY X
Y = mX + C
Single independent variable
9
6
GRADES
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY
#cylinders (X1) Bore (X2) Horsepower (X3) peak-rpm (X4) Price (Y)
four 3.47 111 5000 13495
four 3.47 111 5000 16500
six 2.68 154 5000 16500
four 3.19 102 5500 13950
five 3.19 115 5500 17450
five 3.19 110 5500 15250
R squared of linear regression
Y
70
60
50
Dependent variable
40
30
20
10
0
0 1 2 3 4 5 6 7
Independent variable
R squared of linear regression
Y
70
60
50
Dependent variable
40
30
20
10
0
0 1 2 3 4 5 6 7
Independent variable
R squared of linear regression
9
6
GRADES Y
5
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY X
R squared of linear regression
9
6
GRADES Y
5
1
C
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY X
Y = mX + C
LINEAR REGRESSION
Algorithm to predict the value of
dependent variable with value of
one or more independent variables.
6
GRADES Y
5
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY X
R squared of linear regression
9
6
GRADES Y
5
1
C
0
0 2 4 6 8 10 12
AVERAGE HRS OF STUDY X
Y = mX + C
R squared of linear regression
Hrs
of Grade
study s
Y-
Mean(YM (Y- Y-Predicted (YP-
X Y ) Y-YM YM)2 (YP) YP-YM YM)2
1 3 5.375 -2.375 5.64 3.39 -1.99 3.95
2 4 5.375 -1.375 1.89 3.92 -1.46 2.13
3 3 5.375 -2.375 5.64 4.45 -0.93 0.86
3 5 5.375 -0.375 0.14 4.45 -0.93 0.86
5 7 5.375 1.625 2.64 5.50 0.13 0.02
6 7 5.375 1.625 2.64 6.03 0.66 0.43
8 6 5.375 0.625 0.39 7.09 1.72 2.94
10 8 5.375 2.625 6.89 8.15 2.77 7.70
5.375 25.88 18.89
𝛴 𝑌𝑃 − 𝑌𝑀 2
=18.89/25.88
R squared = σ 𝑌 − 𝑌𝑀 2 =0.73%
What does low value of R squared means