Exemplo n.º 1
0
        public void DeserializationTest1()
        {

            MemoryStream stream = new MemoryStream(Properties.Resources.kmeans);

            BinaryFormatter bf = new BinaryFormatter();
            object o = bf.DeserializeAnyVersion(stream);

            KMeans kmeans = (KMeans)o;


            KMeans kbase = new KMeans(3);

            Assert.AreEqual(kbase.Iterations, kmeans.Iterations);
            Assert.AreEqual(kbase.MaxIterations, kmeans.MaxIterations);
            Assert.AreEqual(kbase.Tolerance, kmeans.Tolerance);

            Assert.AreEqual(kbase.UseCentroidSeeding, kmeans.UseCentroidSeeding);
            Assert.AreEqual(kbase.ComputeInformation, kmeans.ComputeInformation);

            Assert.AreEqual(kbase.Distance, kmeans.Distance);
        }