Book Image

Hands-On Artificial Intelligence with Java for Beginners

By : Nisheeth Joshi
Book Image

Hands-On Artificial Intelligence with Java for Beginners

By: Nisheeth Joshi

Overview of this book

Artificial intelligence (AI) is increasingly in demand as well as relevant in the modern world, where everything is driven by technology and data. AI can be used for automating systems or processes to carry out complex tasks and functions in order to achieve optimal performance and productivity. Hands-On Artificial Intelligence with Java for Beginners begins by introducing you to AI concepts and algorithms. You will learn about various Java-based libraries and frameworks that can be used in implementing AI to build smart applications. In addition to this, the book teaches you how to implement easy to complex AI tasks, such as genetic programming, heuristic searches, reinforcement learning, neural networks, and segmentation, all with a practical approach. By the end of this book, you will not only have a solid grasp of AI concepts, but you'll also be able to build your own smart applications for multiple domains.
Table of Contents (14 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Discretizing attributes


We will now look at how to discretize attributes using Weka. First, let's explain what discretization is. Discretizing attributes means discretizing a range of numeric attributes in the dataset into nominal attributes. Hence, discretization is actually creating numeric data into categories. We will use binning for this; it skips the class attribute, if set.

 

Suppose that we have values from 1 to 60, and we want to categorize them into three different categories. Instead of creating numeric data, we want to create categorical data. We will create three bins. Let's create a bin for all of the values from 0 to 20, another bin for the values from 20 to 40, and a third bin for the values from 40 to 60. Every numeric data will become categorical data, using discretization.

We will now use the following options:

  • -B<num>: This specifies the number of bins in which to divide the numeric attributes. The default value is 10.
  • -R(col1,col2-col4,..): We have to assign the columns...