Skip to content
Snippets Groups Projects
Commit 5255e55c authored by DB Tsai's avatar DB Tsai
Browse files

[SPARK-15411][ML] Add @since to ml.stat.MultivariateOnlineSummarizer.scala

## What changes were proposed in this pull request?

Add since to ml.stat.MultivariateOnlineSummarizer.scala

## How was this patch tested?

unit tests

Author: DB Tsai <dbt@netflix.com>

Closes #13197 from dbtsai/cleanup.
parent 30526395
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ package org.apache.spark.ml.stat.distribution ...@@ -19,6 +19,7 @@ package org.apache.spark.ml.stat.distribution
import breeze.linalg.{diag, eigSym, max, DenseMatrix => BDM, DenseVector => BDV, Vector => BV} import breeze.linalg.{diag, eigSym, max, DenseMatrix => BDM, DenseVector => BDV, Vector => BV}
import org.apache.spark.annotation.{DeveloperApi, Since}
import org.apache.spark.ml.impl.Utils import org.apache.spark.ml.impl.Utils
import org.apache.spark.ml.linalg.{Matrices, Matrix, Vector, Vectors} import org.apache.spark.ml.linalg.{Matrices, Matrix, Vector, Vectors}
...@@ -32,9 +33,11 @@ import org.apache.spark.ml.linalg.{Matrices, Matrix, Vector, Vectors} ...@@ -32,9 +33,11 @@ import org.apache.spark.ml.linalg.{Matrices, Matrix, Vector, Vectors}
* @param mean The mean vector of the distribution * @param mean The mean vector of the distribution
* @param cov The covariance matrix of the distribution * @param cov The covariance matrix of the distribution
*/ */
class MultivariateGaussian( @Since("2.0.0")
val mean: Vector, @DeveloperApi
val cov: Matrix) extends Serializable { class MultivariateGaussian @Since("2.0.0") (
@Since("2.0.0") val mean: Vector,
@Since("2.0.0") val cov: Matrix) extends Serializable {
require(cov.numCols == cov.numRows, "Covariance matrix must be square") require(cov.numCols == cov.numRows, "Covariance matrix must be square")
require(mean.size == cov.numCols, "Mean vector length must match covariance matrix size") require(mean.size == cov.numCols, "Mean vector length must match covariance matrix size")
...@@ -56,6 +59,7 @@ class MultivariateGaussian( ...@@ -56,6 +59,7 @@ class MultivariateGaussian(
/** /**
* Returns density of this multivariate Gaussian at given point, x * Returns density of this multivariate Gaussian at given point, x
*/ */
@Since("2.0.0")
def pdf(x: Vector): Double = { def pdf(x: Vector): Double = {
pdf(x.toBreeze) pdf(x.toBreeze)
} }
...@@ -63,6 +67,7 @@ class MultivariateGaussian( ...@@ -63,6 +67,7 @@ class MultivariateGaussian(
/** /**
* Returns the log-density of this multivariate Gaussian at given point, x * Returns the log-density of this multivariate Gaussian at given point, x
*/ */
@Since("2.0.0")
def logpdf(x: Vector): Double = { def logpdf(x: Vector): Double = {
logpdf(x.toBreeze) logpdf(x.toBreeze)
} }
......
...@@ -64,7 +64,7 @@ class MultivariateGaussian @Since("1.3.0") ( ...@@ -64,7 +64,7 @@ class MultivariateGaussian @Since("1.3.0") (
/** /**
* Returns density of this multivariate Gaussian at given point, x * Returns density of this multivariate Gaussian at given point, x
*/ */
@Since("1.3.0") @Since("1.3.0")
def pdf(x: Vector): Double = { def pdf(x: Vector): Double = {
pdf(x.toBreeze) pdf(x.toBreeze)
} }
...@@ -72,7 +72,7 @@ class MultivariateGaussian @Since("1.3.0") ( ...@@ -72,7 +72,7 @@ class MultivariateGaussian @Since("1.3.0") (
/** /**
* Returns the log-density of this multivariate Gaussian at given point, x * Returns the log-density of this multivariate Gaussian at given point, x
*/ */
@Since("1.3.0") @Since("1.3.0")
def logpdf(x: Vector): Double = { def logpdf(x: Vector): Double = {
logpdf(x.toBreeze) logpdf(x.toBreeze)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment