Giter Club home page Giter Club logo

Comments (3)

exalate-issue-sync avatar exalate-issue-sync commented on May 23, 2024

Wendy Wong commented: codes to reproduce customer issue:

import pandas as pd

import numpy as np

import pandas as pd

import numpy as np

import h2o

from h2o.estimators.coxph import H2OCoxProportionalHazardsEstimator

h2o.init()

np.random.seed(1234)

n_rows = 10

start = np.random.choice([0, 1, 2, 3, 4], size=10)

delta = np.random.choice([1, 2, 3], size=10)

data = {

    "start": start,

    "stop": start + delta,

    "X1": np.random.randn(n_rows),

    "X2": np.random.randn(n_rows),

    "age": np.random.choice(["young", "old"], 10),

    "W": np.random.choice([10, 20], size=n_rows),

    "Offset": np.random.uniform(0, 1, 10),

    "Y": np.random.choice([0, 1], size=n_rows)

}

train = h2o.H2OFrame(pd.DataFrame(data))

train["age"] = train["age"].asfactor()

h2o_model = H2OCoxProportionalHazardsEstimator(

                                               start_column="start",

                                               stop_column="stop",

                                               weights_column="W",

                                               offset_column="Offset",

                                               interactions=["X1", "X2"],

                                               stratify_by=["age"]

)

h2o_model.train(x=["X1", "X2", "age"], y="Y", training_frame=train)

h2o_model.save_mojo("./data/test")

from h2o-3.

exalate-issue-sync avatar exalate-issue-sync commented on May 23, 2024

Wendy Wong commented: Fixed in JIRA-8945

from h2o-3.

h2o-ops avatar h2o-ops commented on May 23, 2024

JIRA Issue Details

Jira Issue: PUBDEV-8944
Assignee: New H2O Bugs
Reporter: Wendy Wong
State: Closed
Fix Version: N/A
Attachments: N/A
Development PRs: N/A

from h2o-3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.