An interactive web application for exploring and visualizing machine learning models in real-time. This project allows users to input data, train models, and see visualizations of the algorithms in action.
- Website: AlgoViz
- Interactive UI with modern animations using Framer Motion
- Comprehensive algorithm collection covering supervised and unsupervised learning
- Step-by-step algorithm visualization to understand model behavior
- Real-time model training with immediate visual feedback
- Parameter tuning to explore how different settings affect model performance
- Sample data generation for quick testing and experimentation
- Responsive design for optimal viewing on all devices
- Detailed documentation with theoretical foundations and practical explanations
- Interactive polynomial curve fitting
- Adjustable polynomial degree and learning rate
- Gradient descent visualization
- Classification and regression trees
- Interactive tree visualization with entropy/gini values
- Adjustable tree depth and split criteria
- Classification and regression modes
- Adjustable k parameter and distance metrics
- Nearest neighbor highlighting
- Multiple kernel options
- Support vector visualization
- Margin width adjustment
- Customizable network architecture
- Layer-by-layer visualization
- Training progress monitoring
- Centroid initialization and movement visualization
- Step-by-step cluster assignment
- Within-cluster variance analysis
- Density-based clustering animation
- Core/border/noise point visualization
- Epsilon and MinPoints parameter tuning
- Data projection and variance explanation
- Eigenvector visualization
- Dimension reduction demonstration
AlgoViz/
โโโ backend/ # Flask backend
โ โโโ app.py # Flask backend entry point
โ โโโ models/ # Machine learning model implementations
โ โ โโโ Reg.py # Polynomial regression model
โ โ โโโ knn.py # K-Nearest Neighbors algorithm
โ โ โโโ DTrees.py # Decision Trees algorithm
โ โ โโโ SVM.py # Support Vector Machines algorithm
โ โ โโโ ANN.py # Artificial Neural Network implementation
โ โ โโโ kmeans.py # K-Means clustering algorithm
โ โ โโโ dbscan.py # DBSCAN clustering algorithm
โ โ โโโ PCA.py # Principal Component Analysis implementation
โ โโโ datasets/ # Data generation utilities
โ โโโ sample_data.py # Sample data generators for each algorithm
โโโ frontend/ # React frontend
โ โโโ public/ # Static assets
โ โโโ src/ # React source code
โ โโโ api/ # API communication layer
โ โโโ pages/ # UI components for each algorithm
โ โโโ components/ # Reusable UI components
โโโ docs/ # Documentation and images
โโโ images/ # Screenshots and diagrams
- Node.js (v14+)
- Python (3.8+)
- pip (Python package manager)
-
Navigate to the project root directory:
cd AlgoViz -
Install the required Python packages:
pip install flask flask-cors python-dotenv numpy pandas scikit-learn matplotlib seaborn joblib
-
Start the Flask backend:
cd backend python app.pyThe backend will start on http://localhost:5000
-
Navigate to the frontend directory:
cd AlgoViz/frontend -
Install Node.js dependencies:
npm install
-
Start the React development server:
npm start
The frontend will be available at http://localhost:3000
- Open your browser and navigate to http://localhost:3000
- Select a machine learning model from the homepage
- Input your data points manually or load sample data
- Configure model parameters as needed
- Run the model to see visualizations and results
- Click on Canvas: Add individual data points
- Sample Datasets: Choose from pre-configured datasets
- CSV Upload: Import your own data (available for some models)
- Zoom/Pan: Navigate complex visualizations
- Play/Pause/Step: Control algorithm animations
- Parameter Sliders: Adjust model settings in real-time
- Color Legend: Understand class and cluster representations
- Polynomial degree selection (1-10)
- Learning rate adjustment (0.001-1.0)
- Gradient descent animation with convergence visualization
- Cost history plotting
- Rยฒ and MSE evaluation metrics
- Classification and regression modes
- Maximum depth control (1-10)
- Split criterion selection (Gini, Entropy, MSE)
- Visual tree structure with node information
- Pruning controls for overfitting prevention
- Adjustable k parameter (1-20)
- Distance metric selection (Euclidean, Manhattan, Minkowski)
- Decision boundary visualization with confidence shading
- Nearest neighbor highlighting on hover
- Leave-one-out cross-validation option
- Kernel selection (Linear, RBF, Polynomial, Sigmoid)
- C parameter adjustment for regularization
- Gamma parameter for non-linear kernels
- Support vector highlighting
- Margin width visualization
- Layer count adjustment (1-5)
- Neurons per layer configuration
- Activation function selection
- Learning rate and momentum settings
- Loss and accuracy curve plotting during training
- Cluster count selection (2-10)
- Centroid initialization methods (Random, K-Means++)
- Step-by-step cluster assignment animation
- Convergence monitoring
- Elbow method for optimal k visualization
- Epsilon (neighborhood radius) adjustment
- MinPoints parameter tuning
- Core/border/noise point identification
- Step-by-step region growing visualization
- Cluster stability analysis across parameters
- Component selection interface
- Variance explanation ratio visualization
- Data projection to reduced dimensions
- Original vs. reconstructed data comparison
- Eigenvector and eigenvalue visualization
If you encounter issues:
- Make sure port 5000 is not in use by another application
- Check the backend health at http://localhost:5000/api/health
- For dependency issues, try installing packages one by one:
pip install flask pip install flask-cors pip install python-dotenv # and so on... - Clear your browser cache if you see stale data
- Check browser console for JavaScript errors
- Ensure you have the latest versions of dependencies
- Additional machine learning models (random forests, boosting algorithms)
- Dataset preprocessing options
- Batch training for larger datasets
- Model comparison tools
- Exportable trained models
- Advanced visualization options
- User accounts and saved experiments
- Mobile app integration
- Frontend: React.js, Framer Motion, Chart.js
- Backend: Flask, Python
- Machine Learning: NumPy, scikit-learn, pandas, matplotlib
- Deployment: Docker, Google Cloud Run, Firebase
- scikit-learn for machine learning algorithms
- React for the frontend framework
- Framer Motion for smooth animations
- Flask for the backend API










