CS6220F13 homework01

This is the instruction page for homework01 of CS6220F13.

Last update: 2013.10.08 16:00 AM


Student first must register to the submission system. It needs to be done only once throughout the course. Check the previous registration page for details of registration. The turnin code is "homework01".

File Names & Format

You can upload up to 3 different classification models. (If you have less than 3 classification models, I would strongly encourage you to include the two sample programs, rich.pl and poor.pl. These simple classification models are often strong enough to beat your model.) Each model should be named run1, run2, and run3, respectively. (No extension such as '.py', '.exe', '.java', '.pl', '.class', '.jar', etc should be in the file names.) Grading is done automatically, so please name the files correctly. Each program's input argument is as follows. Instead of having "result.txt" as the default output file, as in the previous homework description, we changed the configuration and now the program must get output file name from input argument.

$ <run_script> <input_test_file> <output_file>

Example run:

$ ./run1 data/in.txt out/out.txt

Sample code is uploaded at "/course/cs6220f13/code/src/homework01/src" of CCIS cluster. These 6 files show how your src code files should be formatted. You may download and build your homework on top of these files.

yerihyo@hook:/course/cs6220f13/code/src/homework01/src$ ls -l
total 12
-rwxr-xr-x 1 yerihyo grads 308 Oct  6 22:05 halfnhalf.pl
-rwxr-xr-x 1 yerihyo grads 256 Oct  6 22:05 poor.pl
-rwxr-xr-x 1 yerihyo grads 255 Oct  6 22:05 rich.pl
-rwxr-xr-x 1 yerihyo grads  28 Oct  6 21:57 run1
-rwxr-xr-x 1 yerihyo grads  29 Oct  6 21:57 run2
-rwxr-xr-x 1 yerihyo grads  33 Oct  6 21:57 run3

The three perl files, halfnhalf.pl, poor.pl, and rich.pl, are classification programs written in Perl. Each perl program gets two input arguments, input_file, and output_file. I made three bash script files, run1, run2, and run3 to match the submission file format. Each bash file is a dummy script file which does nothing but forward arguments to the perl files. Don't worry about permission of submitted files because I'll add execute permission to all your files before running. However, please add execution path comment at the first line of your files whenever needed. For instance, in case of a python file, the first line of the file should be something like "#!/usr/bin/python", in case of a bash script file, it should be something like "#!/bin/bash". The following table shows my example run1 bash script.

yerihyo@hook:/course/cs6220f13/code/src/homework01/src$ cat run1

./poor.pl $1 $2

Copying files from your local machine to CCIS Linux machines

Mac & Linux

The easiest way is to copy files from your machine to CCIS machines is to use rsync. Given that you are at the base directory of your homework, you can simply rsync between your current directory and the target directory you want to copy your files. The following code will copy all the files and folders below your folder to directory /home/yerihyo/tmp/ in the hook.ccs.neu.edu machine. Since all the CCIS Linux machines share your home folder, sending it to any machine should work.

yerihyo@laptop:/home/yerihyo/src/homework01/src$ rsync -avz ./ hook.ccs.neu.edu:/home/yerihyo/tmp/
sending incremental file list
sent 6103 bytes  received 31 bytes  4089.33 bytes/sec
total size is 20604  speedup is 3.36


psftp is an easy way to transfer files from your local machine to CCIS Linux machines.

Testing Format

Once you've finished writing your program, you may test your program using test_format script (/course/cs6220f13/code/src/homework01/grading/test_format.bash), whether you programs follow correct input format. This script is only for testing whether your program is correctly following input/output formats. The score from the script is bogus.

The script expect your run scripts (run1, run2, run3) be in the current folder. In case of the following example, because my run{1,2,3} files are at "/course/cs6220f13/code/src/homework01/src", I ran the script from that folder. The script creates and automatically removes a folder named "tmp_grading" while testing. So please make sure you don't have such folder before testing.

yerihyo@hook:/course/cs6220f13/code/src/homework01/src$ /course/cs6220f13/code/src/homework01/grading/test_format.bash
Output files on sample test file (file:/course/cs6220f13/code/src/homework01/data/training.nolabel.txt)
run1 (result file: tmp_grading/test/run1.result)
run2 (result file: tmp_grading/test/run2.result)
run3 (result file: tmp_grading/test/run3.result)

Bogus score on sample test file (file:/course/cs6220f13/code/src/homework01/data/training.nolabel.txt)
run1: 24720/32561 (file:tmp_grading/test/run1.score)
run2: 7841/32561 (file:tmp_grading/test/run2.score)
run3: 16280/32561 (file:tmp_grading/test/run3.score)
======= TEST SUCCESSFUL (test_format.bash) ======

If your output format is wrong, the script will print the error message and halt.

yerihyo@hook:/course/cs6220f13/code/src/homework01/src$ /course/cs6220f13/code/src/homework01/grading/test_format.bash 
Something very wrong at -e line 1, <> line 1.


After testing, you submit your files using system's turnin script as follows. The "project" code is "homework01" as in the example below. You can turnin the whole directory (and the sub directories) as in the following example. The submission confirmation email you get is a submission confirmation email not a confirmation email saying that your result is correct. You may submit multiple times, and you will get a confirmation email each time you submit. Only the last submission will be graded.

Please be careful not to include relative path in your code pointing outside your current directory. Also, if you use privately-installed libraries with absolute path, please make sure I have permission to run them. Take special care with locally installed CRAN, CPAN packages, and similar.

yerihyo@hook:/course/cs6220f13/code/src/homework01/src$ /course/cs6220f13/bin/turnin homework01 ./
Warning: Project homework01 is actually due at 10/14/2013 23:59:59.  Are you sure you wish to submit it now? [yn]: y
  Added file run3 (34 bytes, md5 f8c339...)
  Added file halfnhalf.pl (308 bytes, md5 909575...)
  Added file poor.pl (256 bytes, md5 f8bef2...)
  Added file run2 (29 bytes, md5 4e679c...)
  Added file rich.pl (255 bytes, md5 963086...)
  Added file run1 (29 bytes, md5 d429c1...)
Successfully submitted homework01 for user yerihyo (confirmation hXXjos).
Submitted a total of 6 files (911 bytes) in 1 directories.

Sending confirmation email to: yerihyo@ccs.neu.edu
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License