2 1 Linear Regression | Machine Learning
Vložit
- čas přidán 8. 09. 2024
- EXAMPLE: OLD FAITHFUL
3.0 3.5 4.0 4.5 5.0
50 60 70 80 90
Current Eruption Time (min)
Waiting Time (min)
Can we meaningfully predict the time between eruptions only using the
duration of the last eruption?
One model for this
(wait time) ⇡ w0 + (last duration) ⇥ w1
I w0 and w1 are to be learned.
I This is an example of linear regression.
Refresher
w1 is the slope, w0 is called the intercept, bias, shift, offset.HIGHER DIMENSIONS
Two inputs
(output) ⇡ w0 + (input 1) ⇥ w1 + (input 2) ⇥ w2
With two inputs the intuition
is the same #!
REGRESSION: PROBLEM DEFINITION
Data
Input: x 2 Rd (i.e., measurements, covariates, features, indepen. variables)
Output: y 2 R (i.e., response, dependent variable)
Goal
Find a function f : Rd ! R such that y ⇡ f (x; w) for the data pair (x, y).
f (x; w) is called a regression function. Its free parameters are w.
Definition of linear regression
A regression method is called linear if the prediction f is a linear function of
the unknown parameters w.LEAST SQUARES LINEAR REGRESSION MODEL
Model
The linear regression model we focus on now has the form
yi ⇡ f (xi; w) = w0 +
dXj=1
xijwj.
Model learning
We have the set of training data (x1, y1) . . . (xn, yn). We want to use this data
to learn a w such that yi ⇡ f (xi; w). But we first need an objective function to
tell us what a “good” value of w is.
Least squares
The least squares objective tells us to pick the w that minimizes the sum of
squared errors
wLS = arg min
w
nXi=1
(yi # f (xi; w))2 ⌘ arg min
w
L.LEAST SQUARES IN PICTURES
Observations:
Vertical length is error.
The objective function L is the
sum of all the squared lengths.
Find weights (w1, w2) plus an
offset w0 to minimize L.
(w0, w1, w2) defines this plane.
#linearregression #linear #regression #problem #prediction #predicts
About Me:-
/ @kumarpython
Find videos about :-
#Data #data #Analysis #analysis #ArtificialIntelligence #ai #AI #DataScience #machinelearning #deeplearning #neuralnetworks #artificialneuralnetwork #ann #convolutionalneuralnetwork #cnn #recurrentneuralnetwork #rnn #longshorttermmemory #lstm #gatedrecurrentunit #gru #computervision #naturallanguageprocessing #nlp #nltk #spacy #tensorflow #keras #linearregression #linear #logisticregression #regression #knearestneighbour #knn #decisiontree #randomforest #supportvectormachine #svm #clustering #cluster #pca #principlecomponentanalysis #ensemble #sklearn #python