Skip to content

Conversation

@vijaykiran
Copy link
Contributor

Updates the param descriptions in python mllib's classification.py to be consistent. See [SPARK-11219] for more
details.

Copy link
Member

Choose a reason for hiding this comment

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

remove blank lines here, and around other "Allowed values"

@BryanCutler
Copy link
Member

thanks @vijaykiran! I marked a few things for correction and I think in general we should extend the comments to the 100 character limit where applicable.

Copy link
Member

Choose a reason for hiding this comment

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

nit: no period after the ending parenthesis in default line

@vijaykiran
Copy link
Contributor Author

@BryanCutler Thanks for the review, I added a new commit - will review update other two PRs with 100 fill-column as well.

Do you prefer a squashed commit ?

@BryanCutler
Copy link
Member

LGTM. It's not necessary to squash commits, but could you update the PR title/description to indicate that this is for PySpark MLlib classification?

ping @jkbradley @mengxr

@vijaykiran vijaykiran changed the title [SPARK-12630][DOC] Update param descriptions [SPARK-12630][Python][MLib][DOC] Update param descriptions Jan 7, 2016
@vijaykiran vijaykiran changed the title [SPARK-12630][Python][MLib][DOC] Update param descriptions [SPARK-12630][Python][MLlib][DOC] Update param descriptions Jan 7, 2016
@jkbradley
Copy link
Member

I just added a note to the parent JIRA about a formatting issue affecting all 5 PRs: [https://issues.apache.org/jira/browse/SPARK-11219?focusedCommentId=15090225&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15090225]
Could you please check it out & ping when I should review again? Thank you!

@BryanCutler
Copy link
Member

Hi @vijaykiran , will you be able to update the param descriptions to be only up to 74 character limit? Sorry for the mixup, but I think this should be mergable after that.

@vijaykiran vijaykiran force-pushed the master branch 2 times, most recently from 178d0b3 to 517421d Compare January 22, 2016 14:08
@vijaykiran
Copy link
Contributor Author

ping @BryanCutler - Updated the param descriptions, can you take a look ?

@BryanCutler
Copy link
Member

I viewed in pydoc with a window size of 80 and LGTM, cc @jkbradley to take a look. Thanks @vijaykiran!

Copy link
Member

Choose a reason for hiding this comment

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

This line is over the 74 char limit

@BryanCutler
Copy link
Member

@vijaykiran , I missed one line that is a bit too long, could you please fix that, otherwise LGTM

Updates the `param` descriptions consistent. See [SPARK-11219] for more
details.
- Style fixes based on review comments by @BryanCutler.
- Changed fill-column to 100 instead of 80.
@vijaykiran vijaykiran changed the title [SPARK-12630][Python][MLlib][DOC] Update param descriptions [SPARK-12630][Python][MLlib][DOC] Update param descriptions in classification.py Jan 23, 2016
@vijaykiran
Copy link
Contributor Author

ping @BryanCutler @jkbradley - can you guys please take a look again?

@BryanCutler
Copy link
Member

LGTM

@mengxr
Copy link
Contributor

mengxr commented Jan 25, 2016

@vijaykiran @BryanCutler Please run make html under python/docs and check the warning messages. This is what I got:

/Users/meng/src/spark/python/pyspark/mllib/classification.py:docstring of pyspark.mllib.classification.LogisticRegressionWithSGD.train:23: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/classification.py:docstring of pyspark.mllib.classification.LogisticRegressionWithSGD.train:26: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/classification.py:docstring of pyspark.mllib.classification.LogisticRegressionWithLBFGS.train:17: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/classification.py:docstring of pyspark.mllib.classification.LogisticRegressionWithLBFGS.train:20: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/classification.py:docstring of pyspark.mllib.classification.SVMWithSGD.train:23: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/classification.py:docstring of pyspark.mllib.classification.SVMWithSGD.train:26: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.LinearRegressionWithSGD:3: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.LinearRegressionWithSGD:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.RidgeRegressionWithSGD:3: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.RidgeRegressionWithSGD:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.LassoWithSGD:3: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.LassoWithSGD:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.IsotonicRegression:7: ERROR: Unexpected indentation.
/Users/meng/src/spark/python/pyspark/mllib/regression.py:docstring of pyspark.mllib.regression.IsotonicRegression:12: ERROR: Unexpected indentation.

Please test the other two PRs as well. Thanks!

@vijaykiran
Copy link
Contributor Author

@mengxr thanks, will take a look today

@mengxr
Copy link
Contributor

mengxr commented Jan 25, 2016

@vijaykiran Thanks! Please ignore the warnings from regression.py. That will be addressed in https://issues.apache.org/jira/browse/SPARK-12986.

@mengxr
Copy link
Contributor

mengxr commented Jan 27, 2016

ok to test

@SparkQA
Copy link

SparkQA commented Jan 27, 2016

Test build #50152 has finished for PR 10598 at commit bf8f8a0.

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

@mengxr
Copy link
Contributor

mengxr commented Feb 2, 2016

@vijaykiran Could you fix the doc warnings in classification.py? Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

It looks like we have a problem with the formatting of this param. If we want the html to look the same and get rid of any warnings, then I think it has to be written like this

:param regType:
  The type of regularizer used for training our model.

  :Allowed values:
    - "l1" for using L1 regularization
    - "l2" for using L2 regularization
    - None for no regularization

  (default: "l2")

which, I think, looks ugly in the code and not even that great in the html. Alternatively, we could rewrite it inline similar to how some other params have it, like this

:param regType:
  The type of regularizer used for training our model.
  Allowed values: "l1" for using L1 regularization;
  "l2" for using L2 regularization; None for no
  regularization.
  (default: "l2")

Not perfect, but both code and html look decent, imho.
@mengxr , would you be ok with the second inline format?

Copy link
Contributor

Choose a reason for hiding this comment

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

The first one looks better but no strong preference. I tried the following that also works:

        :param regType:
          The type of regularizer used for training our model.
          Allowed values:

            - "l1" for using L1 regularization
            - "l2" for using L2 regularization (default)
            - None for no regularization

Note Allow values is not a Sphinx keyword.

Copy link
Member

Choose a reason for hiding this comment

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

It's not a huge deal so I'm ok with either, but my issue with the additional blank lines is that in the context of the already large param list, the extra blank lines seem like a little much and the rendered html looks sloppy to me too. Since I noticed other parts describing allowed values in a single paragraph, I thought maybe we should stick to that.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we use :Allowed values:, it shows up as :Allowed values: in html, which is weird. We should change existing ones instead of repeating the mistakes, in a separate PR. I don't think the rendered html changes due to that additional blank line. It is just control by top margin of a list, which could be configured via CSS. This is how it looks in html for my proposal, which looks good to me:

screen shot 2016-02-11 at 2 21 41 pm

Let's quickly fix this one and merge this PR.

Copy link
Member

Choose a reason for hiding this comment

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

I believe that :Allowed values: would need to be preceded by a blank line for Sphinx to interpret it in bold like before, but I don't think that needs to be done here. What @mengxr proposed above looks fine with me too.

@vijaykiran , will you be able to make this fix soon? I could take over and finish this last little bit if you can't.

@BryanCutler
Copy link
Member

Thanks for working on this @vijaykiran , I finished up the remaining fix in #11183 so please close this one up.
cc @mengxr

@mengxr
Copy link
Contributor

mengxr commented Feb 12, 2016

@vijaykiran I merged #11183 into master. Do you mind closing this PR? Thanks!

Sign up for free to 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