Created
May 31, 2012 03:11
-
-
Save tabris2012/2840702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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