Laboratory: Machine Learning
CSC 105 The Digital Age Spring 2009

Goals:

This laboratory will be an experiment in machine learning.

Part I: Creating Training Data

Exercise 1

  1. Open a Linux Terminal and type the following command:
    kolourpaint ~weinman/courses/CSC105/labs/blank.bmp &
    This should open a paint window with a (tiny) empty image in it.
  2. Enlarge the image to a reasonable size (perhaps 600%).
  3. Click the "pencil" tool to the left of the image.
  4. Draw the letter, filling most of the image canvas, we selected in class.
  5. From the menu, click File ~ Save As.
  6. Save it in your home directory (the default location) as lastname.bmp (using your own last name, of course).
  7. Return to your terminal, and use the following commands to copy that file to our central repository:
    chmod 644 lastname.bmp
    cp -p lastname.bmp ~weinman/courses/CSC105/labs/ml/train/pos
    

Exercise 2

  1. Return to kolourpaint.
  2. Erase the contents of the image by selecting Image ~ Clear from the menu (or Control+Shift+N).
  3. Using the pencil again, draw a different character of your choice.
  4. Save the file (using the same name; this will overwrite the previous version of your file).
  5. Return to your terminal, and use the following commands to copy that file to our central repository:
    chmod 644 lastname.bmp
    cp -p lastname.bmp ~weinman/courses/CSC105/labs/ml/train/neg
    

Part II: Creating Testing Data

Exercise 1

    1. Return to kolourpaint.
    2. Erase the contents of the image by selecting Image ~ Clear from the menu (or Control+Shift+N).
    3. Using the pencil again, draw another version of the character we chose in class.
    4. Save the file (using the same name; this will overwrite the previous version of your file).
    5. Return to your terminal, and use the following commands to copy that file to our central repository:
      chmod 644 lastname.bmp
      cp -p lastname.bmp ~weinman/courses/CSC105/labs/ml/test/neg
      

    Exercise 2

    1. Return to kolourpaint.
    2. Erase the contents of the image by selecting Image ~ Clear from the menu (or Control+Shift+N).
    3. Using the pencil again, draw a different character of your choice.
    4. Save the file (using the same name; this will overwrite the previous version of your file).
    5. Return to your terminal, and use the following commands to copy that file to our central repository:
      chmod 644 lastname.bmp
      cp -p lastname.bmp ~weinman/courses/CSC105/labs/ml/test/neg
      
    Created: Jerod Weinman, March 16, 2009
    Adapted from Dave Reed, "A Balanced Introduction to Computer Science," Exercises 14.9, 14.10, and 14.13.