Skip to content

Commit e30a100

Browse files
committed
Made mu, sigma private[mllib] members of MultivariateGaussian
Moved MultivariateGaussian (and test suite) from stat.impl to stat.distribution (required updates in GaussianMixture{EM,Model}.scala) Marked MultivariateGaussian as @DeveloperAPI Fixed style error
1 parent 9fa3bb7 commit e30a100

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureEM.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import scala.collection.mutable.IndexedSeq
2222
import breeze.linalg.{DenseVector => BreezeVector, DenseMatrix => BreezeMatrix, diag, Transpose}
2323
import org.apache.spark.rdd.RDD
2424
import org.apache.spark.mllib.linalg.{Matrices, Vector, Vectors}
25-
import org.apache.spark.mllib.stat.impl.MultivariateGaussian
25+
import org.apache.spark.mllib.stat.distribution.MultivariateGaussian
2626
import org.apache.spark.mllib.util.MLUtils
2727

2828
/**

mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import breeze.linalg.{DenseVector => BreezeVector}
2121

2222
import org.apache.spark.rdd.RDD
2323
import org.apache.spark.mllib.linalg.{Matrix, Vector}
24-
import org.apache.spark.mllib.stat.impl.MultivariateGaussian
24+
import org.apache.spark.mllib.stat.distribution.MultivariateGaussian
2525
import org.apache.spark.mllib.util.MLUtils
2626

2727
/**

mllib/src/main/scala/org/apache/spark/mllib/stat/impl/MultivariateGaussian.scala renamed to mllib/src/main/scala/org/apache/spark/mllib/stat/distribution/MultivariateGaussian.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.mllib.stat.impl
18+
package org.apache.spark.mllib.stat.distribution
1919

2020
import breeze.linalg.{DenseVector => DBV, DenseMatrix => DBM, diag, max, eigSym}
2121

22-
import org.apache.spark.mllib.linalg.{ Vectors, Vector, Matrices, Matrix }
22+
import org.apache.spark.mllib.linalg.{Vectors, Vector, Matrices, Matrix}
2323
import org.apache.spark.mllib.util.MLUtils
24+
import org.apache.spark.annotation.DeveloperApi;
2425

2526
/**
2627
* This class provides basic functionality for a Multivariate Gaussian (Normal) Distribution. In
@@ -31,9 +32,10 @@ import org.apache.spark.mllib.util.MLUtils
3132
* @param mu The mean vector of the distribution
3233
* @param sigma The covariance matrix of the distribution
3334
*/
35+
@DeveloperApi
3436
class MultivariateGaussian private[mllib] (
35-
val mu: DBV[Double],
36-
val sigma: DBM[Double]) extends Serializable {
37+
private[mllib] val mu: DBV[Double],
38+
private[mllib] val sigma: DBM[Double]) extends Serializable {
3739

3840
require(sigma.cols == sigma.rows, "Covariance matrix must be square")
3941
require(mu.length == sigma.cols, "Mean vector length must match covariance matrix size")

mllib/src/test/scala/org/apache/spark/mllib/stat/impl/MultivariateGaussianSuite.scala renamed to mllib/src/test/scala/org/apache/spark/mllib/stat/distribution/MultivariateGaussianSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.mllib.stat.impl
18+
package org.apache.spark.mllib.stat.distribution
1919

2020
import org.scalatest.FunSuite
2121

0 commit comments

Comments
 (0)