Teacher: Leonardo Villani
Autors: Andrey Naldoni,Yunes Noronha and Paulo Barros
This project is an aplication of A.I. concepts using Weka for show the use of Nearest Neighbor and K-Nearest Neighbor algorithm.
Concepts you need know before enjoy this project.
- Java - Programming Language
- Weka - library for Java
- Artificial Intelligence - machine learning and data mining
- Nearest Neighbor - algorithm
- K-Nearest Neighbor - algorithm
An small explain about Weka...
Weka is a collection of machine learning algorithms for data mining tasks. The algorithms can either be applied directly to a dataset or called from your own Java code. Weka contains tools for data pre-processing, classification, regression, clustering, association rules, and visualization. It is also well-suited for developing new machine learning schemes.
This project requires JDK 8+,JRE 8+ and Java IDE, we recommend Eclipse to run.
After install this programs, clone our project and use the class CarroClassify.java to test our data source or use as an example to test any other.
In CarroClassify.java you can see this code to set parameters about your machine learning data
String dataSourceToLearn = "carro.arff";
String dataSourceToClassify = "carro-a-classificar.arff";
int classIndex = 6;
int classPossibilites = 4;
int partitions = 5;
int iterations = 5;
Questions about that variables? Consult the documentation about IBK implementations to understand these parameters
This code below is to apply the Nearest Neighbor algorithms in the base as you have been set in the parameters
NearestNeighbor nn;
System.out.println("==========Using Nearest Neighbor==========\n");
nn = new NearestNeighbor(dataSourceToLearn, dataSourceToClassify, classIndex, classPossibilites);
System.out.println(nn.getResults());
If you want to use K-Nearest Neighbor, use this code below
KNearestNeighbor knn;
System.out.println("\n=========Using K-NearestNeighbor=========\n");
knn = new KNearestNeighbor(partitions, iterations, dataSourceToLearn, classIndex, classPossibilites);
System.out.println(knn.getResults());
Weka.jar file is disponible in the project root, if Eclipse acuses an error in this deppendence update the file path.
Want to contribute? Great!
Send your commit and we'll see your code an answer!
Thank you for visiting and use this project as you want!
Free Software, Yeah!