packages feed

clustering 0.3.0 → 0.3.1

raw patch · 3 files changed

+20/−17 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ AI.Clustering.KMeans: KMeansOpts :: Method -> (Vector Word32) -> Bool -> KMeansOpts
+ AI.Clustering.KMeans: [kmeansClusters] :: KMeansOpts -> Bool
+ AI.Clustering.KMeans: [kmeansMethod] :: KMeansOpts -> Method
+ AI.Clustering.KMeans: [kmeansSeed] :: KMeansOpts -> (Vector Word32)

Files

benchmarks/Bench/KMeans.hs view
@@ -1,18 +1,20 @@ module Bench.KMeans     ( benchKMeans ) where -import Criterion.Main-import qualified Data.Matrix.Unboxed as MU-import qualified Data.Vector.Unboxed as U-import System.Random.MWC-import System.IO.Unsafe--import AI.Clustering.KMeans+import           Criterion.Main+import qualified Data.Matrix.Unboxed  as MU+import qualified Data.Vector.Unboxed  as U+import           Data.Word+import           System.IO.Unsafe+import           System.Random.MWC -import Bench.Utils+import           AI.Clustering.KMeans+import           Bench.Utils -gen :: GenIO-gen = unsafePerformIO createSystemRandom+gen :: U.Vector Word32+gen = unsafePerformIO $ do+    g <- createSystemRandom+    fmap fromSeed $ save g  dat :: MU.Matrix Double dat = unsafePerformIO $ fmap MU.fromRows $ randVectors 1000 10@@ -21,11 +23,12 @@ benchKMeans = bgroup "KMeans clustering"     [ bgroup "AI.Clustering.KMeans"         [ bench "k-means++ (n = 1000, k = 7)" $-            whnfIO $ kmeans' gen KMeansPP 7 dat+            whnf ( \x -> membership $ kmeans 7 x defaultKMeansOpts+                { kmeansMethod = KMeansPP+                , kmeansSeed = gen } ) dat         , bench "forgy (n = 1000, k = 7)" $-            whnfIO $ kmeans' gen Forgy 7 dat+            whnf ( \x -> membership $ kmeans 7 x defaultKMeansOpts+                { kmeansMethod = KMeansPP+                , kmeansSeed = gen } ) dat         ]     ]--kmeans' :: GenIO -> Method -> Int -> MU.Matrix Double -> IO (U.Vector Int)-kmeans' g method k = fmap _clusters . kmeans g method k
clustering.cabal view
@@ -1,5 +1,5 @@ name:                clustering-version:             0.3.0+version:             0.3.1 synopsis:            High performance clustering algorithms description:   Following clutering methods are included in this library:
src/AI/Clustering/KMeans.hs view
@@ -2,7 +2,7 @@  module AI.Clustering.KMeans     ( KMeans(..)-    , KMeansOpts+    , KMeansOpts(..)     , defaultKMeansOpts     , kmeans     , kmeansBy