Name : perl-AI-Calibrate
| |
Version : 1.5
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.7.1
| Date : 2023-01-27 16:04:48
|
Group : Development/Libraries/Perl
| Source RPM : perl-AI-Calibrate-1.5-lp154.7.1.src.rpm
|
Size : 0.02 MB
| |
Packager : https://www_suse_com/
| |
Summary : Perl module for producing probabilities from classifier scores
|
Description :
Classifiers usually return some sort of an instance score with their classifications. These scores can be used as probabilities in various calculations, but first they need to be _calibrated_. Naive Bayes, for example, is a very useful classifier, but the scores it produces are usually \"bunched\" around 0 and 1, making these scores poor probability estimates. Support vector machines have a similar problem. Both classifier types should be calibrated before their scores are used as probability estimates.
This module calibrates classifier scores using a method called the Pool Adjacent Violators (PAV) algorithm. After you train a classifier, you take a (usually separate) set of test instances and run them through the classifier, collecting the scores assigned to each. You then supply this set of instances to the calibrate function defined here, and it will return a set of ranges mapping from a score range to a probability estimate.
For example, assume you have the following set of instance results from your classifier. Each result is of the form \'[ASSIGNED_SCORE, TRUE_CLASS]\':
my $points = [ [.9, 1], [.8, 1], [.7, 0], [.6, 1], [.55, 1], [.5, 1], [.45, 0], [.4, 1], [.35, 1], [.3, 0 ], [.27, 1], [.2, 0 ], [.18, 0], [.1, 1 ], [.02, 0] ];
If you then call calibrate($points), it will return this structure:
[ [.9, 1 ], [.7, 3/4 ], [.45, 2/3 ], [.3, 1/2 ], [.2, 1/3 ], [.02, 0 ] ]
This means that, given a SCORE produced by the classifier, you can map the SCORE onto a probability like this:
SCORE >= .9 prob = 1 .9 > SCORE >= .7 prob = 3/4 .7 > SCORE >= .45 prob = 2/3 .45 > SCORE >= .3 prob = 3/4 .2 > SCORE >= .7 prob = 3/4 .02 > SCORE prob = 0
For a realistic example of classifier calibration, see the test file t/AI-Calibrate-NB.t, which uses the AI::NaiveBayes1 module to train a Naive Bayes classifier then calibrates it using this module.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-A/15.4/noarch |