How vaishnaviborusumedi/eeg-seizure-prediction-api works
This repository trains a seizure-risk classifier from EEG features, saves the fitted pipeline, and serves single and batch predictions through FastAPI. The training workflow loads and splits the dataset, tunes a scaled Random Forest, evaluates it, and writes a model artifact. At runtime, the API loads that artifact and exposes prediction, health, and model-information endpoints. Source excerpts support the training and inference calls; endpoint coverage is also documented in the README.
Main entry points: main.py FastAPI app · train.py Load and split · model.pkl Fitted model · dataset.csv EEG dataset
Components 12
Model training
- EEG dataset
dataset.csv - Load and split
train.py - Tune pipeline
train.py - Evaluate model
train.py
Prediction API
- FastAPI app
main.py - Health check
main.py - Model info
main.py - Single prediction
main.py - Batch prediction
main.py - Risk result
main.py
Model artifact
- Fitted model
model.pkl
Other components
- Operator
Connections 12
- EEG dataset → Load and split: loads rows
train.py - Load and split → Tune pipeline: splits data
train.py - Tune pipeline → Evaluate model: fits best model
train.py - Evaluate model → Fitted model: saves model
train.py - Operator → Health check: checks status
README.md - Operator → Model info: requests details
README.md - Operator → Single prediction: submits features
README.md - Operator → Batch prediction: submits batch
README.md - Fitted model → FastAPI app: loaded at startup
main.py - Single prediction → FastAPI app: handled by
main.py - Batch prediction → FastAPI app: handled by
main.py - FastAPI app → Risk result: returns predictions
main.py