Пример #1
0
 public void TestEvaluate()
 {
     var fn = new LogLinkFunction();
     double[] x = { 2 };
     double y = fn.Evaluate(x);
     Assert.AreEqual(0.6931471805599453, y, AIFH.DefaultPrecision);
 }
        public void TestBasic()
        {
            var reg = new MultipleLinearRegression(1);

            Assert.AreEqual(2, reg.LongTermMemory.Length);

            var lnk = new LogLinkFunction();
            reg.LinkFunction = lnk;
            Assert.IsTrue(reg.LinkFunction == lnk);

            reg.LongTermMemory[0] = 1;
            reg.LongTermMemory[1] = 2;

            double[] input = { 1.0 };
            double[] output = reg.ComputeRegression(input);
            Assert.AreEqual(1, output.Length);
            Assert.AreEqual(1.0986122886681098, output[0], AIFH.DefaultPrecision);
        }
Пример #3
0
 public void TestException()
 {
     var fn = new LogLinkFunction();
     double[] x = { 1, 2 };
     fn.Evaluate(x);
 }