Machine learning with Python: your first models · Lesson 2 of 5

Your first model: fitting a straight line

Today you will

  • Predict with a line: prediction = intercept + slope × feature.
  • Find the best-fitting line from data with least squares in Python.
  • Explain what the slope means in real terms.

Before you start: Lesson 1, and the mean (average) of a list.

Opening your exercise book…

Practice

Marked as you go. Get 75% right to complete the lesson.

Getting your desk ready…

Build status · Flash Infinity AI™ is a trademark of AI-Flash Inc. WorldClass is not affiliated with, approved or accredited by any exam board, curriculum provider or university unless a page says so.