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

h2o.interaction doesn't output the desired outcomes #7434

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 6 comments
Closed

h2o.interaction doesn't output the desired outcomes #7434

exalate-issue-sync bot opened this issue May 11, 2023 · 6 comments

Comments

@exalate-issue-sync
Copy link

We have had some issues with running h2o.interaction() in R recently that it either produces incorrect results or runs into errors. I have spent quite some time looking into it but cannot figure out why. I have attached some reproducible examples below. Could you help me take a look what is happening here?

interaction term created has incorrect values -------------------------

df = data.frame(
v1 = c('Y', 'Y', 'Y', 'N', 'N'),
v2 = c('S', 'S', 'S', 'A', 'A'),
v3 = c('E1', 'E1', 'E1', 'B1', 'B1')
)
df.hex = as.h2o(df, 'dfhex')
interaction = h2o.interaction(
data = df.hex,
destination_frame = 'interaction',
factors = c('v2','v3', 'v1'),
pairwise = F,
max_factors = 1000,
min_occurrence = 1
)
combined = h2o.cbind(df.hex, interaction)
combined

As can be seen, the values of all three columns used in the interaction have changed.

v1 v2 v3 v2_v3_v1

1 Y S E1 S_E1_N

2 Y S E1 S_E1_N

3 Y S E1 S_E1_N

4 N A B1 S_E1_Y

5 N A B1 S_E1_Y

Error when creating interaction for data with more than 5 rows ---------

df = data.frame(
v1 = c('Y', 'Y', 'Y', 'N', 'N', 'Y'),
v2 = c('S', 'S', 'S', 'A', 'A', 'N'),
v3 = c('E1', 'E1', 'E1', 'B1', 'B1', 'B1')
)
df.hex = as.h2o(df, 'dfhex')

Error in creating interaction for data with more than 5 rows

h2o.interaction(
data = df.hex,
destination_frame = 'interaction',
factors = c('v2','v3', 'v1'),
pairwise = F,
max_factors = 1000,
min_occurrence = 1
)

ERROR MESSAGE BELOW:

java.lang.ArrayIndexOutOfBoundsException: 2

java.lang.ArrayIndexOutOfBoundsException: 2

at water.fvec.CreateInteractions.makeDomain(CreateInteractions.java:85)

at water.fvec.CreateInteractions.compute2(CreateInteractions.java:171)

at water.H2O$H2OCountedCompleter.compute(H2O.java:1557)

at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)

at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)

at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)

at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)

at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

Error: java.lang.ArrayIndexOutOfBoundsException: 2

But no errors if the order of the interaction is in this way

h2o.interaction(
data = df.hex,
destination_frame = 'interaction',
factors = c('v1','v2', 'v3'),
pairwise = F,
max_factors = 1000,
min_occurrence = 1
)

@exalate-issue-sync
Copy link
Author

Arun Aryasomayajula commented: [~accountid:5db1981f654fb20d96acbd52] will take a look.

@exalate-issue-sync
Copy link
Author

Arun Aryasomayajula commented: Hi [~accountid:5db1981f654fb20d96acbd52] any updates on this?

@exalate-issue-sync
Copy link
Author

Zuzana Olajcová commented: Hi [~accountid:5fa438f822f3990076aa232d], I am able to reproduce the issue but I don’t have a fix yet and need to carefully analyse. Currently I am at vacation until 20th of July, after that I will continue with this JIRA.

@exalate-issue-sync
Copy link
Author

Zuzana Olajcová commented: Resolved in 76b73de

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Details

Jira Issue: PUBDEV-8218
Assignee: Zuzana Olajcová
Reporter: Arun Aryasomayajula
State: Resolved
Fix Version: 3.32.1.5
Attachments: N/A
Development PRs: Available

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

Linked PRs from JIRA

#5581

@h2o-ops h2o-ops closed this as completed May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant