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"); }
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"); }
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"); }
public void OneClass() { Assert.Throws(typeof(ArgumentException), delegate{FuzzySet C = new GaussianClassifier(new string[]{"low"});}); }
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"); }