Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132932 views
License: OTHER
1
\definecolor{c1}{HTML}{0072B2}
2
\definecolor{c2}{HTML}{009E73}
3
\begin{tikzpicture}
4
\tikzstyle{training}=[c1, thick,samples=200,dashed]
5
\tikzstyle{testing}=[c2, thick,samples=200]
6
\begin{axis}[
7
legend pos=north east,
8
legend cell align=left,
9
axis x line=middle,
10
axis y line=middle,
11
grid = major,
12
width=14cm,
13
height=8cm,
14
grid style={dashed, gray!30},
15
xmin=0, % start the diagram at this x-coordinate
16
xmax= 104, % end the diagram at this x-coordinate
17
ymin=0, % start the diagram at this y-coordinate
18
ymax= 0.98, % end the diagram at this y-coordinate
19
axis background/.style={fill=white},
20
xlabel=Epochs,
21
ylabel=Error,
22
y label style={at={(-0.1,1.0)}},
23
tick align=outside,
24
minor tick num=-3,
25
tension=0.08]
26
\addplot[domain=2:50, training] {(x-50)^2/2700 + 0.1};
27
\addplot[domain=4:50, testing] {(x-50)^2/2700 + 0.2};
28
29
\addplot[domain=50:100, training] {0.1};
30
\addplot[domain=50:100, testing] {(x-50)^2/10000 + 0.2};
31
32
\draw[dashed, very thick] (axis cs:50,0.0) -- (axis cs:50,0.3);
33
\draw[decoration={text along path, text={overfitting}, text align={center}}, decorate] (axis cs:51,0.16) -- (axis cs:90,0.16);
34
\draw[-{latex[scale=3.0]}, very thick] (axis cs:51,0.15) -- (axis cs:90,0.15);
35
36
\addlegendentry{Training set}
37
\addlegendentry{Validation set}
38
\end{axis}
39
\end{tikzpicture}
40
41