zhengruifeng commented on code in PR #50013: URL: https://github.com/apache/spark/pull/50013#discussion_r1970735576
########## mllib/src/main/scala/org/apache/spark/ml/classification/FMClassifier.scala: ########## @@ -235,6 +236,13 @@ class FMClassifier @Since("3.0.0") ( model.setSummary(Some(summary)) } + override def estimateModelSize(dataset: Dataset[_]): Long = { + val numFeatures = DatasetUtils.getNumFeatures(dataset, $(featuresCol)) Review Comment: DatasetUtils.getNumFeatures is quite cheap, it will try to fetch `numFeatures` from the metadata, and if there is no such metadata, it just infer the `numFeatures` from the first row. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org