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

LMF reports the same predictions for newdata #1481

Open
jzhdzw opened this issue Jan 25, 2025 · 1 comment
Open

LMF reports the same predictions for newdata #1481

jzhdzw opened this issue Jan 25, 2025 · 1 comment

Comments

@jzhdzw
Copy link

jzhdzw commented Jan 25, 2025

When I use the LMF to predict the slopes hk(x) for new data, the prediction is the same for all samples, which should differ for different x.

@jzhdzw
Copy link
Author

jzhdzw commented Jan 28, 2025

#train linear model forest
lmf <- lm_forest(iv_x.s16, sch_exp.s16, iv_w.s16)
#prediction for section 16
tau.hat.s16 <- predict(lmf)$predictions
#make it 2D instead of 3D
tau.hat.s16 <- drop(tau.hat.s16)
#prediction for non section 16
tau.hat.ns16 <- predict(lmf, newdata=iv_x.ns16)$predictions
tau.hat.ns16 <- drop(tau.hat.ns16)

The predictions for non section 16 are the same for all observations though they have different x

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