@Test public void testTrivialCasesWithOneComponent() { Vector mean = VectorUtils.of(1., 2.); DenseMatrix covariance = MatrixUtil.fromList(Arrays.asList( VectorUtils.of(1, -0.5), VectorUtils.of(-0.5, 1)), true ); GmmModel gmm = new GmmModel( VectorUtils.of(1.0), Collections.singletonList(new MultivariateGaussianDistribution(mean, covariance)) ); Assert.assertEquals(2, gmm.dimension()); Assert.assertEquals(1, gmm.countOfComponents()); Assert.assertEquals(VectorUtils.of(1.), gmm.componentsProbs()); Assert.assertEquals(0., gmm.predict(mean), 0.01); Assert.assertEquals(1, gmm.likelihood(mean).size()); Assert.assertEquals(0.183, gmm.likelihood(mean).get(0), 0.01); Assert.assertEquals(0.183, gmm.prob(mean), 0.01); }
@Override public Double predict(Vector input) { return (double)likelihood(input).maxElement().index(); }
GmmModel extends DistributionMixture<MultivariateGaussianDistribution> implements IgniteModel<Vector, Double>,
    DeployableObject { @Override public Double predict(Vector input) { return (double)likelihood(input).maxElement().index(); } }
GmmModel extends DistributionMixture<MultivariateGaussianDistribution> implements IgniteModel<Vector, Double>,
    DeployableObject { @Override public Double predict(Vector input) { return (double)likelihood(input).maxElement().index(); } GmmModel(Vector componentProbs, List<MultivariateGaussianDistribution> distributions); }
GmmModel extends DistributionMixture<MultivariateGaussianDistribution> implements IgniteModel<Vector, Double>,
    DeployableObject { @Override public Double predict(Vector input) { return (double)likelihood(input).maxElement().index(); } GmmModel(Vector componentProbs, List<MultivariateGaussianDistribution> distributions); @Override Double predict(Vector input); @Override List<Object> getDependencies(); }
GmmModel extends DistributionMixture<MultivariateGaussianDistribution> implements IgniteModel<Vector, Double>,
    DeployableObject { @Override public Double predict(Vector input) { return (double)likelihood(input).maxElement().index(); } GmmModel(Vector componentProbs, List<MultivariateGaussianDistribution> distributions); @Override Double predict(Vector input); @Override List<Object> getDependencies();  }