Skip to content

Ninashaz/Fraud-Detection-with-Streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Summary for Credit Card Fraud Detection Analysis

Credit Card Fraud Detection Dashboard

My photo

Project Overview

A Streamlit-powered interactive dashboard for analyzing credit card fraud patterns, comparing machine learning models, and visualizing detection metrics.

Key Features

  • Interactive Data Exploration: Visualize fraud patterns through univariate, bivariate, and multivariate analysis
  • Model Comparison: Evaluate Logistic Regression, Naive Bayes, and Decision Tree performance
  • Explainable AI: SHAP values for model interpretability
  • Responsive Design: Mobile-friendly Streamlit interface

Claim Info — Streamlit Dashboard

Short summary
A Streamlit dashboard for exploring insurance/transaction claims and running simple fraud-prediction experiments. The app (Nina.py) provides interactive pages for:

  • Viewing claim metadata and a vertical "Claim Info" table
  • Exploring similar cases ("Similarcases")
  • Visual indicators and bivariate analysis ("Indicators")
  • A simple network/relationships view ("Network")
  • Collecting user feedback about predictions ("Feedback")

The app includes exploratory plots (Plotly, seaborn), simple machine‑learning models (Logistic Regression, Naive Bayes, KNN with GridSearchCV), and interactive widgets via Streamlit.


Features

  • Interactive multi-page layout (using streamlit_option_menu)
  • Data inspection and styled tables
  • Bivariate/univariate visualizations (Plotly / seaborn)
  • Model training/evaluation (Logistic Regression, Naive Bayes, KNN)
  • Feedback widget (thumbs up / down)
  • Example image display in the UI

Quickstart (how to run locally)

  1. Create a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate   # macOS / Linux
.venv\Scripts\activate      # Windows (PowerShell)
  1. Install dependencies
pip install streamlit streamlit-option-menu streamlit-feedback pandas numpy plotly scikit-learn seaborn matplotlib
  1. Run the app
streamlit run Nina.py

Open the URL Streamlit prints (usually http://localhost:8501).

Data Analysis

From the sidebar, if you select "Show the analysis", the app will display several charts that explore the dataset.

For example:

screen2

The charts include:

  • Distribution of transaction amount
  • Distribution of transaction time
  • Boxplots comparing transaction values across classes

These visualizations help to better understand the data patterns before applying machine learning models.

Model Comparison

By selecting "Compare Algorithms" from the sidebar, the app evaluates multiple classification models and compares their accuracy on the testing set.

For example:
Screenshot 2025-08-18 at 14 43 20

In this case, the following models were tested:

  • Logistic Regression – Accuracy ≈ 99.92%
  • Naive Bayes – Accuracy ≈ 97.77%
  • Decision Tree – Accuracy ≈ 99.92%

This visualization makes it easy to compare how different machine learning algorithms perform on the dataset, helping to choose the best approach for fraud detection.

About

Interactive Fraud Detection Dashboard using Streamlit

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages