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

Error in predict() with just a constant term #557

Open
RobertGregg opened this issue May 3, 2024 · 0 comments
Open

Error in predict() with just a constant term #557

RobertGregg opened this issue May 3, 2024 · 0 comments

Comments

@RobertGregg
Copy link

using GLM
using DataFrames

df1 = DataFrame(y = rand(10))
df2 = DataFrame(y = rand(10))

model = lm(@formula(y~1),df1)

y = predict(model,df2)

Gives the following error:
ERROR: ArgumentError: collection must be non-empty

I realize this is a weird edge case, but I think it should just return mean(df1.y) for each prediction.

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

No branches or pull requests

1 participant