Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Stanford CS229 Notes - Regression Algorithms

Beoordeling
-
Verkocht
-
Pagina's
12
Geüpload op
02-01-2025
Geschreven in
2024/2025

1. Introduction to Linear Regression and Gradient Descent Purpose: Introduces linear regression as a foundational supervised learning algorithm. Content Highlights: Explanation of hypothesis formulation. Detailed notation and definitions (parameters, input vectors, target variables). Step-by-step derivation of cost function

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Stanford CS229: Machine Learning
Amrit Kandasamy
November 2024


1 Linear Regression and Gradient Descent
Lecture Note Slides


1.1 Notation and Definitions
Pn
Linear Regression Hypothesis: hθ (x) = i=0 θi xi , where x0 = 1.
 
θ0
 .. 
θ= . 
θn
is called the parameters of the learning algorithm. The algorithm’s job is to
choose θ.
 
x0
 .. 
x= . 
xn
is an input vector (often the inputs are called features).
We let m be the number of training examples (elements in the training set).
y is the output, sometimes called the target variable.
(x, y) is one training example. We will use the notation

(x(i) , y (i) )

to denote the ith training example.
As used in the vectors and summation n is the number of features.
:= denotes assignment (usually of some variable or function). For example,
a := a + 1 increments a by 1.
We write hθ (x) as h(x) for convenience.




1

, Figure 1: Visual of Gradient Descent with Two Parameters


1.2 How to Choose Parameters θ
Choose θ such that h(x) ≈ y for the training examples. Generally, we want to
minimize
m
1X
J(θ) = (hθ (x(i) ) − y)2
2 i=1

In order to minimize J(θ), we will employ Batch Gradient Descent.
Let’s look an example with 2 parameters. Start with some point (θ0 , θ1 , J(θ)),
determined either randomly or by some condition. We look around all around
and think,

”What direction should we take a tiny step in to go downward as fast as possible?”.

If a different starting point was used, the resulting optimum minima would have
been changed (see the two paths above).

Now let’s formalize the gradient descent algorithm(s).


1.2.1 Batch Gradient Descent
Let α be the learning rate. Then the algorithm can be written as


θj := θj − α J(θ)
∂θj

Let’s derive the partial derivative part. Assume there’s only 1 training example
for now. Substituting our definition of J, we have
n
!
∂ ∂ 1 2 ∂ X
α J(θ) = (hθ (x) − y) = (hθ (x) − y) · ( θ i xi ) − y
∂θj ∂θj 2 ∂θj i=0


2

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
2 januari 2025
Bestand laatst geupdate op
2 januari 2025
Aantal pagina's
12
Geschreven in
2024/2025
Type
College aantekeningen
Docent(en)
Onbekend
Bevat
Alle colleges

Onderwerpen

€13,76
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
tuningnumbers

Maak kennis met de verkoper

Seller avatar
tuningnumbers stanford university
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
1
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen