train_X, train_y = train[train_index], labels[train_index]
test_X, test_y = train[test_index], labels[test_index]

################################################################################


## list of prediction results from different classifiers 
predictions = []


#############################
##  XGBoost Classifier
#############################

xgb_param = param.xgboost_para()

xgboost_clf = clf.xgboost_classifer(xgb_param, train_X, train_y);

## xgboost input data requires specifc format
xg_test = xgb.DMatrix(test_X, label=test_y)
## prediction from xgboost
y_prob = xgboost_clf.predict(xg_test)

predictions.append(y_prob)


#############################
## Lasagne NN Classifier
#############################
Ejemplo n.º 2
0
for train_index, test_index in sss:
    print 'split the training data'

train_X, train_y = train[train_index], labels[train_index]
test_X, test_y = train[test_index], labels[test_index]

################################################################################

## list of prediction results from different classifiers
predictions = []

#############################
##  XGBoost Classifier
#############################

xgb_param = param.xgboost_para()

xgboost_clf = clf.xgboost_classifer(xgb_param, train_X, train_y)

## xgboost input data requires specifc format
xg_test = xgb.DMatrix(test_X, label=test_y)
## prediction from xgboost
y_prob = xgboost_clf.predict(xg_test)

predictions.append(y_prob)

#############################
## Lasagne NN Classifier
#############################

# standardize the data for NN