AI::CBR::Case - case definition and representation
Define and initialise a case. In a productive system, you will want to encapsulate this.
use AI::CBR::Case; use AI::CBR::Sim qw(sim_frac sim_eq sim_set); # assume we are a doctor and see a patient # shortcut one-time generated case my $case = AI::CBR::Case->new( age => { value => 30, sim => \&sim_frac }, gender => { value => 'male', sim => \&sim_eq }, job => { value => 'programmer', sim => \&sim_eq }, symptoms => { value => [qw(headache)], sim => \&sim_set }, ); # or case-specification with changing data my $patient_case = AI::CBR::Case->new( age => { sim => \&sim_frac }, gender => { sim => \&sim_eq }, job => { sim => \&sim_eq }, symptoms => { sim => \&sim_set }, ); foreach my $patient (@waiting_queue) { $patient_case->set_values( %$patient ); # assume $patient is a hashref with the right attributes ... } ...
Creates a new case specification. Pass a hash of hash references as argument. The hash keys identify the attributes of the case, the hash reference specifies this attribute, with the following values:
sim: a reference to the similarity function to use for this attribute
param: the parameter for the similarity function, if required
weight: the weight of the attribute in the comparison of the case. If you do not give a weight value for an attribute, the package's $DEFAULT_WEIGHT will be used, which is 1 by default.
$DEFAULT_WEIGHT
value: the value of the attribute, if you want to specify the complete case immediately. You can also do this later.
Pass a hash of attribute keys and values. This will overwrite existing values, and can thus be used as a faster method for generating new cases with the same specification.
Darko Obradovic, <dobradovic at gmx.de>
<dobradovic at gmx.de>
Please report any bugs or feature requests to bug-ai-cbr-case at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=AI-CBR. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-ai-cbr-case at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc AI::CBR::Case
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=AI-CBR
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/AI-CBR
CPAN Ratings
http://cpanratings.perl.org/d/AI-CBR
Search CPAN
http://search.cpan.org/dist/AI-CBR
Copyright 2009 Darko Obradovic, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install AI::CBR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::CBR
CPAN shell
perl -MCPAN -e shell install AI::CBR
For more information on module installation, please visit the detailed CPAN module installation guide.