Created
July 1, 2015 16:01
-
-
Save alfard/f0ac95aeeabd7af0527c to your computer and use it in GitHub Desktop.
Facebook Model submission
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from sklearn.metrics import roc_auc_score | |
######################################################################################### | |
NN_E=np.load('/home/alfard/Documents/Kaggle/Facebook-Robot/NN_E.npz') | |
NN_E=NN_E['arr_0'] | |
GB_E=np.load('/home/alfard/Documents/Kaggle/Facebook-Robot/GB_E.npz') | |
GB_E=GB_E['arr_0'] | |
################################################################################################# | |
#Mean1=np.array([ 0.15*NN_E, 0.85*GB_E ]) | |
Mean1=np.array([NN_E]) | |
Proba=np.mean(Mean1, axis=0 ) | |
################################################################################################# | |
C=pd.read_pickle(('/home/alfard/Documents/Kaggle/Facebook-Robot/A.pk')) | |
################################################################################################# | |
P1=pd.DataFrame(Proba,index=C['bidder_id']) | |
P1['bidder_id'] = P1.index | |
P1.columns=['P1','bidder_id'] | |
P1 = P1[['bidder_id','P1']] | |
################################################################## | |
P1.shape | |
test = pd.read_csv('/home/alfard/Documents/Kaggle/Facebook-Robot/test.csv') | |
test.shape | |
list(test) | |
R=pd.merge(test, P1, how='left',on='bidder_id') | |
R.shape | |
R=R[['bidder_id','P1']] | |
R.columns=['bidder_id','prediction'] | |
R.shape | |
R=R.fillna(0) | |
R.to_csv('/home/alfard/Documents/Kaggle/Facebook-Robot/Model_NNlast.csv',index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment