Overview
The home route serves the web interface for the fraud detection system. It provides a user-friendly form for uploading and predicting fraud on insurance claims data.Endpoint
Response
Returns an HTML page with a web form for fraud prediction.Web Interface Features
The web interface (templates/index.html) provides:
Prediction Form
- Custom File Path Input: Enter a file path to predict on custom data
- Default File Prediction: Use pre-configured batch files from
Prediction_Batch_files/
Form Fields
File path to the CSV file containing insurance claims data for prediction
Buttons
- Custom File Predict: Submit prediction with custom file path
- Default File Predict: Use default batch files for prediction
Usage
Access the Web Interface
Open your browser and navigate to:Using Custom File Path
- Enter the file path in the text field (e.g.,
Prediction_Batch_files/) - Click “Custom File Predict”
- Wait for prediction results to appear
Using Default File
- Click “Default File Predict”
- System will use
Prediction_Batch_files/as the default path - Results will display in the Results panel
JavaScript Implementation
The web interface uses jQuery AJAX to call the/predict endpoint:
Response Display
Results are displayed in the Results panel showing:- Confirmation message
- File path where predictions are saved
- Prediction file location:
Prediction_Output_File/Predictions.csv
Health Check
The home route can also serve as a basic health check to verify the Flask application is running:Source Code
The route is defined inmain.py:20-23:
Next Steps
POST /predict
Learn about the prediction API endpoint
Batch Prediction
Process multiple claims in batch mode