Welcome to the AI Learning Lab! This interactive web application allows you to explore, visualize, and understand the workings of various supervised machine learning algorithms right in your browser. Built with vanilla JavaScript, HTML, and CSS, it provides a hands-on experience with data generation, hyperparameter tuning, model training, and performance evaluation.
โจ Live Demo: https://rahulkolekardev.github.io/AI-Learning-Lab/
๐ Repository: https://github.com/rahulkolekardev/AI-Learning-Lab
(Screenshot of the AI Learning Lab in action!)
- ๐ค Interactive Algorithm Selection: Choose from a suite of classic supervised learning algorithms:
- ๐ Linear Regression (Advanced): With detailed metrics (MSE, RMSE, MAE, Rยฒ).
- ๐ค k-Nearest Neighbors (k-NN Classifier): Simple instance-based learning.
- ๐ฏ Logistic Regression (Classifier): For binary classification tasks, with L2 Regularization.
- ๐ณ Decision Tree (Classifier): Visualizes "blocky" decision boundaries.
- ๐ง Naive Bayes (Gaussian Classifier): Probabilistic classification.
- ๐ฏhyperplane Support Vector Machine (SVM Classifier): With Linear and a simplified RBF kernel concept.
- ๐ฒ Random Forest (Classifier): Ensemble of decision trees (simplified).
- ๐ Dynamic Dataset Generation:
- Create various 2D datasets for both classification and regression tasks:
- Gaussian Blobs ๐ต๐ด
- Concentric Circles ๐ฏ
- XOR-like patterns ๐
- Linear Trends ๐
- Sine Waves ใฐ๏ธ
- Control the number of samples and noise level.
- Create various 2D datasets for both classification and regression tasks:
- โ๏ธ Hyperparameter Tuning:
- Adjust key hyperparameters specific to each algorithm in real-time.
- Conditional display of parameters (e.g., for SVM kernels).
- ๐ก Live Training & Visualization:
- Train models instantly with the click of a button.
- For Classifiers: Visualize learned decision boundaries, showing how the model separates the data space.
- For Regressors: See the fitted regression line.
- Data points are plotted for clear context.
- ๐ Comprehensive Performance Metrics:
- Classification: Accuracy.
- Regression: Mean SquaredError (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R-squared (Rยฒ).
- ๐จ "AI Lab" Dark Theme UI:
- A modern, futuristic, dark-themed interface designed for an engaging learning experience.
- Responsive design for various screen sizes.
- ๐งฉ Modular Code Structure:
- Organized with separate JavaScript files for each algorithm and a central
main.jsfor application logic, promoting maintainability and extensibility.
- Organized with separate JavaScript files for each algorithm and a central
- ๐ Educational Focus:
- Each algorithm panel includes a brief description of its principles.
- HTML5: Structure of the application.
- CSS3: Styling, including the dark theme and responsive layout.
- Vanilla JavaScript (ES6+): All core logic, algorithm implementations, and DOM manipulation. No external JS libraries or frameworks are used for the core ML parts.
AI-Learning-Lab/
โโโ index.html # Main application page
โโโ style.css # All CSS styles
โโโ js/
โ โโโ main.js # Core application logic, UI management, event handling
โ โโโ algorithms/ # Folder for individual algorithm implementations
โ โโโ linearRegression.js
โ โโโ knn.js
โ โโโ logisticRegression.js
โ โโโ decisionTree.js
โ โโโ naiveBayes.js
โ โโโ svm.js
โ โโโ randomForest.js
โโโ README.md # This file
- Clone the repository:
git clone https://github.com/rahulkolekardev/AI-Learning-Lab.git cd AI-Learning-Lab - Open
index.htmlin your web browser:- Simply double-click the
index.htmlfile, or open it using your browser's "File > Open" menu. - A modern browser (Chrome, Firefox, Edge, Safari) is recommended. ๐
- Simply double-click the
- Visit the Live Demo: https://rahulkolekardev.github.io/AI-Learning-Lab/
- Select an Algorithm: Choose the supervised learning algorithm you want to explore from the "Select Protocol" dropdown.
- Configure Dataset:
- Select a
Dataset Matrixtype appropriate for the chosen algorithm (classification or regression). - Adjust
Sample Density(number of data points) andSignal Noise. - Click
Generate Data Matrix. You'll see the data points plotted.
- Select a
- Tune Hyperparameters:
- The "CALIBRATION" panel will show hyperparameters specific to the selected algorithm. Adjust them as desired.
- Train the Model:
- Click the
Initiate Trainingbutton. - The model will be trained on the current dataset and hyperparameters.
- Click the
- Observe Results:
- Visualization Grid: The learned decision boundary (for classifiers) or regression line (for regressors) will be overlaid on the data points.
- Performance Analysis: Relevant metrics like Accuracy, MSE, Rยฒ, etc., will be displayed.
- Algorithm Info: Read a brief description of how the selected algorithm works.
- Experiment! ๐
- Try different algorithms with various datasets and hyperparameter settings.
- Click
System Resetto clear the current model and generate a fresh dataset with current settings. - Click
Generate Data Matrixto get new data points while keeping the algorithm and hyperparameters.
- More Algorithms:
- Support Vector Regressor (SVR).
- Gradient Boosting Trees (simplified).
- ๐ง Neural Network (integrated as another option).
- Advanced Hyperparameter Options:
- More kernel options for SVM.
- Different impurity measures for Decision Trees (e.g., Entropy).
- Feature sub-sampling for Random Forest.
- Improved Visualizations:
- ๐ Plotting cost function / learning curves for iterative algorithms.
- ๐ณ Visualizing the structure of Decision Trees.
- Show support vectors for SVM.
- Residual plots for regression.
- Data Import/Export: Allow users to upload their own simple CSV datasets. ๐
- Step-by-Step Training: For iterative algorithms, allow users to step through training iterations. ๐ถโโ๏ธ
- Cross-Validation Simulation: To demonstrate hyperparameter tuning strategies. ๐
- More Detailed Metric Breakdowns: Confusion matrices, precision-recall curves for classifiers. ๐
Contributions, suggestions, and bug reports are welcome! Please feel free to open an issue or submit a pull request on the GitHub repository. Let's make this even better together! ๐งโ๐ป