Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage[utf8]{inputenc}
- \usepackage{amsmath}
- \usepackage{algorithm}
- \usepackage{algorithmic}
- \usepackage{relsize}
- \makeatletter
- \def\textsubscript#1{\ensuremath{_{\mbox{\textscale{.6}{#1}}}}}
- \makeatother
- \begin{document}
- \begin{algorithm}[H]
- \caption{OneR}\label{euclid}
- \textbf{Input:} D = {x1, x2, ยท ยท ยท , xn} // Training data
- \textbf{Output: }OneR Model
- \textbf{Method:}
- \begin{algorithmic}[1]
- \FOR {$ \textit{each attribute}, A\textsubscript{i} \epsilon D, $}
- \FOR {$ \textit{each attribute value}, A\textsubscript{ij} \epsilon A\textsubscript{i}, $}
- \STATE $ \textbf{Make a classification rule:}$
- \STATE $ \textit{ count how often each class appears} $
- \STATE $ \textit{ find the most frequent class }$
- \STATE $ \textit{ make the rule assign that class to this A\textsubscript{ij}} $
- \ENDFOR
- \STATE $ \textit{ Calculate the error rate of this attributeโs A\textsubscript{ij} rule.} $
- \ENDFOR
- \STATE $ \textit{ Choose the attribute A\textsubscript{i}} \epsilon D \textit{with the smallest error rate.} $
- \end{algorithmic}
- \end{algorithm}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement