Algorithm-TrunkClassifier

 view release on metacpan or  search on metacpan

Algorithm/TrunkClassifier/ppport.h  view on Meta::CPAN

pmruntime|||
pmtrans|||
pop_scope|||
pregcomp||5.009005|
pregexec|||
pregfree|||
prepend_elem|||
prepend_madprops|||
printbuf|||
printf_nocontext|||vn
process_special_blocks|||
ptr_table_clear||5.009005|
ptr_table_fetch||5.009005|
ptr_table_find|||n
ptr_table_free||5.009005|
ptr_table_new||5.009005|
ptr_table_split||5.009005|
ptr_table_store||5.009005|
push_scope|||
put_byte|||
pv_display||5.006000|

lib/Algorithm/TrunkClassifier.pm  view on Meta::CPAN

my $SUPPFILE = "";			#File containing class information
my $VERBOSE = 0;			#Report progress during classifier run
my $USEALL = 0;				#Circumvent level selection and use all trunks for classification
my $DATAFILE = "";			#File containing input data

#Description: Wrapper function for running the decision trunk classifier
#Parameters: Command line arguments
#Return value: None
sub runClassifier{
	#Handle commands line arguments
	my $processor = Algorithm::TrunkClassifier::CommandProcessor->new(\$CLASSIFY, \$SPLITPERCENT, \$TESTSET, \$CLASSNAME, \$OUTPUT, \$LEVELS, \$PROSPECT, \$SUPPFILE, \$VERBOSE, \$USEALL, \$DATAFILE);
	$processor->processCmd(@_);
	
	#Read input data
	if($VERBOSE){
		print("Trunk classifier: Reading input data\n");
	}
	my $dataWrapper = Algorithm::TrunkClassifier::DataWrapper->new($CLASSNAME, $PROSPECT, $SUPPFILE, $DATAFILE, $VERBOSE, "input data file");
	my $testset;
	if($CLASSIFY eq "dual"){
		$testset = Algorithm::TrunkClassifier::DataWrapper->new($CLASSNAME, $PROSPECT, $SUPPFILE, $TESTSET, $VERBOSE, "testset data file");
		if($VERBOSE){

lib/Algorithm/TrunkClassifier/CommandProcessor.pm  view on Meta::CPAN

package Algorithm::TrunkClassifier::CommandProcessor;

use warnings;
use strict;

our $VERSION = 'v1.0.1';

my %commands;

#Description: Command processor constructor
#Parameters: (1) TrunkClassifier::CommandProcessor, (2) classification procedure ref, (3), split ref, (4) testset ref,
#            (5) class name variable ref, (6) output folder variable ref, (7) level variable ref, (8) prospect variable ref,
#            (9) supplementary file variable ref, (10) verbose variable ref, (11) useall variable ref, (12) input data file variable ref
#Return value: TrunkClassifier::CommandProcessor object
sub new($ $ $ $ $ $ $ $ $ $ $ $ $){
	my ($class, $classifyRef, $splitPercentRef, $testsetRef, $classnameRef, $outputRef, $levelRef, $prospectRef, $suppfileRef, $verboseRef, $useallRef, $datafileRef) = @_;
	%commands = (
		"-p"			=> {"numArgs" => 1, "validArgs" => 'loocv|split|dual', "var" => $classifyRef, "sub" => \&checkTestsetArg},
		"--procedure"	=> {"numArgs" => 1, "validArgs" => 'loocv|split|dual', "var" => $classifyRef},
		"-e"            => {"numArgs" => 1, "validArgs" => '^[1-9][0-9]?$', "var" => $splitPercentRef},

lib/Algorithm/TrunkClassifier/CommandProcessor.pm  view on Meta::CPAN

		"-u"			=> {"numArgs" => 0, "var" => $useallRef, "value" => 1},
		"--useall"		=> {"numArgs" => 0, "var" => $useallRef, "value" => 1},
		"-h"			=> {"numArgs" => 0, "sub" => \&commandHelp},
		"--help"		=> {"numArgs" => 0, "sub" => \&commandHelp}
	);
	my $self = {"input" => $datafileRef};
	bless($self, $class);
	return $self;
}

#Description: Command processor loop
#Parameters: Command line arguments
#Return value: None
sub processCmd{
	my $self = shift(@_);
	my @commandLine = @_;
	my @allCommands = @_;
	if(!@commandLine){
		commandHelp();
	}
	while(@commandLine){
		my $com = shift(@commandLine);
		my $arg;
		if(!$commands{$com}){

pod/TrunkClassifier.pod  view on Meta::CPAN

GRADE and HISTOLOGY. Class labels could be EARLY and LATE for STAGE, or LOW and HIGH
for GRADE. The format of the file is illustrated here.

  Samples	ClassVar1	ClassVar2
  sample1	classLabel1	classLabel3
  sample2	classLabel1	classLabel4
  sample3	classLabel2	classLabel3
  sample4	classLabel1	classLabel4
  sample5	classLabel2	classLabel4

When this option is given, the algorithm first processes the supplementary file and
writes a new data file containing meta data. This data file is then used as input.

Note: If the C<-p dual> option is used, two datasets must be supplied. In this case the
supplementary file needs to contain the class information of all samples in both datasets.

=item C<-v>

This option makes the algorithm report its progress to the terminal during a run.

=item C<-u>



( run in 0.418 second using v1.01-cache-2.11-cpan-8d75d55dd25 )