Algorithm-AM

 view release on metacpan or  search on metacpan

bin/analogize.pl  view on Meta::CPAN

    my $batch = Algorithm::AM::Batch->new(
        linear => $args{linear},
        exclude_given => !$args{include_given},
        exclude_nulls => !$args{include_nulls},

        training_set => $train,
        # print the result of each classification at the time it is provided
        end_test_hook => sub {
            my ($batch, $test_item, $result) = @_;
            ++$count if $result->result eq 'correct';
            say $test_item->comment . ":\t" . $result->result . "\n";
            for (@print_methods) {
                if($_ eq 'gang_detailed'){
                    say ${ $result->gang_summary(1) };
                }else{
                    say ${ $result->$_ };
                }
            }
        }
    );
    $batch->classify_all($test);

    say "$count out of " . $test->size . " correct";
    return;
}

sub _validate_args {
    my %args = @_;
    if($args{help}){
        pod2usage(1);
    }
    my $errors = '';
    if(!$args{exemplars} and !$args{project}){

lib/Algorithm/AM/algorithm.pod  view on Meta::CPAN

=item *

Exemplars that seem less similar to the test item than those that seem
more similar can still have a magnified effect if there are many of
them.  This is known as the I<gang effect>.

=item *

AM accounts for I<leakage>.

For instance, it is possible for someone to accidentally say "snew"
instead of "snowed", in analogy with "know/knew", "grow/grew",
"throw/threw", "blow/blew", etc.  (I've never done this myself, though
I know someone who has.)  In rule-based modeling, this could never
occur; in AM, this is predicted to occur, though with very low
frequency.

=back

=head1 AUTHOR



( run in 0.542 second using v1.01-cache-2.11-cpan-483215c6ad5 )