Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/3603#discussion_r21582552 --- Diff: python/pyspark/mllib/feature.py --- @@ -220,12 +220,15 @@ def transform(self, dataset): the terms which occur in fewer than `minDocFreq` documents will have an entry of 0. - :param dataset: an RDD of term frequency vectors - :return: an RDD of TF-IDF vectors + :param data: an RDD of term frequency vectors or a term frequency vector + :return: an RDD of TF-IDF vectors or a TF-IDF vector """ - if not isinstance(dataset, RDD): + if isinstance(data, RDD): + return JavaVectorTransformer.transform(self, data) + elif isinstance(data, Vector): --- End diff -- It might be good to support native Python vector/array types, as in pyspark's LogisticRegressionModel.predict method in classification.py
--- 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