# feature_list_of_all_instances.append(l[0:519]) # class_list_of_all_instances.append(int(l[519])) i += 1 # # if i == Total_data_number: # break c = 0 print("Total instances ", len(total_matrix)) print("Total Features ", len(total_matrix[0]) -1) print("Starting To Standardize Total Matrix ... ") # print(total_matrix[0][882:]) total_matrix = standardalize.std(total_matrix, 882, 522 + 73) # print(total_matrix[0][882:]) print("Total instances ", len(total_matrix)) print("Total Features ", len(total_matrix[0])-1) for l in total_matrix: index = len(l) -1 # print(index) feature_list_of_all_instances.append(l[0:index]) class_list_of_all_instances.append(l[index]) for i in class_list_of_all_instances: if i == 1: c += 1 print("Positive data ", c)
# print(l[1286:1295]) total_matrix.append(l) # b = l[1294] # if b == 1.0 :#and b != 0: # i += 1 # print( "count of 2 class " ,i, " value ",b) # if index % 10000 == 0: # print(index) # break # if i == Total_data_number: # break print( "count of 2 class " ,i) print("length of total matrix ", len(total_matrix) ) print("Starting To Standardize Total Matrix ... ") total_matrix = standardalize.std(total_matrix, 882, 412) for l in total_matrix: feature_list_of_all_instances.append(l[0:1294]) class_list_of_all_instances.append(l[1294]) for i in range(0, Total_data_number): data.append(i) kf = cross_validation.KFold(Total_data_number, n_folds=5) # Cs = numpy.logspace(-6, -1, 10) # clf = GridSearchCV(estimator='svc',param_grid=dict(C = Cs) , n_jobs=-1 )
l = x.rstrip('\n').split(',') l = list(map(float, l)) # total_matrix.append(l) index = len(l) - 1 # print(index) feature_list_of_all_instances.append(l[0:index]) class_list_of_all_instances.append(l[index]) # feature_list_of_all_instances.append(l[0:519]) # class_list_of_all_instances.append(int(l[519])) i += 1 # # if i == Total_data_number: # break print("Starting To Standardize Total Matrix ... ") feature_list_of_all_instances = standardalize.std( feature_list_of_all_instances, 882, 400) c = 0 print("Total instances ", len(feature_list_of_all_instances)) print("Total Features ", len(feature_list_of_all_instances[0])) gc.collect() # for l in total_matrix: # index = len(l) -1 # # print(index) # feature_list_of_all_instances.append(l[0:index]) # class_list_of_all_instances.append(l[index]) # total_matrix = []