Lin Xuantian's Notes on Machine Learning Foundations (2)

The screenshots are cool for a while, and the crematorium = =,

2. Learning to answer yes_no

P6 2.1
x = (x1,x2, … xd) represents the various characteristics of the user, threshold represents the threshold
y = { +1(good), -1(bad) }, note that the case of 0 is rare, and it is not much Meaning
h ∈ H
h(x) = sign(summation(1~d)wi xi - threshold)
= sign(summation(0~d)wi
xi) Note: x0 = 1 , w0 = threshold
h(x) can Represents a straight line, dividing o(+1) and x(-1)
insert image description here
insert image description here
insert image description here
(One-dimensional linear classifier, high-dimensional ones are also similar (??? I don’t know how to do similar methods, it seems that I can’t draw it?))

P7 2.2
Try to make g ≈ f on D
as follows in the two-dimensional plane:

Need to find a line that fits f as best as possible

There is such an idea (PLA):
(perceptron learning algorithm perceptron learning algorithm)
start from a line g0, find a way to make it better slowly
, t represents the tth round, and
start to correct
wt+ when there is an error 1 ← wt + yn(t) xn(t)
until no error is found
(knowing the error can improve the algorithm)
[Question: Why is y
x
find some URLs: https://zhuanlan.zhihu.com/p/30641772
Dr. B Station East also commented, but I don’t understand it]
insert image description here
! I understand, y is just -1 or 1, if the angle between w and x > 90°,
assuming that there are w0, x0, y0 at the beginning,
then w0 inner product (or dot product) x0 < 0, sign (w0 · x0) = -1, if y0 is equal to +1 at this time
, as in the above picture, there will be sign (w0
x0)! = y0
(sign function does not know Baidu Encyclopedia)
Therefore, because x0 is translated, it is the dotted line , then, w0+x0 (dotted line), you get the purple one: w0 + y0x0, that is, w0+x0, becomes a new w, which is recorded as w1. If you do this, the angle between w1 and
x0 will be <90°, and the inner product will be natural> 0, sign(w1*x0) = 1 = y0
w is updated successfully, and then follow the train of thought to keep updating until every data will not be misclassified
insert image description here
Note that when dividing the line (dividing pink and blue), the direction of the line is perpendicular to the direction of w. I didn’t understand it at once. I only knew after reading the barrage that the angle between w and x is an acute angle
. , the obtuse angle is X, so the dividing line is the direction of 90 degrees

About knowing the mistake and changing the algorithm:
Will this method stop?
Does g determined after stopping really fit f well
(probably just fit the training set)

Answer to the exercises:
choose 3 because wt+1 = wt + yn xn is multiplied by yn xn
on the left and right sides,

and you can know that yn*wt+1(T) xn >= yn wt(T) xn
This formula represents Lesson 6 The formula w
x, score-threshold value
is more fitting to the front than the latter to yn, indicating that the updated g is really close to f

P8 2.3
Prove the convergence of PLA:
insert image description here
insert image description here
Finally, what is the constant that proves the convergence of PLA in the exercises:
https://www.cnblogs.com/porco/p/4605597.html
I didn’t see how to prove it, and the constant is equal to = p/ R^2

P9 2.4
If there is noise or the data is not linearly separable, PLA may not stop,
especially when the data is not linearly separable, PLA will not stop

In the 2-dimensional graph, find a line with the least error.
This is an np hard problem, which is difficult to solve.
insert image description here
Therefore, find a greedy approach to find a good line:
use greedy PLA to solve (pocket), run a certain number of times, find best known w
insert image description here

Guess you like

Origin blog.csdn.net/Only_Wolfy/article/details/89354827