How to generate an H2O AutoDoc from an H2O-3 Model
1. Install the required dependencies for h2o_autodoc (example on a ubuntu system)
wget https://github.com/jgm/pandoc/releases/download/2.9.1.1/pandoc-2.9.1.1-1-amd64.deb
dpkg -i pandoc*.deb
2. Download and install the h2o_autodoc wheel
pip install h2o_autodoc-1.0.2-cp36-cp36m-linux_x86_64.whl
3. Create an H2O model
# import h2o and initialize h2o cluster
import h2o
from h2o.estimators.gbm import H2OGradientBoostingEstimator
h2o.init()
# import datasets for training and validation
train_path = "https://s3.amazonaws.com/h2o-training/events/ibm_index/CreditCard_Cat-train.csv"
valid_path = "https://s3.amazonaws.com/h2o-training/events/ibm_index/CreditCard_Cat-test.csv"
# import the train and valid dataset
train = h2o.import_file(train_path, destination_frame='CreditCard_Cat-train.csv')
valid = h2o.import_file(valid_path, destination_frame='CreditCard_Cat-test.csv')
# set predictors and response
predictors = train.columns
predictors.remove('ID')
response = "DEFAULT_PAYMENT_NEXT_MONTH"
# convert target to factor
train[response] = train[response].asfactor()
valid[response] = valid[response].asfactor()
# build an H2O-3 GBM Model
model = H2OGradientBoostingEstimator(model_id="gbm_model", seed=1234)
model.train(x = predictors, y = response, training_frame = train, validation_frame = valid)
4. Create H2O AutoDoc Model Report
# H2O AutoDoc package imports
from h2o_autodoc import Config
from h2o_autodoc import render_autodoc
# specify the full path to your H2O AutoDoc Report
output_file_path = 'full/path/to/your/autodoc/report_H2O3.docx'
config = Config(output_path=output_file_path)
# generate an H2O AutDoc report for your model
render_autodoc(h2o, config, model)