def _testing_original_file(self, test_dir, type_data):     
     dnn_predict_dir = '/home/danglab/3P/B/' + self.hidden_layer +'SQR/' + self.artic + type_data + 'full_EMA/' +  'test_' + str(self.test_number) + '/' 
     
     if not os.path.exists(dnn_predict_dir):
         os.makedirs(dnn_predict_dir)
       
     for afile in self.missing_filename_list:
         test_arr, factors = read_file_test(test_dir + afile + '_in.txt', self.n_input_f, "factors")                                #read a missing_feature
         energy = test_arr[:,0]          #ko cho energy vao DNN
         test_arr = test_arr[:,1:self.n_input_f]
         #test_arr[:,36:test_arr.shape[1]] = 0            # loai bo EMA data
         #print test_arr
         #break
     
         self._write_predict_2_file(dnn_predict_dir + afile + '.txt', energy, self.predict(test_arr), factors)      # write result to file
 def _testing_noise_space(self, test_dir, type_data):             
     for type_test in sorted(os.listdir(test_dir)):
         if (not type_test.endswith('zip')) and 'output' not in type_test:                
             type_test_dir = test_dir + type_test + '/'
             print type_test_dir
             dnn_predict_dir = '/home/danglab/3P/B/' + self.hidden_layer +'SQR/' + self.artic + type_data + 'test_' + str(self.test_number) + '/' + type_test + '/'
     
             if not os.path.exists(dnn_predict_dir):
                 os.makedirs(dnn_predict_dir)
             print type_test
             duration = type_test.split('_')[1]     # 50ms, 100ms
               
             #listtest = sorted(os.listdir(type_test_dir))
             #for afile in listtest:
             for prefix_file in self.missing_filename_list:
                 afile = prefix_file + '_' + duration + '_in.txt' 
                 test_arr, factors = read_file_test(type_test_dir + afile, self.n_input_f, "factors")                                #read a missing_feature
                 find_ = [m.start() for m in re.finditer('_', afile)]  
                 energy = test_arr[:,0]          #ko cho energy vao DNN
                 test_arr = test_arr[:,1:self.n_input_f]
                 #print factors
                 self._write_predict_2_file(dnn_predict_dir + afile.replace(afile[find_[4]:len(afile)-4],''), energy, self.predict(test_arr), factors)      # write result to file