วิธีการตรวจจับการฉ้อโกงด้วยการจัดกลุ่มแบบอื่น

การตรวจจับการฉ้อโกงด้วย Python

Charlotte Werger

Data Scientist

มีวิธีการจัดกลุ่มหลายแบบ

การตรวจจับการฉ้อโกงด้วย Python

วิธีการระบุการฉ้อโกงแบบต่าง ๆ: ใช้กลุ่มที่เล็กที่สุด

การตรวจจับการฉ้อโกงด้วย Python

ในความเป็นจริงจะมีลักษณะแบบนี้

การตรวจจับการฉ้อโกงด้วย Python

DBSCAN เทียบกับ K-means

  • ไม่จำเป็นต้องกำหนดจำนวนกลุ่มล่วงหน้า
  • ปรับระยะห่างสูงสุดระหว่างจุดในกลุ่มได้
  • กำหนดจำนวนตัวอย่างขั้นต่ำในแต่ละกลุ่มได้
  • ทำงานได้ดีกับข้อมูลที่มีรูปร่างซับซ้อน
  • แต่มีต้นทุนการคำนวณที่สูงกว่า
การตรวจจับการฉ้อโกงด้วย Python

การนำ DBSCAN ไปใช้งาน

from sklearn.cluster import DBSCAN
db = DBSCAN(eps=0.5, min_samples=10, n_jobs=-1).fit(X_scaled)

# Get the cluster labels (aka numbers) pred_labels = db.labels_
# Count the total number of clusters n_clusters_ = len(set(pred_labels)) - (1 if -1 in pred_labels else 0) # Print model results print('Estimated number of clusters: %d' % n_clusters_)
Estimated number of clusters: 31
การตรวจจับการฉ้อโกงด้วย Python

ตรวจสอบขนาดของแต่ละกลุ่ม

# Print model results
print("Silhouette Coefficient: %0.3f" % metrics.silhouette_score(X_scaled, pred_labels))
Silhouette Coefficient: 0.359
# Get sample counts in each cluster 
counts = np.bincount(pred_labels[pred_labels>=0])
print (counts)
[ 763  496  840  355 1086  676   63  306  560  134   28   18  262  128  332  22  
   22   13   31   38   36   28   14   12   30   10   11   10   21   10    5]
การตรวจจับการฉ้อโกงด้วย Python

มาฝึกกันเถอะ!

การตรวจจับการฉ้อโกงด้วย Python

Preparing Video For Download...