forked from MartinThoma/LaTeX-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d436e1f
commit f182711
Showing
2 changed files
with
42 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,12 @@ | ||
\documentclass[varwidth=true, border=2pt]{standalone} | ||
\documentclass[border=2pt]{standalone} | ||
|
||
\usepackage{pgfplots} | ||
\usepackage{tikz} | ||
\usepackage{xcolor} | ||
\usetikzlibrary{positioning} | ||
\usetikzlibrary{decorations.text} | ||
\usetikzlibrary{decorations.pathmorphing} | ||
|
||
\begin{document} | ||
\begin{tikzpicture} | ||
\begin{axis}[ | ||
legend pos=north east, | ||
axis x line=middle, | ||
axis y line=middle, | ||
grid = major, | ||
width=10cm, | ||
height=10cm, | ||
grid style={dashed, gray!30}, | ||
xmin=0, % start the diagram at this x-coordinate | ||
xmax= 100, % end the diagram at this x-coordinate | ||
ymin=0, % start the diagram at this y-coordinate | ||
ymax= 0.98, % end the diagram at this y-coordinate | ||
axis background/.style={fill=white}, | ||
xlabel=Epochs, | ||
ylabel=Error, | ||
tick align=outside, | ||
minor tick num=-3, | ||
enlargelimits=true, | ||
tension=0.08] | ||
\addplot[domain=2:50, red, thick,samples=200,dashed] {(x-50)^2/2700 + 0.1}; | ||
\addplot[domain=4:50, green, thick,samples=200] {(x-50)^2/2700 + 0.2}; | ||
|
||
\addplot[domain=50:100, red, thick,samples=200,dashed] {0.1}; | ||
\addplot[domain=50:100, green, thick,samples=200] {(x-50)^2/10000 + 0.2}; | ||
|
||
\draw[dashed] (axis cs:50,0.1) -- (axis cs:50,0.2); | ||
\draw[decoration={text along path, text={overfitting}, text align={center}}, decorate] (axis cs:51,0.15) -- (axis cs:90,0.15); | ||
\draw[->] (axis cs:51,0.15) -- (axis cs:90,0.15); | ||
|
||
\addlegendentry{Training} | ||
\addlegendentry{Testing} | ||
\end{axis} | ||
\end{tikzpicture} | ||
\input{overfitting} | ||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
\definecolor{c1}{HTML}{0072B2} | ||
\definecolor{c2}{HTML}{009E73} | ||
\begin{tikzpicture} | ||
\tikzstyle{training}=[c1, thick,samples=200,dashed] | ||
\tikzstyle{testing}=[c2, thick,samples=200] | ||
\begin{axis}[ | ||
legend pos=north east, | ||
legend cell align=left, | ||
axis x line=middle, | ||
axis y line=middle, | ||
grid = major, | ||
width=14cm, | ||
height=8cm, | ||
grid style={dashed, gray!30}, | ||
xmin=0, % start the diagram at this x-coordinate | ||
xmax= 104, % end the diagram at this x-coordinate | ||
ymin=0, % start the diagram at this y-coordinate | ||
ymax= 0.98, % end the diagram at this y-coordinate | ||
axis background/.style={fill=white}, | ||
xlabel=Epochs, | ||
ylabel=Error, | ||
y label style={at={(-0.1,1.0)}}, | ||
tick align=outside, | ||
minor tick num=-3, | ||
tension=0.08] | ||
\addplot[domain=2:50, training] {(x-50)^2/2700 + 0.1}; | ||
\addplot[domain=4:50, testing] {(x-50)^2/2700 + 0.2}; | ||
|
||
\addplot[domain=50:100, training] {0.1}; | ||
\addplot[domain=50:100, testing] {(x-50)^2/10000 + 0.2}; | ||
|
||
\draw[dashed, very thick] (axis cs:50,0.0) -- (axis cs:50,0.3); | ||
\draw[decoration={text along path, text={overfitting}, text align={center}}, decorate] (axis cs:51,0.16) -- (axis cs:90,0.16); | ||
\draw[-{latex[scale=3.0]}, very thick] (axis cs:51,0.15) -- (axis cs:90,0.15); | ||
|
||
\addlegendentry{Training set} | ||
\addlegendentry{Validation set} | ||
\end{axis} | ||
\end{tikzpicture} |