Skip to content
aranyaadheu

Understanding Machine Learning: The Basics Before the Models

A spam filter sorts your email. A music app suggests a song. A map estimates how long your trip will take. These are familiar tasks, but they raise a useful question: how does software make a reasonable guess about something it has not seen before?

Machine learning is one way to do that. Before getting into algorithms, though, it is worth untangling a few terms. AI, data science, machine learning, and deep learning often get used as if they mean the same thing. They do not.

This is a starting guide to those ideas, why Python shows up so often, and what makes machine learning useful in practice.

1.1. What Is Machine Learning?

Machine learning is an approach to building software that learns patterns from data and uses those patterns to make predictions, decisions, or generate content. The software we train is usually called a model. [1]

Consider an email spam filter. Writing a rule for every suspicious phrase would be difficult: legitimate messages sometimes contain those phrases, and spam changes over time. An ML approach can learn from examples of messages labelled as spam or legitimate, then estimate the category of an unfamiliar message.

There is still plenty of human work involved. Someone has to choose the examples, decide what counts as a mistake, and check whether the filter works on new messages.

Spam-filter workflow showing labelled emails used to train a model, followed by a new email passed through that model for a prediction.
Figure 1. Training learns from examples; inference uses the trained model.

A few terms worth knowing

TermMeaningSpam-filter example
SampleOne example in the datasetOne email
FeatureInformation available to the modelA numerical representation of its text
Label or targetThe answer available for a supervised training exampleSpam or legitimate
TrainingThe process of fitting a model to dataLearning useful relationships from labelled messages
InferenceUsing a trained model on an inputEstimating whether a new message is spam

A trained model does not necessarily keep improving whenever someone uses it. Updating it requires a learning process, which may happen periodically or through a deliberately designed online-learning system.

The main learning settings

In supervised learning, examples include target values. Predicting a numerical quantity is a regression task; assigning a category is a classification task. In unsupervised learning, the task is to discover structure without supplied target labels, such as groups of similar records. Reinforcement learning concerns an agent learning a policy through interaction and a reward signal. [1]

These describe learning settings. Generative AI describes a capability—producing content—and can involve different learning settings during development. It is not simply a fourth mutually exclusive category.

Learning is useful only if it transfers

A model can fit familiar examples well and still fail on new ones. Overfitting happens when it captures details of its training data that do not transfer well. Generalization is its ability to perform on relevant, previously unseen examples. [2]

For example, a model might appear excellent at recognising dogs in its training photos, then struggle with different lighting or unfamiliar backgrounds. Its training score would tell only part of the story.

For ML, that is why evaluation must include data not used to fit the model. The practical question is not just whether training succeeded, but whether the model works under the conditions it will face.

1.2. Data Science, AI, Machine Learning, and Deep Learning

A useful starting relationship is:

Deep learning is part of machine learning, and machine learning is part of AI. [3]

Data science overlaps with these fields, but it is not simply another layer inside that hierarchy.

Nested AI, machine learning and deep learning regions, with data science shown as an overlapping field rather than a fourth enclosing layer.
Figure 2. A conceptual map of the fields; the sizes and overlaps are illustrative.

Artificial intelligence

AI is the broader field of building systems capable of tasks associated with intelligence, including reasoning, perception, language, and planning. Some AI approaches learn from data; others use explicitly represented rules, knowledge, or search. So an AI system does not have to use ML. [3]

Machine learning

ML focuses on learning from data rather than expressing every decision as an explicit rule. A model that predicts whether an email is spam is one example of an ML component within an AI application.

Deep learning

Deep learning uses neural networks with multiple layers to learn representations. It is particularly useful for many language, image, and audio tasks. It can reduce the need to hand-design certain features, but it does not remove the need for careful data preparation and evaluation. [3]

Data science

Data science combines programming, statistics, analytical methods, and subject knowledge to investigate questions using data. The output might be an explanation, a forecast, an experiment, a dashboard, or an ML system. [4]

Suppose a shop’s monthly sales have dropped. Looking through transaction records might reveal that a popular item was out of stock for two weeks. Finding that explanation is useful data work, even if no model is trained.

FieldMain focusExample
AIBuilding systems with intelligent capabilitiesPlanning a sequence of actions
Machine learningLearning patterns from dataClassifying incoming messages
Deep learningLearning with multilayer neural networksRecognising speech
Data scienceAnswering questions and informing decisions with dataInvestigating a drop in sales

These are simplified distinctions, not rigid job descriptions. A real project can involve several fields at once.

One problem, several kinds of work

Imagine a small online shop receiving more orders than its staff can comfortably manage.

The first question might be why certain orders arrive late. Comparing delivery records by route and time of day is data analysis. If the shop wants to estimate delivery time for new orders, that becomes a possible ML task.

Now suppose customers also send photos of damaged packages. A deep-learning model could be considered for classifying those images. That is a different task, with different data and evaluation needs.

All of this could sit inside a broader software system. The labels overlap because they describe different parts of the work. These are hypothetical examples; there is no claim here that a particular model would work well without testing it.

1.3. Why Python for Data Science?

Python is a general-purpose language with an extensive scientific-computing ecosystem. Its applications include scientific computing, automation, and software development. [5]

For a beginner, its main attraction is that the same language can carry an investigation from a small script to a more substantial workflow.

It is easier to follow what the code is doing

Data analysis involves many small decisions: which rows to keep, how to handle missing values, and what a number means. Readable code makes those choices easier to review.

Take a simple question: what was the average temperature over five days? Python’s standard library is enough for this:

from statistics import mean

temperatures = [18, 24, 21, 17, 25]

print(f"Average temperature: {mean(temperatures):.1f} °C")
# Average temperature: 21.0 °C

