tiistai 9. tammikuuta 2018

Introduction and basics of Python (Jan 8)

Today was the first lecture and we discussed course organization and took a brief look at using Python for Machine Learning.

Things to remember from today:
  • Passing the course requires: 1) exercises (at least 60%), 2) assignment (competition) and final exam.
  • Remember to register for the exercises in POP.
  • Remember to  register a group for the competition (max 4 members). The deadline is 19.1.
  • First exercises are already in Moodle. Return by Wednesday noon at the latest.
  • You can use classroom (TC303) computers or your own laptop in the exercise sessions. If you use your own, we recommend to install anaconda python (or miniconda with appropriate packages).
The lecture slides are available at the course website. Unfortunately it seems that the video recording failed, so below is a brief summary of the lecture. If you want, last year videos are available (note that dates and competition topics are of course invalid).

The first hour concentrated mostly on the organization of the course (see above).

On the second hour, we looked at the beginning of the slide set. First we emphasized the difference between model based and training based approach for solving recognition and detection problems.  
  • If, for example, the problem is to detect whether a sinusoidal beep is present in an audio signal, there is no point to solve it by showing example. This is because there is a perfect model (formula) for the sinusoid, and we can mathematically define exactly what we are looking for.
  • On the other hand, if the task is to classify pictures of cats and dogs apart, the model based approach is no longer useful: there is no formula that would describe all possible pictures of cats or dogs.
This Wednesday (10.1, noon) there is a deadline for submitting your solutions for the three first exercises in Moodle. This is a special case; usually we return the exercises in the classroom.

The Python tasks are rather straightforward. At the end of the lecture, we looked at how to read the competition target labels (file y_train). Since the lecture video is not available, here's the code.
 
if __name__ == "__main__":
    
    f = open("y_train.csv", "r")
    
    labels = []
    
    for line in f: # f is "iterable"
        
        if "id" in line: # Skip first line
            continue
        
        idx, label = line.split(",")
        labels.append(label.strip())
        
    print(labels)
    

Ei kommentteja:

Lähetä kommentti

Prep for exam, visiting lectures (Feb 22)

On the last lecture, we spent the first 30 minutes on an old exam. In particular, we learned how to calculate the ROC and AUC for a test sam...