Candidates - Perl5 module for manipulating candidate features (help module for Statistics::MaxEntropy)
Statistics::MaxEntropy
use Statistics::Candidates; # create a new candidates object and read candidate features $candidates = Statistics::Candidates->new($some_file); # checks for constant candidate features $candidates->check(); # writes candidates that were not added to a file $candidates->write($some_other_file); # clear the administration about being added or not ... $candidates->clear();
The Candidates object is for storage, retrieval, and manipulation of candidate features.
Candidates
The reason for separating this code from Maxentropy.pm is that a set of candidate features should be considered a separate object. Blessing them into MaxEntropy would be unnatural.
Maxentropy.pm
MaxEntropy
Also this code is simpler and more stable than that in the MaxEntropy module.
This module requires Bit::SparseVector.
Bit::SparseVector
new
$candidates = Statistics::Candidates->new($file);
check
$candidates->check();
write
$candidates->write($file);
clear
$candidates->clear();
The syntax of the candidate feature file is more or less the same as that for the events file:
each line is an event (events specified in the same order as the events file);
each column is a feature;
constant feature functions are forbidden;
values are 0 or 1;
no space between features;
lines that start with # are ignored.
#
Below is a set of candidates for m events, c candidate features; f_ij are bits:
m
c
f_ij
name_c <tab> name_c-1 ... name_2 <tab> name_1 <newline> f_1c ... f_13 f_12 f_11 <newline> . . . f_ic ... f_i3 f_i2 f_i1 <newline> . . . f_mc ... f_m3 f_m2 f_m1
Statistics::MaxEntropy, Statistics::SparseVector..
Version 0.1
Statistics::Candidates comes with ABSOLUTELY NO WARRANTY and may be copied only under the terms of the GNU Library General Public License (version 2, or later), which may be found in the distribution.
Statistics::Candidates
To install Statistics::MaxEntropy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Statistics::MaxEntropy
CPAN shell
perl -MCPAN -e shell install Statistics::MaxEntropy
For more information on module installation, please visit the detailed CPAN module installation guide.