Skip to content

shretadas/PyTorch-ML-Lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PYTORCH-ML-LAB

Empowering Innovation Through Seamless Machine Learning Mastery

last commit html languages

Built with the tools and technologies:

Flask JSON Markdown TOML scikit-learn Babel SymPy Gunicorn NumPy Python SciPy Plotly pandas UV

A comprehensive Machine Learning platform built with Flask, PyTorch, and scikit-learn, providing an interactive interface for model training, evaluation, and predictions.

🌟 Features

  • Multiple ML Models: Support for both traditional ML and deep learning approaches
  • Interactive UI: Web interface for data upload, model training, and predictions
  • Visualization: Real-time plots and metrics for model performance
  • Model Management: Save and load trained models
  • RESTful API: Endpoints for model inference and management

πŸ“ Project Structure

PyTorch-ML-Lab/
β”œβ”€β”€ api/                    # API endpoints for Vercel serverless deployment
β”œβ”€β”€ ml_models/             # Machine learning model implementations
β”‚   β”œβ”€β”€ base_model.py      # Base class for all models
β”‚   β”œβ”€β”€ deep_learning.py   # PyTorch neural network implementations
β”‚   └── traditional_ml.py  # Scikit-learn based models
β”œβ”€β”€ static/                # Static assets (CSS, JS, images)
β”œβ”€β”€ templates/             # HTML templates
β”œβ”€β”€ utils/                # Utility functions
β”‚   β”œβ”€β”€ data_preprocessing.py
β”‚   β”œβ”€β”€ evaluation.py
β”‚   └── visualization.py
β”œβ”€β”€ app.py                # Main Flask application
└── requirements.txt      # Project dependencies

πŸš€ Getting Started

Prerequisites

  • Python 3.8 or higher
  • pip package manager
  • Virtual environment (recommended)

Installation

  1. Clone the repository

    git clone https://github.com/shretadas/PyTorch-ML-Lab.git
    cd PyTorch-ML-Lab
  2. Create and activate virtual environment

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Run the application

    python app.py

The application will be available at http://localhost:5000

🌐 Deployment Options

1. Render Deployment (Recommended for ML)

  1. Create a Render account at https://render.com
  2. Create a new Web Service
  3. Connect your GitHub repository
  4. Configure the service:
    • Build Command: pip install -r requirements.txt
    • Start Command: gunicorn app:app
    • Python Version: 3.8 or higher

2. AWS Deployment

  1. Create an AWS account
  2. Set up an EC2 instance or use AWS Elastic Beanstalk
  3. Configure environment variables
  4. Deploy using AWS CLI or GitHub Actions

3. Google Cloud Platform

  1. Create a GCP account
  2. Enable Cloud Run or App Engine
  3. Configure using app.yaml
  4. Deploy using Cloud SDK

πŸ’» API Reference

Model Training

POST /api/train
Content-Type: application/json

{
    "model_type": "deep_learning",
    "data_path": "path/to/data.csv",
    "parameters": {
        "learning_rate": 0.001,
        "epochs": 100
    }
}

Predictions

POST /api/predict
Content-Type: application/json

{
    "model_id": "model_123",
    "data": [...]
}

πŸ› οΈ Core Components

1. ML Models (ml_models/)

  • base_model.py: Abstract base class defining the model interface
  • deep_learning.py: PyTorch neural network implementations
  • traditional_ml.py: Scikit-learn based models

2. Utils (utils/)

  • data_preprocessing.py: Data cleaning and transformation
  • evaluation.py: Model evaluation metrics
  • visualization.py: Plotting and visualization tools

3. Web Interface (templates/)

  • Interactive dashboards for model training
  • Visualization of model performance
  • Model management interface

πŸ“Š Visualization Examples

The platform generates various visualizations:

  • Learning curves
  • Feature importance plots
  • Confusion matrices
  • Prediction vs Actual plots
  • Residual analysis

πŸ” Environment Variables

Required environment variables:

FLASK_SECRET_KEY=your_secret_key
DATABASE_URL=your_database_url
MODEL_STORAGE_PATH=path/to/store/models

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • PyTorch team for the excellent deep learning framework
  • Scikit-learn community for machine learning tools
  • Flask team for the web framework

πŸ“§ Contact

For questions and feedback:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors