Tutorial python code

During my time as a cognitive neuroscience researcher, I spent much of my time analysing large carrying out statistical analysis of large high-dimensional data (time series of fMRI brain images), using statistical models (GLMs) and machine learning (SVMs and neural networks). Much of this work was done in Python, using libraries such as NumPy and scikit-learn. As part of my teaching, I wrote tutorial code illustrating such approaches.

More recently, as a math teacher, I have written tutorial code aimed at explaining key math concepts. I especially like using code to illustrate concepts visually. Below are some examples.


Intro machine learning and time series analysis tutorials

Tutorial python code running in the browser via Google Colab.

Neural network innards, in NumPy
Linear classifier tutorial, using matrices
Nearest neighbour classifier tutorial
Time-series convolution tutorial
fMRI tutorial: hemodynamic response function
General Linear Model (GLM) design matrix tutorial

Python Turtle

PyTurtle examples to illustrate math concepts, running in the browser via trinket.io.

Python string art
Python string art
Python billiards GCF
Math billiards GCF
Right triangle fractal
Right-angled triangle fractal
Pythagorean tree fractal
Pythagorean tree fractal

Some simple tutorial text-based math games in Python

Divisors math game
"Tax collector" divisors game
Divisors math game
Dollar words: letter-values sum to 100
Divisors math game
Text version of NYT Digits puzzle
Divisors math game
Factors and multiples game










Webpage made using the Creative Commons CSS design Liblueen