Algorithm-AM

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    Stopped printing to amcpresults and terminal
    Switched to Log::Any
    Removed format variables and used Text::Table for reports
    Added Algorithm::AM::Result module
    Removed separate support for "short" and "long" outcomes
    Replaced Project with DataSet and Item
        - resulted in complete reorganization of everything
    Updated/rewrote all documentation
2.45      2014-02-11 21:27:02 America/Los_Angeles
    Fixed gang/grandtotal calculation bugs
    removed debug print statements!
2.44      2014-02-11 16:13:54 America/Los_Angeles
    Fix gangcount updating (bad loop bound)
2.43      2014-02-11 12:22:57 America/Los_Angeles
    reverse 2.42 (think I was wrong)
    More debug printing
    don't pass ref to keys (experimental feature)
2.42      2014-02-10 21:32:23 America/Los_Angeles
    More debug printing
    fix uninitialized array element
2.41      2014-02-10 12:37:57 America/Los_Angeles
    More debug printing
    Fixed big-int bug introduced in 2.40
2.40      2014-02-09 18:37:58 America/Los_Angeles
    More debug printing
2.39      2014-02-08 21:32:43 America/Los_Angeles
    Added lots of print statements for trial release; need more info!
2.38      2014-02-07 20:27:29 America/Los_Angeles
    changed back C99 datatypes until further testing
2.37      2014-02-07 18:52:07 America/Los_Angeles
    removed non-existent dependency that prevented installation
