R में Fraud Detection
Bart Baesens
Professor Data Science at KU Leuven



धोखाधड़ी एक ऐसी अपराध है जो अक्सर दुर्लभ, सोच-समझकर की गई, बारीकी से छिपी, समय के साथ बदलती और अक्सर सुव्यवस्थित होती है, तथा कई रूपों में दिखती है।









एक बड़े तूफ़ान के बाद, एक बीमा कंपनी को कई दावे मिले
डेटा में धोखाधड़ी का प्रतिशत इन फंक्शन से निकाला जा सकता है:
table() और prop.table()अनुपात जानने के लिए prop.table(table(...)) का उपयोग करें
prop.table(table(fraud_label))
0 1
0.9911 0.0089
labels <- c("no fraud", "fraud")
labels <- paste(labels, round(100 * prop.table(table(fraud_label)), 2), "%")
pie(table(fraud_label), labels, col = c("blue", "red"),
main = "Pie chart of storm claims")

धोखाधड़ी पहचान मॉडल का मूल्यांकन करने के लिए उपयोग करें:

predictions <- rep.int(0, times = nrow(claims))
predictions <- factor(predictions, levels = c("no fraud", "fraud"))
caret का फंक्शन confusionMatrix():library(caret)
confusionMatrix(data = predictions, reference = fraud_label)
Reference
Prediction 0 1
0 614 14
1 0 0
Accuracy : 0.9777
> total_cost <- sum(claim_amount[fraud_label == "fraud"])
> print(total_cost)
2301508
R में Fraud Detection