added random state to split in function

This commit is contained in:
Tanushree Tunstall 2022-07-05 14:15:43 +01:00
parent e5f882841e
commit 53c229f480
3 changed files with 24 additions and 21 deletions

View file

@ -215,7 +215,7 @@ def MultModelsCl(input_df, target, skf_cv
, ('Naive Bayes' , BernoulliNB() )
, ('Passive Aggresive' , PassiveAggressiveClassifier(**rs, **njobs) )
, ('QDA' , QuadraticDiscriminantAnalysis() )
, ('Random Forest' , RandomForestClassifier(**rs, n_estimators = 1000 ) )
, ('Random Forest' , RandomForestClassifier(**rs, n_estimators = 1000, **njobs ) )
, ('Random Forest2' , RandomForestClassifier(min_samples_leaf = 5
, n_estimators = 1000
, bootstrap = True

View file

@ -40,7 +40,7 @@ import argparse
import re
homedir = os.path.expanduser("~")
#%% GLOBALS
rs = {'random_state': 42}
#rs = {'random_state': 42}
njobs = {'n_jobs': os.cpu_count() } # the number of jobs should equal the number of CPU cores
#%% Define split_tts function #################################################
@ -51,7 +51,10 @@ def split_tts(ml_input_data
, dst_colname = 'dst'# determine how to subset the actual vs reverse data
, target_colname = 'dst_mode'
, include_gene_name = True
, k_smote = 5):
, k_smote = 5
, random_state = 42):
rs = {'random_state': random_state}
outDict = {}