#NEWLINE# def gbc_svr_predict_part( gbc , train_x , train_y , test_x , feature_pair_sub_list , feature_pair_plus_list , feature_pair_mul_list , feature_pair_divide_list , feature_pair_sub_mul_list , feature_pair_sub_list_sf , feature_pair_plus_list2 ) : #NEWLINE# #INDENT# feature_indexs = getTopFeatures ( train_x , train_y ) #NEWLINE# sub_x_Train = get_data ( train_x , feature_indexs [ : 16 ] , feature_pair_sub_list , feature_pair_plus_list , feature_pair_mul_list , feature_pair_divide_list [ : 20 ] , feature_pair_sub_mul_list [ : 20 ] ) #NEWLINE# sub_x_Test = get_data ( test_x , feature_indexs [ : 16 ] , feature_pair_sub_list , feature_pair_plus_list , feature_pair_mul_list , feature_pair_divide_list [ : 20 ] , feature_pair_sub_mul_list [ : 20 ] ) #NEWLINE# pred_labels = gbc . predict ( sub_x_Test ) #NEWLINE# pred_probs = gbc . predict_proba ( sub_x_Test ) [ : , 1 ] #NEWLINE# ind_test = np . where ( ( pred_probs > 0.55 ) ) [ 0 ] #NEWLINE# ind_train = np . where ( ( train_y > 0 ) ) [ 0 ] #NEWLINE# ind_train0 = np . where ( ( train_y == 0 ) ) [ 0 ] #NEWLINE# preds_all = np . zeros ( [ len ( sub_x_Test ) ] ) #NEWLINE# flag = ( sub_x_Test [ : , 16 ] >= 1 ) #NEWLINE# ind_tmp0 = np . where ( flag ) [ 0 ] #NEWLINE# ind_tmp = np . where ( ( ~ flag ) ) [ 0 ] #NEWLINE# sub_x_Train = get_data ( train_x , feature_indexs [ : 100 ] , feature_pair_sub_list_sf , feature_pair_plus_list2 [ : 100 ] , feature_pair_mul_list [ : 40 ] , feature_pair_divide_list , feature_pair_sub_mul_list ) #NEWLINE# sub_x_Test = get_data ( test_x , feature_indexs [ : 100 ] , feature_pair_sub_list_sf , feature_pair_plus_list2 [ : 100 ] , feature_pair_mul_list [ : 40 ] , feature_pair_divide_list , feature_pair_sub_mul_list ) #NEWLINE# sub_x_Train [ : , 101 ] = np . log ( ( 1 - sub_x_Train [ : , 101 ] ) ) #NEWLINE# sub_x_Test [ ( ind_tmp , 101 ) ] = np . log ( ( 1 - sub_x_Test [ ( ind_tmp , 101 ) ] ) ) #NEWLINE# scaler = pp . StandardScaler ( ) #NEWLINE# scaler . fit ( sub_x_Train ) #NEWLINE# sub_x_Train = scaler . transform ( sub_x_Train ) #NEWLINE# sub_x_Test [ ind_tmp ] = scaler . transform ( sub_x_Test [ ind_tmp ] ) #NEWLINE# svr = SVR ( C = 16 , kernel = 'rbf' , gamma = 0.000122 ) #NEWLINE# svr . fit ( sub_x_Train [ ind_train ] , np . log ( train_y [ ind_train ] ) ) #NEWLINE# preds = svr . predict ( sub_x_Test [ feature_pair_sub_list ] ) #NEWLINE# preds_all [ ind_test ] = np . power ( np . e , preds ) #NEWLINE# preds_all [ ind_tmp0 ] = 0 #NEWLINE# return preds_all