Decision Boundary Plot Calculator

Explore how classifiers separate data, tune model behavior, compare boundaries, test custom points, and export clear visual evidence for practical machine learning analysis workflows.

Decision Boundary Results

Load data, select a classifier, then calculate the boundary.
Train accuracy
Test accuracy
Macro F1
Log loss
Training time
Generalisation gap

Model summary

No model has been trained.

Confusion matrix

The matrix appears after calculation.

Prediction details

Prediction rows appear after calculation.

1. Dataset Input and Generation

Use commas, tabs, or semicolons. A header row is optional.

2. Preprocessing and Validation

3. Classifier and Parameters

4. Boundary and Plot Controls

5. Interactive Prediction and Comparison

Click the plot or enter coordinates to test a prediction.
Hold Ctrl or Command to change multiple selections.
Model comparison results appear here.

Formula Used

Linear decision function: f(x) = w1x1 + w2x2 + b

Logistic probability: P(y = 1 | x) = 1 / (1 + e-f(x))

Euclidean distance: d(x, z) = √[(x1 − z1)² + (x2 − z2)²]

SVM decision: class(x) = sign(w · x + b)

Accuracy: correct predictions / total predictions

F1 score: 2 × precision × recall / (precision + recall)

Generalisation gap: training accuracy − testing accuracy

How to Use

  1. Paste data or generate a synthetic classification dataset.
  2. Choose preprocessing, splitting, and validation settings.
  3. Select a classifier and adjust its main parameters.
  4. Customize the decision regions and point appearance.
  5. Press Calculate and Plot to train the model.
  6. Review metrics, predictions, warnings, and the confusion matrix.
  7. Click the chart to test new coordinates interactively.
  8. Export the chart, predictions, dataset, or PDF report.

Example Data

X1X2ClassExpected region
1.01.2Class ALower-left region
2.51.6Class ALower-middle region
4.44.2Class BUpper-middle region
6.14.9Class BUpper-right region

Frequently Asked Questions

What is a decision boundary?

It is the dividing line or region separating predicted classes.

Why does scaling change the boundary?

Distance-based and gradient-based models react strongly to feature scale.

Can the calculator handle multiclass data?

Yes. It supports multiple class regions and per-class metrics.

What causes an irregular boundary?

Noise, model complexity, limited samples, and nonlinear relationships can contribute.

How can I identify overfitting?

Look for high training accuracy and noticeably lower testing accuracy.

Why might KNN look jagged?

Small neighbourhood sizes create highly local and flexible regions.

What does confidence shading show?

It estimates how certain the selected model is across feature space.

Can I upload labels as words?

Yes. Numeric or text labels are accepted and encoded automatically.

Does the calculator replace production libraries?

No. It is an educational browser implementation for exploration and comparison.

Related Calculators

Confusion Matrix HeatmapPrecision-Recall CurveCumulative Gain ChartLift ChartCalibration CurveProbability Distribution PlotThreshold Performance PlotClass Distribution ChartMulticlass ROC CurveError Analysis Bar Chart

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.