use of org.opensearch.ml.common.parameter.LocalSampleCalculatorInput in project ml-commons by opensearch-project.
the class LocalSampleCalculatorTest method execute.
@Test
public void execute() {
SampleAlgoOutput output = (SampleAlgoOutput) calculator.execute(input);
Assert.assertEquals(6.0, output.getSampleResult().doubleValue(), 1e-5);
input = new LocalSampleCalculatorInput("max", Arrays.asList(1.0, 2.0, 3.0));
output = (SampleAlgoOutput) calculator.execute(input);
Assert.assertEquals(3.0, output.getSampleResult().doubleValue(), 1e-5);
input = new LocalSampleCalculatorInput("min", Arrays.asList(1.0, 2.0, 3.0));
output = (SampleAlgoOutput) calculator.execute(input);
Assert.assertEquals(1.0, output.getSampleResult().doubleValue(), 1e-5);
}
use of org.opensearch.ml.common.parameter.LocalSampleCalculatorInput in project ml-commons by opensearch-project.
the class LocalSampleCalculatorTest method setUp.
@Before
public void setUp() {
calculator = new LocalSampleCalculator(client, settings);
input = new LocalSampleCalculatorInput("sum", Arrays.asList(1.0, 2.0, 3.0));
}
Aggregations