Greetings fellow monks. I hope you are all surviving the Apocalypse ok.
I am trying to apply a logistic regression equation to classify some new cases. The equation yields rather large numbers for the z value. When I try to convert one of these values to a probability like so (simplified example):
my $z = -15863.8668285308;
my $e = exp($z * -1);
my $prob = 1/$e;
$e winds up with value 1.#INF. I researched this and found that it is a problem with how perl handles large numbers.
So I added use bignum;. This stores $z as type Math::BigFloat, but when I try to get the exp() result, it doesn't return. It's not hanging because I can see from Windows task manager that the interpreter is running, but after minutes it is has still not returned. The calculator on my Windows machine returns the answer in a fraction of a second, so something is clearly not right. What am I doing wrong?