Machine Learning Algorithm: Least Squares Regression, Study notes of Computer Science

An overview of the least squares regression algorithm, a popular machine learning technique used for approximating a line or a plane to fit a set of data points. The algorithm aims to minimize the sum of the squared differences between the predicted and actual values. The mathematical derivation, the cost function, and the steps to implement the algorithm.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-dmr
koofers-user-dmr 🇺🇸

10 documents

1 / 29

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1

!
"
#
$&%
'
(
)
*+
%
,-
"
'
.
,
/
-
0
'
1
,-
23
45
67
68
9
3
:;
4<
9=
>
?
@ A
B
C
A
D
DE
F
G
H
?I
JK
GL
JMN
O
M
K
H P
J
G
I
QRS
GL
R
G
C T
L
S
U
G
I
V
S
J
@
MN
WX
X
S
L
M
S
V
Y
G
R
J
P
I
GZ
[
C \
?
]
GZ
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download Machine Learning Algorithm: Least Squares Regression and more Study notes Computer Science in PDF only on Docsity!



 





  



 

  

 





 





 !

"

$&%

' (

) *+

%

,-

  " '. , /

  0

'  1 ,-

23

45

67

68

93

:;

4 <

9 =

? @A B CA D DE

F

HG ?I JK GL JMN

OM K

HP

JGI

QRS GL R G CT LS U GI V

S

@J MN

WXXS LM S V

Y GR JP I GZ [ C
? ] GZ



 





  



 

  

 

)



;

93

9



 ;

;

3

;

(^4) =

93



67

;

9

 9 =

93



=

45 3

=  

93





7

5  =

=

6

4 ^3



7

6

67

; 3

40

=

<

9



7

6

67

;

9

^0

^3

9

93

 6

6

;

7

=

3

9  1 1

3

6

6

4 

  1 <

9 

43 3

9 <

^ 

9  6

67

;

9

!

(^4) = 

^3

4

!

9

;

4 

5

43

=  

93

  1

= 

9 ^3



=

6

? @A B CA D DE

F

HG ?I JK GL JMN

OM K

HP

JGI

QRS GL R G CT LS U GI V

S

@J MN

WXXS LM S V

Y GR JP I GZ [ C
? ] GA



 





  



 

  

 



7

;

9

%&

'(

5  =

=

9 =

93



9 

^33

45

3

 =

=  

93

3

9 

(^4) =



6

3

=

45  ;

(^93)

=  

93



(^4) =



9  =

;

;

93

45

;

;

=

= 

93 <

;

93

^3

4  (^43) 

=

 9 

9 =

9 

 9 =

93



9 



^3

9

3



;

93

;

6

9 =

93



9 



3

^ 

9

93 

=

^ 

9 

9 =

9  ;

9

 9 =

93



=

9 = 

6

? @A B CA D DE

F

HG ?I JK GL JMN

OM K

HP

JGI

QRS GL R G CT LS U GI V

S

@J MN

WXXS LM S V

Y GR JP I GZ [ C
? ]

G!



 





  



 

  

 







  

 9 =

93



^33

45



5

43 

1

3

4

=  

93

 6







  

 9 =

93



9 





^33

45



5

43 

1

3

4

=  

93



6





  



  3

9

3

9 

43

^1

9 =

;



^3

93

 



=

9

   (^9) 

4

=  

93

9 =

93



43

6





  



 



 9

9

   ^ :

4

9

9 

9 =

9

45

3

=  

=

93

 0

9

 9 =

93



9 

=

6



4 3 

9 

=

9

(^3) 

 =

9 <

9 = 

;

9 =

=

=

= 6 6 6 6 6 6 6 6 

? @A B CA D DE

F

HG ?I JK GL JMN

OM K

HP

JGI

QRS GL R G CT LS U GI V

S

@J MN

WXXS LM S V

Y GR JP I GZ [ C
? ] EG



 





  



 

  

 







  



