SelectKBest如何工作?
我正在看本教程:https : //www.dataquest.io/mission/75/improving-your-submission 在第8节中,找到最佳功能,它显示了以下代码。 import numpy as np from sklearn.feature_selection import SelectKBest, f_classif predictors = ["Pclass", "Sex", "Age", "SibSp", "Parch", "Fare", "Embarked", "FamilySize", "Title", "FamilyId"] # Perform feature selection selector = SelectKBest(f_classif, k=5) selector.fit(titanic[predictors], titanic["Survived"]) # Get the raw p-values for each feature, and transform from p-values into scores scores …