Algorithm-DecisionTree
view release on metacpan or search on metacpan
lib/Algorithm/DecisionTree.pm view on Meta::CPAN
The C<regression4.pl> script involves only one predictor variable and one dependent
variable. The training data for this exercise is drawn from the file C<gendata4.csv>.
This data file contains strongly nonlinear data. When you run the script
C<regression4.pl>, you will see how much better the result from tree regression is
compared to what you can get with linear regression.
The C<regression5.pl> script is essentially the same as the previous script except
for the fact that the training datafile used in this case, C<gendata5.csv>, consists
of three noisy segments, as opposed to just two in the previous case.
The script C<regression6.pl> deals with the case when we have two predictor variables
and one dependent variable. You can think of the data as consisting of noisy height
values over an C<(x1,x2)> plane. The data used in this script is drawn from the csv
file C<gen3Ddata1.csv>.
Finally, the script C<regression8.pl> shows how you can carry out bulk prediction for
all your test data records in a disk file. The script writes all the calculated
predictions into another disk file whose name is derived from the name of the test
data file.
=head1 EXPORT
None by design.
=head1 BUGS
Please notify the author if you encounter any bugs. When sending email, please place
the string 'DecisionTree' in the subject line.
=head1 INSTALLATION
Download the archive from CPAN in any directory of your choice. Unpack the archive
with a command that on a Linux machine would look like:
tar zxvf Algorithm-DecisionTree-3.43.tar.gz
This will create an installation directory for you whose name will be
C<Algorithm-DecisionTree-3.43>. Enter this directory and execute the following
commands for a standard install of the module if you have root privileges:
perl Makefile.PL
make
make test
sudo make install
If you do not have root privileges, you can carry out a non-standard install the
module in any directory of your choice by:
perl Makefile.PL prefix=/some/other/directory
make
make test
make install
With a non-standard install, you may also have to set your PERL5LIB environment
variable so that this module can find the required other modules. How you do that
would depend on what platform you are working on. In order to install this module in
a Linux machine on which I use tcsh for the shell, I set the PERL5LIB environment
variable by
setenv PERL5LIB /some/other/directory/lib64/perl5/:/some/other/directory/share/perl5/
If I used bash, I'd need to declare:
export PERL5LIB=/some/other/directory/lib64/perl5/:/some/other/directory/share/perl5/
Another option for a non-standard install would be to place at the top of your own
scripts the following invocation:
BEGIN {
unshift @INC, "/some/other/directory/blib/lib";
}
=head1 THANKS
I wish to thank many users of this module for their feedback. Many of the
improvements I have made to the module over the years are a result of the feedback
received.
I thank Slaven Rezic for pointing out that the module worked with Perl 5.14.x. For
Version 2.22, I had set the required version of Perl to 5.18.0 since that's what I
used for testing the module. Slaven's feedback in the form of the Bug report
C<#96547> resulted in Version 2.23 of the module. Version 2.25 further downshifts
the required version of Perl to 5.10.
On the basis of the report posted by Slaven at C<rt.cpan.org> regarding Version 2.27,
I am removing the Perl version restriction altogether from Version 2.30. Thanks
Slaven!
Version 3.43 was prompted by a bug report sent by Jan Trukenmüller regarding a
missing backslash in a regex in the C<csv_cleanup_needed()> function. Thanks, Jan!
=head1 AUTHOR
The author, Avinash Kak, recently finished a 17-year long "Objects Trilogy Project"
with the publication of the book I<Designing with Objects> by John-Wiley. If
interested, visit his web page at Purdue to find out what this project was all
about. You might like I<Designing with Objects> especially if you enjoyed reading
Harry Potter as a kid (or even as an adult, for that matter).
If you send email regarding this module, please place the string "DecisionTree" in
your subject line to get past my spam filter. Avi Kak's email address is
C<kak@purdue.edu>
=head1 COPYRIGHT
This library is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
Copyright 2017 Avinash Kak
=cut
( run in 0.980 second using v1.01-cache-2.11-cpan-f6376fbd888 )