# Create the training data and label training_data = [ arr for idx_arr, arr in enumerate(data) if idx_arr != idx_lopo_cv ] training_label = [ arr for idx_arr, arr in enumerate(label) if idx_arr != idx_lopo_cv ] # Concatenate the data training_data = np.atleast_2d(np.hstack(training_data)).T training_data = np.nan_to_num(training_data) training_label = label_binarize( np.hstack(training_label).astype(int), [0, 255]) print 'Create the training set ...' # Perform the classification for the current cv and the # given configuration result_cv.append( Classify(training_data, training_label, testing_data, testing_label, **c)) # Concatenate the results per configuration result_config.append(result_cv) # Save the information path_store = '/data/prostate/results/lemaitre-2016-nov/semi-washin-normalized' if not os.path.exists(path_store): os.makedirs(path_store) joblib.dump(result_config, os.path.join(path_store, 'results_normalized_ese.pkl'))
testing_data = np.atleast_2d(data[idx_lopo_cv]).T testing_label = label_binarize(label[idx_lopo_cv], [0, 255]) print 'Create the testing set ...' # Create the training data and label training_data = [arr for idx_arr, arr in enumerate(data) if idx_arr != idx_lopo_cv] training_label = [arr for idx_arr, arr in enumerate(label) if idx_arr != idx_lopo_cv] # Concatenate the data training_data = np.atleast_2d(np.hstack(training_data)).T training_label = label_binarize(np.hstack(training_label).astype(int), [0, 255]) print 'Create the training set ...' # Perform the classification for the current cv and the # given configuration result_cv.append(Classify(training_data, training_label, testing_data, testing_label, **c)) # Concatenate the results per configuration result_config.append(result_cv) # Save the information path_store = '/data/prostate/results/lemaitre-2016-nov/pun-r' if not os.path.exists(path_store): os.makedirs(path_store) joblib.dump(result_config, os.path.join(path_store, 'results_normalized_ese.pkl'))