print(c.fit(df['age'], method='step').export())
# 卡方分箱
print('-'*30)
print(c.fit(df, y='churn', method='chi...28.666666666666668, 41.5]}
连续变量-数据变换
import pandas as pd
# 构造数据
df = pd.DataFrame({'sales': [3,7,8,2,6,3,6]})
# 平方根变换...scipy.stats import pearsonr
r = lambda X, Y: np.array(list(map(lambda x:pearsonr(x, Y)[0], X.T))).T
SelectKBest...array([[1.4, 0.2],
[1.4, 0.2],
[1.3, 0.2]])
# 卡方检验
from sklearn.feature_selection import SelectKBest...from sklearn.feature_selection import chi2
SelectKBest(chi2, k=2).fit_transform(iris.data, iris.target