added and ran hyperparam script for all different classifiers, but couldn't successfully run the feature selection and hyperparam together
This commit is contained in:
parent
74af5ef890
commit
37bda41f44
18 changed files with 131 additions and 142 deletions
22
UQ_LR_FS.py
22
UQ_LR_FS.py
|
@ -60,19 +60,19 @@ jacc_score_fn = {'jcc': make_scorer(jaccard_score)}
|
|||
#%% Logistic Regression + hyperparam + FS: BaseEstimator: ClfSwitcher()
|
||||
model_lr = LogisticRegression(**rs)
|
||||
model_rfecv = RFECV(estimator = model_lr
|
||||
, cv = skf_cv
|
||||
, cv = rskf_cv
|
||||
#, cv = 10
|
||||
, scoring = 'matthews_corrcoef'
|
||||
)
|
||||
|
||||
model_rfecv = SequentialFeatureSelector(estimator = model_lr
|
||||
, n_features_to_select = 'auto'
|
||||
, tol = None
|
||||
# , cv = 10
|
||||
, cv = skf_cv
|
||||
# , direction ='backward'
|
||||
, direction ='forward'
|
||||
, **njobs)
|
||||
# model_rfecv = SequentialFeatureSelector(estimator = model_lr
|
||||
# , n_features_to_select = 'auto'
|
||||
# , tol = None
|
||||
# # , cv = 10
|
||||
# , cv = rskf_cv
|
||||
# # , direction ='backward'
|
||||
# , direction ='forward'
|
||||
# , **njobs)
|
||||
|
||||
# param_grid = [
|
||||
# { 'C': np.logspace(0, 4, 10),
|
||||
|
@ -296,4 +296,6 @@ print('\nFeatures selected from Sequential Feature Selector (Greedy):', len(sfsb
|
|||
|
||||
# Features selected from Sequential Feature Selector (Greedy, Forward): 6 [CV = 10]
|
||||
#These are: Index(['duet_stability_change', 'deepddg', 'ddg_dynamut2', 'rsa', 'kd_values', 'maf']
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# IMP: nice eg of including it as part of pipeline
|
||||
# https://www.tomasbeuzen.com/post/scikit-learn-gridsearch-pipelines/
|
Loading…
Add table
Add a link
Reference in a new issue