-
Notifications
You must be signed in to change notification settings - Fork 0
/
model-fitting.tex
26 lines (17 loc) · 1 KB
/
model-fitting.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
\documentclass[tikz, border=1cm]{standalone}
\definecolor{ACMOrange}{RGB}{252, 146, 0}
\definecolor{ACMRed}{RGB}{253, 27, 20}
\definecolor{ACMPurple}{RGB}{101, 1, 107}
\begin{document}
\begin{tikzpicture}[scale=2, domain=-2:2, y=0.5cm]
\draw[->, thick] (-2.25,-0.25) -- (2.25,-0.25) node [below] {Model complexity};
\draw[->, thick] (-2.25,-0.25) -- (-2.25,5) node [midway, left] {Model error};
\draw[dashed, thick] (0,-0.25) node [below, text width=3cm, align=center] {Optimal model complexity} -- (0,5) ;
\draw[->, thick] (-0.5,4) -- (-1.5,4) node [midway, above] {Underfitting};
\draw[->, thick] (0.5,4) -- (1.5,4)node [midway, above] {Overfitting};
\coordinate (O) at (0,0);
\draw[ACMRed, thick] plot[samples=100] (\x, {2^\x + 2^(-\x)}) node[above right] {Overall model error};
\draw[ACMPurple, thick] plot[samples=100] (\x, {2^(\x)}) node[right] {Modelled noise (variance)};
\draw[ACMOrange, thick] plot[samples=100] (\x, {2^(-\x)}) node[right] {Unmodelled information (bias)};
\end{tikzpicture}
\end{document}