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

[ML][Inference] adjusting definition object schema and validation #47447

Conversation

benwtrent
Copy link
Member

  • Adds Input object for model definition
  • Adjusts field names to match schema
  • Removes the same field name validations and require ensemble to pass down the field map object
  • Adjusts field values processing to be resilient against different numeric types.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@benwtrent
Copy link
Member Author

@elasticmachine update branch

private final List<String> featureNames;

public Input(List<String> featureNames) {
this.featureNames = featureNames;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should either put requireNonNull here or add if statement in line 186.

put("foo", 0.3);
put("bar", null);
}};
assertEquals(0.1, tree.infer(featureMap), 0.00001);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace assertEquals with assertThat(..., closeTo(...))?

Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

put("foo", 0.3);
put("bar", null);
}};
assertEquals(1.0, tree.infer(featureMap), 0.00001);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closeTo?

@@ -336,6 +329,12 @@ public void testClassificationInference() {
featureVector = Arrays.asList(0.0, 1.0);
featureMap = zipObjMap(featureNames, featureVector);
assertEquals(1.0, ensemble.infer(featureMap), 0.00001);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closeTo?

@benwtrent
Copy link
Member Author

run elasticsearch-ci/1

@benwtrent benwtrent merged commit 890b3db into elastic:master Oct 7, 2019
@benwtrent benwtrent deleted the feature/ml-inference-obj-fixup-schema-update branch October 7, 2019 15:16
benwtrent added a commit to benwtrent/elasticsearch that referenced this pull request Oct 7, 2019
…astic#47447)

* [ML][Inference] adjusting definition object schema and validation

* finalizing schema and fixing inference npe

* addressing PR comments
benwtrent added a commit that referenced this pull request Oct 8, 2019
…on (#47447) (#47673)

* [ML][Inference] adjusting definition object schema and validation (#47447)

* [ML][Inference] adjusting definition object schema and validation

* finalizing schema and fixing inference npe

* addressing PR comments

* fixing for backport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants