Accord.Statistics.Links.LogitLinkFunction.Inverse C# (CSharp) Method

Inverse() public method

The Logit mean (activation) function.
The inverse Logit link function is given by g(x) = 1.0 / (1.0 + Math.Exp(-z) in which z = B * x + A.
public Inverse ( double x ) : double
x double A transformed value.
return double
        public double Inverse(double x)
        {
            double z = B * x + A;
            return 1.0 / (1.0 + Math.Exp(-z));
        }

Usage Example

Ejemplo n.º 1
0
        public void LogitLinkFunctionConstructorTest()
        {
            LogitLinkFunction target = new LogitLinkFunction();
            Assert.AreEqual(0, target.A);
            Assert.AreEqual(1, target.B);

            for (int i = 0; i < 11; i++)
            {
                double x = i / 10.0;
                double y = Math.Log(x) - Math.Log(1 - x);

                Assert.AreEqual(y, target.Function(x), 1e-10);
                Assert.AreEqual(x, target.Inverse(y), 1e-10);
            }
        }
All Usage Examples Of Accord.Statistics.Links.LogitLinkFunction::Inverse