Skip to content

Commit

Permalink
Fix issue #72
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolajsp committed Mar 24, 2023
1 parent 76993e0 commit 42b7a97
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/plot_surv_lime.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ plot.surv_lime <- function(x,
if (!type %in% c("coefficients", "local_importance"))
stop("Type should be one of `coefficients`, `local_importance`")

local_importance <- as.numeric(x$result * x$variable_values)
local_importance <- as.numeric(x$result) * as.numeric(x$variable_values)
df <- data.frame(variable_names = names(x$variable_values),
variable_values = as.numeric(x$variable_values),
beta = as.numeric(x$result),
Expand Down
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ print.surv_feature_importance <- function(x, ...) {
print.surv_lime <- function(x, ...) {
res <- x$result

print_result <- rbind(beta = res, `X` = x$variable_values, `local importance (X*beta)` = res * x$variable_values)
print_result <- rbind(beta = res, `X` = x$variable_values, `local importance (X*beta)` = res * as.numeric(x$variable_values))
cat("SurvLIME for observation:\n\n")
print.data.frame(x$variable_values, row.names = FALSE)
cat("\n")
Expand Down

0 comments on commit 42b7a97

Please sign in to comment.