不正か否かの判定

Pythonで学ぶ不正検知

Charlotte Werger

Data Scientist

クラスタ化データから開始

Pythonで学ぶ不正検知

クラスタ重心を割り当てる

Pythonで学ぶ不正検知

クラスタ重心からの距離を定義

Pythonで学ぶ不正検知

重心から最も遠いものに不正フラグを付与

Pythonで学ぶ不正検知

重心までの距離に基づく不正フラグ付け

# Run the kmeans model on scaled data
kmeans = KMeans(n_clusters=6, random_state=42).fit(X_scaled)

# Get the cluster number for each datapoint X_clusters = kmeans.predict(X_scaled)
# Save the cluster centroids X_clusters_centers = kmeans.cluster_centers_
# Calculate the distance to the cluster centroid for each point dist = [np.linalg.norm(x-y) for x,y in zip(X_scaled, X_clusters_centers[X_clusters])]
# Create predictions based on distance km_y_pred = np.array(dist) km_y_pred[dist>=np.percentile(dist, 93)] = 1 km_y_pred[dist<np.percentile(dist, 93)] = 0
Pythonで学ぶ不正検知

モデル結果の検証

  • 不正分析担当者に確認する
  • フラグが立った事例を詳しく調査・記述する
  • 過去の既知の不正事例と比較する
Pythonで学ぶ不正検知

¡Vamos a practicar!

Pythonで学ぶ不正検知

Preparing Video For Download...