Kaggle competition: PetFinder.my Adoption Prediction
import matplotlib.pyplot as plt<drop_column>
train_df = pd.read_csv(r'.. /input/train/train.csv')
 print(train_df.shape)
 print(train_df.head(10))
del(corr )<define_variables>
test_df = pd.read_csv(r'.. /input/test/test.csv')
 print(test_df.shape)
 print(test_df.head(10))
target = 'scalar_coupling_constant'<define_variables>
dropFeatureList=['Description','RescuerID']
for feature in dropFeatureList:
train_df.drop(feature,axis=1,inplace=True)
 test_df.drop(feature,axis=1,inplace=True)
 print(train_df.columns,test_df.columns)
 aml_df = h2o.H2OFrame(train_df)
 Y='AdoptionSpeed'
all_colums = list(aml_df.columns)
 X= all_colums.remove(Y)
 print(all_colums,X)
 aml_df['AdoptionSpeed'] = aml_df['AdoptionSpeed'].asfactor()
if True:
aml = H2OAutoML(max_models=60, max_runtime_secs=1000, seed=42)
 aml.train(x=X, y=Y, training_frame=aml_df)
 print('Training Done!!' )
d_cols = [x for x in df_train.columns if x.startswith('d_')and len(x)== 3]
feat_cols = d_cols + neigh_all_cols + neigh_all_cols_2<prepare_x_and_y>
test_df_h2o= h2o.H2OFrame(test_df)
 dfres = aml.leader.predict(test_df_h2o )
y_train = df_train[target].values<drop_column>
sample_df = pd.read_csv(r'.. /input/test/sample_submission.csv')
 test_h2o = h2o.H2OFrame(test_df)
 submission = test_h2o[:, "PetID"]
final_sub = submission.cbind(dfres[:,'predict'])
 pd_final_sub = pd.DataFrame(final_sub.as_data_frame())
 pd_final_sub.rename(columns={'predict': 'AdoptionSpeed'}, inplace=True)
 pd_final_sub.to_csv('submission_2nd.csv',index=False)
<split><EOS> 
pd_final_sub.AdoptionSpeed.value_counts()