Github user dbtsai commented on a diff in the pull request: https://github.com/apache/spark/pull/9180#discussion_r43417836 --- Diff: mllib/src/main/scala/org/apache/spark/mllib/util/LinearDataGenerator.scala --- @@ -104,7 +103,35 @@ object LinearDataGenerator { nPoints: Int, seed: Int, eps: Double): Seq[LabeledPoint] = { + generateLinearInputInternal(intercept, weights, xMean, xVariance, nPoints, seed, eps, 0.0) + } + + /** + * @param intercept Data intercept + * @param weights Weights to be applied. + * @param xMean the mean of the generated features. Lots of time, if the features are not properly + * standardized, the algorithm with poor implementation will have difficulty + * to converge. + * @param xVariance the variance of the generated features. + * @param nPoints Number of points in sample. + * @param seed Random seed + * @param eps Epsilon scaling factor. + * @param sparcity The ratio of zero elements. If it is 0.0, LabeledPoints with + * DenseVector is returned. + * @return Seq of input. + */ + @Since("1.6.0") + def generateLinearInputInternal( + intercept: Double, + weights: Array[Double], + xMean: Array[Double], + xVariance: Array[Double], + nPoints: Int, + seed: Int, + eps: Double, + sparcity: Double): Seq[LabeledPoint] = { + require(sparcity <= 1.0) --- End diff -- What `sparsity == 0.0` means? All zeros?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org