Chapter 3. Basic Algorithms – Classification, Regression, and Clustering

In the previous chapter, we reviewed the key Java libraries for machine learning and what they bring to the table. In this chapter, we will finally get our hands dirty. We will take a closer look at the basic machine learning tasks such as classification, regression, and clustering. Each of the topics will introduce basic algorithms for classification, regression, and clustering. The example datasets will be small, simple, and easy to understand.

The following is the list of topics that will be covered in this chapter:

  • Loading data
  • Filtering attributes
  • Building classification, regression, and clustering models
  • Evaluating models

Before you start

Download the latest version of Weka 3.6 from http://www.cs.waikato.ac.nz/ml/weka/downloading.html.

There are multiple download options available. We'll want to use Weka as a library in our source code, so make sure you skip the self-extracting executables and pick the ZIP archive as shown at the following image. Unzip the archive and locate weka.jar within the extracted archive:

Before you start

We'll use the Eclipse IDE to show examples, as follows:

  1. Start a new Java project.
  2. Right-click on the project properties, select Java Build Path, click on the Libraries tab, and select Add External JARs.
  3. Navigate to extract the Weka archive and select the weka.jar file.

That's it, we are ready to implement the basic machine learning techniques!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.186.143