一、t检验
2. 逻辑回归代码
#-*- coding: utf-8 -*-
import pandas as pd
import numpy as np
filename = 'bankloan.xls'
data = pd.read_excel(filename)
X = data.iloc[:,:8].as_matrix()
y = data.iloc[:,8].as_matrix()
from sklearn.linear_model import LogisticRegression as LR
from sklearn.linear_model import RandomizedLogisticRegression as RLR
rlr = RLR(selection_threshold=0.25) #建立随机逻辑回归模型,筛选变量
rlr.fit(X,y) #训练模型
chara_scores= rlr.scores_ #获得F值,0-1,分数越大,特征越重要
characters = ['age', 'education', 'years of work', 'address', 'income', 'debit radio', 'credit