Week by week schedule#

Here’s the schedule so far. The In class sections list the things we’ll be doing in class that week. At home sections tell you what you should do at home before that week’s class. For example, you should complete Exercise 1 at home prior to the Week 2 class.

This schedule is subject to update. I will be staying ahead of you by at least 2 weeks, meaning if you want to get an early start on the next 1 or 2 assignments, you can do it without worrying that something will change while you are working on it. If there an error, I will correct it and alert the class through Slack.

Prior to first class#

  • Sign up for the class Slack group. The link was sent to your @wisc email.

  • Follow “Download and Install” instructions (see sidebar on left). The instructions are slightly different depending on whether you have a PC or Mac.

  • If you’ve never used a Linux shell (or Mac terminal), watch this video. Even if you’ve used a terminal before, go through this basic linux commands notebook as a refresher.

  • Sign up for Github if you don’t already have an account. We will be using the very basic capabilities of git: cloning, committing, checking out, and pushing.

    • If you’ve never used git and github, I recommend walking through two tutorials: This one focuses on working with git locally. This one describes pushing and pulling from remote repositories. Confused about the difference between git and github? See here. This video walkthrough is also very nice.

  • If you’re shaky on what a computer file is, how files are stored, how your operating system knows that sound.wav is a sound file and sound.txt is a text file, watch this short video.

  • Lastly, please look through the very basics of Python notebook to get you ready for the first class. If you don’t understand something in that notebook, don’t worry about it, but come prepared to ask questions.

Week 1 (Sept 7): Getting oriented#

In class#

  1. What do we do when we program?

  2. How to run Python scripts.

  3. Intro to Python and PsychoPy

  4. Show a square, make it do something, accept a response

  5. An exercise in algorithmic thinking

Week 2 (Sept 14): Programming basics#

At home#

  1. Submit test assignment by Friday (Sept 8) at 9pm.

  2. Read Think Python Sections 1.1-1.8

  3. Go through the first three self study guides on the class site (see the navigation pane on the left)

  4. Read/skim Think Python Sections 5.1-5.7, 7.1-7.8, 8.1-8.12, and 10.1-10.9

  5. Finish Exercise 1 and push it to your github classroom repository

  6. Sort out any remaining installation/environment issues. Work on customizing your coding environment and learn some keyboard shortcuts!. Also see this helpful video

In class:#

  1. Code review of Exercise 1

    • Special attention to variable names!!

  2. Questions about self-study guides

  3. Revisiting the exercise in algorithmic thinking from Week 1

  4. Primer on writing files

  5. Our first experiment! A Stroop task.

  6. Spend rest of the time working on Exercise 2

Week 3 (Sept 21)#

At home#

  1. Go through and understand Review of Fundamentals A

  2. Go through the Dictionaries and Intro to functions self-study guides.

  3. Read about reading and writing files

  4. Make sure you’ve gone through the Primer on writing files

  5. Read about writing readable code

  6. Finish Exercise 2 while heeding the advice in the previous step.

Tip

You are encouraged to use the Linting feature of Visual Studio Code (I recommend pycodestyle) to help you write code that adheres to Python stylistic standards

In class#

  1. Exercise 2 Code Review

  2. More about functions

  3. String manipulation activity

  4. Dictionary manipulation activity

  5. Randomization and iteration activities: creating simple trial lists

Week 4 (Sept 28)#

At home#

  1. Go through the List Comprehension and Randomization/Iteration/trial generation self-study guides

  2. I strongly recommend that you try out the dictionary exercises that we didn’t get to in class

  3. Read about Namespaces and variable scope

  4. Complete Exercise 3

In class#

  1. Review of importing & calling functions

  2. Catching errors (exceptions) with try/except

  3. Code review for Exercise 3

  4. Some more practice with dictionaries

  5. Intro to Exercise 4 - modularize your Exercise 3 code & add speech recognition!

Week 5 (Oct 5)#

At home#

  1. Review exception handling

  2. Review Fundamentals A - test yourself!!

  3. Complete Exercise 4.

In class#

  1. Warm-up debugging activity

  2. Get together with another group and review Exercise 4 Code Review (25 mins; groups review each other’s code)

  3. Go through Exercise 4 solution

  4. Reading and writing dataframes with pandas

  5. A little extra flourish - Saving state through pickling. Example code

  6. Intro to (Exercise 5)

  7. Working with external files (globbing and preloading)

Week 6 (Oct 12)#

At home#

  1. Look carefully through my_first_function_library.py function library in the Exercise 5 repository and try to understand the code. Play with it. Explore.

  2. Finish Exercise 5, using appropriate functionality from my_first_function_library.py

  3. Ensure your R-studio environment works and that you have the following libraries installed: tidyverse, broom, ggplot2, psych, psychTools, lme4. R notebooks don’t run that well inside Visual Code Studio, so we’ll be running them inside R Studio instead.

  4. Generate stroop data for Exercise 4 by running yourself on the Stroop task: git checkout Exercise_4_collect_data from the solution repository (Exercise_4 branch) and run exercise_4.py. Use your github name as the subject code and key as the response type. If you were born in an odd month (Jan, Mar, etc.) run yourself on .25 prop incongruent. Otherwise, run yourself on .50 incongruent. When the window opens, it will be maximized and the script will run you on 120 trials. There’s a break in the middle. Please try to do the best you can. Upload your data here. If you worked in a team Each team member should run themselves and upload their data.

