<s> from sklearn . datasets import load_iris <EOL> from sklearn . feature_selection import SelectKBest <EOL> from sklearn . pipeline import make_pipeline <EOL> from sklearn . svm import LinearSVC <EOL> rng = np . random . RandomState ( <NUM_LIT> ) <EOL> iris = load_iris ( ) <EOL> X = np . hstack ( [ iris . data , rng . uniform ( size = ( len ( iris . data ) , <NUM_LIT:5> ) ) ] ) <EOL> X_train , X_test , y_train , y_test = train_test_split ( X , iris . target , random_state = <NUM_LIT:2> ) <EOL> selection_pipe = make_pipeline ( SelectKBest ( ) , LinearSVC ( ) ) <EOL> param_grid = { '<STR_LIT>' : <NUM_LIT> ** np . arange ( - <NUM_LIT:3> , <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:7> ] } <EOL> grid = GridSearchCV ( selection_pipe , param_grid , cv = <NUM_LIT:5> ) <EOL> grid . fit ( X_train , y_train ) <EOL> print ( "<STR_LIT>" % grid . best_params_ ) <EOL> print ( "<STR_LIT>" % grid . score ( X_test , y_test ) ) </s>
