【问题标题】:Spark function for normal distrbution (norm.dist)正态分布的 Spark 函数 (norm.dist)
【发布时间】:2020-09-08 20:03:33
【问题描述】:

我正在寻找 spark scala 函数来在 Excel 中找到像 norm.dist 这样的正态分布值。在火花库中找不到。

能否请您帮助我使用功能或替代方法在 spark 中实现相同的功能?请指教。非常感谢。

【问题讨论】:

标签: scala apache-spark apache-spark-mllib normal-distribution apache-spark-ml


【解决方案1】:

在excel中搜索和比较计算后。 我们可以在 commons.math3.distribution 中使用 NormalDistribution 函数,如下所示。 感谢您的评论。

【讨论】:

  • 您在 spark 中需要这个,不是吗?尝试使用import org.apache.spark.ml.linalg.{Matrices, Vectors} import org.apache.spark.ml.stat.distribution.MultivariateGaussian val gaussian = new MultivariateGaussian(Vectors.dense(Array(112.5322297)), Matrices.diag(Vectors.dense(22.56897774)) ) println(gaussian.pdf(Vectors.dense(Array(55.88)))) 支持degenerate_case
猜你喜欢
  • 2013-01-14
  • 1970-01-01
  • 2019-05-18
  • 2013-11-04
  • 2023-03-26
  • 2013-01-28
  • 2020-10-23
  • 1970-01-01
相关资源
最近更新 更多