Skip to content

Commit

Permalink
Prepare for cran
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Nov 24, 2017
1 parent 482cb8b commit 537ffa7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: lime
Type: Package
Title: Local Interpretable Model-Agnostic Explanations
Version: 0.3.0
Date: 2017-09-14
Version: 0.3.1
Date: 2017-11-24
Authors@R: c(person('Thomas Lin', 'Pedersen', role = c('cre', 'aut'), email = "thomasp85@gmail.com"),
person('Michaël', 'Benesty', role = c('aut'), email = "michael@benesty.fr"))
Maintainer: Thomas Lin Pedersen <thomasp85@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# lime 0.3.0.9999
# lime 0.3.1

* Added a `NEWS.md` file to track changes to the package.
* Fixed bug when explaining regression models, due to drop=TRUE defaults (#33)
Expand Down
6 changes: 3 additions & 3 deletions R/models.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ predict_model.H2OModel <- function(x, newdata, type, ...){
if (!requireNamespace('h2o', quietly = TRUE)) {
stop('The h2o package is required for predicting h2o models')
}
pred <- h2o.predict(x, h2o::as.h2o(newdata))
pred <- h2o::h2o.predict(x, h2o::as.h2o(newdata))
h2o_model_class <- class(x)[[1]]
if (h2o_model_class %in% c("H2OBinomialModel", "H2OMultinomialModel")) {
return(as.data.frame(pred[,-1]))
return(as.data.frame(pred[,-1]))
} else if (h2o_model_class == "H2ORegressionModel") {
ret <- as.data.frame(pred[,1])
names(ret) <- "Response"
Expand Down Expand Up @@ -145,7 +145,7 @@ model_type.lda <- function(x, ...) 'classification'
model_type.H2OModel <- function(x, ...) {
h2o_model_class <- class(x)[[1]]
if (h2o_model_class %in% c("H2OBinomialModel", "H2OMultinomialModel")) {
return('classification')
return('classification')
} else if (h2o_model_class == "H2ORegressionModel") {
return('regression')
} else {
Expand Down
4 changes: 2 additions & 2 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ plot_explanations <- function(explanation, ...) {
explanation$feature_desc,
levels = rev(unique(explanation$feature_desc[order(explanation$feature, explanation$feature_value)]))
)
ggplot(explanation, aes(case, feature_desc)) +
geom_tile(aes(fill = feature_weight)) +
ggplot(explanation, aes_(~case, ~feature_desc)) +
geom_tile(aes_(fill = ~feature_weight)) +
facet_wrap(~label, ...) +
scale_x_discrete('Case', expand = c(0, 0)) +
scale_y_discrete('Feature', expand = c(0, 0)) +
Expand Down

0 comments on commit 537ffa7

Please sign in to comment.