Skip to content

Commit

Permalink
add rf baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
NIPS-BRITS committed Nov 28, 2018
1 parent ea68088 commit 811b7c6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 37 deletions.
37 changes: 0 additions & 37 deletions result/light_gbm.py

This file was deleted.

27 changes: 27 additions & 0 deletions result/random_forest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import xgboost as xgb
import numpy as np

model_name = 'brits_i'

impute = np.load('./{}_data.npy'.format(model_name)).reshape(-1, 48 * 35)
label = np.load('./{}_label.npy'.format(model_name))

data = np.nan_to_num(impute)

n_train = 3000

print(impute.shape)
print(label.shape)

from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import roc_auc_score

auc = []

for i in range(10):
model = RandomForestClassifier().fit(data[:n_train], label[:n_train])
pred = model.predict_proba(data[n_train:])

auc.append(roc_auc_score(label[n_train:].reshape(-1,), pred[:, 1].reshape(-1, )))

print(np.mean(auc))

0 comments on commit 811b7c6

Please sign in to comment.