Lecture 31

Crash course on machine learning

MCS 275 Spring 2022
Johnny Joyce

Lecture 31: Crash course on machine learning

Course bulletins:

  • Watch video for lecture 30
  • No in-person meeting on Friday - watch video for lecture 32 by end of Friday.
  • Professor Dumas returns on Monday 4 April

Before I say anything...

What does the phrase "machine learning" make you think of?


  • What is machine learning?
  • What are some examples of machine learning?
  • How can you get into machine learning?

What is machine learning?

"The study of computer algorithms that can improve automatically through experience and by the use of data." - Wikipedia

Motivation: Dog or cat?

How do we write a program to find out whether an image of is a dog or a cat?

Main types of machine learning:

  • Supervised learning — Data is labeled.
  • Unsupervised learning — Data is not labeled.
  • Reinforcement learning — An agent can interact with its world and gets some reward for "good" behavior.
  • We'll focus on supervised and unsupervised learning.

Quick examples (unsupervised):

  • Recommendation systems (e.g. Google search, YouTube/TikTok suggestions, Amazon suggestions)

Quick examples (unsupervised):

  • Dimensionality reduction — Making data have fewer dimensions without losing its "meaning".

Quick examples (unsupervised):

  • Clustering — Finding suitable groups for unlabeled data.

Quick examples (supervised):

  • Classification — Assigning labels to data with labeled categories. E.g. is an image a dog or a cat?

  • Regression — Assigning labels to data with continuous labels. If we know a student's midterm scores, can we predict their final scores?

Let's define something called a "neuron":

Neural networks

Source: IBM

They are a huge collection of "neurons", inspired by the brain.

Loss function

  • We can have a function to characterize how "far" our model's prediction is from the true value.

  • Then we can use calculus to find the values of the weight that make this as small as possible.

Loss function — Characterizes how "far" our model's predictions are from the true answers

Let's try it

→ Jupyter notebook ←

How can you do machine learning with Python?

  • scikit-learn (simplest) — Good for general machine learning or quick implementations.
  • PyTorch — Good for deep learning.
  • TensorFlow — Good for deep learning.

What tools help with machine learning?

  • Python programming
  • Linear algebra
  • Calculus
  • Statistics

What tools help with machine learning?

  • Python programming ✅
  • Linear algebra
  • Calculus
  • Statistics

Classes at UIC relating to machine learning

  • MCS 548 — Mathematical Theory of Artificial Intelligence,
  • CS 411 — Artificial Intelligence I,
  • CS 412 — Introduction to Machine Learning


  • We saw the main types of machine learning (supervised, unsupervised, and reinforcement)
  • We saw brief examples of supervised/unsupervised learning
  • We saw neural networks and built one in scikit-learn

Interesting related links