Skip to content
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

Add docstrings! #26

Merged
merged 41 commits into from
Jun 14, 2022
Merged

Add docstrings! #26

merged 41 commits into from
Jun 14, 2022

Conversation

josephsdavid
Copy link
Contributor

@josephsdavid josephsdavid commented May 23, 2022

Week one of GSOD work! in service of #25 and #913

@ablaom
Copy link
Member

ablaom commented May 23, 2022

There is no need to document any methods in MLJ interface code. The focus in JuliaAI/MLJ.jl#913 is on documenting the model types and that's where all documentation goes. While Julia is not OO, in this case we are kind of organising the documentation as if it were, and so a model docstring here looks a bit like an estimator docstring in sk-learn.

As you can see from the DecisionTree.jl example, if a model implements predict, then that is mentioned in the model docstring under "Operations". Similarly the output of fitted_params and report are also documented in the model doc-string.

All possible operations are listed here for example. The operations predict_mean and predict_mode and predict_median have fallbacks that call predict and are rarely overloaded by an interface. Every probabilistic classifier implements predict but gets predict_mode for free, so that is added to the docs, like in the DecisionTree.jl example.

@ablaom ablaom mentioned this pull request May 23, 2022
5 tasks
@codecov-commenter
Copy link

codecov-commenter commented May 30, 2022

Codecov Report

Merging #26 (c96ddf0) into dev (c496abe) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev      #26   +/-   ##
=======================================
  Coverage   94.44%   94.44%           
=======================================
  Files           1        1           
  Lines          90       90           
=======================================
  Hits           85       85           
  Misses          5        5           
Impacted Files Coverage Δ
src/MLJGLMInterface.jl 94.44% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c496abe...c96ddf0. Read the comment docs.

src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
@ablaom
Copy link
Member

ablaom commented May 30, 2022

I've finished reviewing LinearRegressor. Nice example.

@josephsdavid
Copy link
Contributor Author

josephsdavid commented May 31, 2022

I've finished reviewing LinearRegressor. Nice example.

Woohoo! I should have linear classification and count regression knocked out soon, just working out these examples!

josephsdavid and others added 11 commits May 30, 2022 20:50
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Still need example for count regressor, and the usual fitted params et. al.
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
@ablaom
Copy link
Member

ablaom commented May 31, 2022

@josephsdavid Very embarrassing, but I wrote "marginal" when I meant "conditional" in my suggestions for the intro docstrings. I've edited them accordingly. 😳

josephsdavid and others added 7 commits June 4, 2022 00:48
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
Copy link
Member

@ablaom ablaom left a comment

Choose a reason for hiding this comment

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

It still looks like we need to check consistency of item line beginnings (lower case?) and endings (no period?)

src/MLJGLMInterface.jl Outdated Show resolved Hide resolved
josephsdavid and others added 8 commits June 13, 2022 17:16
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>
@ablaom ablaom merged commit cb21591 into JuliaAI:dev Jun 14, 2022
ablaom added a commit that referenced this pull request Jun 14, 2022
* reformat code to adhere to bluestyle format (no logical changes made)

* replace  macro with  macro and drop Parameters.jl dependency

* Update ci.yml

* Add docstrings! (#26)

* add docstring skeletons

* blue compliance

* linear regression done?

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Add LinearBinaryClassifier

Still need example for count regressor, and the usual fitted params et. al.

* update docs with suggested header

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* resolve scitype issue

* fix more scitype issues

* formatting and details

* more scitypes

* add count regression example

* marginal -> conditional

* cleanup

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* see also fix

* scitype fix

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* drop regressor wiki

* touch up

* tidied up

* add crabs and consistent capitalizations/punctuations

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* Update src/MLJGLMInterface.jl

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

* cleaned up

Co-authored-by: Anthony Blaom, PhD <anthony.blaom@gmail.com>

Co-authored-by: OkonSamuel <okonsamuel50@gmail.com>
Co-authored-by: Okon Samuel <39421418+OkonSamuel@users.noreply.github.com>
Co-authored-by: David Josephs <42522233+josephsdavid@users.noreply.github.com>
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.

3 participants