# CS410 Homework 4: Model Selection **Due Date: 10/9/2024 at 12pm** **Need help?** Remember to check out [Edstem](https://edstem.org/us/courses/61309) and our website for TA assistance. ### Python Notebooks A **Python notebook** is an application that allows users to combine text, code, and visualizations, much like a traditional scientific lab notebook. This assignment is written in a Python notebook. In the file, we describe the tasks, and ask you to insert the code and run it to generate the requisite visualizations. Your handin should include the Python notebook file--modified--as well as your README, as always. --- ### Instructions for Downloading and [Setting Up](https://www.codecademy.com/article/setting-up-jupyter-notebook) Jupyter Notebook To complete this assignment, you’ll need to have **Jupyter Notebook** installed on your computer. Follow the steps below based on your operating system (macOS or Windows). #### **Option 1: Using the Terminal/Command Prompt (Miniconda)** If you’re using **Miniconda** or prefer using the command line: 1. **Install Miniconda (if needed):** - Download Miniconda from the [official website](https://docs.conda.io/en/latest/miniconda.html) and follow the installation instructions. 2. **Launch Jupyter Notebook:** - Open the **Terminal** (macOS) or **Command Prompt** (Windows). - Navigate to the directory where you want to save your files using the `cd` command. For example: ```bash cd path/to/your/folder ``` - Launch Jupyter Notebook by typing: ```bash jupyter notebook ``` - Your browser will open with the Jupyter Notebook interface. 3. **Open the Stencil Code:** - Once Jupyter Notebook launches, navigate to the folder where you cloned the GitHub repository - Click the file to open and start modifying the code. --- #### **Option 2: Using Anaconda Navigator** #### **For Both macOS and Windows** 1. **Download and Install Anaconda:** - Visit the [Anaconda website](https://www.anaconda.com/products/distribution) and download the installer for your operating system (macOS (.pkg) or Windows (.exe)). - Follow the on-screen instructions to complete the installation. - You will be asked if you want to add Anaconda to your PATH environment variable. Do not add Anaconda to the PATH because it can interfere with other software. 2. **Launch Anaconda Navigator:** - Open **Anaconda Navigator** from your applications (macOS) or Start Menu (Windows). 3. **Open Jupyter Notebook:** - In Anaconda Navigator, look for **Jupyter Notebook** under the "Home" tab. - Click the **Launch** button next to Jupyter Notebook. - A browser window will open, displaying the Jupyter Notebook interface. 4. **Navigate to the Stencil Code:** - Use the browser interface to navigate to the folder where you cloned the GitHub repository - Click the file to open it in Jupyter Notebook. --- #### **Option 3: Install Jupyter Notebook via pip** If you *already have Python installed*, using the `pip` package manager is another way to install Jupyter Notebook. 1. Open the **Terminal** (macOS) app or **Command Prompt** (Windows) and install Jupyter Notebook by typing: ```bash pip install notebook ``` 2. Launch Jupyter Notebook: ```bash jupyter notebook ``` OR 2. Open with VS Code 3. Once Jupyter Notebook is running, your browser should open with a page showing your computer’s file directory. --- --- ### Download Please click [here](https://classroom.github.com/a/BadpyE8v) to download the assignment. ### Handin Your handin should contain: - all modified files, including comments describing the logic of your algorithmic modifications, and your tests - a README, containing a brief overview of your implementation, and the outcomes of all tests ### Gradescope Submit your assignment via Gradescope. To submit through GitHub, follow these commands: 1. `git add -A` 2. `git commit -m "commit message"` 3. `git push` Now, you are ready to upload your repo to Gradescope. *Tip*: If you are having difficulties submitting through GitHub, you may submit by zipping up your hw folder. ### Rubric | Component | Points | Notes | |-------------------|----|--------------------------------| | Figure comparing performance on training and test set | 15 | Points awarded for producing a figure that matches the specifications and shows the tradeoff between performance on the training set and test set. | | Cross Validation | 20 | Points awarded for correct implementation of cross validation. | | Grid Search | 25 | Points awarded for correct implementation of grid search, which, for any number of parameters, finds the best parameter setting.| | README Questions| 30 | Points awarded for responses to questions in your notebook file. | | README | 10 | Points awarded for an easy to read and well-organized README file. | :::spoiler README Questions In the notebook, there are a few conceptual questions, repeated here for your convenience. Make sure you answer these in your README. 1. Explain why we might need a metric other than accuracy to measure the performance of a classifier? Provide an example of a problem or dataset where neither provides a useful assessment. (**Hint:** Consider medical tests for rare diseases.) 2. Describe the parameters you use (i.e., their names and what they do), and report the best parameter settings and score found using your grid search. By how much does grid search improve your model's performance? ::: :::success Congrats on submitting your homework; Steve is proud of you!! ![image](https://hackmd.io/_uploads/H1gKUsJ20.png) ![image](https://hackmd.io/_uploads/S1OQ2aCwA.png) :::