def selectFeatures(k_features=5, *args):
"""
# Select k best features using the SelectKBest class in Sklearn.
# Inputs: k=no. of features to select, args=(XTrain,yTrain)
# returns: np array of k features.
"""
X, y = args
skb = SelectKBest(k=k_features)
return skb.fit_transform(X, y)
评论列表
文章目录