赞
踩
1. pdf分页使用的是\newpage 或者 \pagebreak;
https://stackoverflow.com/questions/25240541/how-to-add-newpage-in-rmarkdown-in-a-smart-way
2. python计算IV值
- def compute_IV(df, variable, target):
-
- """
- to compute the IV of the variable
-
- df: data frame;
- variable: compute its IV;
- target: the target(1 or 0)
-
- reference: https://gist.github.com/Kirili4ik/1364c8666b042854b35c04b5b82be720
-
- """
-
- df = df[[variable, target]].copy()
-
- df[target] = np.where(df[target] == 1, 'Good', 'Bad')
-
- df = df.groupby([variable, target]).size().reset_index()
-
- df.rename(columns={0: 'size'}, inplace=True)
-
- import itertools
-
- df2 = pd.DataFrame(itertools.product(list(df[variable].unique()),
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。