Algorithm-LibLinear

 view release on metacpan or  search on metacpan

lib/Algorithm/LibLinear/DataSet.pm  view on Meta::CPAN

use Smart::Args::TypeTiny;
use Types::Standard qw/ArrayRef ClassName FileHandle InstanceOf Num Str/;

my $InstanceOfPackage = InstanceOf[__PACKAGE__];

sub new {
    args
        my $class => ClassName,
        my $data_set => ArrayRef[FeatureWithLabel];

    bless +{ data_set => $data_set } => $class;
}

sub load {
    args
        my $class => ClassName,
        my $fh => +{ isa => FileHandle, optional => 1, },
        my $filename => +{ isa => Str, optional => 1, },
        my $string => +{ isa => Str, optional => 1, };

    if (none { defined } ($fh, $filename, $string)) {

lib/Algorithm/LibLinear/Model.pm  view on Meta::CPAN

use Smart::Args::TypeTiny;
use Types::Standard qw/ClassName InstanceOf Int Str/;

my $InstanceOfPackage = InstanceOf[__PACKAGE__];

sub new {
    args
        my $class => ClassName,
        my $raw_model => InstanceOf['Algorithm::LibLinear::Model::Raw'];

    bless +{ raw_model => $raw_model, } => $class;
}

sub load {
    args
        my $class => ClassName,
        my $filename => Str;

    my $raw_model = Algorithm::LibLinear::Model::Raw->load($filename);
    $class->new(raw_model => $raw_model);
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.916 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )