1Instance(3) User Contributed Perl Documentation Instance(3)
2
3
4
6 AI::DecisionTree::Instance - C-struct wrapper for training instances
7
9 use AI::DecisionTree::Instance;
10
11 my $i = new AI::DecisionTree::Instance([3,5], 7, 'this_instance');
12 $i->value_int(0) == 3;
13 $i->value_int(1) == 5;
14 $i->result_int == 7;
15
17 This class is just a simple Perl wrapper around a C struct embodying a
18 single training instance. Its purpose is to reduce memory usage. In a
19 "typical" training set with about 1000 instances, memory usage can be
20 reduced by about a factor of 5 (from 43.7M to 8.2M in my test program).
21
22 A fairly tight loop is also implemented that helps speed up the
23 "train()" AI::DecisionTree method by about a constant factor of 4.
24
25 Please do not consider this interface stable - I change it whenever I
26 have a new need in AI::DecisionTree.
27
29 Ken Williams, ken@mathforum.org
30
32 AI::DecisionTree
33
34
35
36perl v5.30.0 2019-07-26 Instance(3)