This repository contains a Fraud Detection App, This application utilizes machine learning to predict potentially fraudulent activities in financial transactions. Whether you're accessing the app on the cloud or locally, Follow the guide below to navigate through the setup proces.
Key Features:
-
Predictive Power: Machine learning algorithm to identify potential fraudulent activities in financial transactions.
-
Cloud Accessibility: Access the app through the cloud using the URL: https://frauddetectionmodel.azurewebsites.net.
-
Local Deployment: If preferred, set up and use the app locally by following the installation and usage instructions provided in this guide.
Enhancements and Continuous Improvement:
-
CI/CD Integration: Continuous Integration/Continuous Deployment (CI/CD) pipeline.
-
Workflow for Data Drift Monitoring: Workflow for monitoring data drift, which triggers model retraining and deployment in response to changes in the dataset, ensuring the app's accuracy over time.
-
Monthly Retraining: The app undergoes monthly retraining, enhancing its predictive capabilities.
Follow the comprehensive guide below to navigate through the setup process.
- Python 3.11
- Virtualenv (optional but recommended)
-
Clone the repository:
git clone https://github.com/TouradBaba/Fraud_det_model_MLOps.git
-
Navigate to the app directory:
cd app
-
Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # Linux/Mac .\venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Change the app port: In the
app.py
file, change the port from:app.run(host="0.0.0.0", port=8000)
to:
app.run(port=5001)
-
Access the app through a web browser: https://frauddetectionmodel.azurewebsites.net
-
Use the provided credentials for basic authentication:
- Username: admin
- Password: admin
-
Navigate to the app directory:
cd app
-
Run the Flask app:
python app.py
-
Access the app through a web browser: http://localhost:5001/
-
Use the provided credentials for basic authentication:
- Username: admin
- Password: admin
/
: Home page with a form for making predictions./predict
: Endpoint for making predictions with JSON data./predict-file
: Endpoint for making predictions with a CSV file upload.
To make predictions using a CSV file, upload a CSV file containing transaction data. An Example file is provided in the repository called test.csv
.
-
For files, the app will add a new column called
Class
and assign 1 or 0 for each row:- 1 --> Fraudulent
- 0 --> Normal
-
For inserted data, the response will be either:
- "Potentially Fraudulent Activity Detected"
- "Transaction Appears Normal"