Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| from train import train_model | |
| from predict import predict_labels | |
| from test import test_model | |
| from validate import validate_files | |
| from schemas import TransactionData | |
| app = FastAPI(title="LogReg Multi-Output Classifier API") | |
| def train(): | |
| result = train_model() | |
| return {"message": "Model trained and saved successfully", "accuracy": result} | |
| def predict(input_data: TransactionData): | |
| prediction = predict_labels(input_data) | |
| return {"predictions": prediction} | |
| def test(): | |
| return test_model() | |
| def validate(): | |
| return validate_files() | |