Created
December 19, 2016 16:17
-
-
Save josep2/b7c5ae98533a734471a66fee70c42331 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def harmonicMean(values: Seq[Double]): Double = { | |
values.length / values.map(v => 1.0 / v).sum | |
} | |
// Borrowed from: https://github.com/Leksyk/ml/blob/3d2c8ede6ff99d8c6ec3f830e6a4c49b85ee8e82/similar-words/src/main/scala/Utils.scala |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment