You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the package. I noticed that tidyrules:::tidy.rpart() seems to have trouble when the data is passed through apply as an additional argument as opposed to being a set argument. Is there a workaround? Sometimes I'd like to iterate through the data...
library(rpart)
library(tidyrules)
#> #> Attaching package: 'tidyrules'#> The following object is masked from 'package:rpart':#> #> prunex1<- lapply(list(as.formula("Kyphosis ~ Age + Number + Start")), \(x) rpart(formula=x, data=kyphosis))
tidy(x1[[1]])
#> ---- Rulelist --------------------------------#> ▶ Keys: NULL#> ▶ Number of rules: 5#> ▶ Model type: rpart#> ▶ Estimation type: classification#> ▶ Is validation data set: FALSE#> #> #> rule_nbr LHS RHS support confidence lift#> <int> <chr> <fct> <int> <dbl> <dbl>#> 1 1 ( Start >= 8.5 ) & ( Start >= 14.5 ) abse… 29 0.968 1.22#> 2 2 ( Start >= 8.5 ) & ( Start < 14.5 ) &… abse… 12 0.929 1.18#> 3 3 ( Start >= 8.5 ) & ( Start < 14.5 ) &… abse… 14 0.812 1.03#> 4 4 ( Start < 8.5 ) pres… 19 0.571 2.72#> 5 5 ( Start >= 8.5 ) & ( Start < 14.5 ) &… pres… 7 0.556 2.65#> ----------------------------------------------x2<- lapply(list(as.formula("Kyphosis ~ Age + Number + Start")), rpart, data=kyphosis)
tidy(x2[[1]])
#> Error in is.data.frame(data): ..1 used in an incorrect context, no ... to look in
Hello,
Thank you for the package. I noticed that
tidyrules:::tidy.rpart()
seems to have trouble when the data is passed throughapply
as an additional argument as opposed to being a set argument. Is there a workaround? Sometimes I'd like to iterate through the data...Created on 2024-11-18 with reprex v2.1.1
The text was updated successfully, but these errors were encountered: