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

fix predict docstring and remove trailing dim #467

Merged
merged 3 commits into from
Apr 9, 2022

Conversation

piever
Copy link
Contributor

@piever piever commented Jan 24, 2022

This PR fixes the docstring of predict(::LinearModel, x; interval, level), which claimed to return a matrix with 3 columns, whereas it is actually a named tuple with three fields (prediction, lower, upper).

It also fixes the types of the returned lower and upper. Previously, prediction was a vector (IMO, the correct shape), whereas lower and upper were N x 1 matrices (IMO, the incorrect shape). Now, all three are vectors.

@palday palday requested a review from nalimilan February 4, 2022 19:57
@nalimilan
Copy link
Member

Thanks. The docstring fix is fine, but I'm afraid changing the return type would be breaking so we should wait until 2.0.

@piever
Copy link
Contributor Author

piever commented Feb 8, 2022

I'm afraid changing the return type would be breaking so we should wait until 2.0.

I see your point, but I am not sure it is so clear cut. Is there a way that we could verify whether this change breaks any downstream package?

Even though it is possible, it seems unlikely to me that changing from N x 1 matrix to vector would break code in practice. If we can test that this does not cause breakage in packages that depend on GLM, could it be done for the 1.7 release?

Otherwise, it seems overly laborious to change now the docstring to document the (IMO incorrect) return type, add a milestone to not forget about this, and then come back to it and update code and docstring.

Project.toml Outdated Show resolved Hide resolved
@nalimilan
Copy link
Member

Let's merge this and #458 and then tag 1.7.0.

@piever
Copy link
Contributor Author

piever commented Apr 9, 2022

Thanks for accepting the change! I've rebased and force-pushed to fix the conflicts (on the Project.toml file).

@codecov-commenter
Copy link

Codecov Report

Merging #467 (c8542c2) into master (a3253b0) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #467   +/-   ##
=======================================
  Coverage   84.12%   84.12%           
=======================================
  Files           7        7           
  Lines         819      819           
=======================================
  Hits          689      689           
  Misses        130      130           
Impacted Files Coverage Δ
src/lm.jl 96.06% <100.00%> (ø)

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 67fdc43...c8542c2. Read the comment docs.

@nalimilan nalimilan merged commit b52461f into JuliaStats:master Apr 9, 2022
@piever piever deleted the pv/vec branch April 9, 2022 20:34
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