Lensa ML
Lensa ML

Classification vs Regression

Step 1 of 6

Two Kinds of Predictions

Categories vs numbers

SizePrice $kFeature 1Feature 2
TASK
Regression
OUTPUT
Number
EXAMPLE
$180k

Regression predicts a continuous number — like house price, temperature, or stock value. The output can be any real number.

Step 1 of 6: Two Kinds of Predictions

Categories vs numbers

SizePrice $kFeature 1Feature 2
TASK
Regression
OUTPUT
Number
EXAMPLE
$180k

Regression predicts a continuous number — like house price, temperature, or stock value. The output can be any real number.

Step 2 of 6: Regression

Predicting continuous values

SizePrice $k
Slope40
Intercept50
MSE
296
SLOPE
40
INTERCEPT
50

Regression fits a line ŷ = 40x + 50. The red lines show residuals — the error for each point. MSE = 296 measures the average squared error. Great fit!

Step 3 of 6: Binary Classification

Yes or no

Probability curve
1.00.50.0Feature 1θ=0.50P(class=1)
Scatter plot
Feature 1Feature 2
Decision thresholdθ = 0.50
ACCURACY
83%
TRUE POS
11
FALSE POS
1
THRESHOLD
0.50

The sigmoid curve (top) maps Feature 1 to a probability. The vertical boundary (bottom) shows where the decision splits in feature space. Try adjusting the threshold — watch the boundary shift. Yellow-ringed points are misclassified.

Step 4 of 6: Multi-class Classification

More than two categories

Class AClass BClass C
Class A
99.1%
Class B
0.0%
Class C
0.9%
TemperatureT = 1.00
PREDICTED
Class A
ACTUAL
Class A
CONFIDENCE
99%

Softmax turns raw scores into probabilities across 3 classes. At T=1.0 (default), softmax balances confidence and uncertainty. Click any point to see its class probabilities.

Step 5 of 6: Choosing the Right Loss

MSE vs Cross-Entropy

Predicted P(class=1)Loss (true label = 1)MSECE
Model says P(class=1) = … (correct answer is 1)P = 0.70
MSE LOSS
0.090
CE LOSS
0.357
CE / MSE
4.0×

MSE treats classification like a number-guessing game — it only cares how far the probability is from 1. Cross-entropy (CE) is designed for classification — it measures how surprised the model is by the true label. Drag the slider left to see CE explode while MSE stays mild — that's why CE is the standard loss for classification.

Step 6 of 6: When to Use Which

A decision guide

InputHouse PriceNeural NetHidden layersLinear outputRegressionŷ ∈ ℝMSE🏠
TASK TYPE
Regression
LOSS
MSE
OUTPUT
ŷ ∈ ℝ

House Price: This is regression — predict a continuous value. Use a linear output layer and MSE or MAE loss.