som 10.1.4 → 10.1.5
raw patch · 4 files changed
+14/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +2/−0
- som.cabal +2/−2
- src/Data/Datamining/Clustering/SGM3Internal.hs +2/−2
- test/Data/Datamining/Clustering/SGM3QC.hs +8/−2
ChangeLog.md view
@@ -1,5 +1,7 @@ # Changelog for som ++10.1.5 Bug fix in SGM3. 10.1.4 Modified SGM3 to work with limited range floating point types. 10.1.3 Added SGM3. 10.1.2 Fixed a warning.
som.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1bf49fbb93fa296979cf7d70de8ae9502be4b03a10627c6d7d158c97eafae269+-- hash: ed692aa37706e47ed881b4ea21769be3add5357c26ac89e9d5408c65a03158c2 name: som-version: 10.1.4+version: 10.1.5 synopsis: Self-Organising Maps description: Please see the README on GitHub at <https://github.com/mhwombat/som#readme> category: Math
src/Data/Datamining/Clustering/SGM3Internal.hs view
@@ -294,9 +294,9 @@ :: (Num t, Ord t, Fractional x, Real x, Num x, Ord x, Enum k, Ord k) => SGM t x k p -> p -> (k, x, M.Map k (p, x), SGM t x k p) trainAndClassify s p+ | size s == capacity s = (bmu, bmuDiff, report, s2) | size s < 2 = addModelTrainAndClassify s p- | bmuDiff > diffThreshold- && size s < capacity s = addModelTrainAndClassify s p+ | bmuDiff > diffThreshold = addModelTrainAndClassify s p | bmuDiff > cutoff = (bmu4, bmuDiff, report4, s4) | otherwise = (bmu, bmuDiff, report, s2) where diffThreshold = meanModelDiff s
test/Data/Datamining/Clustering/SGM3QC.hs view
@@ -133,8 +133,7 @@ prop_classify_never_causes_error_unless_som_empty :: TestSGM -> Double -> Property prop_classify_never_causes_error_unless_som_empty (TestSGM s _) p- = not (isEmpty s) ==> property $ deepseq x True- where x = classify s p+ = not (isEmpty s) ==> property $ deepseq (classify s p) True prop_trainNode_reduces_diff :: TestSGM -> Double -> Property prop_trainNode_reduces_diff (TestSGM s _) x = not (isEmpty s) ==>@@ -154,6 +153,10 @@ -- TODO prop: map will never exceed capacity +prop_train_never_causes_error :: TestSGM -> Double -> Property+prop_train_never_causes_error (TestSGM s _) p+ = property $ deepseq (train s p) True+ prop_train_only_modifies_one_model :: TestSGM -> Double -> Property prop_train_only_modifies_one_model (TestSGM s _) p@@ -204,6 +207,7 @@ sStable3 = trainBatch sStable2 ps (k2, _, _) = classify sStable3 (head ps) + test :: Test test = testGroup "QuickCheck Data.Datamining.Clustering.SGM2" [@@ -223,6 +227,8 @@ prop_trainNode_reduces_diff, testProperty "prop_training_reduces_diff" prop_training_reduces_diff,+ testProperty "prop_train_never_causes_error"+ prop_train_never_causes_error, testProperty "prop_train_only_modifies_one_model" prop_train_only_modifies_one_model, testProperty "prop_train_increments_counter"