Skip to content

Instantly share code, notes, and snippets.

@tabris2012
Created May 31, 2012 03:11
Show Gist options
  • Save tabris2012/2840702 to your computer and use it in GitHub Desktop.
Save tabris2012/2840702 to your computer and use it in GitHub Desktop.
sub chromHMM {
@lineList = @{$_[0]};
$alpha = 0.02;
$K = 5; #分ける状態数
for ($i =0; $i < @lineList; $i++) {
foreach $list (@attr) { #示唆単語それぞれについて
$j =1; #ベクトル未追加フラグ
foreach $line (@{$list}) {
if ($lineList[$i][0] =~ /$line/) {
push @{$vector[$i]}, 1;
$j =0;
last;
}
}
if ($j) {
push @{$vector[$i]}, 0;
}
}
} #各行ベクトル化終了
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment