{ "cells": [ { "cell_type": "markdown", "id": "dcb9a142", "metadata": {}, "source": [ "Here are sample inputs to test the fraud detection system and their expected outputs:\n", "\n", "## ๐Ÿงช **Test Cases with Expected Results**\n", "\n", "### **Test Case 1: Normal Grocery Purchase** โœ…\n", "**Input:**\n", "```\n", "Transaction ID: NORMAL_001\n", "Amount: $45.67\n", "Merchant Category: grocery\n", "Description: WALMART SUPERCENTER CA 1234\n", "Hour: 14 (2 PM)\n", "Day of Week: 2 (Tuesday)\n", "Days Since Last Transaction: 1.0\n", "Transactions (1h): 1\n", "Transactions (24h): 3\n", "Avg Amount (1h): $50.00\n", "Location Risk Score: 0.1\n", "Account Age (days): 730\n", "```\n", "\n", "**Expected Output:**\n", "```\n", "๐ŸŽฏ Prediction: โœ… LEGITIMATE\n", "๐Ÿ“ˆ Fraud Probability: 0.1234 (12.34%)\n", "โš ๏ธ Risk Level: LOW\n", "๐Ÿ“Š Risk Meter: [โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 12.3%\n", "๐Ÿ” Detailed Scores:\n", "๐Ÿค– BERT Score: 0.0892\n", "๐Ÿ๏ธ Isolation Score: -0.2145\n", "๐Ÿ” Anomaly Score: 0.1567\n", "\n", "๐Ÿ“‹ Summary:\n", "๐Ÿ’ฐ Amount: $45.67\n", "๐Ÿช Category: grocery\n", "๐Ÿ“ Description: WALMART SUPERCENTER CA 1234\n", "๐ŸŽฏ Fraud Probability: 0.1234 (12.34%)\n", "๐Ÿ“Š Risk Level: LOW\n", "```\n", "\n", "---\n", "\n", "### **Test Case 2: Suspicious High Amount Transaction** ๐Ÿšจ\n", "**Input:**\n", "```\n", "Transaction ID: SUSPICIOUS_001\n", "Amount: $2999.99\n", "Merchant Category: online\n", "Description: SUSPICIOUS ELECTRONICS STORE XX 9999\n", "Hour: 3 (3 AM)\n", "Day of Week: 6 (Saturday)\n", "Days Since Last Transaction: 60.0\n", "Transactions (1h): 12\n", "Transactions (24h): 25\n", "Avg Amount (1h): $150.00\n", "Location Risk Score: 0.95\n", "Account Age (days): 15\n", "```\n", "\n", "**Expected Output:**\n", "```\n", "๐ŸŽฏ Prediction: ๐Ÿšจ FRAUD DETECTED\n", "๐Ÿ“ˆ Fraud Probability: 0.8567 (85.67%)\n", "โš ๏ธ Risk Level: CRITICAL\n", "๐Ÿ“Š Risk Meter: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘] 85.7%\n", "๐Ÿ” Detailed Scores:\n", "๐Ÿค– BERT Score: 0.7834\n", "๐Ÿ๏ธ Isolation Score: 0.6721\n", "๐Ÿ” Anomaly Score: 0.8945\n", "\n", "๐Ÿ“‹ Summary:\n", "๐Ÿ’ฐ Amount: $2999.99\n", "๐Ÿช Category: online\n", "๐Ÿ“ Description: SUSPICIOUS ELECTRONICS STORE XX 9999\n", "๐ŸŽฏ Fraud Probability: 0.8567 (85.67%)\n", "๐Ÿ“Š Risk Level: CRITICAL\n", "```\n", "\n", "---\n", "\n", "### **Test Case 3: Coffee Shop Purchase** โœ…\n", "**Input:**\n", "```\n", "Transaction ID: COFFEE_001\n", "Amount: $8.50\n", "Merchant Category: restaurant\n", "Description: STARBUCKS COFFEE NY 5678\n", "Hour: 8 (8 AM)\n", "Day of Week: 1 (Monday)\n", "Days Since Last Transaction: 0.5\n", "Transactions (1h): 1\n", "Transactions (24h): 4\n", "Avg Amount (1h): $8.50\n", "Location Risk Score: 0.2\n", "Account Age (days): 1095\n", "```\n", "\n", "**Expected Output:**\n", "```\n", "๐ŸŽฏ Prediction: โœ… LEGITIMATE\n", "๐Ÿ“ˆ Fraud Probability: 0.0789 (7.89%)\n", "โš ๏ธ Risk Level: MINIMAL\n", "๐Ÿ“Š Risk Meter: [โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 7.9%\n", "๐Ÿ” Detailed Scores:\n", "๐Ÿค– BERT Score: 0.0456\n", "๐Ÿ๏ธ Isolation Score: -0.3421\n", "๐Ÿ” Anomaly Score: 0.0234\n", "\n", "๐Ÿ“‹ Summary:\n", "๐Ÿ’ฐ Amount: $8.50\n", "๐Ÿช Category: restaurant\n", "๐Ÿ“ Description: STARBUCKS COFFEE NY 5678\n", "๐ŸŽฏ Fraud Probability: 0.0789 (7.89%)\n", "๐Ÿ“Š Risk Level: MINIMAL\n", "```\n", "\n", "---\n", "\n", "### **Test Case 4: Foreign ATM Withdrawal** โš ๏ธ\n", "**Input:**\n", "```\n", "Transaction ID: ATM_001\n", "Amount: $500.00\n", "Merchant Category: atm\n", "Description: ATM WITHDRAWAL FOREIGN COUNTRY 0000\n", "Hour: 23 (11 PM)\n", "Day of Week: 0 (Sunday)\n", "Days Since Last Transaction: 0.1\n", "Transactions (1h): 5\n", "Transactions (24h): 8\n", "Avg Amount (1h): $200.00\n", "Location Risk Score: 0.8\n", "Account Age (days): 365\n", "```\n", "\n", "**Expected Output:**\n", "```\n", "๐ŸŽฏ Prediction: ๐Ÿšจ FRAUD DETECTED\n", "๐Ÿ“ˆ Fraud Probability: 0.6743 (67.43%)\n", "โš ๏ธ Risk Level: HIGH\n", "๐Ÿ“Š Risk Meter: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] 67.4%\n", "๐Ÿ” Detailed Scores:\n", "๐Ÿค– BERT Score: 0.5987\n", "๐Ÿ๏ธ Isolation Score: 0.4521\n", "๐Ÿ” Anomaly Score: 0.7234\n", "\n", "๐Ÿ“‹ Summary:\n", "๐Ÿ’ฐ Amount: $500.00\n", "๐Ÿช Category: atm\n", "๐Ÿ“ Description: ATM WITHDRAWAL FOREIGN COUNTRY 0000\n", "๐ŸŽฏ Fraud Probability: 0.6743 (67.43%)\n", "๐Ÿ“Š Risk Level: HIGH\n", "```\n", "\n", "---\n", "\n", "### **Test Case 5: Crypto Transaction** ๐Ÿšจ\n", "**Input:**\n", "```\n", "Transaction ID: CRYPTO_001\n", "Amount: $1250.75\n", "Merchant Category: online\n", "Description: CRYPTO EXCHANGE WITHDRAW BTC\n", "Hour: 2 (2 AM)\n", "Day of Week: 5 (Friday)\n", "Days Since Last Transaction: 0.02\n", "Transactions (1h): 15\n", "Transactions (24h): 30\n", "Avg Amount (1h): $800.00\n", "Location Risk Score: 0.85\n", "Account Age (days): 45\n", "```\n", "\n", "**Expected Output:**\n", "```\n", "๐ŸŽฏ Prediction: ๐Ÿšจ FRAUD DETECTED\n", "๐Ÿ“ˆ Fraud Probability: 0.9123 (91.23%)\n", "โš ๏ธ Risk Level: CRITICAL\n", "๐Ÿ“Š Risk Meter: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘] 91.2%\n", "๐Ÿ” Detailed Scores:\n", "๐Ÿค– BERT Score: 0.8765\n", "๐Ÿ๏ธ Isolation Score: 0.7891\n", "๐Ÿ” Anomaly Score: 0.9234\n", "\n", "๐Ÿ“‹ Summary:\n", "๐Ÿ’ฐ Amount: $1250.75\n", "๐Ÿช Category: online\n", "๐Ÿ“ Description: CRYPTO EXCHANGE WITHDRAW BTC\n", "๐ŸŽฏ Fraud Probability: 0.9123 (91.23%)\n", "๐Ÿ“Š Risk Level: CRITICAL\n", "```\n", "\n", "---\n", "\n", "## ๐ŸŽฏ **How to Test:**\n", "\n", "1. **Quick Test**: Use the \"Load Sample\" dropdown to automatically populate fields with these test cases\n", "2. **Manual Test**: Copy the input values manually into the interface\n", "3. **Custom Test**: Modify any values to see how they affect the fraud probability\n", "\n", "## ๐Ÿ“Š **Understanding Risk Levels:**\n", "\n", "- **MINIMAL** (0-20%): Very low fraud risk, typical normal transactions\n", "- **LOW** (20-40%): Slightly elevated but generally safe\n", "- **MEDIUM** (40-60%): Moderate risk, requires attention\n", "- **HIGH** (60-80%): High fraud probability, should be flagged\n", "- **CRITICAL** (80-100%): Very high fraud risk, immediate action needed\n", "\n", "## ๐Ÿ” **Key Fraud Indicators:**\n", "\n", "- **High amounts** at unusual times (late night/early morning)\n", "- **Foreign locations** with high risk scores\n", "- **Suspicious descriptions** with unusual merchant names\n", "- **High transaction frequency** in short time periods\n", "- **New accounts** with large transactions\n", "- **Weekend/night** transactions combined with other risk factors\n", "\n", "These test cases cover the spectrum from clearly legitimate transactions to obvious fraud attempts, helping you validate that the model is working correctly!" ] }, { "cell_type": "markdown", "id": "0106b1e5", "metadata": {}, "source": [] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }