机器学习训练营——机器学习爱好者的自由交流空间(入群联系qq:2279055353)
案例介绍
IEEE-CIS
(IEEE Computational Intelligence Society)在人工智能与机器学习的很多领域开展科研工作。目前,他们与全球领先的支付服务公司Vesta
合作,针对金融欺诈预防行业,寻求最佳的解决方案。这个案例将建立基于电子商务数据的反欺诈模型,改善欺诈交易预警效率,有助于商务活动减少欺诈损失,提高收益。
数据描述
本案例是一个二值分类问题,即,目标变量表示用户的交易行为是否是欺诈的(fraudlent
or not fraudlent
). 该套数据由两个文件identity
and transaction
组成,它们由共同的特征TransactionID
连接。注意,并不是所有的交易都有对应的identity
信息。
Transaction 类特征
-
ProductCD
-
card1 - card6
-
addr1, addr2
-
P_emaildomain
-
R_emaildomain
-
M1 - M9
Identity 类特征
-
DeviceType
-
DeviceInfo
-
id_12 - id_38
数据探索
加载必需的库。
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.metrics import roc_auc_score
import matplotlib.gridspec as grids