Statistical Learning Fundamentals
-
Examples, Features, and Targets
An example supplies observed features used for prediction and, in supervised learning, a target specifying the answer for training or evaluation.
-
Classification and Regression Targets
Classification predicts a categorical outcome under the task's definition. Regression predicts a numerical quantity.
-
A Majority-Class Baseline
A majority baseline predicts the most frequent training class, offering an interpretable reference for a classification task.
-
The Mean as a Constant Squared-Error Predictor
For a list of real targets, the arithmetic mean minimizes squared error among constant predictions.
-
The Median as a Constant Absolute-Error Predictor
A median of real targets minimizes total absolute error among constant predictions. The minimizer can be nonunique with an even number of observations.
-
Absolute and Squared Prediction Loss by Hand
Mean absolute error averages residual magnitudes. Mean squared error averages their squares, giving larger residuals more numerical influence.
-
Looking for Patterns in Prediction Residuals
Residuals compare observed and predicted values. A plot against input or fitted value can reveal errors that one aggregate hides.
-
Feature Scale in a Distance-Based Model
Distance can be dominated by variables with large numerical scale, even when all features are meant to have comparable influence.
-
Standardizing a Feature with Training Statistics
Centering subtracts a chosen mean. Standardization also divides by a positive scale, often a training standard deviation.
-
Encoding an Unordered Feature with One-Hot Values
One-hot features give each supported category a separate position without assigning an ordinary numeric order to category names.
-
A Nearest Neighbor on a Number Line
Nearest-neighbor prediction chooses training examples with smallest distance to a query under the prescribed feature representation.
-
Voting Among Several Nearby Examples
A nearest-neighbor classifier can predict from the labels of the k closest examples. Choice of k and a tie rule affect the decision.
-
Following a Decision Tree Prediction
A trained decision tree can route a row through chosen feature tests until it reaches a leaf carrying a prediction.
-
Impurity of a Small Decision Tree Node
A classification node can use the distribution of labels to measure how mixed its examples are under a chosen impurity rule.
-
Reading a Linear Prediction from Its Weights
A linear predictor combines features with coefficients and may include an intercept. Each term has meaning at the chosen input scale.
-
Computing Residuals for a Fitted Line
A residual records the difference between an observation and the model's prediction under a specified sign convention.
-
Slope and Intercept in a One-Feature Model
An intercept is the predicted value at feature zero. A slope reports how much predicted output changes for a unit feature increase.
-
Training Loss and Previously Unseen Examples
Training loss summarizes predictions on data used for fitting. Performance on new inputs needs evaluation on a relevant separate set.
-
Underfitting a Simple Pattern
A model can be too restricted to capture a relationship useful on both training and new data under the task's loss.
-
Overfitting Examples That Include Noise
A flexible model can follow idiosyncrasies in training observations and lose accuracy on new observations from the intended population.
-
A Penalty on Large Model Coefficients
Regularization can combine prediction loss with a penalty on selected parameter values. Its effect depends on the form and weight of that penalty.
-
Fitted Parameters and Model Settings
Fitted parameters are produced by training. Hyperparameters or model settings govern that process or define a choice among possible models.
-
Grouping Unlabeled Examples
Unsupervised learning can find structure using available features without designated target labels for each example.
-
Updating a Cluster Center by Averaging
For fixed assignments in ordinary Euclidean k-means, choosing the arithmetic mean of each nonempty cluster minimizes its sum of squared distances.
-
Projecting Data Onto One Direction
A projection onto a unit direction can turn a vector into one coordinate measured along that direction.
-
A Predicted Probability and an Action Rule
A probability estimates an outcome. A separate threshold or policy determines what action follows from that estimate.
-
The Logistic Function Turns a Score into a Probability
Logistic regression transforms a real score with a logistic function so its predicted probability lies between zero and one for finite scores.
-
Averaging Several Model Predictions
An ensemble can combine several regressors or probability predictors by averaging outputs under a documented rule.
-
Choosing a Model When Examples Are Limited
A model choice should reflect data size, relevant variation, and what evidence is available for evaluation.
-
Documenting Inputs and Outputs of a Prediction
A model interface needs the feature fields, units, allowed missing values, and meanings of results or error states.