WPI Worcester Polytechnic Institute

Computer Science Department
------------------------------------------

CS539 Machine Learning. Spring 2009 
Project 1 - Using the Weka System to Preprocess Datasets

PROF. CAROLINA RUIZ 

DUE DATE: Thursday, Jan 29th 2009. Slides are due at 1:00 (by email to Prof. Ruiz) and a hardcopy of the written report is due at 3:30 pm (beginning of class).  ------------------------------------------


PROJECT DESCRIPTION

The purpose of this project is two-fold:

PROJECT ASSIGNMENT

  1. Download and install the latest developer version of Weka (currently weka-3-5-4) following the instructions on the course webpage.

  2. You can find the Weka code in a file called "weka-src.jar", which should be located in the directory where Weka was installed. This "weka-src.jar" file is a zip file. Hence you need to winzip or unzip it to extract its contents. Inside, you will find the .java files that implement Weka.

  3. Read in detail the "Explorer Guide" and the "Experimenter Tutorial" provided with the Weka system. Browse through the "Package Documentation" to become familiar with it.

  4. Datasets: Consider the following datasets:

    1. The iris data (available in the data directory of the Weka system as the "iris.arff" file).

    2. The census-income (also called "adult") dataset from the US Census Bureau which is available at the Univ. of California Irvine (UCI) Data Repository.
      The census-income dataset contains census information for 48,842 people. It has 14 attributes for each person (age, workclass, fnlwgt, education, education-num, marital-status, occupation, relationship, race, sex, capital-gain, capital-loss, hours-per-week, and native-country) and a boolean attribute class classifying the input of the person as belonging to one of two categories >50K, <=50K.

      Convert the census-income data to the arff format. For this you can either use any tools provided by Weka, or you can make the conversion outside the Weka system using other tools (e.g., a word editor, Excel, etc.). Create a census-income.arff file with the converted dataset.

  5. Experiments: For each of the above datasets:

    1. Use the "Explorer" option of the Weka system to perform the following operations:
      • Open the dataset in Weka.
      • Preprocess the dataset attributes using Weka's filters. In particular,
        • explore different ways of discretizing continuous attributes. That is, convert numeric attributes into "nominal" ones by binning numeric values into intervals.
          • Use the Discretize filter under the Supervised Filters. Play with the filter and its parameters. Read the Java code implementing it, and describe this code and the meaning of each parameter in your written report.
          • Use the Discretize filter under the Unsupervised Filters. Play with the filter and its parameters. Read the Java code implementing it, and describe this code and the meaning of each parameter in your written report.
        • explore different ways of removing missing values. Missing values in arff files are represented with the character "?". See the weka.filter.ReplaceMissingValuesFilter in Weka. Play with the filter and read the Java code implementing it.
    2. Use both the "Explorer" and the "Experimenter" options of the Weka system in turn to run the "ZeroR" and the "OneR" classifiers (under the "Classify" tab) over the above datasets. Use different ways of testing your results. That is, explore the following alternatives offered by the Weka system:
      • Testing your results over the training data.
      • Splitting your input file into two parts one for training and one for testing.
      • Using n-fold crossvalidation. Play with different values for n.
      Analyze the results obtained (i.e., interpret the meaning of the output produced by Weka). In particular, pay attention to the model constructed, the accuracy (percentage of correctly classified instances), the error (percentage of incorrectly classified instances), the confusion matrices, and any other part of the output that you find interesting. Read to the Java code implementing the ZeroR and the OneR classifiers.

    3. Run several experiments with your data and the system varying the parameters so that you gain familiarity with the system.

ORAL AND WRITTEN REPORTS AND DUE DATE