Overview
Download the assignment file assignment1.zip
.
The ipython notebooks
sparse-classifiers.ipynb
and
dense-classifier.ipynb
contain more detailed instructions.
We recommend sparse-classifiers.py
first since it has more complete helper code to get you used to the setup.
After you downloaded and unzipped assignment1.zip
:
- run
jupyter notebook
in the assignment folder - Find starter code inside
a1
, where most of the parts you have to implement are marked withTODO
Submitting your work:
Once you are done
working run the collectSubmission.sh
script; this will produce a file called
assignment1.zip
. Submit this to the class Dropbox.
The written part should be included, either in the notebook, or as a separate file. If you worked with a partner, please submit one answer (unless you substantially disagree on it). Include the ids of both partners.
Setup
Installing Python 3.5+:
To use python3, make sure to install version 3.5 or 3.6 on your local machine. If you are on Mac OS X, you can do this using Homebrew with brew install python3
. You can find instructions for Ubuntu here.
Virtual environment: If you decide to work locally, we recommend using virtual environment for the project. If you choose not to use a virtual environment, it is up to you to make sure that all dependencies for the code are installed globally on your machine. To set up a virtual environment, run the following:
cd assignment1
sudo pip install virtualenv # This may already be installed
virtualenv -p python3 .env # Create a virtual environment (python3)
# Note: you can also use "virtualenv .env" to use your default python (usually python 2.7)
source .env/bin/activate # Activate the virtual environment
pip install -r requirements.txt # Install dependencies
# Work on the assignment for a while ...
deactivate # Exit the virtual environment
Note that every time you want to work on the assignment, you should run source .env/bin/activate
(from within your assignment1
folder) to re-activate the virtual environment, and deactivate
again whenever you are done.
Download data:
Run the git clone https://github.com/cos495nlp/data
from the assignment1
directory.
Start IPython:
You should start the IPython notebook server from the
assignment1
directory, with the jupyter notebook
command.