Skip to content

[SPARK-11940][PYSPARK][ML] Python API for ml.clustering.LDA - #10242

Closed
zjffdu wants to merge 4 commits into
apache:masterfrom
zjffdu:SPARK-11940
Closed

[SPARK-11940][PYSPARK][ML] Python API for ml.clustering.LDA#10242
zjffdu wants to merge 4 commits into
apache:masterfrom
zjffdu:SPARK-11940

Conversation

@zjffdu

Copy link
Copy Markdown
Contributor

Besides this issue, also fix another in issue in python/pyspark/init.py (should provide more informative message when no doc is defined but since annotation is added.

@SparkQA

Copy link
Copy Markdown

Test build #47480 has finished for PR 10242 at commit 792b883.

  • This patch fails Python style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@SparkQA

Copy link
Copy Markdown

Test build #47483 has finished for PR 10242 at commit 5b5f091.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@SparkQA

Copy link
Copy Markdown

Test build #47573 has finished for PR 10242 at commit 9c2bf31.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@zjffdu

Copy link
Copy Markdown
ContributorAuthor

@yanboliang Could you help review it ?

Comment threadpython/pyspark/ml/clustering.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add \ at the end of each line, otherwise it can not generate API doc correctly.
typo: ssetParams -> setParams

@zjffdu

Copy link
Copy Markdown
ContributorAuthor

@yanboliang Push another commit to address the comments. BTW, for the unit test, I will get different result if I use python2.7, is it expected ?

@SparkQA

Copy link
Copy Markdown

Test build #47788 has finished for PR 10242 at commit d189853.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@SparkQA

Copy link
Copy Markdown

Test build #47790 has finished for PR 10242 at commit ebf5e35.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@SparkQA

Copy link
Copy Markdown

Test build #47797 has finished for PR 10242 at commit bef9c91.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@SparkQA

Copy link
Copy Markdown

Test build #47801 has finished for PR 10242 at commit 592f50b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * class LDAModel(JavaModel):\n * class DistributedLDAModel(LDAModel):\n * class LocalLDAModel(LDAModel):\n * class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):\n

@mengxr

Copy link
Copy Markdown
Contributor

@zjffdu Sorry for slow response! @zjffdu Could you update since versions in this PR and address @yanboliang 's comment? Next version will be 2.0.0 instead of 1.7.0.

@yanboliang Could you make another pass after the update? Thanks!

@zjffdu

Copy link
Copy Markdown
ContributorAuthor

Sorry for late response, I will update this PR in the next following days.

@SparkQA

Copy link
Copy Markdown

Test build #52180 has finished for PR 10242 at commit b27c275.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class LDAModel(JavaModel):
    • class DistributedLDAModel(LDAModel):
    • class LocalLDAModel(LDAModel):
    • class LDA(JavaEstimator, HasFeaturesCol, HasMaxIter, HasSeed, HasCheckpointInterval):

Comment threadpython/pyspark/ml/clustering.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we usually make the next line start with ..., you can refer here.

@SparkQA

Copy link
Copy Markdown

Test build #52277 has finished for PR 10242 at commit e8723db.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Comment threadpython/pyspark/ml/clustering.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also expose estimatedDocConcentration for LDAModel?

@SparkQA

Copy link
Copy Markdown

Test build #56318 has finished for PR 10242 at commit 16ea17d.

  • This patch fails Python style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #56323 has finished for PR 10242 at commit 372d5a5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yanboliang

Copy link
Copy Markdown
Contributor

@zjffdu Please update this PR according the change at #11663 for type conversion and #11939 for param setters using _set method.

Comment threadpython/pyspark/__init__.py Outdated
indent_p = re.compile(r'\n( +)')

def deco(f):
if not f.__doc__:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea, but can you please do it in a separate PR? This is a broad change, so separating it out would be helpful (in case of conflicts, etc.).

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create SPARK-14834 for this.

@jkbradley

Copy link
Copy Markdown
Member

@zjffdu thanks for the updates! Btw, can you please add the "[ML]" tag to the PR title?

@jkbradley

Copy link
Copy Markdown
Member

One more high-level request: Could you please add persistence to this? I'd like to start adding persistence to Python wrappers immediately since we now have full Python coverage. You should be able to extend MLReadable, MLWritable and add a simple test.

Comment threadpython/pyspark/ml/clustering.py Outdated

@since("2.0.0")
def vocabSize(self):
"""Vocabulary size (number of terms or terms in the vocabulary)"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"terms or terms" must be a mistake from a search-and-replace. I bet it's supposed to be "terms or words"
Could you fix that here and in the Scala doc too please?

@zjffduzjffdu changed the title [SPARK-11940][PYSPARK] Python API for ml.clustering.LDA[SPARK-11940][PYSPARK][ML] Python API for ml.clustering.LDAApr 22, 2016
@jkbradley

Copy link
Copy Markdown
Member

@zjffdu Do you mind if I take over this PR? I'd really like to get this API in for 2.0. You'll still be the primary author on the commit.

@zjffdu

Copy link
Copy Markdown
ContributorAuthor

@jkbradley I made some update based your comments before, but don't have time to implement the model persistence feature. Please take over this PR.

@SparkQA

Copy link
Copy Markdown

Test build #57050 has finished for PR 10242 at commit 2b2bafe.

  • This patch fails Python style tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@jkbradley

Copy link
Copy Markdown
Member

OK thanks! I'll update it

@jkbradley

Copy link
Copy Markdown
Member

Thanks, I did the rebase and updated it. It's in this new PR: [https://github.com//pull/12723]

Could you please close this issue, and if you have time take a look at the new PR? Thanks!

@zjffduzjffdu closed this Apr 27, 2016
asfgit pushed a commit that referenced this pull request Apr 29, 2016
## What changes were proposed in this pull request?
pyspark.ml API for LDA
* LDA, LDAModel, LocalLDAModel, DistributedLDAModel
* includes persistence
This replaces [#10242]
## How was this patch tested?
* doc test for LDA, including Param setters
* unit test for persistence
Author: Joseph K. Bradley <joseph@databricks.com>
Author: Jeff Zhang <zjffdu@apache.org>
Closes#12723 from jkbradley/zjffdu-SPARK-11940.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@zjffdu@SparkQA@mengxr@yanboliang@jkbradley