In [1]:
import h2o
In [2]:
h2o.init()
In [3]:
from h2o.utils.shared_utils import _locate # private function. used to find files within h2o git project directory.
prostate = h2o.upload_file(path=_locate("smalldata/logreg/prostate.csv"))
prostate.describe()
In [4]:
prostate["CAPSULE"] = prostate["CAPSULE"].asfactor()
model = h2o.deeplearning(x = prostate[list(set(prostate.columns) - set(["ID","CAPSULE"]))], y = prostate["CAPSULE"], training_frame = prostate, activation = "Tanh", hidden = [10, 10, 10], epochs = 10000)
model.show()
In [5]:
predictions = model.predict(prostate)
predictions.show()
In [6]:
performance = model.model_performance(prostate)
performance.show()