COSC 388: Machine Learning

Project 1
Fall 2006

Due: Sep 29 @ 5 PM
4 points

  1. Write a program to read, parse, and store examples in Mark's File Format (mff). Consider the following version of the Bikes data set:

    Make Tires Handle Bars Water Bottles Weight Bike Type
    Trek Knobby Straight 1 250.3 Mountain
    Bridgestone Treads Straight 2 200.1 Hybrid
    Cannondale Knobby Curved 0 222.9 Mountain
    Nishiki Treads Curved 1 190.3 Hybrid
    Trek Treads Straight 2 196.8 Hybrid

    The file bikes.mff shows this data set in Mark's File Format. Files containing valid data sets begin with '@dataset' followed by an identifier. Attribute declarations appear next. The string '@attribute' precedes each declaration, which is for a symbolic attribute, a discrete attribute, or a numeric attribute. The attribute's name appears next, followed by its domain. The domain for symbolic attributes is a list of values separated by whitespace. The domain for discrete attributes is simply a positive integer, with zero being the first legitimate value. The domain for numeric attributes is not explicitly specified and is assumed to be the set of representable floating-point numbers.

    The token '@examples' separates the attribute declarations from the examples, which are simply values separated by whitespace.

    Comments begin with the pound character (#), and are followed by one or more spaces and the body of the comment. They are inline comments, so the parser can ignore the rest of the line following the start of a comment.

    For simplicity, you can assume that all elements of the file are separated by at least one space character. Moreover, attribute declarations and examples will appear on single lines.

  2. In subsequent projects, operations on the data set you will need to perform include I would recommend implementing two structures: one for the information about attributes, and one for the examples themselves.

  3. The program should take input from the command line. Use -t to specify the name of the training file and use -T to specify the name of the testing file, if any.
    % readdata -t bikes.mff
    % readdata -t bikes.train
    % readdata -t bikes.train -T bikes.test
    % readdata -t bikes-tr.mff -T bikes-te.mff
    
    The program should perform light checks for proper formatting and data integrity. For this project, the program can simply output the examples of the input files to the console.

  4. Implement the program using the language of your choosing (e.g., ANSI C, ANSI C++, Java, Fortran 77, Lisp, ruby, python); however, it must compile and run on my Unix machine. If using C, C++, or Fortran, use make. Makefile.c and Makefile.c++ are examples, but at some point before the due date, I'll conduct a tutorial on the mysterious world of makefiles. The implementation must be general, meaning that it should work for all possible data sets. Do not use static data structures. You must implement your program using the standard libraries the language provides. If you want to use something non-standard, check with me first.
Instructions for Submission: In the header comments, provide the following information:
//
// Name
// E-mail Address
// Platform: Windows, OS X, Linux, Solaris (daruma), etc.
// Language/Environment: gcc, g++, java, g77, etc.
//
// In accordance with the class policies and Georgetown's Honor Code,
// I certify that, with the exceptions of the class resources and those
// items noted below, I have neither given nor received any assistance
// on this project.
/
When you are ready to submit your program for grading, create a compressed archive of a directory containing only your project's source, and send it to me by e-mail as an attachment. The directory's name should be the same as your net ID.

For example, assume your net ID is ab123. If the directory p1 contains your project, then rename the directory to ab123.

To make the archive smaller, remove any object files, such as .class, a.out, and .o files.

Use zip, tar, or jar to create an archive:

% zip ab123.tar ab123/*
% tar -cf ab123.tar ab123
% jar -cf ab123.jar ab123
Use jar only for Java projects. If you use jar or tar, then compress the archive by typing
% gzip ab123.tar
% gzip ab123.jar
which creates a file ab123.tar.gz and ab123.jar.gz, respectively.

N.B. If you use zip, then you need to change the extension of your file to something other than .zip, as UIS strips .zip attachments. The extension .piz works pretty well. So you'd rename ab123.zip to ab123.piz.

Attach the file containing your project to an e-mail and send it to me.

Make sure you send a carbon copy of your project to yourself, so you'll have a record of when you submitted your project. Ideally, also keep a copy on a university or department machine. However, make sure that your archive, directory, or files are not readable by others.

Submit your project before 5:00 P.M. on the due date.