JuliaStats / GLM.jl

Generalized linear models in Julia
Other
584 stars 114 forks source link

fix predict docstring and remove trailing dim #467

Closed piever closed 2 years ago

piever commented 2 years ago

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.

nalimilan commented 2 years ago

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 commented 2 years ago

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.

nalimilan commented 2 years ago

Let's merge this and https://github.com/JuliaStats/GLM.jl/pull/458 and then tag 1.7.0.

piever commented 2 years ago

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

codecov-commenter commented 2 years ago

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.