exercise:D10bcb88bf: Difference between revisions
From Stochiki
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
\newcommand{\mathds}{\mathbb}</math></div> | \newcommand{\mathds}{\mathbb}</math></div> | ||
Implement the naive separation algorithm, that picks one data point at random and then labels that half of the data set which is closest to the first point as <math>0</math> and the rest as <math>1</math>. Test the algorithm on the data set from [[ | Implement the naive separation algorithm, that picks one data point at random and then labels that half of the data set which is closest to the first point as <math>0</math> and the rest as <math>1</math>. Test the algorithm on the data set from [[exercise:61a5967859 |Problem]]. When generating the data, mark the data points with <math>0</math> and <math>1</math> and after running the separation algorithm, let your code count how many data points got classified correctly. |
Latest revision as of 02:34, 2 June 2024
[math]
\newcommand{\smallfrac}[2]{\frac{#1}{#2}}
\newcommand{\medfrac}[2]{\frac{#1}{#2}}
\newcommand{\textfrac}[2]{\frac{#1}{#2}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\e}{\operatorname{e}}
\newcommand{\B}{\operatorname{B}}
\newcommand{\Bbar}{\overline{\operatorname{B}}}
\newcommand{\pr}{\operatorname{pr}}
\newcommand{\dd}{\operatorname{d}\hspace{-1pt}}
\newcommand{\E}{\operatorname{E}}
\newcommand{\V}{\operatorname{V}}
\newcommand{\Cov}{\operatorname{Cov}}
\newcommand{\Bigsum}[2]{\mathop{\textstyle\sum}_{#1}^{#2}}
\newcommand{\ran}{\operatorname{ran}}
\newcommand{\card}{\#}
\renewcommand{\P}{\operatorname{P}}
\renewcommand{\L}{\operatorname{L}}
\newcommand{\mathds}{\mathbb}[/math]
Implement the naive separation algorithm, that picks one data point at random and then labels that half of the data set which is closest to the first point as [math]0[/math] and the rest as [math]1[/math]. Test the algorithm on the data set from Problem. When generating the data, mark the data points with [math]0[/math] and [math]1[/math] and after running the separation algorithm, let your code count how many data points got classified correctly.