Start with the prediction task
Work through the short introductions to regression, classification and data preparation, then identify the output your own task needs.
Start with: Machine Learning Crash Course
RedLectern topic
Classification · regression · clustering · forecasting · anomaly detection · recommendation.
For: Analysts · ML beginners.
After this page you can: Select a baseline method for a predictive task.
Page reviewed
Part of: Artificial Intelligence › Machine Learning
Predictive machine learning uses data to produce an estimate, category, grouping, ranking or signal that can help answer a practical question. The first decision is what the output should mean: a category suggests classification, a number suggests regression, and a future value suggests forecasting. If there is no target label, clustering can help explore groups, while anomaly detection looks for observations that differ from expected patterns. Recommendation systems rank or select items for a user or situation.
For tabular data, start with a clear target and a simple baseline that matches it, such as predicting the most common class or the average value. Compare that baseline with a small number of suitable methods, using a validation approach that reflects how predictions will be used. Keep a separate test set for a final check. For forecasting, preserve time order so future observations do not leak into training. A metric is useful only when it matches the decision: distinguish, for example, the cost of missed positive cases from the cost of false alarms. The goal is not to choose a method by name, but to make a fair comparison on the task and data at hand.
Work through the short introductions to regression, classification and data preparation, then identify the output your own task needs.
Start with: Machine Learning Crash Course
Start with the basics of time series forecasting, then learn how to evaluate forecasts with time-aware splits.
Start with: Forecasting: Principles and Practice, 3rd edition
Begin by naming the output you need. A category calls for classification; a numerical target calls for regression. When the task has no labelled target, clustering groups observations by similarity, while dimensionality reduction represents data with fewer dimensions. These methods answer different questions, so a cluster should not be treated as a predicted class unless you have labels that support that interpretation.
A decision tree is a readable starting point for classification or regression: it applies rules based on features. A random forest combines predictions from randomized trees. Anomaly detection flags observations that differ from expected patterns; a recommender system selects or ranks items based on a user or context. These are candidate approaches, not guarantees of useful predictions. Define the target or decision first, then compare a simple baseline against methods that fit it.
Explains how decision trees use feature-based rules for classification and regression, including interpretability and overfitting concerns.
Describes how randomized trees are combined in a forest.
Introduces recommendations based on similarities among users and items.
Classification
Predicting which category an input belongs to.
Regression
Predicting a numerical value.
Clustering
Grouping items according to similarities in their data.
Dimensionality reduction
Representing data with fewer dimensions while retaining useful information.
Decision tree
A model that follows branching conditions to reach a prediction.
Random forest
A model combining predictions from multiple decision trees.
Anomaly detection
Identifying observations that differ from expected patterns.
Recommender system
A system selecting or ranking items for a user or situation.
For each task, name the output type and a plausible first method: predict whether a shipment will arrive late; estimate its delivery time in hours; group orders with similar patterns but no labels.
Late or not late is classification; delivery time in hours is regression; unlabeled order groups call for clustering.
Supervised learning uses examples with known target values or categories. For a classification task, begin by checking class frequencies and compare a model against a simple majority-class prediction. For a numerical target, compare a model against a simple constant prediction such as the training-set mean. These baselines make it easier to tell whether added complexity improves the task metric.
For a first model, linear or logistic regression gives a reference point; a small decision tree can provide a rule-based comparison. Keep model selection separate from the final test. Use training data to fit, validation data to choose, and test data once for a final estimate. A test set that is reused to tune choices can stop representing a clean check. Make the split resemble the way future cases will arrive, and check that held-out examples are representative and not duplicates of training examples.
Explains training, validation and test sets and why repeated test-set use can distort evaluation.
Introduces a simple numerical prediction model and its relationship between features and a label.
A dataset has 90 examples in class A and 10 in class B. What simple classification baseline would you try, and why should you avoid judging it by accuracy alone?
Predict class A for every case as a majority-class baseline. Its accuracy is 90%, but it never finds class B, so inspect class-specific measures such as recall and precision too.
When examples do not have labels, start by asking whether the aim is to find groups, compress a representation or flag unusual observations. Clustering can reveal patterns, but the result depends on how similarity is represented and should be checked against the question you are investigating. Anomaly detection also depends on what counts as expected: methods may learn from a typical set of observations or search for outliers already present in the data. Treat flags as signals to examine, not as explanations by themselves.
Forecasting differs because the target is in the future. A simple forecast can use recent values or a historical average as a reference, then be compared with a time-series method. Evaluate with rolling time-based splits: each training window should contain only observations that came before its test point. Choose a forecast horizon that matches the real decision, since one-step accuracy may not describe a multi-step use.
Shows rolling-origin evaluation in which each training set uses only observations before its test point.
Distinguishes outlier detection from novelty detection and explains their use for anomaly detection.
You have weekly sales for two years and need a four-week-ahead forecast. How should you split data for evaluation, and what should each test window represent?
Use rolling-origin splits that train only on weeks before each test point. Evaluate four-week-ahead errors at each origin, so the test windows match the forecast horizon and never use future weeks for training.
No recent updates are available.
Gareth James, Daniela Witten, Trevor Hastie, Robert Tibshirani · 2021
A broad, less technical introduction to statistical learning, with chapter labs. The authors provide the full R edition PDF online.
Christopher M. Bishop · 2006
A substantial reference on pattern recognition and machine learning. Tufts links a free author-provided PDF; the book expects multivariate calculus and basic linear algebra.
Rob J. Hyndman and George Athanasopoulos · 2021
A focused text for choosing and assessing forecasting methods. The third edition is free to read online.
Kevin P. Murphy · 2022
A broad probabilistic reference that includes supervised learning. The author provides a free online draft under a CC-BY-NC-ND license.