double getIPReputation(unsigned long int IPToCheck);
This function returns a number representing the overall reputation of the IP based on local GBUdb statistics. This number (Reputation Figure) can be easily manipulated to provide additional weight values in systems that combine multiple tests using a weight based scoring system. The Reputation Figure is calculated by combining the Probability figure and the Confidence figure using the formula:
R = sign(P) * sqrt(abs(P * C))
This function returns very quickly and can be called as often as required without any follow-up actions as long as the SNF Engine is active (between startupSNF() and shutdownSNF()). This function is thread-safe and does not interfere with other scanning functions.
- IPToCheck = The IP to test.
- returns a number between -1.0 and +1.0 representing the combined probability that the IP will produce spam.
Converting IP Reputation Figures To Weights
There are a number of ways to convert a Reputation figure to a weight value. The simplest is to simply multiply the Reputation figure by the maximum weight you wish to give to this test.
SimpleWeight = R * MaxReputationWeight
Since many legitimate ISPs also produce a lot of spam it might be useful to apply a bias to this weight so that these systems appear closer to zero. For example if you applied a maximum weight of 10 and found that many ISPs regularly scored 5 or more then you might add a Bias of -5 to bring those systems toward zero.
BiasedWeight = (R * MaxReputationWeight) + Bias
A more sophisticated system might allow for different weights on the positive and negative going Reputation figures so that the amount of negative or positive weight that can be applied can be adjusted independently. Such a system might also wish to apply a bias directly to the reputation figure before doing that calculation so that the zero point can be adjusted to compensate for averages.
In a system like this, if legitimate ISPs tended to get a Reputation Figure of 0.5 then the bias might be -0.5 so that this would become the zero point. Then the positive and negative weight factors could be adjusted so that the desired maximum and minimum weights can be achieved... Note that in this scenario the positive and negative weight settings are not maximum values.
SplitWeight = (0 > (R + Bias)) ? ((R + Bias) * NegativeWeightFactor) : ((R + Bias) * PositiveWeightFactor) MaximumNegativeWeight is given by (-1.0 + Bias) * NegativeWeightFactor MaximumPositiveWeight is given by (+1.0 + Bias) * PositiveWeightFactor When R + Bias == 0.0, the weight will be 0.
The most sophisticated system might provide a graphic interface that maps the reputation figure directly to a desired weight. This would allow the user to shape the effect of the Reputation figure any way they wish in order to gain very tight control over their system's accuracy.