From ae6f784994a23982eb7ffe3106f32db9a90ffe76 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Fri, 15 Dec 2023 12:27:22 +0100 Subject: [PATCH] Rewire likelihood & entropy --- lib/src/MixtureFactory.cxx | 7 +++---- lib/test/t_MixtureFactory_std.expout | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/src/MixtureFactory.cxx b/lib/src/MixtureFactory.cxx index ebe9d6c..c0bcbb3 100644 --- a/lib/src/MixtureFactory.cxx +++ b/lib/src/MixtureFactory.cxx @@ -163,11 +163,10 @@ OT::Mixture MixtureFactory::buildAsMixture(const OT::Sample & sample, for (OT::UnsignedInteger i = 0; i < sampleSize; ++i) labels[i] = tabLabels[i] - 1; delete [] tabLabels; - BICLogLikelihood = OT::Point(3); - // old version: BICLogLikelihood[0] = param->getModel()->getLogLikelihood(false); + BICLogLikelihood.resize(3); BICLogLikelihood[0] = clusteringModelOutput->getLikelihood(); - // old version: BICLogLikelihood[1] = param->getModel()->getCompletedLogLikelihood(); - // old version: BICLogLikelihood[2] = param->getModel()->getEntropy(); + BICLogLikelihood[1] = clusteringModelOutput->getCompletedLikelihood(); + BICLogLikelihood[2] = clusteringModelOutput->getEntropy(); return OT::Mixture(coll); } diff --git a/lib/test/t_MixtureFactory_std.expout b/lib/test/t_MixtureFactory_std.expout index 4e564c9..200b832 100644 --- a/lib/test/t_MixtureFactory_std.expout +++ b/lib/test/t_MixtureFactory_std.expout @@ -1,9 +1,9 @@ -nb clusters=1 +nb clusters=3 point=class=Point name=Unnamed dimension=2 values=[-1.66667,-1.66667] reference pdf=0.0345418 reference cdf=0.456312 reference quantile(0.75)=class=Point name=Unnamed dimension=2 values=[2.06331,2.06331] -estimated pdf=0.0314941 -estimated cdf=0.412686 -estimated quantile(0.75)=class=Point name=Unnamed dimension=2 values=[1.03894,1.10747] +estimated pdf=0.0349052 +estimated cdf=0.448466 +estimated quantile(0.75)=class=Point name=Unnamed dimension=2 values=[2.03067,2.10481] done