AI-DecisionTree
view release on metacpan or search on metacpan
structures it was using. Don't worry, I'm not going C-crazy. I
won't be making many (any?) more of these kinds of changes, but
these ones were probably necessary.
- Removed a bit of debugging code that I left in for 0.03.
0.03 Mon Sep 2 11:41:18 AEST 2002
- Added a 'prune' parameter to new(), which controls whether the tree
will be pruned after training. This is usually a good idea, so the
default is to prune. Currently we prune using a simple
minimum-description-length criterion.
- Training instances are now represented using a C struct rather than
a Perl hash. This can dramatically reduce memory usage, though it
doesn't have much effect on speed. Note that Inline.pm is now
required.
- The list of instances is now deleted after training, since it's no
longer needed.
lib/AI/DecisionTree.pm view on Meta::CPAN
=over 4
=item noise_mode
Controls the behavior of the
C<train()> method when "noisy" data is encountered. Here "noisy"
means that two or more training instances contradict each other, such
that they have identical attributes but different results.
If C<noise_mode> is set to C<fatal> (the default), the C<train()>
method will throw an exception (die). If C<noise_mode> is set to
C<pick_best>, the most frequent result at each noisy node will be
selected.
=item prune
A boolean C<prune> parameter which specifies
whether the tree should be pruned after training. This is usually a
good idea, so the default is to prune. Currently we prune using a
simple minimum-description-length criterion.
=item verbose
If set to a true value, some status information will be output while
training a decision tree. Default is false.
=item purge
If set to a true value, the C<do_purge()> method will be invoked
during C<train()>. The default is true.
=item max_depth
Controls the maximum depth of the tree that will be created during
C<train()>. The default is 0, which means that trees of unlimited
depth can be constructed.
=back
=item add_instance(attributes => \%hash, result => $string, name => $string)
Adds a training instance to the set of instances which will be used to
form the tree. An C<attributes> parameter specifies a hash of
attribute-value pairs for the instance, and a C<result> parameter
specifies the result.
( run in 0.424 second using v1.01-cache-2.11-cpan-0a6323c29d9 )