Machine Learning Playground
Train classic machine learning models directly in your browser. Tweak hyperparameters, visualize decision boundaries and regression lines, and watch optimization converge in real time — no setup, no installation required.
Linear Regression
Fit a straight line to your data using gradient descent. Watch the loss decrease in real time as the model learns the optimal slope and intercept. Adjust the learning rate, number of iterations, and dataset size to see how they affect convergence.
Polynomial Regression
Extend linear regression by fitting curves to non-linear data. Choose the polynomial degree and observe how higher degrees capture complex patterns but risk overfitting. Compare train vs. validation error to understand the bias–variance tradeoff.
K-Nearest Neighbors (KNN)
Classify new data points based on the majority vote of their K nearest neighbors. Visualize decision boundaries that change dynamically as you adjust K, the distance metric, and the number of classes. Place your own query point and see real-time classification.
Decision Tree Classifier
Build and visualize a decision tree step-by-step. Watch how the algorithm recursively splits the feature space using information gain or Gini impurity. Control tree depth, minimum samples per leaf, and see the full tree structure rendered interactively.
K-Means Clustering
Step through the K-Means clustering algorithm iteration by iteration. Watch centroids move, cluster assignments change, and convergence happen before your eyes. Experiment with different K values, initialization methods, and data distributions.
Support Vector Machine (SVM)
Visualize support vectors, decision boundaries, and margins in a binary classification task. Experiment with different kernels (linear, RBF, polynomial), regularization strength (C parameter), and see how they affect the separating hyperplane.
What You'll Learn
Supervised vs. Unsupervised
Understand the fundamental difference between learning from labeled data (regression, classification) and discovering hidden structure (clustering).
Model Selection & Tuning
See firsthand how hyperparameters like learning rate, K value, tree depth, and kernel choice shape model behavior.
Evaluation Metrics
Track MSE, accuracy, silhouette score, and more as you train. Learn which metrics matter for which tasks.
Decision Boundaries
Visualize how different algorithms carve up the feature space to separate classes or fit data.
Ready to Train Your First Model?
Start with Linear Regression — the simplest and most foundational ML algorithm. Watch gradient descent minimise the loss function step by step.
Launch Linear Regression