Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Fraud Detection Project

Objective

Detect fraudulent financial transactions using machine learning techniques.

Dataset

Kaggle Fraud Detection Dataset (~636,262 transactions) with features including:

  • step: timestep of the transaction
  • type: type of transaction (PAYMENT, TRANSFER, CASH_OUT, DEPOSIT, etc.)
  • amount: transaction amount
  • nameOrig: sender account
  • oldbalanceOrg: initial balance of sender
  • newbalanceOrig: new balance of sender
  • nameDest: receiver account
  • oldbalanceDest: initial balance of receiver
  • newbalanceDest: new balance of receiver
  • isFraud: target variable (1 if fraud, 0 otherwise)
  • isFlaggedFraud: flagged by the system (not always accurate)

Tools & Libraries

  • Python 3.11
  • Pandas, NumPy
  • Matplotlib, Seaborn
  • Scikit-learn (Logistic Regression)
  • Streamlit (for app deployment)

Feature Engineering

  • balanceDiffOrig = oldbalanceOrg - newbalanceOrig
  • balanceDiffDest = newbalanceDest - oldbalanceDest
  • Focus on TRANSFER and CASH_OUT transactions

Model

  • Logistic Regression with class_weight='balanced'
  • Input features: numeric (amount, balances) + categorical (type)
  • Preprocessing: StandardScaler for numeric, OneHotEncoder for categorical

Model Performance

  • F1-score: 0.82
  • Confusion matrix available in notebook
  • High precision and recall achieved for fraud class

Visualization

  • Transaction distribution by type
  • Fraud rate by transaction type
  • Boxplots and histograms for transaction amounts
  • Correlation heatmap

Streamlit App

  • Users input transaction details (type, amount, balances)
  • Predicts if transaction is fraudulent
  • Displays results with st.success or st.error

Files in Repository

  • fraud_detection.ipynb → Jupyter Notebook with analysis and model training
  • fraud_detection_pipeline.pkl → Trained logistic regression pipeline
  • streamlit_app.py → Streamlit interface for predictions
  • screenshots/ → app screenshots

Key Insights

  • Only 0.13% of transactions are fraudulent → highly imbalanced dataset
  • TRANSFER and CASH_OUT transactions are most prone to fraud
  • Feature engineering improves model accuracy
  • Logistic Regression is interpretable and effective for baseline predictions

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages