CS 66 Lab 1
Due Monday, 09/05/2022, by midnight (23:59, EST)
Announcements
-
Class participation, EdSTEM, Figma, and Google Folder.
Goals
The goals for this lab assignment are:
-
Install the python packages required for machine learning programming
-
Get familiar with LDA
-
Get familiar with SVM
1. Run the time() function (10 min)
-
Get your programming environment settings, for example:
OS: Ubuntu 16.04.3 GPU: Geforce 1080 Ti or Tesla P100 Memory: 16 GB Python: 3.10 Scikit-learn: 1.1
-
Review how to get the execution time of a Python program
import time start = time.time() print("hello") end = time.time() print(end - start)
2. LDA (10 min)
-
Example 1: 'Normal, Ledoit-Wolf …'
-
Download Python source code: plot_lda.py
-
-
Example 2: 'Comparison of LDA and PCA ..'
-
Download Python source code: plot_pca_vs_lda.py'
-
-
For both of the two examples above:
-
Download the existing code
-
Set up the coding environment, help your classmates with this Python and Scikit-learn installation.
-
Run the existing code
-
Track the execution time and write them down in your notes.txt file.
-
Take the screenshots of your results after running the code.
-
-
Write in your own words what LDA is, in four to five sentences, in your notes.txt file.
3. SVM (10 min)
-
Example 1: 'SVM: Maximum margin …'
-
Download Python source code: plot_separating_hyperplane.py
-
-
Example 2: 'Plot different SVM …'
-
Download Python source code: plot_iris_svc.py
-
-
For both of the two examples above:
-
Download the existing code
-
Set up the coding environment
-
Run the existing code
-
Track the execution time and write them down in your notes.txt file.
-
Take the screenshots of your results after running the code.
-
-
Write in your own words what SVM is, in four to five sentences, in your notes.txt file.
-
You may use the two above examples' dataset related sections as references.
4. Self-evaluation about Machine learning
4.1. Programming: CS21, CS35, or related programming experience
4.2. Math: calculus, linear algebra, probability and statistics.
4.3. Research: summer research experience? other research related projects?
5. Submission Guide
-
Each student only submits one file, lab_1_lastname.zip, including
-
notes_lab_1_lastname.txt for your notes, including the code run time.
-
A screenshot folder for all the screenshots files (PNG or JPEG), total size less than 5 M.
-
6. Notes
-
Email 'xqu1@swarthmore.edu' your zip file for lab 1.
-
Lab assignments will typically be released on Tuesday and will be due by midnight on the following Monday.