Instructor Guide

Instructions and recommendations for effective curriculum implementation.

Preparation

  • Become familiar with the curriculum, including the Course Overview and the session plans provided in the Teacher Resources.

    Follow the Python Environment Setup Guide to install Python and the needed packages for starting machine learning.

    Note that this guide is for setting up computers for the 'Intro to Python for Machine Learning and AI' course.

    However, there is another guide to setup computers for the 'Machine Learning and AI with Python' course.

    Bring and distribute USB drives in order for students to save and take home their projects. Students can also save to a cloud service if USB drives are unavailable.

    To save their work, they will just need to copy the .py file. In later lessons when students use external files, they will also need to save those files in the same location as the .py file.

Setting Up

  • For all student workstations:

    Follow the Python Environment Setup Guide to install Python and IDLE.

    The guide will also explain how to use Pip to install NumPy, Pandas, Matplotlib and Scikit-Learn. These are external packages that will be used in later lessons.

    Add a desktop shortcut to IDLE.

    Add a desktop shortcut to the course website.

    If students are using their own computers then they should be sent the Python Environment Setup Guide at least a week before the first class so that they can prepare their own computers.

Student Self-Setup Troubleshooting



In the event that students are running python on their own computers, either because the session is being conducted virtually or the student brought their own computer to class, here are some quick solutions.


If they are using an IDE other than IDLE

If they are not using IDLE as their IDE, you can try to help them through google and looking up the documentation for that IDE. But not all IDEs are the same, and you may just need to tell them to follow the setup guide and use IDLE before you can help them with their python environment issues.


ModuleNotFoundError

Happens when the student has an import at the top of their file.

These are two common reasons why this error occurs (assuming it's not just a spelling error):

1. The student did not follow the instructions in the setup guide to use pip install to install the python module to their computer before typing the code. Make sure they go to the command line (In Windows, use the Command Prompt app. Do not use pip from the Python Shell. Under no circumstances will you ever use pip from inside the Python Shell).

2. Assuming you have run the pip list command inside the python shell and you see the module, and it is still not working when you run the code from IDLE, the student may have more than 1 version of python installed on their computer and tha pathing towards the correct version of python. If this is the reason, you have 3 options:
  1. Uninstall all versions of python from your computer and reinstall them. If that doesn't work, follow the below workaround steps to run the pip command for the specific version of python the student is using from IDLE.
  2. Fiddle around with Path variables on the computer to try to have the computer direct to the correct version of python. If you aren't familiar with altering path variables on Windows computers or creating aliases in Mac/Unix, this option is NOT recommended.
  3. Indicate the version of pip to run the install by using the full path in the command line. This option is a hassle to do every time the student needs to perform a pip install, but the solution is more reliable than the other options. Click the box below to show the steps for this option.


In IDLE you can look up where your python version is. Go to File > Path Browser to open up the browser window.

Look for a path that ends in something like Python38. Downloads from the python website will go into the user directory and go through their AppData folder.



Once you have the full path, write out the full path and add \Scripts\ and then add pip at the end, all in quotes, followed by your install command and the module you want to install.

For example, from the above screenshot, here is the full command that would be run to install numpy.

C:\Users\hahna\AppData\Local\Programs\Python\Python38\Scripts\pip install numpy

You can run other commands using this method too, like pip list. This is an example of a pip list command being run using the full path.



This is an example showing how normally typing python and then typing the direct path points you to different versions of python.





Session Plans

  • The course is comprised of 10 sessions. Session Plans are provided in the Teacher Resources to provide instructors with a step-by-step guide for facilitating the session. Each Session Plan includes presentation slides to be projected throughout the session.

    Each section of a Session Plan represents a lesson. Lessons labeled Teacher-Led require the instructor to provide direct instruction, facilitate class discussion, and lead class activities. Self-Paced lessons are designed for students to complete at their own pace. Students should not begin new lessons until the entire class is instructed to do so. Self-paced lessons provide an ending activity that students should work on until the rest of the class is ready to move on to the next lesson.

Teaching Assistants

  • Training for teaching assistants is encouraged. This provides the lead teacher the opportunity to get to know the TAs and define expectations for them.

    Suggested TA expectations include:
    1. Be attentive to lessons and announcements intended for the entire class. Assisting students while the teacher is addressing the class causes students (and TAs) to miss important information.
    2. Actively and regularly survey student progress when there are no students seeking assistance.
    3. Consider assigning a teacher-led lesson to TAs who are capable and comfortable with this task. Doing so will provide a possibly refreshing change for students, help the students get to know and become comfortable with the TAs, and help the TA develop (possibly eventually becoming a lead teacher).

Problem Solving



    Syntax Problems:

    A common issue that may occur is that a student's code may not work correctly.

    The most likely problem is that the student has spelled something wrong, forgot to indent or has other syntax errors.

    The console may provide some information as to which line has the error but if not, a student may need to read through the code they have written to make sure everything is correct.


    Program Works but Acts Strangely:

    Sometimes there are no errors in code, but when the program is run, it doesn't work as planned.

    This usually happens when values used in code are incorrect.

    Unfortunately, there is no easy fix for problems like this and the best thing to do is go back through the lesson to make sure everything was done correctly.

    Sometimes a lesson may tell students to experiment with values. In this case, some values may be too extreme to work in the game so they should try using different values to see what does work.


    Other Issues:

    When it comes to development, anything can happen. There will always be unknown problems, so you need to be prepared to deal with them

    The best way to handle problems is to prevent them in the first place with good coding practices. This can mean:

    1. Consistent naming conventions for variables
    2. Encapsulating code inside of reusable functions
    3. Each part of the code should do one thing well
    4. Bring your own ideas of good standards into the course as well, if students are having trouble keeping track of their code.

    Students should save often. This can be done using CTRL + S or by clicking File -> Save in the top left of IDLE.

    Students should also read steps in lessons carefully and take extra care when spelling to avoid later errors.