AI::MaxEntropyAI::MaxEntropy is a Perl extension for learning Maximum Entropy Models. | |
Download |
AI::MaxEntropy Ranking & Summary
Advertisement
- License:
- MIT/X Consortium Lic...
- Price:
- FREE
- Publisher Name:
- Laye Suen
- Publisher web site:
- http://search.cpan.org/~laye/AI-MaxEntropy-0.20/lib/AI/MaxEntropy.pm
AI::MaxEntropy Tags
AI::MaxEntropy Description
AI::MaxEntropy is a Perl extension for learning Maximum Entropy Models. AI::MaxEntropy is a Perl extension for learning Maximum Entropy Models.SYNOPSIS use AI::MaxEntropy; # create a maximum entropy learner my $me = AI::MaxEntropy->new; # the learner see 2 red round smooth apples $me->see( => 'apple' => 2); # the learner see 3 yellow long smooth bananas $me->see( => 'banana' => 3); # and more # samples needn't have the same numbers of active features $me->see( => 'pomelo'); # the order of active features is not concerned, too $me->see( => 'pomelo'); # ... # and, let it learn my $model = $me->learn; # then, we can make predictions on unseen data # ask what a red thing is most likely to be print $model->predict()."n"; # the answer is apple, because all red things the learner have ever seen # are apples # ask what a smooth thing is most likely to be print $model->predict()."n"; # the answer is banana, because the learner have seen more smooth bananas # (weighted 3) than smooth apples (weighted 2) # ask what a red, long thing is most likely to be print $model->predict()."n"; # the answer is banana, because the learner have seen more long bananas # (weighted 3) than red apples (weighted 2) # print out scores of all possible answers to the feature round and red for ($model->all_labels) { my $s = $model->score( => $_); print "$_: $sn"; } # save the model $model->save('model_file'); # load the model $model->load('model_file'); Requirements: · Perl
AI::MaxEntropy Related Software