Algorithm-BaumWelch
view release on metacpan or search on metacpan
lib/Algorithm/BaumWelch.pm view on Meta::CPAN
Model (HMM). The algorithm calculates the forward and backwards probabilities for each HMM state in a series and then re-estimates the parameters of
the model.
=cut
use version; our $VERSION = qv('0.0.2');
#r/ matrices de BW sao 1xN_states matrices - quer dizer quasi arrays - entao nao usa matrices reais. arrays são bastante
sub new {
my $class = shift;
my $self = [undef, undef, []]; bless $self, $class;
return $self;
}
sub feed_obs {
my ($self, $series) = @_;
my %uniq;
@uniq{@{$series}} = 1;
my @obs = (keys %uniq);
@obs = sort { $a cmp $b } @obs;
$self->[0][0] = $series;
( run in 1.494 second using v1.01-cache-2.11-cpan-de7293f3b23 )