2.36      2014-02-07 16:24:26 America/Los_Angeles
    remove given/when (which trigger 'experimental' warnings)
    better handling of project files
    line directives added to ginormous eval statement

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

    my $result = Algorithm::AM::Result->new(
        given_excluded => $given_excluded,
        cardinality => $num_feats,
        exclude_nulls => $self->exclude_nulls,
        count_method => $self->linear ? 'linear' : 'squared',
        training_set => $training_set,
        test_item => $test_item,
        test_in_train => $test_in_training,
    );

    $log->debug(${$result->config_info})
        if($log->is_debug);

    $result->start_time([ (localtime)[0..2] ]);
    $self->_fillandcount(
        $lattice_sizes, $self->linear ? 1 : 0);
    $result->end_time([ (localtime)[0..2] ]);

    unless ($self->{pointers}->{'grand_total'}) {
        #TODO: is this tested yet?
        if($log->is_warn){
            $log->warn('No training items considered. ' .

lib/Algorithm/AM/Batch.pm  view on Meta::CPAN

    $self->_set_test_set($test_set);

    if($self->begin_hook){
        $self->begin_hook->($self);
    }

    # save the result objects from all items, all iterations, here
    my @all_results;

    foreach my $item_number (0 .. $test_set->size - 1) {
        if($log->is_debug){
            $log->debug('Test items left: ' .
                $test_set->size + 1 - $item_number);
        }
        my $test_item = $test_set->get_item($item_number);
        # store the results just for this item
        my @item_results;

        if($self->begin_test_hook){
            $self->begin_test_hook->($self, $test_item);
        }

        if($log->is_debug){
            my ( $sec, $min, $hour ) = localtime();
            $log->info(
                sprintf( "Time: %2s:%02s:%02s\n", $hour, $min, $sec) .
                $test_item->comment . "\n" .
                sprintf( "0/$self->{repeat}  %2s:%02s:%02s",
                    $hour, $min, $sec ) );
        }

        my $iteration = 1;
        while ( $iteration <= $self->repeat ) {

lib/Algorithm/AM/Batch.pm  view on Meta::CPAN

}

# log the summary printouts from the input result object
sub _log_result {
    my ($result) = @_;

    $log->info(${$result->statistical_summary});

    $log->info(${$result->analogical_set_summary()});

    if($log->is_debug){
        $log->debug(${ $result->gang_summary(1) });
    }elsif($log->is_info){
        $log->info(${ $result->gang_summary(0) })
    }
    return;
}

# create the training set for this iteration, calling training_item_hook and
# updating excluded_items along the way
sub _make_training_set {
    my ($self, $test_item, $iteration) = @_;

lib/Algorithm/AM/Batch.pm  view on Meta::CPAN


=head2 C<classify_all>

Using the analogical modeling algorithm, this method classifies
the test items in the project and returns a list of
L<Result|Algorithm::AM::Result> objects.

L<Log::Any> is used to log information about the current progress and
timing. The statistical summary, analogical set, and gang summary
(without items listed) are logged at the info level, and the full
gang summary with items listed is logged at the debug level.

Hooks are provided to the user for monitoring or modifying
classification configuration. These hooks may be passed into the
object constructor or set via one of the accessor methods.
Batch classification proceeds as follows:

  call begin_hook
  loop all test set items
    call begin_test_hook
    repeat X times, where X is specified by the "repeat" setting

ppport.h  view on Meta::CPAN

DEBUG_R_TEST|5.007001||Viu
DEBUG_r_TEST|5.007001||Viu
DEBUG_s|5.003007||Viu
DEBUG_S|5.017002||Viu
DEBUG_SBOX32_HASH|5.027001||Viu
DEBUG_SCOPE|5.008001||Viu
DEBUG_s_FLAG|5.007001||Viu
DEBUG_S_FLAG|5.017002||Viu
DEBUG_STACK_r|5.009005||Viu
DEBUG_STADTX_HASH|5.027001||Viu
debug_start_match|5.009004||Viu
DEBUG_STATE_r|5.009004||Viu
DEBUG_s_TEST|5.007001||Viu
DEBUG_S_TEST|5.017002||Viu
DEBUG_t|5.003007||Viu
DEBUG_T|5.007001||Viu
DEBUG_TEST_r|5.021005||Viu
DEBUG_T_FLAG|5.007001||Viu
DEBUG_t_FLAG|5.007001||Viu
DEBUG_TOP_FLAG|5.007001||Viu
DEBUG_TRIE_COMPILE_MORE_r|5.009002||Viu

ppport.h  view on Meta::CPAN

getc|5.003007||Viu
get_c_backtrace|5.021001||Vi
get_c_backtrace_dump|5.021001||V
get_context|5.006000|5.006000|nu
getc_unlocked|5.003007||Viu
get_cv|5.006000|5.003007|p
get_cvn_flags|5.009005|5.003007|p
get_cvs|5.011000|5.003007|p
getcwd_sv|5.007002|5.007002|
get_db_sub|||iu
get_debug_opts|5.008001||Viu
get_deprecated_property_msg|5.031010||cVniu
getegid|5.005000||Viu
getenv|5.005000||Viu
getenv_len|5.006000||Viu
geteuid|5.005000||Viu
getgid|5.005000||Viu
getgrent|5.009000||Viu
GETGRENT_R_HAS_BUFFER|5.008000||Viu
GETGRENT_R_HAS_FPTR|5.008000||Viu
GETGRENT_R_HAS_PTR|5.008000||Viu

ppport.h  view on Meta::CPAN

I_NETINET_IN|5.003007|5.003007|Vn
I_NETINET_TCP|5.006000|5.006000|Vn
inet_ntoa|5.005000||Viu
INFNAN_NV_U8_DECL|5.023000||Viu
INFNAN_U8_NV_DECL|5.023000||Viu
ingroup|5.003007||Viu
INIT|5.003007||Viu
init_argv_symbols|5.007003||Viu
init_constants|5.017003||Viu
init_dbargs|||iu
init_debugger|5.005000||Viu
init_i18nl10n|5.006000||cVu
init_i18nl14n|5.006000||dcVu
initialize_invlist_guts|5.029002||Viu
init_ids|5.005000||Viu
init_interp|5.005000||Viu
init_main_stash|5.005000||Viu
init_named_cv|5.027010||cViu
init_os_extras|5.005000||Viu
init_perllib|5.005000||Viu
init_postdump_symbols|5.005000||Viu

ppport.h  view on Meta::CPAN

magic_clearisa|5.010001||Viu
magic_clearpack|5.003007||Viu
magic_clearsig|5.003007||Viu
magic_copycallchecker|5.017000||Viu
magic_dump|5.006000|5.006000|u
magic_existspack|5.003007||Viu
magic_freearylen_p|5.009003||Viu
magic_freeovrld|5.007001||Viu
magic_get|5.003007||Viu
magic_getarylen|5.003007||Viu
magic_getdebugvar|5.021005||Viu
magic_getdefelem|5.004000||Viu
magic_getnkeys|5.004005||Viu
magic_getpack|5.003007||Viu
magic_getpos|5.003007||Viu
magic_getsig|5.003007||Viu
magic_getsubstr|5.004005||Viu
magic_gettaint|5.003007||Viu
magic_getuvar|5.003007||Viu
magic_getvec|5.004005||Viu
magic_killbackrefs|5.006000||Viu

ppport.h  view on Meta::CPAN

magic_nextpack|5.003007||Viu
magic_regdata_cnt|5.006000||Viu
magic_regdatum_get|5.006000||Viu
magic_regdatum_set|5.006001||Viu
magic_scalarpack|5.009001||Viu
magic_set|5.003007||Viu
magic_set_all_env|5.004004||Viu
magic_setarylen|5.003007||Viu
magic_setcollxfrm|5.004000||Viu
magic_setdbline|5.003007||Viu
magic_setdebugvar|5.021005||Viu
magic_setdefelem|5.004000||Viu
magic_setenv|5.003007||Viu
magic_sethint|5.009004||Vi
magic_sethint_feature|5.031007||Viu
magic_setisa|5.003007||Viu
magic_setlvref|5.021005||Viu
magic_setmglob|5.003007||Viu
magic_setnkeys|5.003007||Viu
magic_setnonelem|5.027009||Viu
magic_setpack|5.003007||Viu

ppport.h  view on Meta::CPAN

PERLDB_SAVESRC|5.010001||Viu
PERLDB_SAVESRC_INVALID|5.010001||Viu
PERLDB_SAVESRC_NOSUBS|5.010001||Viu
PERLDB_SINGLE|5.004002||Viu
PERLDB_SUB|5.004002||Viu
PERLDB_SUBLINE|5.004002||Viu
PERLDB_SUB_NN|5.004005||Viu
PERL_DEB2|5.021007||Viu
PERL_DEB|5.008001||Viu
PERL_DEBUG|5.008001||Viu
Perl_debug_log|5.003007||Viu
PERL_DEBUG_PAD|5.007003||Viu
PERL_DEBUG_PAD_ZERO|5.007003||Viu
PERL_DECIMAL_VERSION|5.019008||Viu
PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION|5.009003||Viu
perl_destruct|5.007003|5.007003|n
PerlDir_chdir|5.005000||Viu
PerlDir_close|5.005000||Viu
PerlDir_mapA|5.006000||Viu
PerlDir_mapW|5.006000||Viu
PerlDir_mkdir|5.005000||Viu

ppport.h  view on Meta::CPAN

PerlIO|5.003007||Viu
PerlIO_apply_layers|5.007001|5.007001|
PerlIOArg|5.007001||Viu
PerlIOBase|5.007001||Viu
PerlIO_binmode|5.007001|5.007001|
PERLIOBUF_DEFAULT_BUFSIZ|5.013007||Viu
PerlIO_canset_cnt|5.003007|5.003007|n
PerlIO_clearerr|5.007003|5.007003|
PerlIO_close|5.007003|5.007003|
PerlIO_context_layers|5.009004|5.009004|u
PerlIO_debug|5.007001|5.007001|
PERLIO_DUP_CLONE|5.007003||Viu
PERLIO_DUP_FD|5.007003||Viu
PerlIO_eof|5.007003|5.007003|
PerlIO_error|5.007003|5.007003|
PerlIO_exportFILE|5.003007|5.003007|n
PERLIO_F_APPEND|5.007001||Viu
PerlIO_fast_gets|5.003007|5.003007|n
PERLIO_F_CANREAD|5.007001||Viu
PERLIO_F_CANWRITE|5.007001||Viu
PERLIO_F_CLEARED|5.013008||Viu

ppport.h  view on Meta::CPAN

PERL_LONG_MAX|5.003007|5.003007|p
PERL_LONG_MIN|5.003007|5.003007|p
PERL_MAGIC_arylen|5.007002|5.003007|p
PERL_MAGIC_arylen_p|5.009003|5.009003|
PERL_MAGIC_backref|5.007002|5.003007|p
PERL_MAGIC_bm|5.007002|5.003007|p
PERL_MAGIC_checkcall|5.013006|5.013006|
PERL_MAGIC_collxfrm|5.007002|5.003007|p
PERL_MAGIC_dbfile|5.007002|5.003007|p
PERL_MAGIC_dbline|5.007002|5.003007|p
PERL_MAGIC_debugvar|5.021005|5.021005|
PERL_MAGIC_defelem|5.007002|5.003007|p
PERL_MAGIC_env|5.007002|5.003007|p
PERL_MAGIC_envelem|5.007002|5.003007|p
PERL_MAGIC_ext|5.007002|5.003007|p
PERL_MAGIC_fm|5.007002|5.003007|p
PERL_MAGIC_glob||5.003007|ponu
PERL_MAGIC_hints|5.009004|5.009004|
PERL_MAGIC_hintselem|5.009004|5.009004|
PERL_MAGIC_isa|5.007002|5.003007|p
PERL_MAGIC_isaelem|5.007002|5.003007|p

ppport.h  view on Meta::CPAN

PL_DBgv|5.005000||Viu
PL_DBline|5.005000||Viu
PL_DBsignal|5.005000|5.003007|poVnu
PL_DBsignal_iv|5.021005||Viu
PL_DBsingle|5.005000|5.003007|poV
PL_DBsingle_iv|5.021005||Viu
PL_DBsub|5.005000|5.003007|poV
PL_DBtrace|5.005000|5.003007|poV
PL_DBtrace_iv|5.021005||Viu
PL_debstash|5.005000|5.003007|poVnu
PL_debug|5.005000||Viu
PL_debug_pad|5.007003||Viu
PL_defgv|5.004005|5.003007|p
PL_def_layerlist|5.007003||Viu
PL_defoutgv|5.005000||Viu
PL_defstash|5.005000||Viu
PL_delaymagic|5.005000||Viu
PL_delaymagic_egid|5.015008||Viu
PL_delaymagic_euid|5.015008||Viu
PL_delaymagic_gid|5.015008||Viu
PL_delaymagic_uid|5.015008||Viu
PL_destroyhook|5.010000||Viu

ppport.h  view on Meta::CPAN

PL_main_start|5.005000||Viu
PL_markstack|5.005000||Viu
PL_markstack_max|5.005000||Viu
PL_markstack_ptr|5.005000||Viu
PL_max_intro_pending|5.005000||Viu
PL_maxo|5.005000||Viu
PL_maxsysfd|5.005000||Viu
PL_mbrlen_ps|5.031009||Viu
PL_mbrtowc_ps|5.031009||Viu
PL_Mem|5.006000||Viu
PL_memory_debug_header|5.009004||Viu
PL_MemParse|5.006000||Viu
PL_MemShared|5.006000||Viu
PL_mess_sv|5.005000|5.004000|poVnu
PL_min_intro_pending|5.005000||Viu
PL_minus_a|5.005000||Viu
PL_minus_c|5.005000||Viu
PL_minus_E|5.009003||Viu
PL_minus_F|5.005000||Viu
PL_minus_l|5.005000||Viu
PL_minus_n|5.005000||Viu

ppport.h  view on Meta::CPAN

PL_utf8_toupper|5.006000||Viu
PL_utf8_xidcont|5.013010||Viu
PL_utf8_xidstart|5.013010||Viu
PL_vtbl_arylen|5.015000||Viu
PL_vtbl_arylen_p|5.015000||Viu
PL_vtbl_backref|5.015000||Viu
PL_vtbl_bm|5.015000||Viu
PL_vtbl_checkcall|5.017000||Viu
PL_vtbl_collxfrm|5.015000||Viu
PL_vtbl_dbline|5.015000||Viu
PL_vtbl_debugvar|5.021005||Viu
PL_vtbl_defelem|5.015000||Viu
PL_vtbl_env|5.015000||Viu
PL_vtbl_envelem|5.015000||Viu
PL_vtbl_fm|5.015000||Viu
PL_vtbl_hints|5.015000||Viu
PL_vtbl_hintselem|5.015000||Viu
PL_vtbl_isa|5.015000||Viu
PL_vtbl_isaelem|5.015000||Viu
PL_vtbl_lvref|5.021005||Viu
PL_vtbl_mglob|5.015000||Viu

ppport.h  view on Meta::CPAN

rpeep|5.013005||Viu
rsignal|5.004000|5.004000|
rsignal_restore|5.004000||Viu
rsignal_save|5.004000||Viu
rsignal_state|5.004000|5.004000|u
RsPARA|5.003007||Viu
RsRECORD|5.005000||Viu
RsSIMPLE|5.003007||Viu
RsSNARF|5.003007||Viu
run_body|5.006000||Viu
runops_debug|5.005000||cVu
RUNOPS_DEFAULT|5.005000||Viu
runops_standard|5.005000||cVu
run_user_filter|5.009003||Viu
rv2cv_op_cv|5.013006|5.013006|
RV2CVOPCV_FLAG_MASK|5.021004||Viu
RV2CVOPCV_MARK_EARLY|5.013006|5.013006|
RV2CVOPCV_MAYBE_NAME_GV|5.021004||Viu
RV2CVOPCV_RETURN_NAME_GV|5.013006|5.013006|
RV2CVOPCV_RETURN_STUB|5.021004||Viu
rvpv_dup|5.007003|5.007003|u

ppport.h  view on Meta::CPAN

setgid|5.005000||Viu
setgrent|5.009000||Viu
SETGRENT_R_HAS_FPTR|5.008000||Viu
SETGRENT_R_PROTO|5.008000|5.008000|Vn
sethostent|5.005000||Viu
SETHOSTENT_R_PROTO|5.008000|5.008000|Vn
SETi|5.003007||Viu
setjmp|5.005000||Viu
setlinebuf|5.005000||Viu
setlocale|5.009000||Viu
setlocale_debug_string|5.027002||Vniu
SETLOCALE_R_PROTO|5.008000|5.008000|Vn
SET_MARK_OFFSET|5.006000||Viu
setmode|5.005000||Viu
SETn|5.003007||Viu
setnetent|5.005000||Viu
SETNETENT_R_PROTO|5.008000|5.008000|Vn
set_numeric_radix|5.006000||Viu
SET_NUMERIC_STANDARD|5.004000||Viu
set_numeric_standard|5.006000||cViu
SET_NUMERIC_UNDERLYING|5.021010||Viu

ppport.h  view on Meta::CPAN

unpackstring|5.008001|5.008001|
unpackWARN1|5.007003||Viu
unpackWARN2|5.007003||Viu
unpackWARN3|5.007003||Viu
unpackWARN4|5.007003||Viu
unreferenced_to_tmp_stack|5.013002||Viu
unshare_hek|5.004000||Viu
unshare_hek_or_pvn|5.008000||Viu
unsharepvn|5.003007|5.003007|u
unwind_handler_stack|5.009003||Viu
update_debugger_info|5.009005||Viu
upg_version|5.009005|5.009005|
UPG_VERSION|5.019008||Viu
Uquad_t|5.006000|5.006000|Vn
U_S|5.003007||Viu
usage|5.005000||Viu
USE_64_BIT_ALL|5.006000|5.006000|Vn
USE_64_BIT_INT|5.006000|5.006000|Vn
USE_64_BIT_RAWIO|5.006000||Viu
USE_64_BIT_STDIO|5.006000||Viu
USE_BSDPGRP|5.003007||Viu



( run in 1.206 second using v1.01-cache-2.11-cpan-49f99fa48dc )