Home » Machine Learning/Artificial Intelligence

Introduction to weka and Machine learning in Java

In this article, we will learn about weka api and will see that how can we use it in our eclipse IDE?
Submitted by Raunak Goswami, on August 28, 2018

What is weka, and how do we use it in machine learning for java?

Weka is basically a machine learning software developed by the University of Waikato. The software Is written in Java programming language. Weka.jar contains various predefined classes which include classes for various regression and classification techniques which are using in machine learning. So, using weka the java developers just have to create an object of a particular machine learning class that they want to use. This reduces the code length as the developers don’t have to code the various machine learning techniques or algorithms from the scratch.

Not only that, weka also has various predefined classes for feature selection that come in very handy. The software is open source and can be downloaded for free of cost. So, without wasting any time let us now look at how to include weka.jar in your java project library. I would be using Eclipse Helios, you can you any eclipse version for Java. First of all, you need to download weka.jar for which can be download from here: Weka.jar

1) Now open your Eclipse ide and create a new java project by clicking on file option → new → java project and you will see a dialogue box as follows:

Machine Learning with Java 1

2) Write the name of your project and the click on next, after clicking you should get a dialog box as shown below:

Machine Learning with Java 2

3) Here, click on the libraries option located right to the libraries option you will see a dialog box a shown below:

Machine Learning with Java 3

4) At your right you will see multiple options, there you will see an option to add external JARs… which is at the second place from the top, here select the weka.jar file that you have downloaded from the link your dialog box should look like this:

Machine Learning with Java 4

Now, click on finish and you successfully added the weka library files in your project now you just have to import those class files in your code, to test that whether you have successfully added the weka class files or not, just create a new class inside your project and write "import weka". As you write the following statement you will see a list of suggestions shown by the Eclipse IDE. This indicated that the weka classes have been included.

Hope you have understood the basics of weka and its installation in eclipse IDE. The dataset that we would be preferred for machine learning using weka will have. are an extension and not the conventional.CSV extension. In my upcoming articles, we will have a look at, how we can convert .CSV to .arff using Eclipse IDE. Till then have a great day ahead and keep learning.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.