Skip to content

load_libs() with engine == "earth" #913

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

Merged
merged 1 commit into from
Mar 10, 2023
Merged

load_libs() with engine == "earth" #913

merged 1 commit into from
Mar 10, 2023

Conversation

simonpcouch
Copy link
Contributor

@simonpcouch simonpcouch commented Mar 9, 2023

Closes #251.🏄

With this PR:

library(parsnip)

mars(
  mode = "classification",
  num_terms = 1,
  prod_degree = 1,
  prune_method = "backward"
) %>% 
  set_engine("earth") %>% 
  fit(Species ~ ., iris)
#> Loading required package: Formula
#> Loading required package: plotmo
#> Loading required package: plotrix
#> Loading required package: TeachingDemos
#> parsnip model object
#> 
#> GLM (family binomial, link logit):
#>            nulldev  df       dev  df   devratio     AIC iters converged
#> setosa     190.954 149   190.954 149          0     193     4         1
#> versicolor 190.954 149   190.954 149          0     193     4         1
#> virginica  190.954 149   190.954 149          0     193     4         1
#> 
#> Earth selected 1 of 15 terms, and 0 of 4 predictors (nprune=1)
#> Termination condition: Reached nk 21
#> Importance: Sepal.Length-unused, Sepal.Width-unused, Petal.Length-unused, ...
#> Number of terms at each degree of interaction: 1 (intercept only model)
#> 
#> Earth
#>                  GCV       RSS GRSq RSq
#> setosa     0.2252151  33.33333    0   0
#> versicolor 0.2252151  33.33333    0   0
#> virginica  0.2252151  33.33333    0   0
#> All        0.6756452 100.00000    0   0

Created on 2023-03-09 with reprex v2.0.2

@simonpcouch
Copy link
Contributor Author

simonpcouch commented Mar 9, 2023

Ideally this would involve a fix in earth. Unfortunately, sent an email to maintainers with suggested fixes and didn't hear anything. We also maintain a load_libs() helper already without issue, and use it elsewhere in earth internals already.

Copy link
Member

@EmilHvitfeldt EmilHvitfeldt left a comment

Choose a reason for hiding this comment

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

Love it! no notes

@simonpcouch simonpcouch merged commit f928323 into main Mar 10, 2023
@simonpcouch simonpcouch deleted the earth-251 branch March 10, 2023 01:07
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namespacing issue with MARS models
2 participants