use of org.opensearch.ml.common.dataset.DataFrameInputDataset in project ml-commons by opensearch-project.
the class MachineLearningClientTest method predict_WithAlgoAndInputData.
@Test
public void predict_WithAlgoAndInputData() {
MLInput mlInput = MLInput.builder().algorithm(FunctionName.KMEANS).inputDataset(new DataFrameInputDataset(input)).build();
assertEquals(output, machineLearningClient.predict(null, mlInput).actionGet());
}
use of org.opensearch.ml.common.dataset.DataFrameInputDataset in project ml-commons by opensearch-project.
the class MachineLearningClientTest method predict_WithAlgoAndInputDataAndParametersAndListener.
@Test
public void predict_WithAlgoAndInputDataAndParametersAndListener() {
MLInput mlInput = MLInput.builder().algorithm(FunctionName.KMEANS).parameters(mlParameters).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());
}
use of org.opensearch.ml.common.dataset.DataFrameInputDataset in project ml-commons by opensearch-project.
the class MachineLearningClientTest method predict_WithAlgoAndParametersAndInputData.
@Test
public void predict_WithAlgoAndParametersAndInputData() {
MLInput mlInput = MLInput.builder().algorithm(FunctionName.KMEANS).parameters(mlParameters).inputDataset(new DataFrameInputDataset(input)).build();
assertEquals(output, machineLearningClient.predict(null, mlInput).actionGet());
}
use of org.opensearch.ml.common.dataset.DataFrameInputDataset 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());
}
use of org.opensearch.ml.common.dataset.DataFrameInputDataset in project ml-commons by opensearch-project.
the class MachineLearningClientTest method predict_WithAlgoAndParametersAndInputDataAndModelId.
@Test
public void predict_WithAlgoAndParametersAndInputDataAndModelId() {
MLInput mlInput = MLInput.builder().algorithm(FunctionName.KMEANS).parameters(mlParameters).inputDataset(new DataFrameInputDataset(input)).build();
assertEquals(output, machineLearningClient.predict("modelId", mlInput).actionGet());
}
Aggregations