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] Add hyperparameter model metadata #66349

Merged
merged 21 commits into from
Dec 18, 2020

Conversation

valeriy42
Copy link
Contributor

@valeriy42 valeriy42 commented Dec 15, 2020

This adds hyperparameters section to the stored model metadata document. Here is an example

"hyperparameters": [
        {
            "name": "downsample_factor",
            "value": 0.35355339059327386,
            "supplied": false,
            "absolute_importance": 0.123,
            "relative_importance": 0.9123
        },
        {
            "name": "alpha",
            "value": 0.010766199582740555,
            "supplied": false,
            "absolute_importance": 0.0123,
            "relative_importance": 0.0321
        },
        {
            "name": "gamma",
            "value": 0.1,
            "supplied": true,
            "absolute_importance": 0.0,
            "relative_importance": 0.0
        }
    ]

@valeriy42 valeriy42 marked this pull request as ready for review December 18, 2020 12:08
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

@valeriy42
Copy link
Contributor Author

Thank you for your review @benwtrent . I applied your changes. It would be great if you could take another look.

…frame/process/results/ModelMetadata.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
Comment on lines 69 to 73
this.hyperparameterName = hyperparameterName;
this.value = value;
this.absoluteImportance = absoluteImportance;
this.relativeImportance = relativeImportance;
this.supplied = supplied;
Copy link
Member

Choose a reason for hiding this comment

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

If the Doubles and the Boolean are truly not nullable, they should be double and boolean (unboxed, not nullable).

If they are nullable, the parser needs to treat them as optional and the serialization needs to as well

valeriy42 and others added 6 commits December 18, 2020 13:56
…ml/inference/trainedmodel/metadata/TrainedModelMetadata.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…ml/inference/trainedmodel/metadata/TrainedModelMetadata.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
valeriy42 and others added 6 commits December 18, 2020 14:57
…ml/inference/trainedmodel/metadata/Hyperparameters.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…ml/inference/trainedmodel/metadata/Hyperparameters.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…ml/inference/trainedmodel/metadata/Hyperparameters.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…ml/inference/trainedmodel/metadata/Hyperparameters.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…ml/inference/trainedmodel/metadata/HyperparametersTests.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
…ml/inference/trainedmodel/metadata/HyperparametersTests.java

Co-authored-by: Benjamin Trent <ben.w.trent@gmail.com>
@valeriy42
Copy link
Contributor Author

retest

@valeriy42
Copy link
Contributor Author

recheck

},
"supplied": {
"type": "boolean"
},

Choose a reason for hiding this comment

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

^ dangling comma

@benwtrent
Copy link
Member

@elasticmachine update branch

@benwtrent benwtrent merged commit f136b72 into elastic:master Dec 18, 2020
benwtrent pushed a commit to benwtrent/elasticsearch that referenced this pull request Dec 18, 2020
This adds `hyperparameters` section to the stored model metadata document. Here is an example
```json
"hyperparameters": [
        {
            "name": "downsample_factor",
            "value": 0.35355339059327386,
            "supplied": false,
            "absolute_importance": 0.123,
            "relative_importance": 0.9123
        },
        {
            "name": "alpha",
            "value": 0.010766199582740555,
            "supplied": false,
            "absolute_importance": 0.0123,
            "relative_importance": 0.0321
        },
        {
            "name": "gamma",
            "value": 0.1,
            "supplied": true,
            "absolute_importance": 0.0,
            "relative_importance": 0.0
        }
    ]
```
benwtrent added a commit that referenced this pull request Dec 18, 2020
This adds `hyperparameters` section to the stored model metadata document. Here is an example
```json
"hyperparameters": [
        {
            "name": "downsample_factor",
            "value": 0.35355339059327386,
            "supplied": false,
            "absolute_importance": 0.123,
            "relative_importance": 0.9123
        },
        {
            "name": "alpha",
            "value": 0.010766199582740555,
            "supplied": false,
            "absolute_importance": 0.0123,
            "relative_importance": 0.0321
        },
        {
            "name": "gamma",
            "value": 0.1,
            "supplied": true,
            "absolute_importance": 0.0,
            "relative_importance": 0.0
        }
    ]
```

Co-authored-by: Valeriy Khakhutskyy <1292899+valeriy42@users.noreply.github.com>
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.

5 participants