def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Age = row[0] response.Menopause = row[1] response.Tumor_size = row[2] response.Inv_nodes = row[3] response.Node_caps = row[4] response.Deg_malig = row[5] response.Breast = row[6] response.Breast_quad = row[7] response.Irradiat = row[8] response.Class = row[9] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Clump_thickness = numpy.uint32(row[0]) response.Cell_size_uniformity = numpy.uint32(row[1]) response.Cell_shape_uniformity = numpy.uint32(row[2]) response.Marginal_adhesion = numpy.uint32(row[3]) response.Single_epi_cell_size = numpy.uint32(row[4]) response.Bare_nuclei = row[5] response.Bland_chromatin = numpy.uint32(row[6]) response.Normal_nucleoli = numpy.uint32(row[7]) response.Mitoses = numpy.uint32(row[8]) response.Class = row[9] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Length = numpy.uint32(row[0]) response.Even_odd = row[1] response.First_char_vowel = row[2] response.Second_char_vowel = row[3] response.Vowels = numpy.uint32(row[4]) response.Consonants = numpy.uint32(row[5]) response.Vowel_consonant_ratio = row[6] response.Spaces = numpy.uint32(row[7]) response.Dots = numpy.uint32(row[8]) response.Words = numpy.uint32(row[9]) response.Class = row[10] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Attribute_1 = row[0] response.Attribute_2 = row[1] response.Attribute_3 = row[2] response.Attribute_4 = row[3] response.Attribute_5 = row[4] response.Attribute_6 = row[5] response.Attribute_7 = row[6] response.Attribute_8 = row[7] response.Attribute_9 = row[8] response.Class = row[9] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Mcv = numpy.uint32(row[0]) response.Alkphos = numpy.uint32(row[1]) response.Sgpt = numpy.uint32(row[2]) response.Sgot = numpy.uint32(row[3]) response.Gammagt = numpy.int64(row[4]) response.Drinks = row[5] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Mpg = row[0] response.Cylinders = row[1] response.Cubicinches = row[2] response.Horsepower = numpy.uint32(row[3]) response.Weightlbs = row[4] response.Time_to_sixty = numpy.uint32(row[5]) response.Year = row[6] response.Class = row[7] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Largest_spot_size = row[0] response.Spot_distribution = row[1] response.Activity = row[2] response.Evolution = row[3] response.Previous_24_hour_flare_activity_code = row[4] response.Historically_complex = row[5] response.Did_region_become_historically_complex = row[6] response.Area = row[7] response.Area_of_the_largest_spot = row[8] response.C_class_flares_production_by_this_region = row[9] response.M_class_flares_production_by_this_region = row[10] response.X_class_flares_production_by_this_region = row[11] response.Class = row[12] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments # This is for OpenML dataset # 61 ############################################################### response.Sepallength = row[0] response.Sepalwidth = row[1] response.Petallength = row[2] response.Petalwidth = row[3] response.Class = row[4] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Observation_number = row[0] response.Hospital_identification_number_for_blood_sample = numpy.int64( row[1]) response.Age_of_patient = numpy.uint32(row[2]) response.Date_that_blood_sample_was_taken = numpy.int64(row[3]) response.Ml = row[4] response.M2 = row[5] response.M3 = row[6] response.M4 = row[7] response.Class = row[8] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Home_away = row[0] response.Favorite_points = numpy.uint32(row[1]) response.Underdog_points = numpy.uint32(row[2]) response.Pointspread = row[3] response.Favorite_name = row[4] response.Underdog_name = row[5] response.Year = numpy.uint32(row[6]) response.Week = numpy.uint32(row[7]) response.Weekday = row[8] response.Overtime = row[9] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Fixed_acidity = row[0] response.Volatile_acidity = row[1] response.Citric_acid = row[2] response.Residual_sugar = row[3] response.Chlorides = row[4] response.Free_sulfur_dioxide = row[5] response.Total_sulfur_dioxide = row[6] response.Density = row[7] response.Ph = row[8] response.Sulphates = row[9] response.Alcohol = row[10] response.Class = row[11] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Id = numpy.uint32(row[0]) response.Englishsepaker = row[1] response.Courseinstructor = row[2] response.Course = row[3] response.Summer = row[4] response.Classsize = numpy.uint32(row[5]) response.Class = row[6] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Sex = row[0] response.Dvrt = numpy.uint32(row[1]) response.Educational_level = row[2] response.Leaving_certificate = row[3] response.Prestige_score = row[4] response.Type_school = row[5] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.A01 = numpy.uint32(row[0]) response.A02 = numpy.uint32(row[1]) response.A03 = row[2] response.A04 = row[3] response.A05 = row[4] response.A06 = row[5] response.A07 = row[6] response.A08 = row[7] response.A09 = row[8] response.A10 = row[9] response.A11 = row[10] response.A12 = row[11] response.A13 = row[12] response.A14 = row[13] response.A15 = row[14] response.A16 = row[15] response.A17 = row[16] response.A18 = row[17] response.A19 = row[18] response.A20 = row[19] response.A21 = row[20] response.A22 = row[21] response.A23 = row[22] response.A24 = row[23] response.A25 = row[24] response.A26 = row[25] response.A27 = row[26] response.A28 = row[27] response.A29 = row[28] response.A30 = row[29] response.A31 = row[30] response.A32 = row[31] response.A33 = row[32] response.A34 = row[33] response.Class = row[34] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Tr = row[0] response.Tree = row[1] response.Br = row[2] response.Tl = row[3] response.In = numpy.uint32(row[4]) response.Internode_1 = row[5] response.Internode_2 = row[6] response.Internode_3 = row[7] response.Internode_4 = row[8] response.Internode_5 = row[9] response.Internode_6 = row[10] response.Internode_7 = row[11] response.Internode_8 = row[12] response.Internode_9 = row[13] response.Internode_10 = row[14] response.Internode_11 = row[15] response.Internode_12 = row[16] response.Internode_13 = row[17] response.Internode_14 = row[18] response.Internode_15 = row[19] response.Internode_16 = row[20] response.Internode_17 = row[21] response.Internode_18 = row[22] response.Internode_19 = row[23] response.Internode_20 = row[24] response.Internode_21 = row[25] response.Internode_22 = row[26] response.Internode_23 = row[27] response.Internode_24 = row[28] response.Internode_25 = row[29] response.Internode_26 = row[30] response.Internode_27 = row[31] response.Internode_28 = row[32] response.Internode_29 = row[33] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.X1 = row[0] response.X2 = row[1] response.X3 = row[2] response.X4 = row[3] response.X5 = row[4] response.X6 = row[5] response.X7 = row[6] response.X8 = row[7] response.X9 = row[8] response.X10 = row[9] response.X11 = row[10] response.X12 = row[11] response.X13 = row[12] response.X14 = row[13] response.X15 = row[14] response.X16 = row[15] response.X17 = row[16] response.X18 = row[17] response.X19 = row[18] response.X20 = row[19] response.X21 = row[20] response.X22 = row[21] response.X23 = row[22] response.X24 = row[23] response.X25 = row[24] response.X26 = row[25] response.X27 = row[26] response.X28 = row[27] response.X29 = row[28] response.X30 = row[29] response.X31 = row[30] response.X32 = row[31] response.Phase = row[32] ############################################################### return response
def hppdatabroker(self, request, context): parameters = get_parameters() logger.debug("Connecting to databroker") response = model_pb2.Features(MSSubClass=float(parameters[0]), LotArea=float(parameters[1]), YearBuilt=float(parameters[2]), BedroomAbvGr=float(parameters[3]), TotRmsAbvGrd=float(parameters[4])) logger.debug(response) return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Age = numpy.uint32(row[0]) response.Sex = row[1] response.On_thyroxine = row[2] response.Query_on_thyroxine = row[3] response.On_antithyroid_medication = row[4] response.Sick = row[5] response.Pregnant = row[6] response.Thyroid_surgery = row[7] response.I131_treatment = row[8] response.Query_hypothyroid = row[9] response.Query_hyperthyroid = row[10] response.Lithium = row[11] response.Goitre = row[12] response.Tumor = row[13] response.Hypopituitary = row[14] response.Psych = row[15] response.Tsh_measured = row[16] response.Tsh = row[17] response.T3_measured = row[18] response.T3 = numpy.uint32(row[19]) response.Tt4_measured = row[20] response.Tt4 = numpy.uint32(row[21]) response.T4u_measured = row[22] response.T4u = numpy.uint32(row[23]) response.Fti_measured = row[24] response.Fti = numpy.uint32(row[25]) response.Tbg_measured = row[26] response.Tbg = row[27] response.Referral_source = row[28] response.Class = row[29] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.V1 = row[0] response.V2 = row[1] response.V3 = row[2] response.V4 = row[3] response.V5 = row[4] response.V6 = row[5] response.V7 = row[6] response.V8 = row[7] response.V9 = row[8] response.V10 = row[9] response.V11 = row[10] response.V12 = row[11] response.V13 = row[12] response.V14 = row[13] response.V15 = row[14] response.V16 = row[15] response.V17 = row[16] response.V18 = row[17] response.V19 = row[18] response.V20 = row[19] response.V21 = row[20] response.V22 = row[21] response.V23 = row[22] response.V24 = row[23] response.Class = row[24] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Cap_shape = row[0] response.Cap_surface = row[1] response.Cap_color = row[2] response.Bruises_3f = row[3] response.Odor = row[4] response.Gill_attachment = row[5] response.Gill_spacing = row[6] response.Gill_size = row[7] response.Gill_color = row[8] response.Stalk_shape = row[9] response.Stalk_root = row[10] response.Stalk_surface_above_ring = row[11] response.Stalk_surface_below_ring = row[12] response.Stalk_color_above_ring = row[13] response.Stalk_color_below_ring = row[14] response.Veil_type = row[15] response.Veil_color = row[16] response.Ring_number = row[17] response.Ring_type = row[18] response.Spore_print_color = row[19] response.Population = row[20] response.Habitat = row[21] response.Class = row[22] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Ds_name = row[0] response.T = row[1] response.N = row[2] response.P = numpy.uint32(row[3]) response.K = numpy.uint32(row[4]) response.Bin = numpy.uint32(row[5]) response.Cost = numpy.uint32(row[6]) response.Sdratio = row[7] response.Correl = row[8] response.Cancor1 = row[9] response.Cancor2 = row[10] response.Fract1 = row[11] response.Fract2 = row[12] response.Skewness = row[13] response.Kurtosis = row[14] response.Hc = row[15] response.Hx = row[16] response.Mcx = row[17] response.Enatr = row[18] response.Nsratio = row[19] response.Alg_name = row[20] response.Class = row[21] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Loc = row[0] response.V_g_ = row[1] response.Ev_g_ = row[2] response.Iv_g_ = row[3] response.N = row[4] response.V = row[5] response.L = row[6] response.D = row[7] response.I = row[8] response.E = row[9] response.B = row[10] response.T = row[11] response.Locode = row[12] response.Locomment = numpy.uint32(row[13]) response.Loblank = numpy.uint32(row[14]) response.Loccodeandcomment = numpy.uint32(row[15]) response.Uniq_op = row[16] response.Uniq_opnd = row[17] response.Total_op = row[18] response.Total_opnd = row[19] response.Branchcount = row[20] response.Defects = row[21] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Class = row[0] response.Buying_price_vhigh = row[1] response.Buying_price_high = row[2] response.Buying_price_med = row[3] response.Buying_price_low = row[4] response.Maintenance_price_vhigh = row[5] response.Maintenance_price_high = row[6] response.Maintenance_price_med = row[7] response.Maintenance_price_low = row[8] response.Doors_2 = row[9] response.Doors_3 = row[10] response.Doors_4 = row[11] response.Doors_5more = row[12] response.Persons_2 = row[13] response.Persons_4 = row[14] response.Persons_more = row[15] response.Luggage_boot_size_small = row[16] response.Luggage_boot_size_med = row[17] response.Luggage_boot_size_big = row[18] response.Safety_low = row[19] response.Safety_med = row[20] response.Safety_high = row[21] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.State = numpy.uint32(row[0]) response.Account_length = numpy.uint32(row[1]) response.Area_code = row[2] response.Phone_number = row[3] response.International_plan = row[4] response.Voice_mail_plan = row[5] response.Number_vmail_messages = numpy.uint32(row[6]) response.Total_day_minutes = row[7] response.Total_day_calls = numpy.uint32(row[8]) response.Total_day_charge = row[9] response.Total_eve_minutes = row[10] response.Total_eve_calls = numpy.uint32(row[11]) response.Total_eve_charge = row[12] response.Total_night_minutes = row[13] response.Total_night_calls = numpy.uint32(row[14]) response.Total_night_charge = row[15] response.Total_intl_minutes = row[16] response.Total_intl_calls = numpy.uint32(row[17]) response.Total_intl_charge = row[18] response.Number_customer_service_calls = row[19] response.Class = row[20] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Checking_status = row[0] response.Duration = numpy.uint32(row[1]) response.Credit_history = row[2] response.Purpose = row[3] response.Credit_amount = row[4] response.Savings_status = row[5] response.Employment = row[6] response.Installment_commitment = numpy.uint32(row[7]) response.Personal_status = row[8] response.Other_parties = row[9] response.Residence_since = numpy.uint32(row[10]) response.Property_magnitude = row[11] response.Age = numpy.uint32(row[12]) response.Other_payment_plans = row[13] response.Housing = row[14] response.Existing_credits = numpy.uint32(row[15]) response.Job = row[16] response.Num_dependents = numpy.uint32(row[17]) response.Own_telephone = row[18] response.Foreign_worker = row[19] response.Class = row[20] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Region_centroid_col = numpy.uint32(row[0]) response.Region_centroid_row = numpy.uint32(row[1]) response.Region_pixel_count = numpy.uint32(row[2]) response.Short_line_density_5 = row[3] response.Short_line_density_2 = row[4] response.Vedge_mean = row[5] response.Vegde_sd = row[6] response.Hedge_mean = row[7] response.Hedge_sd = row[8] response.Intensity_mean = row[9] response.Rawred_mean = row[10] response.Rawblue_mean = row[11] response.Rawgreen_mean = row[12] response.Exred_mean = row[13] response.Exblue_mean = row[14] response.Exgreen_mean = row[15] response.Value_mean = row[16] response.Saturation_mean = row[17] response.Hue_mean = row[18] response.Class = row[19] ############################################################### return response
def run(hpp_parameters): logging.basicConfig() print("Calling HPP_Stub..") start_ch = timer() with grpc.insecure_channel('localhost:{}'.format(port)) as channel: stub = model_pb2_grpc.PredictStub(channel) ui_request = model_pb2.Features(MSSubClass=float(hpp_parameters[0]), LotArea=float(hpp_parameters[1]), YearBuilt=float(hpp_parameters[2]), BedroomAbvGr=float(hpp_parameters[3]), TotRmsAbvGrd=float(hpp_parameters[4])) response = stub.predict_sale_price(ui_request) print("Greeter client received: ") print(response) end_ch = timer() print('Done!') ch_time = end_ch - start_ch print('Time for connecting to server = {}'.format(ch_time)) return response.salePrice
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Compactness = numpy.uint32(row[0]) response.Circularity = numpy.uint32(row[1]) response.Distance_circularity = numpy.uint32(row[2]) response.Radius_ratio = row[3] response.Pr_axis_aspect_ratio = numpy.uint32(row[4]) response.Max_length_aspect_ratio = numpy.uint32(row[5]) response.Scatter_ratio = row[6] response.Elongatedness = numpy.uint32(row[7]) response.Pr_axis_rectangularity = numpy.uint32(row[8]) response.Max_length_rectangularity = numpy.uint32(row[9]) response.Scaled_variance_major = row[10] response.Scaled_variance_minor = row[11] response.Scaled_radius_of_gyration = row[12] response.Skewness_about_major = numpy.uint32(row[13]) response.Skewness_about_minor = numpy.uint32(row[14]) response.Kurtosis_about_major = numpy.uint32(row[15]) response.Kurtosis_about_minor = numpy.uint32(row[16]) response.Hollows_ratio = numpy.uint32(row[17]) response.Class = row[18] ############################################################### return response
def get_next_row(self, request, context): response = model_pb2.Features() total_rows = openml_obj.get_num_rows() current_row = openml_obj.current_row #print("total number of rows of OpenML file: ", total_rows) if current_row == total_rows: context.set_code(grpc.StatusCode.NOT_FOUND) context.set_details('All available data has been processed') print("All data processed. Exception raised") return response #print(f"fetching row {current_row} from a total of {total_rows}") row = openml_obj.get_next_row(current_row) openml_obj.current_row = openml_obj.current_row + 1 ############################################################### # Here goes the OpenML dataset specific Feature assignments ############################################################### response.Lymphatics = row[0] response.Block_of_affere = row[1] response.Bl_of_lymph_c = row[2] response.Bl_of_lymph_s = row[3] response.By_pass = row[4] response.Extravasates = row[5] response.Regeneration_of = row[6] response.Early_uptake_in = row[7] response.Lym_nodes_dimin = numpy.uint32(row[8]) response.Lym_nodes_enlar = numpy.uint32(row[9]) response.Changes_in_lym = row[10] response.Defect_in_node = row[11] response.Changes_in_node = row[12] response.Changes_in_stru = row[13] response.Special_forms = row[14] response.Dislocation_of = row[15] response.Exclusion_of_no = row[16] response.No_of_nodes_in = numpy.uint32(row[17]) response.Class = row[18] ############################################################### return response