Commits

Grzegorz Chrupała  committed 0796302

Simplify NLP.Scores.jensenShannon

  • Participants
  • Parent commits be09b92

Comments (0)

Files changed (2)

File nlp-scores/NLP/Scores.hs

 -- The distributions can be unnormalized.
 jensenShannon :: (Floating a, T.Traversable t, T.Traversable u) => t a -> u a -> a
 jensenShannon xs ys = 0.5 * kullbackLeibler xs zs + 0.5 * kullbackLeibler ys zs
-  where zs = zipWithTF (\x y -> 0.5 * (x+y)) xs ys
+  where zs = zipWithTF (+) xs ys
           
 -- | Adjusted Rand Index: <http://en.wikipedia.org/wiki/Rand_index>
 ari :: (Ord a, Ord b) => Counts a b -> Double

File nlp-scores/nlp-scores.cabal

 -- The package version. See the Haskell package versioning policy
 -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
 -- standards guiding when and how versions should be incremented.
-Version:             0.5.3
+Version:             0.5.4
 
 -- A short (one-line) description of the package.
 Synopsis:            Scoring functions commonly used for evaluation in NLP and IR