Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.neighbors import KNeighborsClassifier
- def KBest_LDA_KNB(k, n, p):
- tuned_parameters = [
- { 'feature_selection' : [SelectKBest()],
- 'feature_selection__k' : k,
- 'feature_reduction' : [LinearDiscriminantAnalysis()],
- 'feature_reduction__n_components' : n,
- 'clf__n_neighbors' : p
- },
- ]
- estimators = [('feature_selection', SelectKBest()), ('feature_reduction', LinearDiscriminantAnalysis()) ,('clf', KNeighborsClassifier(n))]
- return (estimators, tuned_parameters)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement