Ejemplo n.º 1
0
		public void DoubleCross()
		{
			FuzzySet C = new GaussianClassifier(new string[]{"low", "high"}, cross: 2.0);
			Assert.AreEqual(0.33333, Math.Round(C["low"].centroid(), 5), "Invalid low centroid");
			Assert.AreEqual(0.66667, Math.Round(C["high"].centroid(), 5), "Invalid high centroid");
			Assert.AreEqual(0.11111, Math.Round(C["high"].Domain.begin, 5), "Invalid high begin");
		}
Ejemplo n.º 2
0
		public void DefaultDomain()
		{
			FuzzySet C = new GaussianClassifier(new string[]{"low", "high"});
			Assert.AreEqual(0.33333, Math.Round(C["low"].centroid(), 5), "Invalid low centroid");
			Assert.AreEqual(0.66667, Math.Round(C["high"].centroid(), 5), "Invalid high centroid");
			Assert.AreEqual(0.38889, Math.Round(C["high"].Domain.begin, 5), "Invalid high begin");
		}
Ejemplo n.º 3
0
		public void EdgeTrue()
		{
			FuzzySet C = new GaussianClassifier(new string[]{"low", "high"}, edge: true);
			Assert.AreEqual(0.0, Math.Round(C["low"].centroid(), 5), "Invalid low centroid");
			Assert.AreEqual(1.0, Math.Round(C["high"].centroid(), 5), "Invalid high centroid");
		}
Ejemplo n.º 4
0
		public void OneClass()
		{			
			Assert.Throws(typeof(ArgumentException), delegate{FuzzySet C = new GaussianClassifier(new string[]{"low"});});
		}
Ejemplo n.º 5
0
		public void AnotherDomain()
		{
			FuzzySet C = new GaussianClassifier(new string[]{"low", "high"}, begin: 10.0, end: 23.0);
			Assert.AreEqual(14.33333, Math.Round(C["low"].centroid(), 5), "Invalid low centroid");
			Assert.AreEqual(18.66667, Math.Round(C["high"].centroid(), 5), "Invalid high centroid");
		}