4 

9 =

93



9



4     1

9

(^4)  

9  

; ; ;

 ;

;

 ;  ;

^ 

; ;

 ;  

^ 

; 

^ 

;

^ 

5

43

 6

9 =

93



(^93)

9  3

 

<

7

=

.^  -



 

 



 

 







         









 

  

 









 

 

 









 



  







!     "



   



















 











 

$



      

 

  

 





 

 

% 

 

 

&

! 





     





 

!



  '   

  

!



(











(

  "   



  

   ) "  * +

 

 





 

   %   +











! 





 



)



,



+.-





  ,



 , 



  ,







? @A B CA D DE

F

HG ?I JK GL JMN

OM K

HP

JGI

QRS GL R G CT LS U GI V

S

@J MN

WXXS LM S V

Y GR JP I GZ [ C
? ] G B



 





  



 

  

 

!





 



 





  1



3

=

45

=

;

4 ^3



6

4 ^3



=  

93



45

=

=

9   



 

=

6

7







 



 3

9

= 

9  93 <

9 

43



45

9 1

9 =

;

(^4) = 

=

=

=

 ^ 

^  ; 9 =   

93

45

=



 ;

9 



=

9 = 

93

9 







 6

 



 

 

 



 



"  "  "  "  "  "  "  "  " "   " "   " "   " "   " " " "     " " " "     " " " " " " " "        







        

 

 









    !    " ,  ,

, 

, 

"     

? @A B CA D DE

F

HG ?I JK GL JMN

OM K

HP

JGI

QRS GL R G CT LS U GI V

S

@J MN

WXXS LM S V

Y GR JP I GZ [ C
? ] G [

*^ /

>^.

>^.

>^4

>^4

>^.

A/

,^2

*^ /

>^.

>^.

>^4

>^4

B

>^.

A/

C

B < / C < ; / < : <

*^ /

>^.

? >^.

C

>^.

A/

A@
8 B

DE

@F

DMN

OM

E

A P

D @B

CDE

@ F

D
<F

F E

G
@B
H
E

9 D

MN

IJJE

F M

E
H
K
@D

D^ P B

@L
M
<N
O^8
@L









^ &

(^1)

(^2)

(^3)

(^4)

(^5)

6

0 1 2 3 4 5

(^1)

(^2)

(^3)

(^4)

(^5)

6

0 10 20 30 40

(^1)

(^2)

(^3)

(^4)

(^5)

6

0 50

100150200250300350

A@
8 B

DE

@ F

D MN

OM

E

A P

D @B

CDE

@ F

D
<F

F E

G
@B
H
E

9 D

MN

IJJE

F M

E
H
K
@D

D^ P B

@L
M
<N
O^8
@L
L

 

  



*^ ^ '

 

^ ^ '









^ '





^ )



,^0

'^7

A@
8 B

DE

@ F

D MN

OM

E

A P

D @B

CDE

@ F

D
<F

F E

G
@B
H
E

9 D

MN

IJJE

F M

E
H
K
@D

D^ P B

@L
M
<N
O^8
@L







 







 



%^ 

  

^ '

^ 
A@
8 B

DE

@ F

D MN

OM

E

A P

D @B

CDE

@ F

D
<F

F E

G
@B
H
E

9 D

MN

IJJE

F M

E
H
K
@D

D^ P B

@L
M
<N
O^8
@L 0

^ '



 

 

^ )



^ %

%^ 

^ 

^ 

^ 

DE

 F

D N

O

E

 P

D

F

F

^ D

N '

((# F

D^ P 

−0.

0

1

−0.8 −0.6 −0.4 −0. 0

0.2 0.4 0.6 0.

* N

O

 P

^ *

N '

*^ P 

  • 



 & 

!

* N

O

 P

^ *

N '

*^ P 

  • 





 



  









^ *



  









* N

O

 P

^ *

N '

*^ P 

  •