Beginner lesson

Lesson 1: What Is Machine Learning?

Beginner Course position: 1 of 30 Track: Machine Learning Tutorials

This lesson introduces what machine learning is and how it differs from rule-based software within a structured machine learning path. It begins with intuition, moves into workflow thinking, and then shows a practical Python example with clear notes.

Concept and intuition

What Is Machine Learning? is a core topic in machine learning because it shapes how we frame the problem, choose tools, and judge results. It allows computers to learn from examples, which makes it useful for prediction, ranking, recognition, and pattern discovery when fixed rules are not enough.

When learning what machine learning is and how it differs from rule-based software, do not focus only on formulas. The more important habit is to ask what the model is trying to learn, what assumptions it makes, and what could go wrong when the data is noisy, incomplete, or biased.

How it fits into a workflow

In a real project, what machine learning is and how it differs from rule-based software sits inside a larger workflow: define the problem, prepare data, choose features, train a model, evaluate it carefully, and improve the system over time. Strong machine learning practice is iterative rather than one-shot.

This means you should connect what machine learning is and how it differs from rule-based software to practical questions such as: What data is available? How will predictions be used? Which errors are most costly? How will the system be monitored after deployment? Those questions matter as much as model accuracy.

Common mistakes and practical advice

A common beginner mistake is to treat what machine learning is and how it differs from rule-based software as a purely technical task. In practice, success depends on data quality, evaluation design, and the clarity of the business goal. Even a sophisticated model can fail if the data pipeline is weak or the target is poorly defined.

As you read the code example in this lesson, pay attention to how the inputs are shaped, how training and prediction are separated, and how the output is interpreted. Good coding habits make machine learning work more reliable, explainable, and easier to improve.

Three practical examples

Spam filtering

An email service learns patterns from messages labeled spam and not spam.

Sales forecasting

A retailer predicts future demand from past sales, prices, and seasonal trends.

Recommendation

A content platform estimates what a user is likely to watch or read next.

First prediction with linear regression

This code example focuses on clarity rather than production scale. Read the comments, then study the notes below to understand why each step matters.

from sklearn.linear_model import LinearRegression
import numpy as np

X = np.array([[1], [2], [3], [4], [5]])
y = np.array([48, 55, 63, 71, 79])

model = LinearRegression()
model.fit(X, y)

prediction = model.predict([[6]])
print("Predicted score:", round(prediction[0], 2))

Code walkthrough

  • `X` holds the input feature, in this case study hours.
  • `y` holds the target value we want to predict, exam score.
  • `fit()` trains the model by learning a relationship from past examples.
  • `predict()` uses the trained model on a new value the model has not seen before.

Summary and key takeaways

  • Machine learning learns patterns from data instead of fixed handwritten rules.
  • A machine learning system usually needs data, a target, a model, and evaluation.
  • Prediction on new examples is the real goal, not memorizing training data.
  • Even small examples show the core workflow of training and prediction.

Exercises

  • Explain in one paragraph how machine learning differs from traditional programming.
  • Give three examples from daily life where machine learning is used.
  • Change the code so it predicts the score for 7 study hours.
  • What risks might appear if the training data is inaccurate?

Continue your learning