Alterna · learning material

06.3 Known points and new data

The complex curve may well repeat the training points and do not go well between them. Therefore, the error on the new data is checked separately.

What this material covers

Content and key concepts

On the previous page, from evaluation to grade decision.
The complex curve may well repeat the training points and do not go well between them. Therefore, the error on the new data is checked separately.
The selection of straight lines and the division of points makes it possible to see the learning process on simple data. Verification answers do not participate in the corrections.
Для изменения рисунка включитеJavaScript; расчёт и теория доступны далее.
You can remember the dots and you can't predict well between them.
Train is used to select parameters; validation is used for choosing degree, regularization and other solutions; test is used in the final evaluation after choice. The multiple test settings turn it into another validation; pre-treatment is also taught by tran: it is not possible to calculate the norm in advance.
DegreeD polynomial has D+1 coefficients:
y
^
(
x
)
=
∑
j
=
0
D
c
j
x
j
,
min
⁡
c
∥
X
c
−
y
∥
2
2
+
λ
∑
j
=
1
D
c
j
2
.
\hat y(x)=\sum_{j=0}^{D}c_jx^j,
\quad \min_c\|Xc-y\|_2^2+\lambda\sum_{j=1}^{D}c_j^2.
y
^
​
(
x
)
=
j
=
0
∑
D
​
c
j
​
x
j
,
c
min
​
∥
X
c
−
y
∥
2
2
​
+
λ
j
=
1
∑
D
​
c
j
2
​
.
Here Xij=xij. Bias c0 is not fined. With the growth of degree, the family of functions expands, but the curve found can start to follow the noise. When >0, the higher coefficients get the price; it's not magically removing all errors.
In the lab, eight fixed train dots are built as y=x2+noise·sin(17x). Seven separate validation points are estimated relative to x2. Degree1,2.7 and noise can be changed.
Validation does not participate in the decision of the system
The data are specifically synthetic, so this is a demonstration of the mechanism, not a statistical study of the quality of regression.
A manual counter-example.
The point(-1.1),(1.1) is accurately described as the constant1 and squared x2. Both models have a train error0. On the validation point(0.0) the square error is 1 and 0. From the zero traine errror, you cannot choose the correct continuation without preconditions.
Research.
Record the data and noise, increase the degree. Write both errors and co-officents. Then reduce the noise. The conclusion of the "big model is always worse" is incorrect: the result depends on data, regularization and optimization. A small curve can also be underfit.
Restriction.
A small fat solves normal equations with pivoting; for larger QR/SVD tasks, it is usually more sustainable. With the system out of the system, an error is shown, not an arbitrary successful graph.
After the validation settings, a separate test is needed for the final evaluation.
How do you compare errors of different types? How does this question continue?
Python examples of Chapter 06
Academic base

Textbook contents map