YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Credit Card Fraud Detection

This project implements an end-to-end machine learning pipeline to detect fraudulent credit card transactions using the Kaggle Credit Card Fraud Detection dataset.

Features

  • Exploratory Data Analysis (EDA): Quick analysis of class imbalance and feature distributions.
  • Robust Preprocessing: Scaling of Time and Amount using RobustScaler to handle outliers.
  • Multiple Models: Includes Logistic Regression (baseline) and Random Forest Classifier.
  • Advanced Evaluation: Focuses on Precision-Recall AUC, Confusion Matrices, and F1-scores to handle highly imbalanced data (0.17% fraud).

Project Structure

  • src/: Core logic
    • data_preprocessing.py: Data cleaning and splitting.
    • model.py: Training functions for LR and RF.
    • model_evaluation.py: Performance metrics and visualization.
  • main.py: Orchestrates the full pipeline.
  • predict.py: Script for loading a saved model and making predictions.
  • eda.py: Preliminary data exploration.
  • models/: Directory containing saved .pkl model files.

How to Run

  1. Install dependencies:
    pip install -r requirements.txt
    
  2. Run the full pipeline:
    python main.py
    
  3. Run EDA:
    python eda.py
    
  4. Run the Streamlit Dashboard (Data Scientist View):
    streamlit run app.py
    
  5. Run the Premium Analytics Frontend (Business/Production View):
    • First, start the API:
      python api.py
      
    • Then, open frontend/index.html in your browser.

Results

  • Logistic Regression: High recall (92%) but low precision (6%).
  • Random Forest: High precision (96%) and good F1-score (84%).

Artifacts

  • class_distribution.png: Visualization of the imbalance.
  • confusion_matrix.png: Last trained model's confusion matrix.
  • precision_recall_curve.png: PR curve for performance evaluation.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support