spectral-clustering 0.3.0.4 → 0.3.1.0
raw patch · 2 files changed
+24/−14 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
spectral-clustering.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: spectral-clustering-version: 0.3.0.4+version: 0.3.1.0 license: GPL-3 license-file: LICENSE copyright: 2019 Gregory W. Schwartz
src/Math/Clustering/Spectral/Dense.hs view
@@ -124,19 +124,29 @@ -- | Obtain the second left singular vector (or N earlier) and E on of a sparse -- matrix. secondLeft :: Int -> Int -> H.Matrix Double -> [H.Vector Double]-secondLeft n e m =- fmap (VS.drop (n - 1))- . H.toColumns- . (\(!x, _, _) -> x)- . SVD.sparseSvd (e + (n - 1))- . H.mkCSR- . filter (\((_, _), x) -> x /= 0)- . concatMap (\(!i, xs) -> fmap (\(!j, !x) -> ((i, j), x)) xs)- . zip [0..]- . fmap (zip [0..])- . H.toLists- $ m+secondLeft n e m = take e+ . drop (n - 1)+ . H.toColumns+ . (\(u, _, _) -> u)+ . H.svd+ $ m +-- -- | Obtain the second left singular vector (or N earlier) and E on of a sparse+-- -- matrix.+-- secondLeft :: Int -> Int -> H.Matrix Double -> [H.Vector Double]+-- secondLeft n e m =+-- fmap (VS.drop (n - 1))+-- . H.toColumns+-- . (\(!x, _, _) -> x)+-- . SVD.sparseSvd (e + (n - 1))+-- . H.mkCSR+-- . filter (\((_, _), x) -> x /= 0)+-- . concatMap (\(!i, xs) -> fmap (\(!j, !x) -> ((i, j), x)) xs)+-- . zip [0..]+-- . fmap (zip [0..])+-- . H.toLists+-- $ m+ -- | Get the normalized matrix B from an input matrix where the features are -- columns and rows are observations. Optionally, do not normalize. getB :: Bool -> H.Matrix Double -> B@@ -208,7 +218,7 @@ { K.kmeansMethod = K.Forgy , K.kmeansClusters = False , K.kmeansSeed = U.fromList [run]- } + } -- | Get the most common element of a list. mostCommon :: (Ord a) => [a] -> a