Deep Learning 7 综合性案例 Credit Card Anomly Detection

[TOC]

Credit Card Frauds Detection

处理样本分布不均问题:Imbalance Datasets distribution

几种可行的解决方案:

  • 采样方法
    • under-sampling 欠采样
    • over-sampling 过采样
  • 集成学习+阈值调整 *

根据不同的种类来区分颜色的【通过利用plotly=>histogram】

import plotly.express as px
fig = px.histogram(data, x='attr', color='attr')
fig.show()

直接画出数量,不用区分种类颜色的【直接利用matplotlib.pyplot=>bar】import matplotlib.pyplot as plt

eg1:

plt.bar(data.attr.value_counts().index, data.attr.value_counts().values)

eg2:

df['Attr'].value_counts().plot.bar()

直方图类型 [多个属性]:

import plotly.express as px
fig = px.histogram(data, x='attr1', color='attr2')

饼状图 [单个属性]

import plotly.express as px
fig = px.pie(data, name='attr')

数据可视化–numerical data连续数据

Posted on Jan 28, 2020