aboutsummaryrefslogtreecommitdiff
path: root/bin/cluster.hs
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2023-01-16 11:56:11 +1100
committerJustin Bedo <cu@cua0.org>2023-01-16 11:57:11 +1100
commited791d360102309d7ce7f89089a7a5c73968725a (patch)
tree822b14d7b1a88817a2d7acf3cb4adb8259626bf1 /bin/cluster.hs
parent3668d6b45478ef9e8a48fc469f931b52f6dad9c6 (diff)
fix length
Diffstat (limited to 'bin/cluster.hs')
-rw-r--r--bin/cluster.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/cluster.hs b/bin/cluster.hs
index 6bcac29..7984bfd 100644
--- a/bin/cluster.hs
+++ b/bin/cluster.hs
@@ -68,7 +68,7 @@ model xs = do
mapM_ scoreLog $ zipWith likelihood params xs
let cls = take (length xs) clusters
k = maximum cls + 1
- n = length $ head xs
+ n = length (head xs) `div` 2
pure (map (take k) $ take n ps, cls)
where
likelihood ps cnts = product $ zipWith go ps (pairs cnts)