From the course: Data Science for Java Developers

Unlock this course with a free trial

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

Creating a DataItem interface

Creating a DataItem interface - Java Tutorial

From the course: Data Science for Java Developers

Creating a DataItem interface

- [Narrator] Okay. So now that we've got our flower data loaded into our program, let's start actually building out a K-nearest neighbor classifier. So we're going to create a new class here and we're going to call that class KNN Classifier. And before we actually get started building this class out it's a good idea for us to come up with some way of representing our data points in more of a generic way using an interface, right? Because otherwise our implementation of this KNN classifier will be tied directly to our Flower Record class. Which would make it pretty useless if we wanted to turn around and use it for some other type of data, right? So we're going to create an interface here that we're going to use. And we're going to call that interface, data item. Okay. And the way this interface is going to work is it's going to have two methods. The first method, is going to return a list of doubles and we're going…

Contents