输入数据:
id diagnosis Invoice No Test Name
111 M 2 2
112 B 6 5
113 M 4 6
代码:
#2) Univariate feature selection and random forest classification
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
# find best scored features
select_feature = SelectKBest(chi2, k=1).fit(x_train, y_train)
print('Score list:', select_feature.scores_)
print('Feature list:', x_train.columns)
p.append(x_train.columns.values.tolist())
输出:
{'Test Name': 0.09090909090909091}
现在我的问题是它如何计算得分?