Interface MachineLearningClient

All Known Implementing Classes:
MachineLearningNodeClient

public interface MachineLearningClient
A client to provide interfaces for machine learning jobs. This will be used by other plugins.
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.opensearch.common.action.ActionFuture<org.opensearch.action.delete.DeleteResponse>
    Delete the model with modelId.
    void
    deleteModel(String modelId, org.opensearch.core.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
    Delete MLModel For more info on delete model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#delete-model
    default org.opensearch.common.action.ActionFuture<org.opensearch.action.delete.DeleteResponse>
    Delete the task with taskId.
    void
    deleteTask(String taskId, org.opensearch.core.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
    Delete MLTask For more info on delete task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#delete-task
    default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.MLModel>
    getModel(String modelId)
    Get MLModel and return ActionFuture.
    void
    getModel(String modelId, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.MLModel> listener)
    Get MLModel and return model in listener For more info on get model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#get-model-information
    default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.MLTask>
    getTask(String taskId)
    Get MLTask and return ActionFuture.
    void
    getTask(String taskId, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.MLTask> listener)
    Get MLTask and return task in listener For more info on get task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#get-task-information
    default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput>
    predict(String modelId, org.opensearch.ml.common.input.MLInput mlInput)
    Do prediction machine learning job For additional info on Predict, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#predict
    void
    predict(String modelId, org.opensearch.ml.common.input.MLInput mlInput, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
    Do prediction machine learning job For additional info on Predict, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#predict
    default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput>
    run(org.opensearch.ml.common.input.MLInput mlInput, Map<String,Object> args)
    Execute train/predict/trainandpredict.
    void
    run(org.opensearch.ml.common.input.MLInput mlInput, Map<String,Object> args, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
    Execute train/predict/trainandpredict.
    default org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse>
    searchModel(org.opensearch.action.search.SearchRequest searchRequest)
    For more info on search model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-model
    void
    searchModel(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
    For more info on search model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-model
    default org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse>
    searchTask(org.opensearch.action.search.SearchRequest searchRequest)
    For more info on search task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-task
    void
    searchTask(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
    For more info on search task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-task
    default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput>
    train(org.opensearch.ml.common.input.MLInput mlInput, boolean asyncTask)
    Do the training machine learning job.
    void
    train(org.opensearch.ml.common.input.MLInput mlInput, boolean asyncTask, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
    Do the training machine learning job.
    default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput>
    trainAndPredict(org.opensearch.ml.common.input.MLInput mlInput)
    Train model then predict with the same data set.
    void
    trainAndPredict(org.opensearch.ml.common.input.MLInput mlInput, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
    Train model then predict with the same data set.
  • Method Details

    • predict

      default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput> predict(String modelId, org.opensearch.ml.common.input.MLInput mlInput)
      Do prediction machine learning job For additional info on Predict, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#predict
      Parameters:
      modelId - the trained model id
      mlInput - ML input
      Returns:
      ActionFuture of MLOutput
    • predict

      void predict(String modelId, org.opensearch.ml.common.input.MLInput mlInput, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
      Do prediction machine learning job For additional info on Predict, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#predict
      Parameters:
      modelId - the trained model id
      mlInput - ML input
      listener - a listener to be notified of the result
    • trainAndPredict

      default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput> trainAndPredict(org.opensearch.ml.common.input.MLInput mlInput)
      Train model then predict with the same data set. For additional info on train and predict, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#train-and-predict
      Parameters:
      mlInput - ML input
      Returns:
      ActionFuture of MLOutput
    • trainAndPredict

      void trainAndPredict(org.opensearch.ml.common.input.MLInput mlInput, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
      Train model then predict with the same data set. For additional info on train and predict, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#train-and-predict
      Parameters:
      mlInput - ML input
      listener - a listener to be notified of the result
    • train

      default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput> train(org.opensearch.ml.common.input.MLInput mlInput, boolean asyncTask)
      Do the training machine learning job. The training job will be always async process. The job id will be returned in this method. For more info on train model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#train-model
      Parameters:
      mlInput - ML input
      asyncTask - is async task or not
      Returns:
      ActionFuture of MLOutput
    • train

      void train(org.opensearch.ml.common.input.MLInput mlInput, boolean asyncTask, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
      Do the training machine learning job. The training job will be always async process. The job id will be returned in this method. For more info on train model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#train-model
      Parameters:
      mlInput - ML input
      asyncTask - is async task or not
      listener - a listener to be notified of the result
    • run

      default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.output.MLOutput> run(org.opensearch.ml.common.input.MLInput mlInput, Map<String,Object> args)
      Execute train/predict/trainandpredict.
      Parameters:
      mlInput - ML input
      args - algorithm parameters
      Returns:
      ActionFuture of MLOutput
    • run

      void run(org.opensearch.ml.common.input.MLInput mlInput, Map<String,Object> args, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.output.MLOutput> listener)
      Execute train/predict/trainandpredict.
      Parameters:
      mlInput - ML input
      args - algorithm parameters
      listener - a listener to be notified of the result
    • getModel

      default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.MLModel> getModel(String modelId)
      Get MLModel and return ActionFuture. For more info on get model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#get-model-information
      Parameters:
      modelId - id of the model
      Returns:
      ActionFuture of ml model
    • getModel

      void getModel(String modelId, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.MLModel> listener)
      Get MLModel and return model in listener For more info on get model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#get-model-information
      Parameters:
      modelId - id of the model
      listener - action listener
    • getTask

      default org.opensearch.common.action.ActionFuture<org.opensearch.ml.common.MLTask> getTask(String taskId)
      Get MLTask and return ActionFuture. For more info on get task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#get-task-information
      Parameters:
      taskId - id of the task
      Returns:
      ActionFuture of ml task
    • getTask

      void getTask(String taskId, org.opensearch.core.action.ActionListener<org.opensearch.ml.common.MLTask> listener)
      Get MLTask and return task in listener For more info on get task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#get-task-information
      Parameters:
      taskId - id of the model
      listener - action listener
    • deleteModel

      default org.opensearch.common.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> deleteModel(String modelId)
      Delete the model with modelId. For more info on delete model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#delete-model
      Parameters:
      modelId - ML model id
      Returns:
      the result future
    • deleteModel

      void deleteModel(String modelId, org.opensearch.core.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
      Delete MLModel For more info on delete model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#delete-model
      Parameters:
      modelId - id of the model
      listener - action listener
    • deleteTask

      default org.opensearch.common.action.ActionFuture<org.opensearch.action.delete.DeleteResponse> deleteTask(String taskId)
      Delete the task with taskId. For more info on delete task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#delete-task
      Parameters:
      taskId - ML task id
      Returns:
      the result future
    • deleteTask

      void deleteTask(String taskId, org.opensearch.core.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)
      Delete MLTask For more info on delete task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#delete-task
      Parameters:
      taskId - id of the task
      listener - action listener
    • searchModel

      default org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchModel(org.opensearch.action.search.SearchRequest searchRequest)
      For more info on search model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-model
      Parameters:
      searchRequest - searchRequest to search the ML Model
      Returns:
      Action future of search response
    • searchModel

      void searchModel(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
      For more info on search model, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-model
      Parameters:
      searchRequest - searchRequest to search the ML Model
      listener - action listener
    • searchTask

      default org.opensearch.common.action.ActionFuture<org.opensearch.action.search.SearchResponse> searchTask(org.opensearch.action.search.SearchRequest searchRequest)
      For more info on search task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-task
      Parameters:
      searchRequest - searchRequest to search the ML Task
      Returns:
      Action future of search response
    • searchTask

      void searchTask(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.core.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)
      For more info on search task, refer: https://opensearch.org/docs/latest/ml-commons-plugin/api/#search-task
      Parameters:
      searchRequest - searchRequest to search the ML Task
      listener - action listener