Skip to content

KHRMNKY/AutoMl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AutoML - Automated Machine Learning Platform

An intelligent, cloud-deployed machine learning platform that automates model selection and training for classification, regression, and computer vision tasks. Features both REST API and web UI interfaces.

Live Demo: https://automl.kahramankaya.com/docs#/


✨ Features

  • Three ML Task Types:

    • πŸ“Š Tabular Classification - Automatic model selection from Random Forest, SVM, Decision Tree
    • πŸ“ˆ Regression - Automatic selection from Random Forest, SVR, Decision Tree
    • πŸ–ΌοΈ Vision Classification - Deep learning models (ResNet18, VGG16, MobileNet v2) with transfer learning
  • Automatic Model Selection: Trains multiple models and automatically selects the best performer

  • GPU Support: CUDA-enabled Docker container for fast training

  • Dual Interfaces: FastAPI REST endpoints + Streamlit web UI

  • Cloud Ready: Fully containerized and deployed on cloud infrastructure

  • Flexible Input: Supports CSV files and image directories

  • Pre-configured Transforms: Optimized image preprocessing with augmentation


Quick Start

Installation

Clone the repository:

git clone https://github.com/KHRMNKY/AutoMl.git
cd AutoMl

Create a virtual environment:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

πŸ“š Usage

Option 1: REST API

Start the FastAPI server:

uvicorn api:app --reload

The API will be available at http://127.0.0.1:8000

View interactive API documentation at http://127.0.0.1:8000/docs

Option 2: Streamlit Web UI

Run the Streamlit interface:

streamlit run streamlit4.py

Access the UI at http://localhost:8501


πŸ“– API Endpoints

Vision Classification

  • POST /vision_classification/train - Train vision model

    {
      "train_folder": "/path/to/train/folder",
      "learning_rate": 0.001,
      "epochs": 10
    }
  • POST /vision_classification/predict - Predict on images

    {
      "image_path": "/path/to/image/folder"
    }

Classification (CSV)

  • POST /classification/train - Train classification model

    {
      "train_csv_path": "/path/to/train.csv"
    }
  • POST /classification/predict - Get predictions

    {
      "test_csv_path": "/path/to/test.csv"
    }

Regression (CSV)

  • POST /regression/train - Train regression model

    {
      "train_csv_path": "/path/to/train.csv"
    }
  • POST /regression/predict - Get predictions

    {
      "test_csv_path": "/path/to/test.csv"
    }

πŸ“ Project Structure

AutoMl/
β”œβ”€β”€ api.py                    # FastAPI backend server
β”œβ”€β”€ autoML.py                 # Core AutoML class with model logic
β”œβ”€β”€ streamlit4.py             # Streamlit web UI
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ Dockerfile                # Docker containerization
β”œβ”€β”€ LICENSE                   # Apache 2.0 License
β”œβ”€β”€ README.md                 # This file
└── data/
    β”œβ”€β”€ Iris_train.csv        # Sample training data
    β”œβ”€β”€ Iris_test.csv         # Sample testing data
    └── images/               # Sample image datasets
        β”œβ”€β”€ apple_pie/
        β”œβ”€β”€ baby_back_ribs/
        └── baklava/

πŸ”§ Configuration

Vision Classification Parameters

  • Input Size: 224Γ—224 pixels
  • Batch Size: 32
  • Train/Test Split: 80/20
  • Augmentation: TrivialAugmentWide with 31 magnitude bins
  • Normalization: ImageNet standard (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])

Supported Models

Classification/Regression (Tabular):

  • Random Forest
  • Support Vector Machine (SVM/SVR)
  • Decision Tree

Vision Classification:

  • ResNet18 (ImageNet pre-trained)
  • VGG16 (ImageNet pre-trained)
  • MobileNet v2 (ImageNet pre-trained)

🐳 Docker Deployment

Build the Docker image:

docker build -t automl:latest .

Run the container:

docker run -p 8081:8081 --gpus all automl:latest

The API will be available at http://localhost:8081


πŸ“Š Example Usage

Using Python

from autoML import AutoML

# Initialize AutoML
automl = AutoML()

# Train classification model
automl.model_fit('data/Iris_train.csv', task='classification')

# Make predictions
predictions = automl.predict('data/Iris_test.csv')
print(f"Best Model: {automl.model_name}")
print(f"Score: {automl.score}")
print(f"Predictions: {predictions}")

πŸ“¦ Dependencies

  • FastAPI: Web framework for building APIs
  • PyTorch: Deep learning framework
  • Scikit-learn: Machine learning algorithms
  • Streamlit: Web UI framework
  • Pandas: Data manipulation
  • NumPy: Numerical computing
  • Torchvision: Computer vision utilities
  • Pillow: Image processing

See requirements.txt for complete list with versions.


🌐 Deployment

This project is currently deployed at: https://automl.kahramankaya.com/docs#/

The API is hosted on cloud infrastructure with GPU support for accelerated training.


πŸ“ Data Format

For Classification/Regression

  • Format: CSV files
  • Target: Last column should be the target variable
  • Features: All other columns are treated as features
  • Preprocessing: Automatic handling of categorical variables and feature scaling

For Vision Classification

  • Format: Folder structure with class subfolders
  • Example:
    train_data/
    β”œβ”€β”€ class1/
    β”‚   β”œβ”€β”€ image1.jpg
    β”‚   └── image2.jpg
    └── class2/
        β”œβ”€β”€ image3.jpg
        └── image4.jpg
    

About

AutoML - Cloud-deployed automated machine learning platform supporting classification, regression, and computer vision with FastAPI REST API and Streamlit UI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors