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

Add ML Predict, Train APIs #755

Merged

Conversation

nathaliellenaa
Copy link
Contributor

@nathaliellenaa nathaliellenaa commented Dec 24, 2024

Description

Added missing ML Predict and Train APIs.

Issues Resolved

Part of opensearch-project/opensearch-py#867.

ML Predict, Train APIs to add

  • POST /_plugins/_ml/_predict/{algorithm_name}/{model_id}
  • POST /_plugins/_ml/_train/{algorithm_name}
  • POST /_plugins/_ml/_train_predict/{algorithm_name}

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.

Signed-off-by: Nathalie Jonathan <nathhjo@amazon.com>
Copy link
Contributor

github-actions bot commented Dec 24, 2024

Changes Analysis

Commit SHA: bb1b52b
Comparing To SHA: edf9d6f

API Changes

Summary

├─┬Paths
│ ├──[➕] path (4632:3)
│ ├──[➕] path (4650:3)
│ └──[➕] path (4667:3)
└─┬Components
  ├──[➕] requestBodies (27282:7)
  ├──[➕] requestBodies (27297:7)
  ├──[➕] requestBodies (27157:7)
  ├──[➕] responses (30386:7)
  ├──[➕] responses (30392:7)
  ├──[➕] responses (30345:7)
  ├──[➕] parameters (22937:7)
  ├──[➕] parameters (22919:7)
  ├──[➕] parameters (22925:7)
  ├──[➕] parameters (22931:7)
  ├──[➕] schemas (54307:7)
  ├──[➕] schemas (53802:7)
  ├──[➕] schemas (54338:7)
  ├──[➕] schemas (54030:7)
  ├──[➕] schemas (53863:7)
  ├──[➕] schemas (54316:7)
  ├──[➕] schemas (53888:7)
  ├──[➕] schemas (53895:7)
  ├──[➕] schemas (54068:7)
  ├──[➕] schemas (53840:7)
  ├──[➕] schemas (54058:7)
  ├──[➕] schemas (53991:7)
  ├──[➕] schemas (53909:7)
  ├──[➕] schemas (54041:7)
  ├──[➕] schemas (53811:7)
  ├──[➕] schemas (54289:7)
  ├──[➕] schemas (54227:7)
  ├──[➕] schemas (54052:7)
  └─┬ml._common___Task
    └─┬state
      ├──[➕] enum (54247:15)
      └──[➕] enum (54251:15)

Document Element Total Changes Breaking Changes
paths 3 0
components 30 0
  • Total Changes: 33
  • Additions: 33

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/12550254156/artifacts/2372208653

API Coverage

Before After Δ
Covered (%) 606 (59.35 %) 609 (59.65 %) 3 (0.3 %)
Uncovered (%) 415 (40.65 %) 412 (40.35 %) -3 (-0.3 %)
Unknown 43 43 0

Copy link
Collaborator

@Tokesh Tokesh left a comment

Choose a reason for hiding this comment

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

Awesome! Brilliant job!
I might have made a mistake somewhere since I haven’t worked much with these APIs, but this is an outsider’s perspective.

CHANGELOG.md Outdated Show resolved Hide resolved
spec/namespaces/ml.yaml Show resolved Hide resolved
spec/schemas/ml._common.yaml Outdated Show resolved Hide resolved
spec/schemas/ml._common.yaml Show resolved Hide resolved
@nathaliellenaa
Copy link
Contributor Author

Awesome! Brilliant job! I might have made a mistake somewhere since I haven’t worked much with these APIs, but this is an outsider’s perspective.

Thank you for your feedback @Tokesh ! They are really helpful, appreciate it :)

… defined ML status as an enum, updated ML task state enum, updated CHANGELOG.md.

Signed-off-by: Nathalie Jonathan <nathhjo@amazon.com>
Copy link
Collaborator

@Tokesh Tokesh left a comment

Choose a reason for hiding this comment

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

Looks good, fix vale complaints pls? See the diff.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This is good. Sorry to be annoying, can we please use examples from the movies/books themes? Make up something in that vein (e.g. best sellers in certain years). We plan to use these examples in docs and would like to keep things consistent.

tests/plugins/ml/train_predict/train_and_predict.yaml Outdated Show resolved Hide resolved
spec/schemas/ml._common.yaml Outdated Show resolved Hide resolved
…t and train_predict API, fixed vale complaints.

Signed-off-by: Nathalie Jonathan <nathhjo@amazon.com>
tests/plugins/ml/train_predict/predict.yaml Outdated Show resolved Hide resolved
tests/plugins/ml/train_predict/predict.yaml Outdated Show resolved Hide resolved
Signed-off-by: Nathalie Jonathan <nathhjo@amazon.com>
@dblock
Copy link
Member

dblock commented Dec 30, 2024

@Tokesh You good with this? Re-review/merge pls?

Copy link
Collaborator

@Tokesh Tokesh left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you very much! :)
Happy upcoming New Year!

@Tokesh Tokesh merged commit a3849b4 into opensearch-project:main Dec 31, 2024
29 of 30 checks passed
@nathaliellenaa nathaliellenaa deleted the add-ml-predict-train-api branch January 9, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants