-
Notifications
You must be signed in to change notification settings - Fork 43
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
Would it make sense to work directly with Tidymodel objects of class model_fit
#236
Comments
Yes, it make sense and you can propose a pull request... but you must take care to avoid increasing the list of (indirect) package dependencies. We try to keep this list as low as possible for obvious reasons. I am not in favor of even a suggests to {tidymodels} in DESCRIPTION, due to the very large number of indirect hard dependencies (95 packages for {tidymodels}), even if some are already dependencies of {broom} obviously.
So you should basically provide a method for the generic |
Thanks for the feedback! My testing suggests that all that is needed is to add these lines at the top of
At the least, this solves my problem, keeps all the current tests passing, and does not require any new packages. Would something like this be OK for the PR, or do we really need a new method? |
No, not really. You have to write a proper method model_fit for |
#237 submitted. Thanks for the guidance! |
Related.... #152. Not sure if you want to take that on at any point @phgrosjean. I haven't had too many problems with the dependencies from broom or broom.mixed, but that could help. |
@datalorax Yes, but #152 needs a lot more work and testing that I can do for now. This one is easier. |
Yes, 100% agree. |
I have made a workflow method too. I did a couple of tests. When {broom.mixed} is required, there is an error if it is not loaded:
The example on the {workflows} main page does not work with the stan engine, but it works with base
Now, if I use
Now, the workflow version also works:
I am pretty sure there are many other {tidymodels} model_fit, workflow objects, or other that do not work properly with {equatiomatic}... you mileage will vary! |
@datalorax @davidkane9 I am waiting for your possible comments or suggestions before I submit the new version of {equationmatic} to CRAN. |
Thanks @phgrosjean, I am confused why explicit calls to It does not surprise me that many of the models won't work. We could go about trying to make most of them work but that also feels like a significant undertaking. So basically I'm fine with whatever you want to do. |
Yes, it is not clear why |
Apologies for not responding! This solves my problem. Please release a new version to CRAN, whenever convenient. |
Consider:
Created on 2024-08-22 with reprex v2.1.0
There is no bug here. But things would be easier for my students if
extract_eq()
were to acceptmod
, or any object resulting from fitting a tidymodel. This seems like it should be an easy fix: just check the class at the start, and pull out the fitted object if it is classmodel_fit
.I can submit a PR if this seems sensible.
The text was updated successfully, but these errors were encountered: