Machine Learning
Logistic Regression — Classification Basics
Probability map
Data
Model
Larger λ keeps the weights small and the boundary smoother.
How to use this tool
- 1Choose a dataset (or click on the plot to add points of the selected class).
- 2Set the features, learning rate, regularisation and number of epochs, then press Train.
- 3Watch the loss fall and the decision boundary move; misclassified points are ringed.
- 4Move the threshold and compare training and test metrics, the confusion matrix and ROC curve.
Frequently asked questions
Batch gradient descent on the average log loss plus an L2 penalty (λ/2n)·‖w‖². With enough epochs the weights match scikit-learn’s LogisticRegression with C = 1/λ.
A plain logistic regression draws a straight boundary. Adding x1², x1·x2, x2² and higher terms lets it draw curves, for example around a circle — at the risk of overfitting, which regularisation controls.
Predictions only. Lowering it catches more positives (higher recall) at the cost of more false alarms (lower precision); the ROC curve shows this trade-off for every threshold.
No. Everything is calculated in your browser; nothing you enter is sent to MuhammadLab.
Related tools
Naive Bayes — Fast Probabilistic Classification
See naive Bayes at work: Gaussian NB on 2D data with class means and spreads, and a spam filter with per-word evidence.
Random Forests — Bagging for Trees
Train a random forest on 2D data and compare it with single trees: decision regions, OOB accuracy and feature importance.
Gradient Descent — Optimization (Explained)
Compare gradient descent, momentum, Nesterov, RMSProp and Adam on bowls, valleys, Rosenbrock, Himmelblau and saddles.