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

Fixes earth GLM models and prediction test routine #102

Merged
merged 4 commits into from
May 25, 2022

Conversation

edgararuiz
Copy link
Collaborator

@edgararuiz
Copy link
Collaborator Author

Results now match:

options(scipen = 999)
library(tidyverse)
library(tidypredict)
library(earth)
data("etitanic", package = "earth")

mars.mod.1 <- earth(
    survived ~ age + sex,
    data = etitanic,
    glm = list(family = binomial)
  )

etitanic %>%
  tidypredict_to_column(mars.mod.1) %>%
  mutate(pred = predict(mars.mod.1, type = "response")[,1]) %>%
  head(10) 
#>    pclass survived    sex     age sibsp parch       fit      pred
#> 1     1st        1 female 29.0000     0     0 0.7407665 0.7407665
#> 2     1st        1   male  0.9167     1     2 0.4856151 0.4856151
#> 3     1st        0 female  2.0000     1     2 0.9033125 0.9033125
#> 4     1st        0   male 30.0000     1     2 0.1937987 0.1937987
#> 5     1st        0 female 25.0000     1     2 0.7407665 0.7407665
#> 6     1st        1   male 48.0000     0     0 0.1937987 0.1937987
#> 7     1st        1 female 63.0000     1     0 0.7407665 0.7407665
#> 8     1st        0   male 39.0000     0     0 0.1937987 0.1937987
#> 9     1st        1 female 53.0000     2     0 0.7407665 0.7407665
#> 10    1st        0   male 71.0000     0     0 0.1937987 0.1937987

Created on 2021-09-28 by the reprex package (v2.0.1)

@edgararuiz edgararuiz requested a review from topepo September 28, 2021 18:40
@topepo topepo merged commit de7dbe3 into tidymodels:main May 25, 2022
@github-actions
Copy link

github-actions bot commented Jun 9, 2022

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 Jun 9, 2022
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.

2 participants