<jupyter_start><jupyter_text>H2OLet's use [H20 AutoML](https://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html) and see what we can build. This seems like 'stacking, the easy way out'.<jupyter_code>import h2o
from h2o.automl import H2OAutoML

h2o.init()
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import pandas as pd
import pickle
from pathlib import Path
from tqdm.notebook import trange, tqdm
### USE FOR LOCAL JUPYTER NOTEBOOKS ###
DOWNLOAD_DIR = Path('../download')
DATA_DIR = Path('../data')
SUBMISSIONS_DIR = Path('../submissions')
MODEL_DIR = Path('../models')
#######################################

# Paths must be strings
X = h2o.import_file(path='../download/train_values.csv')
y = h2o.import_file(path='../download/train_labels.csv')
y['damage_grade'] = y['damage_grade'].asfactor()
data = X.merge(y)
y_str = 'damage_grade'
data.drop('building_id')
aml = H2OAutoML(max_models=30, seed=1)
aml.train(y=y_str, training_frame=data.drop('building_id'))
lb = aml.leaderboard
lb.head(rows=lb.nrows)
aml.leader
X_test = h2o.import_file(path='../download/test_values.csv')
preds = aml.predict(X_test)['predict']
building_id_df = h2o.as_list(X_test['building_id'])
preds_def = h2o.as_list(preds)
my_sub = pd.concat([building_id_df, preds_def], axis=1)
my_sub = my_sub.set_index('building_id')
title = '../submissions/03-13 h2o AutoML - 30 models - seed=1 - no data preprocessing'
my_sub.to_csv(title)
my_sub<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1710794297352342, 'fraction_numerical': 0.019008825526137134, 'mean_word_length': 5.985781990521327, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '613907', 'license': 'MIT', 'n_tokens_mistral': 583, 'n_tokens_neox': 571, 'n_words': 114, 'path': 'analysis/6.6_h2o.ipynb', 'repo_name': 'theadammurphy/drivendata_earthquake_damage_competition', 'size': '1473'}