use of org.opensearch.ml.common.parameter.MLOutput in project ml-commons by opensearch-project.
the class MachineLearningClientTest method predict_WithAlgoAndInputDataAndListener.
@Test
public void predict_WithAlgoAndInputDataAndListener() {
MLInput mlInput = MLInput.builder().algorithm(FunctionName.KMEANS).inputDataset(new DataFrameInputDataset(input)).build();
ArgumentCaptor<MLOutput> dataFrameArgumentCaptor = ArgumentCaptor.forClass(MLOutput.class);
machineLearningClient.predict(null, mlInput, dataFrameActionListener);
verify(dataFrameActionListener).onResponse(dataFrameArgumentCaptor.capture());
assertEquals(output, dataFrameArgumentCaptor.getValue());
}
Aggregations