title: Implementing Naïve Bayes algorithm in Java - Need some guidance
body: <p>As a School assignment i'm required to implement Naïve Bayes algorithm which i am intending to do in Java.</p>
  
  <p>In trying to understand how its done, i've read the book "Data Mining - Practical Machine Learning Tools and Techniques" which has a section on this topic but am still unsure on some primary points that are blocking my progress.</p>
  
  <p>Since i'm seeking guidance not solution in here, i'll tell you guys what i thinking in my head, what i think is the correct approach and in return ask for correction/guidance which will very much be appreciated. please note that i am an absolute beginner on Naïve Bayes algorithm, Data mining and in general programming so you might see stupid comments/calculations below:</p>
  
  <p>The training data set i'm given has 4 attributes/features that are numeric and normalized(in range[0 1]) using Weka (no missing values)and one nominal class(yes/no) </p>
  
  <p>1) The data coming from a csv file is numeric  HENCE </p>
  
  <ul> * Given the attributes are numeric i use PDF (probability density function) formula.
  <ul>+ To calculate the PDF in java i first separate the attributes based on whether they're in class yes or class no and hold them into different array <code>(array class yes and array class no) </code></ul>
  <ul>+ Then calculate the mean(<code>sum of the values in row / number of values in that row</code>) and standard divination for each of the 4 attributes (columns) of each class</ul>
  <ul>+ Now to find PDF of a given value(n) i do <code>(n-mean)^2/(2*SD^2),</code> </ul>
  <ul>+  Then to find <code>P( yes | E) </code> and <code>P( no | E) </code> i <code>multiply the PDF value of all 4 given attributes and compare which is larger</code>, which indicates the class it belongs to  </ul> 
  </ul>
  
  <p>In temrs of Java, i'm using <code>ArrayList of ArrayList</code> and <code>Double </code> to store the attribute values.</p>
  
  <p>lastly i'm unsure how to to get new data? Should i ask for input file (like csv) or command prompt and ask for 4 values?</p>
  
  <p>I'll stop here for now (do have more questions) but I'm worried this won't get any responses given how long its got. I will really appreciate for those that give their time reading my problems and comment. </p>