#NEWLINE# def gbc_gp_predict( train_x , train_y , test_x ) : #NEWLINE# #INDENT# feature_indexs = getTopFeatures ( train_x , train_y ) #NEWLINE# sub_x_Train = get_data ( train_x , feature_indexs [ : 16 ] , features . feature_pair_sub_list , features . feature_pair_plus_list , features . feature_pair_mul_list , features . feature_pair_divide_list [ : 20 ] ) #NEWLINE# sub_x_Test = get_data ( test_x , feature_indexs [ : 16 ] , features . feature_pair_sub_list , features . feature_pair_plus_list , features . feature_pair_mul_list , features . feature_pair_divide_list [ : 20 ] ) #NEWLINE# labels = toLabels ( train_y ) #NEWLINE# gbc = GradientBoostingClassifier ( n_estimators = 3000 , max_depth = 9 ) #NEWLINE# gbc . fit ( sub_x_Train , labels ) #NEWLINE# pred_probs = gbc . predict_proba ( sub_x_Test ) [ : , 1 ] #NEWLINE# ind_test = np . where ( ( pred_probs > 0.55 ) ) [ 0 ] #NEWLINE# gp_preds_part = gbc_gp_predict_part ( sub_x_Train , train_y , sub_x_Test [ ind_test ] ) #NEWLINE# gp_preds = np . zeros ( len ( test_x ) ) #NEWLINE# gp_preds [ ind_test ] = gp_preds_part #NEWLINE# return gp_preds_part