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

Parsing error for only one variable model #99

Closed
JohnsonHsieh opened this issue Apr 1, 2021 · 1 comment
Closed

Parsing error for only one variable model #99

JohnsonHsieh opened this issue Apr 1, 2021 · 1 comment
Labels
bug 💣 Bug to fix

Comments

@JohnsonHsieh
Copy link

JohnsonHsieh commented Apr 1, 2021

Dear Maintainer

I found that modelStudio would not allow a model_explainer object when model has only one variable.
There is the following example:

titanic_imputed_sub <- subset(titanic_imputed, select = c("survived", "class"))
model_titanic <- glm(survived ~ class, data = titanic_imputed_sub, family = "binomial")

# create an explainer for the model
explainer_titanic <- explain(model_titanic,
                             data = titanic_imputed_sub,
                             y = titanic_imputed$survived,
                             label = "Titanic GLM")

# pick observations
new_observations <- titanic_imputed[1:2,]
rownames(new_observations) <- c("Lucas","James")

# make a studio for the model
modelStudio(explainer_titanic,
            new_observations, eda=FALSE,
            N = 200,  B = 5)
  Calculating ... 
  Calculating ingredients::feature_importance 
    Elapsed time: 00:00:00 ETA: 0s Error in `[.default`(data, , , drop = FALSE) : 維度數目不正確
此外: Warning message:
In value[[3L]](cond) : 
Error occurred in ingredients::feature_importance function: 長度為 0 的引數
Called from: NextMethod("[")
@hbaniecki
Copy link
Member

Thanks!
This will be fixed with the next versions of the corresponding packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💣 Bug to fix
Projects
None yet
Development

No branches or pull requests

2 participants