From the course: Data Science for Java Developers

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Calculating the possible labels

Calculating the possible labels - Java Tutorial

From the course: Data Science for Java Developers

Calculating the possible labels

- [Instructor] Okay, so now that we know a little bit more about what a Naive Bayes classifier is and how it works, the next thing we're going to do is see how to actually implement one in Java. And this is going to be a slightly tricky process. So as we're walking through it, if you don't understand something, don't focus too much on that. Just focus on actually making the program work and getting a high-level idea of what's going on. So the first thing we're going to do is we're going to create a new Java class. We'll just call this one NaiveBayesExample. And we're just going to copy the code from our KNNExample here. And that will give us a good start anyway since we're already loading all the flower data. We'll just need to change this to a Bayes classifier. Okay, and now that we've done that, the next thing we're going to do is we're going to create a new class which will actually be the Naive Bayes classifier itself.…

Contents