Classification problems involve predicting which category or class an input belongs to. In 2D binary classification, we have two features (X₁ and X₂) and need to separate data points into two classes.

In civil engineering, this could represent:
Soil stability: Classifying soil samples as "stable" or "unstable" based on moisture content and density
Structural safety: Categorizing bridge components as "safe" or "requires inspection" based on load and age
Traffic flow: Predicting "congested" vs "free-flowing" traffic based on time of day and weather conditions

The goal is to find a decision boundary that best separates the two classes, minimizing classification errors.
• Select boundary type (linear/quadratic), adjust weight parameters, and use "Find Optimal Solution" to optimize
• Load sample datasets or add points by clicking the plot—use "Click adds" boxes to choose class (red circles or teal squares)
• Observe three boundary lines: red solid (high confidence Class 0), magenta dotted (decision boundary at 50%), teal solid (high confidence Class 1)
• Background shading shows probability surface - darker shading indicates higher model confidence

When does a linear boundary suffice, and when do you need a quadratic boundary? Try the sample datasets to explore.
Red circles: Class 0 data points
Teal squares: Class 1 data points
Red solid line: High confidence Class 0 threshold (25% probability)
Magenta dotted line: Decision boundary (50% probability - separates the two classes)
Teal solid line: High confidence Class 1 threshold (75% probability)
Background shading: Probability surface (faint red = likely Class 0, faint teal = likely Class 1, intensity shows confidence)
Linear boundary: Uses θ₀, θ₁, θ₂ → Straight line boundary
Quadratic boundary: Uses θ₀, θ₁, θ₂, θ₁₁, θ₂₂, θ₁₂ → Curved boundaries (ellipses, parabolas)
• Start with linear boundaries for linearly separable data
• Use quadratic boundaries when data forms curved patterns
• The "Find Optimal Solution" button uses gradient descent to minimize loss
Accuracy: Percentage of correctly classified points (higher is better)
Loss: Cross-entropy loss measuring prediction confidence (lower is better)
• Perfect separation: Loss approaches 0, accuracy approaches 100%
• Overfitting risk: Complex boundaries may not generalize to new data
• Use simpler boundaries (linear) when interpretability is important
• Complex boundaries may be needed for real-world civil engineering data
• Always validate on separate test data to check generalization
f(x)=σ(0+0.1x1+0.1x2)

Click adds:

Class 0
Class 1
📏
Linear
〰️
Quadratic
Accuracy=75%
Loss=0.599
0
0.1
0.1

Developed by Kevin Yu & Panagiotis Angeloudis