These are made-up temperatures, and this is ordinary data analysis. We have calculated an average, not trained a model. It is a small distinction, but an important one when the terms start blending together.

There is a tool for most steps in the workflow

ToolTypical role
NumPyNumerical arrays and mathematical operations
pandasWorking with tabular data
MatplotlibCreating plots
scikit-learnPreprocessing, conventional ML models, and evaluation
PyTorch or TensorFlowBuilding and training neural networks
JupyterCombining executable code, notes, and outputs
An iterative Python workflow showing pandas for tabular data, NumPy for numerical operations, Matplotlib for plots and scikit-learn for modelling and evaluation.
Figure 3. Choose tools for the task; real workflows move back and forth.

You do not need to learn all of them at once. Start with a task and introduce a tool when it solves a concrete problem.

Python also benefits from compiled implementations beneath many numerical operations. NumPy, for example, performs many array operations in compiled code. That helps explain how Python can support substantial numerical work despite the overhead of ordinary Python loops. [6]

Python is not automatically the fastest or best choice for every system. Memory, latency, scale, existing infrastructure, and team experience still matter. Other languages and tools—including SQL and R—can be appropriate parts of a data workflow.

Start with a small, complete workflow

Instead of collecting library names, try answering one question from a CSV file. Inspect it, clean it, calculate something useful, plot the result, and explain what the data cannot tell you.

When you move to ML, scikit-learn provides a consistent workflow for fitting models, generating predictions, and evaluating them. Its documentation also introduces pipelines that keep preprocessing and prediction together. [7]

At the end, you should be able to explain what you found and how you checked it. That is a better first milestone than importing every popular library.

1.4. The Future of Data Science

Will easier tools make data science less important? I would look at it another way: which parts of the work still need care when writing code and fitting a model take less effort?

Nobody can give a reliable timetable for how the profession will change. These are the areas I would keep learning about.

Knowing what to ask

A tool can help produce a chart, suggest code, or fit a model. Someone still needs to decide whether the question is worthwhile, whether the data represents the intended population, and whether the output supports the decision being considered.

Suppose customers who use a discount code spend more. Did the discount encourage them to buy, or were frequent shoppers simply more likely to notice and use the offer? A chart can show the association. Working out the explanation takes more thought.

A model needs a surrounding system

The practical work extends beyond a training notebook. Data collection, validation, serving, testing, and monitoring all contribute to a production ML system. Google’s production-ML material emphasises that the model is only one component of that wider system. [8]

For learning purposes, this suggests a useful progression: understand an experiment first, then learn how its assumptions hold up when other people depend on its output.

Understanding the setting and explaining the result

A technically correct answer to the wrong question is not useful. Knowing the setting helps you choose meaningful measurements and understand the consequences of mistakes.

Communication matters for the same reason. A chart should make the finding easier to understand; an explanation should make its limitations clear. Neither should hide uncertainty behind technical vocabulary.

That is why I would keep working on programming, statistics, data quality, experimental reasoning, and clear writing. Those skills give you a way to question the output of whichever tool you happen to be using.

Try writing rules for every kind of spam message or every possible way someone might phrase a search. The rules soon become difficult to maintain. ML is appealing because, for some tasks, learning from examples offers a workable alternative.

The same broad approach fits different tasks

An organisation might want to forecast demand, rank relevant items, classify messages, or identify unusual records. These tasks differ, but each can involve learning relationships from past observations.

For a small hypothetical shop, demand forecasting could help inform stock planning. It would still need comparison with a simple baseline, such as using the previous week’s sales. A complicated model that performs worse than that baseline adds little value.

It helps with work that repeats at scale

A person can examine a handful of messages. Examining thousands creates a different operational problem. An ML component can help prioritise or organise that work, with people reviewing cases where the consequences or uncertainty justify it.

Scale also amplifies mistakes. A small error rate can affect many people, so the cost of an incorrect prediction belongs in the design discussion.

Some inputs are hard to describe with rules

Images, speech, and language contain variation that makes exhaustive rule-writing difficult. ML offers ways to learn useful representations and relationships from examples. Success still depends on the task and evidence; it is not a promise that every messy problem has a reliable learned solution.

Its value depends on how the output is used

A prediction only becomes useful when someone can act on it appropriately. Before choosing ML, I would ask:

If a straightforward rule or a descriptive analysis answers the question reliably, that may be the appropriate solution. Choosing a simpler method can be a sound engineering decision.

A Small Exercise Before Moving On

Choose one familiar application: a spam filter, a recommendation feature, or a demand forecast. Write down its input, expected output, possible training examples, and one costly mistake.

Then answer two questions: could a simple rule solve the task well enough, and how would you test a model on examples it has not seen?

You can do this on paper. If you can describe the task, the examples, and what a useful result would look like, you are ready to start exploring a small dataset.

References

The technical explanations above were checked against these primary sources:

  1. Google for Developers, What Is Machine Learning?
  2. Google Machine Learning Crash Course, Overfitting
  3. IBM, AI vs. Machine Learning vs. Deep Learning vs. Neural Networks
  4. IBM, What Is Data Science?
  5. Python Software Foundation, Applications for Python
  6. NumPy documentation, What Is NumPy?
  7. scikit-learn documentation, Getting Started
  8. Google Machine Learning Crash Course, Production ML Systems

Chapter Learning Resources

The following links belong to the learning outline behind this chapter. The linked videos are provided for further study; this article is an independently written explanation, not a transcript or a verified summary of those videos.

1.1. What is machine learning?

1.2. Differences between Data Science, AI, Machine Learning, and Deep Learning

1.3. Why Python for Data Science?

1.4. Future of Data Science


Share this post on:

Next Post
গবেষণার প্রথম ধাপ: A Beginner’s Guide to Research