import numpy as np
from sklearn.feature_selection import SelectKBest, f_classif
import matplotlib.pyplot as plt
selector = SelectKBest(f_classif, k=13)
selector.fit(X_train, y_train)
scores_select = selector.pvalues_
print scores_select
# Plotting the bar Graph to visually see the weight of each feature
plt.bar(range(len(scores_select)), scores_select, align='center')
plt.xticks(range(len(features_columns)), features_columns, rotation='vertical')
plt.show()
做与
相同的事情void function(int *parameter){}
? 第一个也可以用于传递变量指针而不是数组吗?有点困惑。