Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงช AI Learning Lab - Interactive Supervised Algorithm Playground ๐Ÿš€

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

๐Ÿ–ผ๏ธ Application Preview

AI Learning Lab Screenshot (Screenshot of the AI Learning Lab in action!)

๐ŸŒŸ Features

  • ๐Ÿค– 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.
  • โš™๏ธ 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.js for application logic, promoting maintainability and extensibility.
  • ๐ŸŽ“ Educational Focus:
    • Each algorithm panel includes a brief description of its principles.

๐Ÿ› ๏ธ Tech Stack

  • 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.

๐Ÿ“ Project Structure

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

๐Ÿš€ How to Run Locally

  1. Clone the repository:
    git clone https://github.com/rahulkolekardev/AI-Learning-Lab.git
    cd AI-Learning-Lab
  2. Open index.html in your web browser:
    • Simply double-click the index.html file, or open it using your browser's "File > Open" menu.
    • A modern browser (Chrome, Firefox, Edge, Safari) is recommended. ๐ŸŒ

๐ŸŽฎ How to Use the Playground

  1. Visit the Live Demo: https://rahulkolekardev.github.io/AI-Learning-Lab/
  2. Select an Algorithm: Choose the supervised learning algorithm you want to explore from the "Select Protocol" dropdown.
  3. Configure Dataset:
    • Select a Dataset Matrix type appropriate for the chosen algorithm (classification or regression).
    • Adjust Sample Density (number of data points) and Signal Noise.
    • Click Generate Data Matrix. You'll see the data points plotted.
  4. Tune Hyperparameters:
    • The "CALIBRATION" panel will show hyperparameters specific to the selected algorithm. Adjust them as desired.
  5. Train the Model:
    • Click the Initiate Training button.
    • The model will be trained on the current dataset and hyperparameters.
  6. 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.
  7. Experiment! ๐ŸŽ‰
    • Try different algorithms with various datasets and hyperparameter settings.
    • Click System Reset to clear the current model and generate a fresh dataset with current settings.
    • Click Generate Data Matrix to get new data points while keeping the algorithm and hyperparameters.

๐Ÿ”ฎ Future Enhancements (Potential Ideas)

  • 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. ๐Ÿ“œ

๐Ÿค Contributing

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! ๐Ÿง‘โ€๐Ÿ’ป


About

๐Ÿš€ AI Learning Lab: Visually explore machine learning concepts! Interactive data, real-time model training & dynamic visualizations in your browser. (Vanilla JS)

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages