Sign inSign up

akash26052005/adspectra-api

By akash26052005

•Updated about 1 year ago

A sales prediction model made by Akash Halder

Image
API management
Machine learning & AI
Data science
1

242

akash26052005/adspectra-api repository overview

⁠📊 AdSpectra API

AdSpectra API is a FastAPI-powered ML inference service that predicts sales based on advertising budgets (TV, Radio, Newspaper). It is containerized with Docker and ready to deploy anywhere.


⁠🚀 Features

  • 🔥 FastAPI backend with interactive Swagger docs
  • 📈 Predicts sales based on ad budget inputs
  • ✅ Provides real metrics: R² (confidence), MAE, MSE, RMSE
  • 🐳 Lightweight and portable with Docker

⁠🐳 Run with Docker

⁠1. Pull the image from Docker Hub
docker pull akash26052005/adspectra-api:latest
⁠2. Run the container locally
docker run -d -p 8000:8000 akash26052005/adspectra-api:latest
  • -d → run in detached mode
  • -p 8000:8000 → map container port 8000 to host port 8000

⁠🌐 Access the API


⁠📡 Example Prediction

⁠POST /predict
⁠Request
{
  "TV_Ad_Budget": 230.1,
  "Radio_Ad_Budget": 37.8,
  "Newspaper_Ad_Budget": 69.2
}
⁠Response
{
  "success": true,
  "input": {
    "TV Ad Budget": 230.1,
    "Radio Ad Budget": 37.8,
    "Newspaper Ad Budget": 69.2
  },
  "prediction": {
    "prediction": 21.98799999999997,
    "confidence_r2": 98.13,
    "mae": 62.07,
    "mse": 59,
    "rmse": 76.9
  }
}

⁠📊 Analytics Endpoint

⁠GET /analytics

Provides global model performance metrics:

{
  "success": true,
  "metrics": {
    "model_accuracy": 98.13,
    "mae": 62.07,
    "mse": 59,
    "rmse": 76.9
  }
}

⁠🛠️ Build & Push (for contributors)

# Build the image
docker build -t adspectra-api .

# Tag the image for Docker Hub
docker tag adspectra-api akash26052005/adspectra-api:latest

# Push to Docker Hub
docker push akash26052005/adspectra-api:latest

⁠📄 License

This project is open-source and available under the MIT License.

Tag summary

Content type

Image

Digest

sha256:f404724df…

Size

145.7 MB

Last updated

about 1 year ago

docker pull akash26052005/adspectra-api