Assignment 0: Introduction + Python

Corresponding TA: Raymond Yeh

Overview

Release Date: 08/29/17

Due Date: 09/14/17

In this assignment you will:


Written Section

Exercise:


Programming Section

Part 1: Setup

For this course, we will provide support when working on EWS machines. Feel free to develop on whatever system you prefer, however do test your code on the EWS machines.

EWS instructions

ssh (netid)@remlnx.ews.illinois.edu

You may need vpn if you are not on a campus network.

module load python/3.4.3
virtualenv --system-site-packages ~/ece544na_fa2017
source ~/ece544na_fa2017/bin/activate
pip install --upgrade pip
svn co https://subversion.ews.illinois.edu/svn/fa17-ece544/(netid)
cd (netid)
svn cp https://subversion.ews.illinois.edu/svn/fa17-ece544/_shared/mp0 .
cd mp0
pip install -r requirements.txt

Part 2: Exercise

In this exercise you will be working with economic news data. The dataset contains titles of new articles and a corresponding score indicating the positivity of the title, the higher the more positive. You will process the data and find out which of the words indicates positivity.

High level overview.

In main.py the overall program structure is provided for you. We start with loading the data from file, followed by processing the data, then finally printing the results to screen. Read over this file to understand the overall objective.

You do not have to edit this file. Revelant File: main.py

To run:

python main.py

Reading in data.

In io_tools.py, you will fill in two functions for reading and writing to file in txt format. Read the docstring for more details.

The txt format is tab separated in the order of article_id, title, positivity score.

For example:

000    Yields on CDs Fell in the Latest Week    3.0

The article_id is 000, the title is “Yields on CDs Fell in the Latest Week”, with the score of 3.0, indicating the title is more negative.

Revelant File: io_tools.py

Data processing

in data_tools.py you will fill in functions for basic feature processing. Read docstring for more details.

Revelant File: data_tools.py

Writing tests

In test.py, we have provided a basic testing framework using unittest along with some test cases. Feel free to write more test cases.

Revelant File: test.py

To run the tests use the following command:

python test.py

Part 3: Submit

Submitting your code is simply commiting you code. This can be done with the follow command:

svn commit -m "Some meaningful comment here."

Note: The assignment will be autograded. It is important that you do not use additional libraries, or change the provided functions input and output.