Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132930 views
License: OTHER
1
\documentclass{article}
2
\usepackage[pdftex,active,tightpage]{preview}
3
\setlength\PreviewBorder{2mm}
4
5
\usepackage[utf8]{inputenc} % this is needed for umlauts
6
\usepackage[ngerman]{babel} % this is needed for umlauts
7
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
8
\usepackage{amssymb,amsmath,amsfonts} % nice math rendering
9
\usepackage{braket} % needed for \Set
10
\usepackage{algorithm,algpseudocode}
11
12
\DeclareMathOperator*{\argmin}{arg\,min}
13
14
\begin{document}
15
\begin{preview}
16
\begin{algorithm}[H]
17
\begin{algorithmic}
18
\Require Trainingsdaten $X$ jeweils mit Klasse $K(X)$, Attribute~$A$,
19
Qualitätsfunktion $\varphi$
20
\Procedure{ID3}{$X$, $A$}
21
\If{$K(x_i) = K(x_j) \;\;\;\forall x_i, x_j \in X$}
22
\State \Return Klasse $K(x_0)$
23
\Else
24
\State $a_\text{min} \gets \argmin_{a \in A} \varphi(a)$
25
\State $n \gets \Call{CreateNode}{}$
26
\For{Attributwert $w$ in $a_\text{min}(X)$}
27
\State $X_{a_\text{min} = w} \gets \{x \in X | a_\text{min}(X) = w\}$
28
\State $child \gets \Call{ID3}{X_{a_\text{min}}, A}$
29
\State $n.\Call{AddChild}{child}$
30
\EndFor
31
\State \Return $n$
32
\EndIf
33
\EndProcedure
34
\end{algorithmic}
35
\caption{ID3 Algorithmus}
36
\label{alg:ID3}
37
\end{algorithm}
38
\end{preview}
39
\end{document}
40
41