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

Deserialization of 'monotone_constraints' from JSON Representation of MOJO Details Does Not Work #7849

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

Comments

@exalate-issue-sync
Copy link

JSON model details:
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "ModelParameterSchemaV3",}}
{{"schema_type": "Iced"}}
{{},}}
{{"name": "monotone_constraints",}}
{{"label": "monotone_constraints",}}
{{"help": "A mapping representing monotonic constraints. Use +1 to enforce an increasing constraint and -1 to specify a decreasing constraint.",}}
{{"required": false,}}
{{"type": "KeyValue[]",}}
{{"default_value": null,}}
{{"actual_value": [}}
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "KeyValueV3",}}
{{"schema_type": "KeyValue"}}
{{},}}
{{"key": "AGE",}}
{{"value": 1}}
{{},}}
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "KeyValueV3",}}
{{"schema_type": "KeyValue"}}
{{},}}
{{"key": "PSA",}}
{{"value": -1}}
{{}}}
{{],}}
{{"input_value": [}}
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "KeyValueV3",}}
{{"schema_type": "KeyValue"}}
{{},}}
{{"key": "AGE",}}
{{"value": 1}}
{{},}}
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "KeyValueV3",}}
{{"schema_type": "KeyValue"}}
{{},}}
{{"key": "PSA",}}
{{"value": -1}}
{{}}}
{{],}}
{{"level": "secondary",}}
{{"values": [],}}
{{"is_member_of_frames": [],}}
{{"is_mutually_exclusive_with": [],}}
{{"gridable": false}}
{{},}}

see the attached screenshot.

@exalate-issue-sync
Copy link
Author

Marek Novotny commented: cc [~accountid:557058:04659f86-fbfe-4d01-90c9-146c34df6ee6] [~accountid:5a32df017dcf343865c26fa5] [~accountid:5bd82be4216ccf49622e5137]

@exalate-issue-sync
Copy link
Author

Jan Sterba commented: please provide steps to reproduce and what is the desired output, I dont understand whats wrong here

@exalate-issue-sync
Copy link
Author

Marek Novotny commented: [~accountid:5bd82be4216ccf49622e5137]

The actual value of {{monotone_constraints}} in JSON representation is:
{{"actual_value": [}}
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "KeyValueV3",}}
{{"schema_type": "KeyValue"}}
{{},}}
{{"key": "AGE",}}
{{"value": 1}}
{{},}}
{{{}}
{{"__meta": {}}
{{"schema_version": 3,}}
{{"schema_name": "KeyValueV3",}}
{{"schema_type": "KeyValue"}}
{{},}}
{{"key": "PSA",}}
{{"value": -1}}
{{}}}
{{]}}

but it’s deserialized as {{null}}.

I’ve loaded the h2o mojo model via this h2o API:

{{import hex.genmodel.{ModelMojoReader, MojoModel, MojoReaderBackendFactory}}}
{{val reader = MojoReaderBackendFactory.createReaderBackend(mojoFile.getAbsolutePath)}}
{{val h2oMojo = ModelMojoReader.readFrom(reader, true)}}

and i would expect some non-null object as a result of this expression:
{{val parameters = h2oMojo._modelAttributes.getModelParameters()}}
{{parameters.filter(i => i.name == "monotone_constraints").head.actual_value}}

Do you want me also to provide the mojo with {{monotone_constraints}} set? Do you want to know more details?

@exalate-issue-sync
Copy link
Author

Jan Sterba commented: thanks, now I know what is the problem

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-7793
Assignee: Jan Sterba
Reporter: Marek Novotny
State: Resolved
Fix Version: 3.32.0.2
Attachments: Available (Count: 2)
Development PRs: Available

Linked PRs from JIRA

#5034

Attachments From Jira

Attachment Name: gbm.json
Attached By: Marek Novotny
File Link:https://h2o-3-jira-github-migration.s3.amazonaws.com/PUBDEV-7793/gbm.json

Attachment Name: Screen Shot 2020-09-23 at 17.32.25.png
Attached By: Marek Novotny
File Link:https://h2o-3-jira-github-migration.s3.amazonaws.com/PUBDEV-7793/Screen Shot 2020-09-23 at 17.32.25.png

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