added feature selection on all models but lets see if it works, only worked until DT

This commit is contained in:
Tanushree Tunstall 2022-05-23 07:47:56 +01:00
parent a420822a93
commit 3c7d8690ee
17 changed files with 2425 additions and 1202 deletions

View file

@ -25,7 +25,6 @@ X_eg, y_eg = make_classification(n_samples=1000,
pipe = Pipeline([('scaler', StandardScaler()),
('selector', SelectKBest(mutual_info_classif, k=9)),
('classifier', LogisticRegression())])
search_space = [{'selector__k': [5, 6, 7, 10]},
@ -97,7 +96,7 @@ search_space = [{'fs__min_features_to_select': [1,2]
gscv_fs = GridSearchCV(pipe
, search_space
, cv = skf_cv
, cv = rskf_cv
, scoring = mcc_score_fn
, refit = 'mcc'
, verbose = 1
@ -239,4 +238,4 @@ output_modelD
# json.dump(output_modelD, f)
# #
# with open(file, 'r') as f:
# data = json.load(f)
# data = json.load(f)