ML command supports category_field parameter
Description
From the document of ML command, it shows that ml supports category_field command, but actually it doesn't work. This PR makes ML command supports category_field parameter.
Request:
POST _plugins/_ppl?format=jdbc
{
"query":"source = abcd_test | eval value = cast(value as double) | fields value, category | ml action='trainandpredict' algorithm='rcf' input='value' category_field='category'"
}
Response:
{
"schema": [
{
"name": "value",
"type": "double"
},
{
"name": "category",
"type": "string"
},
{
"name": "score",
"type": "double"
},
{
"name": "anomalous",
"type": "boolean"
}
],
"datarows": [
[
1,
"a",
0,
false
],
[
2,
"b",
0,
false
]
],
"total": 2,
"size": 2
}
Related Issues
https://github.com/opensearch-project/sql/issues/3406
Check List
- [x] New functionality includes testing.
- [x] New functionality has been documented.
- [ ] New functionality has javadoc added.
- [ ] New functionality has a user manual doc added.
- [ ] API changes companion pull request created.
- [x] Commits are signed per the DCO using
--signoff. - [ ] Public documentation issue/PR created.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.
@LantaoJin @qianheng-aws @songkant-aws please help to review this PR, thanks!
This PR is stalled because it has been open for 30 days with no activity.
LGTM
@LantaoJin @qianheng-aws @yuancu Need other reviews.
This PR is stalled because it has been open for 2 weeks with no activity.
This PR is stalled because it has been open for 2 weeks with no activity.
@LantaoJin can you re-review?
This PR is stalled because it has been open for 2 weeks with no activity.