O'Reilly logo
live online training icon Live Online training

Linear Algebra with Python: Essential Math for Data Science

enter image description here

Take control of your data by honing your fundamental math skills

Topic: Math, Science, Engineering
Michael Cullan

Linear algebra is a field of mathematics dealing with vector spaces and linear functions. The understanding of linear algebra is crucial for data analysis techniques and machine learning. Even state-of-the-art deep learning algorithms rely on the concepts of linear algebra. While the field of linear algebra is extensive, it is important to focus on the areas that are directly applicable for data science.

This is the first course in a four-part series focused on essential math topics. These courses are grouped in pairs with this natural progression:

  1. Linear Algebra with Python
  2. Linear Regression with Python

and

  1. Probability with Python
  2. Statistics and Hypothesis Testing with Python

What you'll learn-and how you can apply it

By the end of this live, hands-on, online course, you’ll understand:

  • Matrices and vectors and how to perform mathematical operations using matrices and vectors
  • How linear equations are constructed

And you’ll be able to:

  • Represent data as a matrix or vector
  • Construct a system of linear equations
  • Using Python’s NumPy package to perform linear algebra operations

This training course is for you because...

  • You are someone in a technical role but are looking for foundational knowledge to transition into a data scientist position
  • You work with data and want to start building predictive models
  • You want to become a data analyst or data scientist

Prerequisites

  • Basic math: addition, subtraction, multiplication and division
  • Algebra
  • Basic Python: variable creation, conditional statements, functions, loops

Recommended preparation:

  • None

Recommended follow-up:

About your instructor

  • Michael holds a master’s degree in statistics and a bachelor’s degree in mathematics. His academic research areas ranged from computational paleobiology, where he developed software for measuring evidence for disparate evolutionary models based on fossil data, to music and AI, where he assisted in modeling musical data for a jazz improvisation robot.

    In his current work, Michael teaches hands-on courses in data science as well as business-oriented topics in managing data science initiatives at the organizational level. Aside from teaching, he leads internal data science projects for Pragmatic Institute in support of the marketing and operations teams. In his free time, he applies his math and programming skills toward creating code-based visual art and design projects.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Getting Started (5 minutes)

  • Presentation: Introduction to Jupyter Notebook environment

Introduction to Linear Algebra (5 minutes)

  • Presentation: What is linear algebra? What aspects of it are covered in this class?
  • Poll: Which of the following equations is a linear equation?

Vectors and Matrices (10 minutes)

  • Presentation: What are vectors and matrices?
  • Exercise: Fill-in-the-blank — Matrix dimensions

Operations with Vectors and Matrices (10 minutes)

  • Presentation: How do we work with matrices (addition and multiplication)?
  • Poll: Which of the matrices from the last exercise can be multiplied?
  • Exercise: Add two matrices

Scalar Product and Orthogonality (10 minutes)

  • Presentation: How do you multiply two vectors?
  • Exercise: Find the dot product of two matrices

Linear Independence and Transformation (10 minutes)

  • Presentation: What is independence?
  • Poll: Are these vectors dependent or independent?
  • Presentation: Linear transformation property

Eigenvectors and Eigenvalues (5 minutes) - Presentation: What makes Eigenvectors different from other vectors?

Q&A and Discussion (10 minutes)

  • Break (5 minutes)

Introduction to NumPy (10 minutes)

  • Presentation: What is a NumPy array (i.e. the ndarray class)?
  • Exercise: Create an array on Jupyter Hub

Operation with NumPy Arrays (15 minutes)

  • Presentation: How do you use Universal functions (e.g. addition) in NumPy?
  • Exercise: Add two arrays
  • Presentation: How do you do matrix multiplication?
  • Exercise: Multiply two arrays
  • Presentation: How do you transpose a matrix?
  • Exercise: Transpose an array

Performance Improvements When Using NumPy Arrays (5 minutes)

  • Presentation: Why is NumPy faster

Array Indexing (10 minutes)

  • Presentation: How can I get a subset of an array?
  • Exercise: Slicing an array

Q&A and Discussion (10 minutes)