Reader small image

You're reading from  Hands-On Artificial Intelligence with Java for Beginners

Product typeBook
Published inAug 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789537550
Edition1st Edition
Languages
Right arrow
Author (1)
Nisheeth Joshi
Nisheeth Joshi
author image
Nisheeth Joshi

Nisheeth Joshi is an associate professor and a researcher at Banasthali University. He has also done a PhD in Natural Language Processing. He is an expert with the TDIL Program, Department of IT, Government of India, the premier organization overseeing language technology funding and research in India. He has several publications to his name in various journals and conferences, and also serves on the program committees and editorial boards of several conferences and journals.
Read more about Nisheeth Joshi

Right arrow

Filtering attributes


We will learn how to filter attributes in this section. Let's start with the code.

We will first import the following packages and classes:

import weka.core.Instances;
import weka.core.converters.ArffSaver;
import java.io.File;
import weka.core.converters.ConverterUtils.DataSource;
import weka.filters.Filter;
import weka.filters.unsupervised.attribute.Remove;

We imported the Instances, ArffSaver, File, and DataSourceclasses from their respective packages, as seen in the preceding code. We used them in the previous chapter, as well. The Instance class will take the database into the memory, and we will work with the dataset in the memory. The ArffSaver class will help us to save our dataset onto the disk. The File class will give the name to the disk, and the DataSource class will open the dataset from the disk.

As you can see in the preceding code snippet, we imported a new class, Filter, from the weka.filters package. We can apply filters using the Filter class. The filter...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Artificial Intelligence with Java for Beginners
Published in: Aug 2018Publisher: PacktISBN-13: 9781789537550

Author (1)

author image
Nisheeth Joshi

Nisheeth Joshi is an associate professor and a researcher at Banasthali University. He has also done a PhD in Natural Language Processing. He is an expert with the TDIL Program, Department of IT, Government of India, the premier organization overseeing language technology funding and research in India. He has several publications to his name in various journals and conferences, and also serves on the program committees and editorial boards of several conferences and journals.
Read more about Nisheeth Joshi