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