Package org.opensearch.ml.client
Class MachineLearningNodeClient
- java.lang.Object
-
- org.opensearch.ml.client.MachineLearningNodeClient
-
- All Implemented Interfaces:
MachineLearningClient
public class MachineLearningNodeClient extends java.lang.Object implements MachineLearningClient
-
-
Constructor Summary
Constructors Constructor Description MachineLearningNodeClient(org.opensearch.client.node.NodeClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteModel(java.lang.String modelId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)Delete MLModelvoiddeleteTask(java.lang.String taskId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)Delete MLTaskvoidgetModel(java.lang.String modelId, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLModel> listener)Get MLModel and return model in listenervoidgetTask(java.lang.String taskId, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLTask> listener)Get MLTask and return task in listenervoidpredict(java.lang.String modelId, org.opensearch.ml.common.parameter.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)Do prediction machine learning jobvoidsearchModel(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)voidsearchTask(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)voidtrain(org.opensearch.ml.common.parameter.MLInput mlInput, boolean asyncTask, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)Do the training machine learning job.voidtrainAndPredict(org.opensearch.ml.common.parameter.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)Train model then predict with the same data set.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opensearch.ml.client.MachineLearningClient
deleteModel, deleteTask, getModel, getTask, predict, searchModel, searchTask, train, trainAndPredict
-
-
-
-
Method Detail
-
predict
public void predict(java.lang.String modelId, org.opensearch.ml.common.parameter.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)Description copied from interface:MachineLearningClientDo prediction machine learning job- Specified by:
predictin interfaceMachineLearningClient- Parameters:
modelId- the trained model idmlInput- ML inputlistener- a listener to be notified of the result
-
trainAndPredict
public void trainAndPredict(org.opensearch.ml.common.parameter.MLInput mlInput, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)Description copied from interface:MachineLearningClientTrain model then predict with the same data set.- Specified by:
trainAndPredictin interfaceMachineLearningClient- Parameters:
mlInput- ML inputlistener- a listener to be notified of the result
-
train
public void train(org.opensearch.ml.common.parameter.MLInput mlInput, boolean asyncTask, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLOutput> listener)Description copied from interface:MachineLearningClientDo the training machine learning job. The training job will be always async process. The job id will be returned in this method.- Specified by:
trainin interfaceMachineLearningClient- Parameters:
mlInput- ML inputasyncTask- is async task or notlistener- a listener to be notified of the result
-
getModel
public void getModel(java.lang.String modelId, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLModel> listener)Description copied from interface:MachineLearningClientGet MLModel and return model in listener- Specified by:
getModelin interfaceMachineLearningClient- Parameters:
modelId- id of the modellistener- action listener
-
deleteModel
public void deleteModel(java.lang.String modelId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)Description copied from interface:MachineLearningClientDelete MLModel- Specified by:
deleteModelin interfaceMachineLearningClient- Parameters:
modelId- id of the modellistener- action listener
-
searchModel
public void searchModel(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)- Specified by:
searchModelin interfaceMachineLearningClient- Parameters:
searchRequest- searchRequest to search the ML Modellistener- action listener
-
getTask
public void getTask(java.lang.String taskId, org.opensearch.action.ActionListener<org.opensearch.ml.common.parameter.MLTask> listener)Description copied from interface:MachineLearningClientGet MLTask and return task in listener- Specified by:
getTaskin interfaceMachineLearningClient- Parameters:
taskId- id of the modellistener- action listener
-
deleteTask
public void deleteTask(java.lang.String taskId, org.opensearch.action.ActionListener<org.opensearch.action.delete.DeleteResponse> listener)Description copied from interface:MachineLearningClientDelete MLTask- Specified by:
deleteTaskin interfaceMachineLearningClient- Parameters:
taskId- id of the tasklistener- action listener
-
searchTask
public void searchTask(org.opensearch.action.search.SearchRequest searchRequest, org.opensearch.action.ActionListener<org.opensearch.action.search.SearchResponse> listener)- Specified by:
searchTaskin interfaceMachineLearningClient- Parameters:
searchRequest- searchRequest to search the ML Tasklistener- action listener
-
-