Class Notes (1,100,000)
US (490,000)
CMU (200)
10-601 (2)
Lecture 1

10-601 Lecture Notes - Lecture 1: Jacqueline Scott, Cygwin, Bernoulli DistributionExam

School of Computer Science Courses
Course Code
Matt Gomley

This preview shows pages 1-3. to view the full 21 pages of the document.
Homework 1
CMU 10-601: Machine Learning (Spring 2019)
OUT: Wednesday, Jan 16th, 2019
DUE: Wednesday, Jan 23rd, 2019, 11:59pm
TAs: Daniel Bird, Longxiang Zhang, Jacqueline Scott, Chenxi Xu
START HERE: Instructions
Collaboration policy: Collaboration on solving the homework is allowed, after you
have thought about the problems on your own. It is also OK to get clarification (but
not solutions) from books or online resources, again after you have thought about the
problems on your own. There are two requirements: first, cite your collaborators fully
and completely (e.g., “Jane explained to me what is asked in Question 2.1”). Second,
write your solution independently: close the book and all of your notes, and send col-
laborators out of the room, so that the solution comes from you only. See the Academic
Integrity Section on the course site for more information:
Late Submission Policy: See the late submission policy here: http://www.cs.cmu.
Submitting your work:
– Autolab: You will submit your code for programming questions on the home-
work to Autolab ( After uploading your
code, our grading scripts will autograde your assignment by running your pro-
gram on a virtual machine (VM). The software installed on the VM is identical
to that on, so you should check that your code runs
correctly there. If developing locally, check that the version number of the pro-
gramming language environment and versions of permitted libraries match those
on (Octave users: Please make sure you do not use any
Matlab-specific libraries in your code that might make it fail against our tests.)
You have a total of 10 Autolab submissions. Use them wisely. In order to
not waste Autolab submissions, we recommend debugging your implementation
on your local machine (or the linux servers) and making sure your code is run-
ning correctly first before any Autolab submission. The above is true for future
assignments, but this one allows unlimited submissions.
1Compiled on Wednesday 16th January, 2019 at 20:30

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

Gradescope: For written problems such as short answer, multiple choice, deriva-
tions, proofs, or plots, we will be using Gradescope (
Please use the provided template. Submissions can be handwritten onto the tem-
plate, but should be labeled and clearly legible. If your writing is not legible, you
will not be awarded marks. Alternatively, submissions can be written in LaTeX.
Regrade requests can be made, however this gives the TA the opportunity to
regrade your entire paper, meaning if additional mistakes are found then points
will be deducted. Each derivation/proof should be completed on a separate page.
For short answer questions you should not include your work in your solution.
If you include your work in your solutions, your assignment may not be graded
correctly by our AI assisted grader. For this assignment only, if you answer at
least 90% of the written questions correctly, you get full marks on the Gradescope
portion of this assignment. For this assignment only, we will offer two rounds
of grading. The first round of grading will happen immediately following the
due date specified above. We will then release your grades to you and if you got
less than 90% on the written questions, you will be allowed to submit once again
by a second due date. The exact due date for the second round will be announced
after we release the first round grades.
Materials: Download from autolab the tar file (“Download handout”). The tar file
will contain all the data that you will need in order to complete this assignment.
For multiple choice or select all that apply questions, shade in the box or circle in the
template document corresponding to the correct answer(s) for each of the questions. For
EXusers, use and for shaded boxes and circles, and don’t change anything else.

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

1 Hello, Autolab! [32 Points]
1.1 Introduction
This homework is neither representative the standard difficulty of programming assignments
for this course nor is it designed to test your ability to program. In this homework you
have to choose Python, Octave, Java, or C++ as your programming language.
Submitting code for more than one language may result in undefined behavior..
The goal of this assignement is to ensure that you:
1. Have a way to edit and test your code (i.e. a text editor and compiler/interpreter)
2. Are familiar with submitting to Autolab
3. Are familiar with file I/O and standard output in the language of your choice
Warning: This handout assumes that you are using a unix command prompt (with zsh,
bash, csh or similar). All of the command prompts lines listed in this handout will work
on the machines. You may need to use other commands or methods
if you are working locally - especially if you are using Windows.
1.2 Reading from a file [22pts]
In reverse.{py|m|java|cpp}, implement a program that reads in the lines of a file, then
writes them in reverse order to an output file. Specifically, your program should take two
command line arguments: the name of the input file and the name of the output file. It should
read the lines of the input file and write them to the output file from last to first, separated
by “\n”. You should assume that the input file has unix-style line breaks. (Windows uses
\r\n” to indicate a new line. Unix uses only “\n”.)
For example, if the file input.txt contained the stream
which is commonly displayed as
depending on your language of choice, one of the following:
python input.txt output.txt
octave -qH reverse.m input.txt output.txt
javac; java reverse input.txt output.txt
You're Reading a Preview

Unlock to view full version