print('Load the target ' + str(trainIndex[refSampleInd])) target = dh.loadDeepCyTOFData(dataPath, trainIndex[refSampleInd], relevantMarkers, mode) # Pre-process sample. if choice!=5: target = dh.preProcessSamplesCyTOFData(target) ''' Train the de-noising auto encoder. ''' print('Train the de-noising auto encoder.') start = tm.time() DAE = dae.trainDAE(target, dataPath, refSampleInd, trainIndex, relevantMarkers, mode, keepProb, denoise, loadModel, dataSet[choice]) denoiseTarget = dae.predictDAE(target, DAE, denoise) ''' Train the feed-forward classifier on (de-noised) target. ''' denoiseTarget, preprocessor = dh.standard_scale(denoiseTarget, preprocessor = None) if loadModel: from keras.models import load_model cellClassifier = load_model(os.path.join(io.DeepLearningRoot(), 'savemodels/' + dataSet[choice] + '/cellClassifier.h5')) else:
# for data_path in data_paths: # data = pd.read_csv(data_path, compression='gzip', error_bad_lines=False) # actual = pd.read_csv(data_path.replace("/x/","/y/"), compression='gzip', error_bad_lines=False) # Pre-process sample. Don't need to, my samples are cleaned and processed target = dh.preProcessSamplesCyTOFData(target) ''' Train the de-noising auto encoder. ''' print('Train the de-noising auto encoder.') res_dir = data_dir.replace("raw/", "results/").replace( "/x/", "/deepCyTOF_models/" + str(trainNum) + "/") Path(res_dir).mkdir(parents=True, exist_ok=True) DAE = dae.trainDAE(target, data_dir, refSampleInd, trainIndex, relevantMarkers, mode, keepProb, denoise, loadModel, res_dir) denoiseTarget = dae.predictDAE(target, DAE, denoise) ''' Train the feed-forward classifier on (de-noised) target. ''' denoiseTarget, preprocessor = dh.standard_scale(denoiseTarget, preprocessor=None) res_dir = data_dir.replace("raw/", "results/").replace( "/x/", "/deepCyTOF_models/" + str(trainNum) + "/") Path(res_dir).mkdir(parents=True, exist_ok=True) if loadModel: from keras.models import load_model cellClassifier = load_model( os.path.join(io.DeepLearningRoot(),