Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SW-2567] Fix CoxPH docs example for Scala and Python #2531

Merged
merged 3 commits into from Jun 3, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions doc/src/site/sphinx/ml/sw_coxph.rst
Expand Up @@ -42,6 +42,10 @@ See also :ref:`parameters_H2OCoxPH`.

import ai.h2o.sparkling.ml.algos.H2OCoxPH
val estimator = new H2OCoxPH()
.setStartCol("start")
.setStopCol("stop")
.setTies("breslow")
.setLabelCol("event")
val model = estimator.fit(trainingDF)

You can also get raw model details by calling the *getModelDetails()* method available on the model as:
Expand Down Expand Up @@ -83,12 +87,16 @@ See also :ref:`parameters_H2OCoxPH`.
testingFrame = h2o.import_file("https://raw.githubusercontent.com/h2oai/sparkling-water/master/examples/smalldata/coxph_test/heart_test.csv")
testingDF = hc.asSparkFrame(testingFrame)

Train the model. You can configure all the available Isolation Forest arguments using provided setters or constructor parameters.
Train the model. You can configure all the available CoxPH arguments using provided setters or constructor parameters.

.. code:: python

from pysparkling.ml import H2OCoxPH
estimator = H2OCoxPH()
estimator = H2OCoxPH()\
.setStartCol('start')\
.setStopCol('stop')\
.setTies('breslow')\
.setLabelCol('event')
model = estimator.fit(trainingDF)

You can also get raw model details by calling the *getModelDetails()* method available on the model as:
Expand Down