In class#

  1. Couple more trial generation exercises

  2. Code review of Exercise 5

  3. Data Wrangling Crash Course (1/3) - we’ll start here a. Understanding the logic behind the tidyverse b. GGPlot plotting basics

  4. Begin Exercise 6 - analyzing your Stroop data!

Week 7 (Oct 19)#

At home#

  1. Finish Exercise 6. Make sure to include a knitted-to-HTML notebook along with your submission.

In class#

  1. Review of Exercise 6

  2. Graphing for insight: quick overview of some DOs and DONT’s of data visualization

  3. Exploring the General Social Survey

Week 8 (Oct 26th)#

At home#

  1. Review data types and review Ordered vs. unordered factors.

  2. Follow the instructions here to import all the GSS data using the gssr package (The reason I am directing you to an outside resource is that this mirrors real-world situations, so it’s important to get used to it).

  3. Finish Exercise 7

In class#

  1. Review of Exercise 7: What was hard? What was interesting? What did you want to do, but didn’t know how?

  2. More practice graphing and interpreting data

  3. Brief discussion of final projects

Week 9 (Nov 2nd)#

At home#

  1. Finish Exercise 8

  2. Form a team for your project (2-3 people)

  3. Submit first project proposal

In class#

  1. Review of Exercise 8

  2. Intro to regular expressions

  3. Intro to basic natural language processing

Week 10 (Nov 9th)#

At home#

  1. Finish going through the regular expressions notebook (there’s also a linked additional tutorial that you may want to look over).

  2. Make sure the NLTK library is installed in your environment. If not, install using pip install nltk. Then in an interactive python window in the psych750 environment, execute the following

import nltk
nltk.download(["names", "stopwords", "state_union", "twitter_samples", "movie_reviews", "averaged_perceptron_tagger", "vader_lexicon", "punkt"])
  1. Finish Exercise 9 and test your solutions to make sure they match the strings they should and don’t match the strings they shouldn’t.

In class#

  1. Install pytest

    pip install pytest
    
  2. Review Exercise 9 with attention to unit testing.

  3. Example of regular expressions on the command line

  4. Introduction to Python’s Natural Language ToolKit (NLTK)

  5. Quick case study of using NLTK to access WordNet

  6. Begin Exercise 10

Week 11 (Nov 16th)#

At home#

  1. Look over this intro to NLTK tutorial.

  2. Look over this more extended tutorial to using WordNet with NLTK

  3. Optionally, look over this tutorial of sentiment analysis with NLTK

  4. Finish Exercise 10

In class#

  1. Review Exercise 10

  2. Runtime and memory considerations (intro to the Big O)

  3. Introduction to classes and object-oriented design

Week 12 (Nov 23rd)#

No class! Happy Thanksgiving! 🦃#

Week 13 (Nov 30th)#

At home#

  1. Finish going through the classes notebook

  2. Finish Exercise 11

  3. Schedule brief in-person or zoom meeting with me to check in on project progress.

In class#

  1. Review of Exercise 11

  2. Intro to webscraping

  3. Webcraping with Beautiful Soup in-class activity

  4. Example of scraping images from Bing Search

  5. Using APIs (Case study: PRAW)

Week 14 (Dec 7th)#

At home#

  1. Work on Projects

In class#

  1. Project presentations: Prepare a 7-8 minute presentation (10 minute slots including Q&A). For experiment projects, your presentation should include a rationale, a demo of your experiment, what you are hoping to learn from it. Feel free to also mention what challenges you faced implementing it. For data-analysis projects, your presentation should likewise include rationale (why did you pick to analyze these data), a walk through of your findings, and a discussion of next steps if you were to pursue this project at a larger scale.

  2. A few tips for an effective presentation:

Tip

  • Remember that the slides are for the audience, not for you. You should not be reading from your slides and should limit text (ideally, to a title, axis labels, and a few take home points at the end.

  • Make sure what you show is legible. Make it big!

  • For a short presentation like this, you don’t need an outline telling us what you’re going to be telling us. Just get right into it.

  • Try to think about each slide from the audience’s perspective. Will they understand it given what you’ve told them so far? Is the following slide answering the question they are likely to have next?

  • Humans love stories. Your presentation should have a narrative arc.

  • Have fun with it! If you’re having fun giving it, the audience will have fun listening.

Project submission info#

Due date for the final project materials is Dec 16th 9pm. Accept the assignment on GitHub Classroom.

For experiment projects, your submission should include your presentation slides, executable experiment code and necessary materials, and a brief (think 2-3 pages at most) narrative explaining the project rationale and design. Your code should be written adhereing to the PEP8 style guide. Make sure to use informative variable names. Document your functions using DOCSTRINGS. Regular python comments should be reserved for code that you think is not self-explanatory.

For data-analysis projects, your submission should include your presentation slides, raw data that you’re working with, R (or Python) notebooks both raw and compiled/knitted (HTML or PDF). If you’re using R, use Rmd. If you’re using Python, use Jupyter (.ipynb). I personally recommend using Python for pre-processing your data and sticking with R for actual analysis. The markdown file should contain sufficient narrative to explain your analyses and graphs. Please do not just have a sequence of R code blocks. Include text above/below explaining what’s going on, sequencing it in a logical way so that a reader can proceed from the beginning and understand what each analysis and graph that follows is conveying. Please do organize the markdown file neatly using nested headings (#, ## etc.). For compactly reporting several very similar results, using tabsets is a good idea.