Skip to content
3JS-DevTrailsPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Event-Based ML Backend

This backend implements a data-driven ML system for automated income loss claims.

Prerequisites

  • Python 3.8+
  • Virtual environment (recommended)

Setup Instructions

  1. Navigate to the backend directory:

    cd backend
  2. Create and activate a virtual environment:

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

    pip install -r requirements.txt
  4. Initialize AI Models (CRITICAL): Run the training script to generate the regional models and initial synthetic data.

    python ai_service/train.py

    This will create a backend/ai_service/models/ folder with .pkl files.

Running the Application

  1. Start the Flask Server:

    python app.py

    The server will start at http://localhost:5000.

  2. Trigger the Weekly Pipeline (Admin Hook): You can manually trigger a full system evaluation (ingestion -> features -> AI -> decision -> claims) by sending a POST request to: http://localhost:5000/predictions/run-pipeline

Running Tests

To verify all API endpoints and logic:

python -m pytest tests/

Architecture

  • ai_service/: Standalone ML training and prediction logic (Region-based & Personalized).
  • services/: Core logic for ingestion, preprocessing, and the rules engine.
  • routes/: Flask API endpoints.
  • jobs/: Background tasks/pipelines.
  • db/: Mock MongoDB implementation.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages