Example #1
0
        self.coef_ = self.feature_importances_


##############################################################################
# #folder to read feartures from
output_folder = "/home/ubuntu/Documents/Thesis_work/results/1_min_features/aftdb/"

output_folder_aftdb = "/home/ubuntu/Documents/Thesis_work/results/1_min_features/aftdb/"
output_folder_afpdb_patient = "/home/ubuntu/Documents/Thesis_work/results/1_min_features/afpdb_patient/"
output_folder_afpdb_normal = "/home/ubuntu/Documents/Thesis_work/results/1_min_features/afpdb_normal/"

### read values from text files ######

## read these once
#global_vocab=rw.read_features_frm_file(output_folder_afpdb_normal,"global_vocab_pickle.txt")
global_vocab = rw.read_features_frm_file(output_folder,
                                         "global_vocab_pickle.txt")

# ##################### change key value pairs of global vocab ####################
inv_global_vocab = dict(zip(global_vocab.values(), global_vocab.keys()))
print inv_global_vocab[
    3]  # confirm that this is the std_dev_features and del is from dictionary

del inv_global_vocab[3]
## read features from different databases
#
all_features_aftdb = rw.read_features_frm_file(output_folder_aftdb,
                                               "all_features_pickle.txt")
all_features_afpdb_patient = rw.read_features_frm_file(
    output_folder_afpdb_patient, "all_features_pickle.txt")
all_features_afpdb_normal = rw.read_features_frm_file(
    output_folder_afpdb_normal, "all_features_pickle.txt")
def get_features_from_folder(output_folder):
    ### read values from text files ######
    all_features=rw.read_features_frm_file(output_folder,"all_features_pickle.txt")
    rec_name_array=rw.read_features_frm_file(output_folder,"rec_name_array_pickle.txt")
    return all_features,rec_name_array
Example #3
0
from sklearn import cross_validation
import wfdb_setup as ws;
import process_rr as pr;
import data_cleaning as dc;
import graphs 
import read_write as rw;
import non_linear_measures as nlm;
import classification_functions as cl

##############################################################################
output_folder="/home/ubuntu/Documents/Thesis_work/results/19_oct_results/non_linear/sodp_analysis/non_linear_features_edges_changed/"

#output_folder="/home/ubuntu/Documents/Thesis_work/results/19_oct_results/afpdb_test_records/"

### read values from text files ######
all_features=rw.read_features_frm_file(output_folder,"all_features_pickle.txt")
rw.write_value(all_features,output_folder,"list_of_list_before_cleaning","w")
global_vocab=rw.read_features_frm_file(output_folder,"global_vocab_pickle.txt")
rec_name_array=rw.read_features_frm_file(output_folder,"rec_name_array_pickle.txt")

##################### change key value pairs of global vocab ####################
inv_global_vocab = dict(zip(global_vocab.values(), global_vocab.keys()))
#print type(inv_global_vocab.values())
all_features_list=inv_global_vocab.values()
np.savetxt(output_folder+"all_features_list.txt",all_features_list,fmt="%s",delimiter=',',newline='\n')


#generate class labels
y=np.array(cl.generate_labels(rec_name_array))
print ("label array is: " + str(y))
Example #4
0
from sklearn import cross_validation
import wfdb_setup as ws
import process_rr as pr
import data_cleaning as dc
import graphs
import read_write as rw
import non_linear_measures as nlm
import classification_functions as cl

##############################################################################
output_folder = "/home/ubuntu/Documents/Thesis_work/results/19_oct_results/non_linear/sodp_analysis/non_linear_features_edges_changed/"

#output_folder="/home/ubuntu/Documents/Thesis_work/results/19_oct_results/afpdb_test_records/"

### read values from text files ######
all_features = rw.read_features_frm_file(output_folder,
                                         "all_features_pickle.txt")
rw.write_value(all_features, output_folder, "list_of_list_before_cleaning",
               "w")
global_vocab = rw.read_features_frm_file(output_folder,
                                         "global_vocab_pickle.txt")
rec_name_array = rw.read_features_frm_file(output_folder,
                                           "rec_name_array_pickle.txt")

##################### change key value pairs of global vocab ####################
inv_global_vocab = dict(zip(global_vocab.values(), global_vocab.keys()))
#print type(inv_global_vocab.values())
all_features_list = inv_global_vocab.values()
np.savetxt(output_folder + "all_features_list.txt",
           all_features_list,
           fmt="%s",
           delimiter=',',
def get_features_from_folder(output_folder):
    ### read values from text files ######
    all_features = rw.read_features_frm_file(output_folder, "all_features_pickle.txt")
    rec_name_array = rw.read_features_frm_file(output_folder, "rec_name_array_pickle.txt")
    return all_features, rec_name_array
        self.coef_ = self.feature_importances_
        
##############################################################################
# #folder to read feartures from
output_folder="/home/ubuntu/Documents/Thesis_work/results/1_min_features/aftdb/"

output_folder_aftdb="/home/ubuntu/Documents/Thesis_work/results/1_min_features/aftdb/"
output_folder_afpdb_patient="/home/ubuntu/Documents/Thesis_work/results/1_min_features/afpdb_patient/"
output_folder_afpdb_normal="/home/ubuntu/Documents/Thesis_work/results/1_min_features/afpdb_normal/"


### read values from text files ######

## read these once
#global_vocab=rw.read_features_frm_file(output_folder_afpdb_normal,"global_vocab_pickle.txt")
global_vocab=rw.read_features_frm_file(output_folder,"global_vocab_pickle.txt")

# ##################### change key value pairs of global vocab ####################
inv_global_vocab = dict(zip(global_vocab.values(), global_vocab.keys()))
print inv_global_vocab[3] # confirm that this is the std_dev_features and del is from dictionary

del inv_global_vocab[3]
## read features from different databases
# 
all_features_aftdb=rw.read_features_frm_file(output_folder_aftdb,"all_features_pickle.txt")
all_features_afpdb_patient=rw.read_features_frm_file(output_folder_afpdb_patient,"all_features_pickle.txt")
all_features_afpdb_normal=rw.read_features_frm_file(output_folder_afpdb_normal,"all_features_pickle.txt")
# all_features_nsrdb=rw.read_features_frm_file(output_folder_nsrdb,"all_features_pickle.txt")
# all_features_afdb=rw.read_features_frm_file(output_folder_afdb,"all_features_pickle.txt")

#all_features=rw.read_features_frm_file(output_folder,"all_features_pickle.txt")