EN VI

What Is Machine Learning? A Plain Guide for Data Analysts

By ··7 min read

Short answer

Machine learning is a way to build a prediction rule from examples instead of writing the rule by hand. You give a program past data where the answer is known, it finds a pattern, and it applies that pattern to new rows. For an analyst, it is a tool for questions such as which customers may leave, and it is only as reliable as the data and the checks around it.

Up to now, every query we write follows a rule that we type ourselves. For example, CASE WHEN total_amount >= 15000000 THEN 'Large' is a rule that a person chose. This works when the rule is easy to state. On a table with millions of customers, however, no one can write down which of them are about to stop buying. Machine learning is the tool for that second kind of problem, so we start with what it does and what it needs.

Rules from people, rules from data

In normal programming, a person writes the rule and the computer applies it. In machine learning, a person provides examples and the computer finds the rule. To judge the rule, we later test it on rows that it has not seen.

Rule written by a personRule learned from data
You provideThe rulePast rows with the answer
You getOutput for each rowA model that predicts new rows
ExampleOrders above 15 million are LargeWhich customers will not order again

The words you will meet

Four words cover most conversations. A feature is one input column, such as the number of orders in the last 90 days. A label is the answer we want to predict, such as whether the customer ordered again. Training means letting the program study rows where the label is known. A prediction is the model's answer for a new row.

  • The features can be orders_90d, days_since_last_order and avg_order_value.
  • The label is reordered, which is 1 if the customer ordered again and 0 if not.
  • The prediction is a probability or a yes or no for each new customer.

Supervised and unsupervised learning

This is a classification problem when the label is a category, and a regression problem when the label is a number. Both belong to supervised learning, because every training row comes with an answer. Unsupervised learning has no label. It looks for structure on its own, as in grouping customers into segments.

A shop owner does the supervised version without thinking about it. After a year of watching customers, she notices who comes back. Then she guesses which new customer will return. The model does the same with more rows and less guessing.

Where data analysts use it

  • Churn prediction finds the customers who may stop buying.
  • Forecasting estimates next month's orders or revenue.
  • Segmentation groups customers that behave alike.
  • Scoring ranks the leads that are more likely to buy.

Many of these questions can also be answered with SQL alone. A GROUP BY on the last order date already gives a basic churn list. A model earns its place when the pattern depends on many columns at once, since a person cannot write that rule by hand.

What can go wrong

A model learns whatever is in the data, including the mistakes. If the history has duplicate rows or missing values, the model learns from them too. The score on training rows also looks better than it will be in real use. For this reason, we always test on rows that were held back, which we show in the post on a first model with scikit-learn.

Frequently asked questions

Is machine learning the same as artificial intelligence?

No. Machine learning is one approach inside the wider field of artificial intelligence. It covers methods that learn patterns from data.

Do data analysts need machine learning?

Not for every role. Most analyst work is SQL, spreadsheets and dashboards. Machine learning helps when a question needs prediction from many columns, and knowing the basics helps you work with data scientists.

What data does machine learning need?

It needs past rows where the answer is known, enough of them to show the pattern, and columns that are accurate. A model trained on wrong data repeats the errors.

References

Keep learning, step by step.

Each lesson in Learn has a business context, a runnable example and a result check, so you practise this habit on real questions.