internalsGet Pro

Module 03 · Lesson 2 of 12Pro

Dot products: measuring how similar vectors are

Level
Beginner
Topic
Linear algebra for machine learning
Reading time
13 min

When you finish this page you can

  1. Compute the dot product of two vectors by hand and with NumPy’s @ operator.
  2. Explain what its sign and size say about the angle between two vectors and their lengths.
  3. Choose between a raw dot product and cosine similarity by asking whether a vector’s length is information or noise.
  4. Read a linear model’s score as the dot product of its weights and a customer’s features, plus an intercept.
  1. scikit-learn: the fit and predict pattern14 min
  2. Vectors: lists of numbers with direction13 min

The heaviest shopper looks most like a new parent

is our example online store. Its ML team works on a notebook sample of about 1 million orders, 200,000 customers and 50,000 products. Joseph leads Kartly’s growth team and owns recommendations. He is launching a baby-care range and wants to send the launch offer to customers who shop like Kartly’s baby-care regulars.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan