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

allow predicting from a single observation #653

Merged
merged 10 commits into from Oct 14, 2022
Merged

allow predicting from a single observation #653

merged 10 commits into from Oct 14, 2022

Conversation

palday
Copy link
Member

@palday palday commented Oct 12, 2022

closes #625

  • add entry in NEWS.md
  • after opening this PR, add a reference and run docs/NEWS-update.jl to update the cross-references.
  • I've bumped the version appropriately

src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Base: 94.23% // Head: 94.23% // No change to project coverage 👍

Coverage data is based on head (92af160) compared to base (a7d6eb3).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #653   +/-   ##
=======================================
  Coverage   94.23%   94.23%           
=======================================
  Files          29       29           
  Lines        2795     2795           
=======================================
  Hits         2634     2634           
  Misses        161      161           
Impacted Files Coverage Δ
src/grouping.jl 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@kleinschmidt kleinschmidt left a comment

Choose a reason for hiding this comment

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

given that the Grouping struct itself doesn't keep track of the levels, I think all the validation stuff can just be skipped altogether. also, would it break anything to just remove the termnames/contrasts_matrix methods altogether? I think the only place they get used is in these constructors...

src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
Co-authored-by: Dave Kleinschmidt <dave.f.kleinschmidt@gmail.com>
src/grouping.jl Outdated Show resolved Hide resolved
src/grouping.jl Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@kleinschmidt kleinschmidt left a comment

Choose a reason for hiding this comment

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

love 2 delete code.

src/grouping.jl Outdated
Comment on lines 25 to 26
StatsModels.contrasts_matrix(::Grouping, baseind, n) = zeros(0, 0)
StatsModels.termnames(::Grouping, levels::AbstractVector, baseind::Integer) = levels
# StatsModels.contrasts_matrix(::Grouping, baseind, n) = error("Grouping terms don't have associated contrasts")
# StatsModels.termnames(::Grouping, levels::AbstractVector, baseind::Integer) = levels
Copy link
Member

Choose a reason for hiding this comment

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

probably better to just clean up this cruft, OR leave the methods as they were before with a note that they're probably not needed since we've added a direct constructor for ContrastsMatrix

src/grouping.jl Outdated Show resolved Hide resolved
palday and others added 2 commits October 14, 2022 03:32
Co-authored-by: Dave Kleinschmidt <dave.f.kleinschmidt@gmail.com>
@palday palday merged commit 0ffbaa5 into main Oct 14, 2022
@palday palday deleted the pa/predfromsingle branch October 14, 2022 05:13
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.

Predict: only one level found
2 participants