2018-04-03 开胃学习Data系列 - Feature Creation for Machine Learning

导入

前提条件:

# Import the libraries we will be using
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline
sns.set(style='ticks', palette='Set2')
plt.rcParams['figure.figsize'] = 10, 8

import sys
sys.path.append("..")
from ds_utils.features_pipeline import pipeline_from_config

我们使用真正的直接营销活动 direct marketing campaign 中的邮件回复数据集。每个记录都代表一个直接 marketing offer 的个人。solicitation 请求慈善募捐。
The columns (features) are:

x x
income household income
Firstdate data assoc. with the first gift by this individual
Lastdate data associated with the most recent gift
Amount average amount by this individual over all periods (incl. zeros)
rfaf2 frequency code
rfaa2 donation amount code
pepstrfl flag indicating a star donator
glast amount of last gift
gavr amount of average gift

The target variables is class and is equal to one if they gave in this campaign and zero otherwise.

# Load the data
mailing_url = "https://gist.githubusercontent.com/anonymous/5275f1f59be561ec9734c90d80d176b9/raw/f92227f9b8cdca188c1e89094804b8e46f14f30b/-"
mailing_df = pd.read_csv(mailing_url)
# Let's take a look at the data
mailing_df.head(5)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,452评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,959评论 0 23
  • 高一时, 他悄悄的喜欢上一个短发姑娘 下课一起讨论习题,一起打闹,一起聊天 短发女生很大条 丝毫没有察觉出他看她的...
    大头诺阿诺阅读 311评论 0 0
  • 我本来是想走了 因为你这一声唤 又侧过了身 手执一把蒲团 扇啊扇啊 空气促成一股急流 转了一个弯儿 夏日的沉闷和挫...
    Cherie雨丝阅读 199评论 1 2
  • 很多事,决定了就要坚持,2016,动起来,做起来,以便在明年今日可以自豪的告诉自己:你,真的越来越好了!你,真的做到了!
    迷茫如斯阅读 100评论 0 0