Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Here in the project we are going to predict if a person can get diabetes by using
some simple attributes. Naive bayes predicts that by using bayes theorem for
example, lets consider single attribute pregnancy to see true positive value. First
value is 6 so considering it as p(a)=6/100 and p(b)=4/100 then p(e1)=1/768
therefore after substituting the value in the formula
p(e/a)=p(e1/a).p(a)/p(e1/a)+p(e2/b) then we will get 0.65 which is the true
negative hence we can calculate true positive now it is 0.35
Java code for naïve bayes
//build model
NaïveBayes model=new Naïvebaiyes();
mode1.buildclassifier(train);
//use
Evaluation eval_train=new evaluation(test);
Eval train.evaluatemodel(model, test);
Logistic regression