#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 14 13:04:39 2018 @author: whb17 """ import p2funcs as p2f k_list = [2e-7, 0.000002, 0.00002, 0.0002, 0.002, 0.02, 0.2, 2.0] select_k = 0.0002 k_i = k_list.index(select_k) k_list_t2=list(p2f.frange(k_list[k_i], k_list[k_i+1], k_list[k_i])) print(k_list_t2)
# Print aggregate gamma values for i in range(len(opt_t1_gammas)): print('\nOptimal tier 1 gamma for dataset %s found to be %s' % (toy_dataset_list[i][0], opt_t1_gammas[i])) # Find most frequent gamma value t1_gamma_consensus = p2f.most_common(opt_t1_gammas) #Just in case last value selected: if t1_gamma_consensus == t1_gamma_list[-1]: t1_gamma_consensus = t1_gamma_list[-2] # Create tier 2 gamma list gamma_i_t1 = t1_gamma_list.index(t1_gamma_consensus) t2_gamma_list = list( p2f.frange(t1_gamma_list[gamma_i_t1 - 1], t1_gamma_list[gamma_i_t1], t1_gamma_list[gamma_i_t1 - 1])) + list( p2f.frange(t1_gamma_list[gamma_i_t1], t1_gamma_list[gamma_i_t1 + 1], t1_gamma_list[gamma_i_t1])) #t2_gamma_list = [t1_gamma_list[gamma_i_t1]] #Dictionary of AUC matrices by gamma amat_dict_list = [] # Collect optimal tier2 gammas opt_t2_gammas = [] for toy_label, toy_X in toy_dataset_list: print('\n##### Now running dataset %s through Tier 2 #####' % toy_label)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 18 11:16:11 2018 @author: whb17 """ import p2funcs as p2f tier1 = [0.002 / 10000, 0.2 / 1000, 0.2 / 100, 0.2 / 10, 0.2, 0.2 * 10] tier2 = list(p2f.frange(tier1[2 - 1], tier1[2], tier1[2 - 1])) + list( p2f.frange(tier1[2], tier1[2 + 1], tier1[2])) print(tier2)
# Name of script to trace where images came from scriptname = 'gs_tune_2' #Select current toy dataset #dataset = '018' #mesa = pd.read_csv('../../data/mesa/MESA_Clinical_data_full_COMBI-BIO_non-verbose.csv', sep=',', header=0, index_col=1) #List of toy datasets to test #dataset_list = ['017', '018', '019', '020', '021', '022', '023', '024'] dataset_list = ['023'] #dataset_list = ['MESA'] # hyperparameters to test #gamma_list = [2e-10, 2e-9, 2e-8, 2e-7, 2e-6, 2e-5, 2e-4, 2e-3, 2e-2, 0.2, 2.0] gamma_list = list(p2f.frange(0.002, 0.02, 0.002)) for dataset in dataset_list: print('\nRunning %s with %s:' % (scriptname, dataset)) #Create directory if directory does not exist #filepath = '../../figs/out/%s/%s/%s/' % (scriptname, nowdate, dataset) filepath = '../../figs/out/%s/%s/' % (scriptname, nowdate) if not os.path.exists(filepath): os.makedirs(filepath) # Import dataset and target if dataset == 'MESA': X = pd.read_csv(