Skip to content

Commit 5672d13

Browse files
committed
exact threshold
1 parent 51a237b commit 5672d13

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ class GaussianMixture @Since("2.0.0") (
491491
@Since("2.0.0")
492492
object GaussianMixture extends DefaultParamsReadable[GaussianMixture] {
493493

494-
/** Limit number of features such that numFeatures^2^ < Integer.MaxValue */
495-
private[clustering] val MAX_NUM_FEATURES = 46000
494+
/** Limit number of features such that numFeatures^2^ < Int.MaxValue */
495+
private[clustering] val MAX_NUM_FEATURES = math.sqrt(Int.MaxValue).toInt
496496

497497
@Since("2.0.0")
498498
override def load(path: String): GaussianMixture = super.load(path)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ class GaussianMixture private (
278278

279279
private[clustering] object GaussianMixture {
280280

281-
/** Limit number of features such that numFeatures^2^ < Integer.MaxValue */
282-
private[clustering] val MAX_NUM_FEATURES = 46000
281+
/** Limit number of features such that numFeatures^2^ < Int.MaxValue */
282+
private[clustering] val MAX_NUM_FEATURES = math.sqrt(Int.MaxValue).toInt
283283

284284
/**
285285
* Heuristic to distribute the computation of the `MultivariateGaussian`s, approximately when

0 commit comments

Comments
 (0)