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

$plot_parallel() fails with an ugly error message if there are no numeric features #22

Closed
andreash0 opened this issue Nov 24, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@andreash0
Copy link
Collaborator

Reprex:

library(mlr3oml)
library(counterfactuals)
oml_data = OMLData$new(50)
tic_tac_toe <- oml_data$data
rf = randomForest::randomForest(Class ~ ., data = tic_tac_toe)
predictor = iml::Predictor$new(rf)
whatif_classif = WhatIfClassif$new(predictor, n_counterfactuals = 10L)
cfactuals = whatif_classif$find_counterfactuals(
  x_interest = tic_tac_toe[1L, ], desired_class = "negative", desired_prob = c(0.5, 1)
)
cfactuals$plot_parallel()
#> Warning in cfactuals$plot_parallel(): Can only consider numeric features for
#> parallel plot. Non-numeric features have been removed.
#> Error in `$<-.data.frame`(`*tmp*`, ".ID", value = structure(2:1, .Label = c("0", : Ersetzung hat 2 Zeilen, Daten haben 0

TODO: Add check, if there are any numeric features and exit early if not.

@andreash0 andreash0 added the bug Something isn't working label Nov 24, 2022
@andreash0 andreash0 self-assigned this Nov 24, 2022
@dandls dandls closed this as completed in 30f5e45 Nov 28, 2022
dandls added a commit that referenced this issue Nov 28, 2022
Early stop for parallel plot if there are no numeric features. Fixes #22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant