Github user mpetruska commented on a diff in the pull request: https://github.com/apache/spark/pull/19659#discussion_r149690477 --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/NGram.scala --- @@ -42,11 +42,22 @@ class NGram @Since("1.5.0") (@Since("1.5.0") override val uid: String) /** * Minimum n-gram length, greater than or equal to 1. + * All values of m such that n <= m <= maxN will be used. * Default: 2, bigram features * @group param */ @Since("1.5.0") - val n: IntParam = new IntParam(this, "n", "number elements per n-gram (>=1)", + val n: IntParam = new IntParam(this, "n", "minimum number of elements per n-gram (>=1)", + ParamValidators.gtEq(1)) + + /** + * Maximum n-gram length, greater than or equal to `n`. + * All values of m such that n <= m <= maxN will be used. + * Default: 2, bigram features + * @group param + */ + @Since("From which version?") + val maxN: IntParam = new IntParam(this, "maxN", "maximum number elements per n-gram (>=n)", --- End diff -- Added explanation in the scaladoc comment for the case when `maxN` is not set. The default is set to 2 here: https://github.com/apache/spark/pull/19659
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org