public void CountMDFMean_CountCorrectMean() { Params.inputDataDimension = 3; Params.outputDataDimension = 3; ClusterX clusterX = new ClusterX(new Sample(new double[] { 1, 2, 3 }, 1.0, 0), null); clusterX.AddItem(new Vector(new double[] { 2, 3, 4 }), 0); clusterX.AddItem(new Vector(new double[] { 3, 4, 5 }), 0); clusterX.Items[0].ValuesMDF = new double[] { 1, 2, 3 }; clusterX.Items[1].ValuesMDF = new double[] { 2, 3, 4 }; clusterX.Items[2].ValuesMDF = new double[] { 3, 4, 5 }; clusterX.CountMDFMean(); Assert.AreEqual(clusterX.MeanMDF[0], 2.0); Assert.AreEqual(clusterX.MeanMDF[1], 3.0); Assert.AreEqual(clusterX.MeanMDF[2], 4.0); }
public void GetGaussianNLL_GetCorrectGausianNLL() { Params.inputDataDimension = 3; Params.outputDataDimension = 3; ClusterX clusterX = new ClusterX(new Sample(new double[] { 1, 2, 3 }, 1.0, 0), null); clusterX.AddItem(new Vector(new double[] { 2, 3, 4 }), 0); clusterX.AddItem(new Vector(new double[] { 3, 4, 5 }), 0); clusterX.Items[0].ValuesMDF = new double[] { 1, 2, 3 }; clusterX.Items[1].ValuesMDF = new double[] { 2, 3, 4 }; clusterX.Items[2].ValuesMDF = new double[] { 3, 4, 5 }; clusterX.CountMDFMean(); clusterX.CovMatrixMDF = new double[3, 3] { { 1, 2, 3 }, { 2, 1, 2 }, { 3, 3, 1 } }; // clusterX.GetGaussianNLL(new double[] { 1, 2, 3 }); }