8000 [MRG] Minor doc fixes to coordinate_descent.py by NicolasHug · Pull Request #11737 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] Minor doc fixes to coordinate_descent.py #11737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 7, 2018

Conversation

NicolasHug
Copy link
Member
@NicolasHug NicolasHug commented Aug 2, 2018

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Minor doc changes to use latex instead of plain text math equations.

Minor doc changes to remove latex in docstrings + small fix for Frobenius norm index

Any other comments?

Copy link
Member
@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

For docstrings, we value readability in plain text. I much prefer what we have there.

@jnothman
Copy link
Member
jnothman commented Aug 2, 2018

I think the numpydoc spec says something similar

@NicolasHug
Copy link
Member Author
NicolasHug 8000 commented Aug 2, 2018

Oh OK, I wasn't aware of that.

May I still suggest the following changes?

||W||_21 = \\sum_i \\sqrt{\\sum_j w_{ij}^2} -> ||W||_21 = sum_i sqrt{sum_j w_{ij}^2}
and
||Y - XW||^Fro_2 -> ||Y - XW||_Fro^2

@jnothman
Copy link
Member
jnothman commented Aug 3, 2018 via email

@agramfort
Copy link
Member

this has been discussed in the past. Using non-latex in docstring (not narrative doc)
makes it easier to read from a terminal/notebook.

I would not change this.

my 2c

Removed pseudo latex notation and fixed Fro norm indication
@NicolasHug NicolasHug changed the title [MRG] Used latex in ElasticNet doc [MRG] Minor doc fixes to coordinate_descent.py Aug 3, 2018
@NicolasHug
Copy link
Member Author

I just committed the above proposed changes and changes this PR's title.

@@ -1612,13 +1612,13 @@ class MultiTaskElasticNet(Lasso):

The optimization objective for MultiTaskElasticNet is::

(1 / (2 * n_samples)) * ||Y - XW||^Fro_2
(1 / (2 * n_samples)) * ||Y - XW||_Fro^2
Copy link
Member

Choose a reason for hiding this comment

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

+1 for this one, I think it's an error

+ alpha * l1_ratio * ||W||_21
+ 0.5 * alpha * (1 - l1_ratio) * ||W||_Fro^2

Where::

||W||_21 = \\sum_i \\sqrt{\\sum_j w_{ij}^2}
||W||_21 = sum_i sqrt(sum_j w_ij ^ 2)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe -1 for this one. It seems not friendly to latex users. More importantly, it's not consistent with other parts of the doc (e.g., MultiTaskLasso).

Copy link
Member Author

Choose a reason for hiding this comment

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

The comments above suggest that docstrings should not contain any latex.

Copy link
Member

Choose a reason for hiding this comment

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

I won't be too strict on these minor issues.

@qinhanmin2014 qinhanmin2014 merged commit aa7a6fc into scikit-learn:master Aug 7, 2018
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.

4 participants
0