Skip to content

Fraud Detection App integrating MLOps for seamless deployment and continuous enhancement.

License

Notifications You must be signed in to change notification settings

TouradBaba/Fraud_det_app_MLOps

Repository files navigation

Fraud Detection App

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.

Table of Contents

  1. Prerequisites
  2. Installation
  3. Usage on the Cloud
  4. Usage Locally
  5. Endpoints
  6. File Upload
  7. Response

Prerequisites

  • Python 3.11
  • Virtualenv (optional but recommended)

Installation

  1. Clone the repository:

    git clone https://github.com/TouradBaba/Fraud_det_model_MLOps.git
  2. Navigate to the app directory:

    cd app
  3. Create and activate a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # Linux/Mac
    .\venv\Scripts\activate  # Windows
  4. Install dependencies:

    pip install -r requirements.txt
  5. 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)

Usage on the Cloud

  1. Access the app through a web browser: https://frauddetectionmodel.azurewebsites.net

  2. Use the provided credentials for basic authentication:

    • Username: admin
    • Password: admin

Usage Locally

  1. Navigate to the app directory:

    cd app
  2. Run the Flask app:

    python app.py
  3. Access the app through a web browser: http://localhost:5001/

  4. Use the provided credentials for basic authentication:

    • Username: admin
    • Password: admin

Endpoints

  • /: 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.

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.

Response

  • 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"

Releases

No releases published

Packages

No packages published