Flask Application
The Fraud Detection ML System is built using Flask, a lightweight Python web framework. The API provides endpoints for training machine learning models and making predictions on fraud detection datasets.Base URL
PORT environment variable.
Available Endpoints
The API exposes the following endpoints:GET /
Access the web interface for fraud prediction
POST /train
Train a new fraud detection model using data from a specified folder
POST /predict
Make predictions on new data using the trained model
GET /dashboard
Access the Flask monitoring dashboard for performance metrics
Authentication
Currently, the API does not require authentication. All endpoints are publicly accessible.CORS Configuration
Cross-Origin Resource Sharing (CORS) is enabled for all endpoints usingflask-cors. All origins are currently allowed via:
@cross_origin() to handle preflight requests.
Monitoring Dashboard
The application includes Flask Monitoring Dashboard for tracking API performance and usage:Error Handling
All endpoints implement comprehensive error handling for:ValueError- Invalid input valuesKeyError- Missing required parametersException- General exceptions