Kaggle competition: Mercedes-Benz Greener Manufacturing
df_train = pd.read_csv('.. /input/titanic/train.csv')
 df_test = pd.read_csv('.. /input/titanic/test.csv' )<feature_engineering>
print(h2o.__version__)
 h2o.init(max_mem_size='16G' )
df_test['Survived'] = 999<concatenate>
%%time
train = h2o.import_file(".. /input/mercedes-benz-greener-manufacturing/train.csv")
 test = h2o.import_file(".. /input/mercedes-benz-greener-manufacturing/test.csv")
df = pd.concat([df_train , df_test] , axis = 0)
 print(df_train.shape)
 print(df_test.shape)
 print('Combined dataframe shape :',df.shape )<count_missing_values>
x = train.columns
y = 'y'
x.remove(y)
print('The number of null values in age columns',df['Age'].isnull().sum())
 print('The % of null values in age columns',round(df['Age'].isnull().mean() * 100,2))<count_missing_values>
aml = H2OAutoML(max_runtime_secs = 3500, seed = 1, project_name = "lb_frame")
 aml.train(x = x, y = y, training_frame = train )
print('The number of null values in cabin columns',df['Cabin'].isnull().sum())
 print('The % of null values in cabin columns',round(df['Cabin'].isnull().mean() * 100,2))<drop_column>
aml.leader
df.drop(columns = 'Cabin' , inplace = True )<count_missing_values>
pred = aml.predict(test)
 pred.head()
print('The number of null values in Embarked is ', df['Embarked'].isnull().sum() )<categorify>
h2o.save_model(aml.leader, path = "./product_backorders_model_bin" )
df['Embarked'].replace({np.nan:'S'} , inplace = True )<filter>
sample_submission = pd.read_csv('.. /input/mercedes-benz-greener-manufacturing/sample_submission.csv')
 sample_submission.shape
df[df['Fare'].isnull() ]<count_missing_values>
sample_submission['y'] = pred.as_data_frame().values
sample_submission.to_csv('h2o_automl_submission_4.csv', index=False )
df['Name'].isnull().sum() 
<count_values>
h2o.save_model(aml.leader, path = "submission1.csv" )