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