Code Monkey home page Code Monkey logo

Comments (4)

thomasp85 avatar thomasp85 commented on May 29, 2024

I cannot reproduce this. Have you tried with the most recent version of h2o?

from lime.

coforfe avatar coforfe commented on May 29, 2024

Hello,

Sorry for the delay.
I have just tried and it continues giving the same error.
I am using the latest h2o version.

> 
> # XGBOOST
> full_iris_frame <- as.h2o(iris)
  |=====================================================================================================| 100%
> 
> full_xgb <- h2o.xgboost(training_frame = full_iris_frame, y = "Species")
  |=====================================================================================================| 100%
>  
> full_explainer <- lime::lime(dplyr::select(as.data.frame(full_iris_frame), -Species), full_xgb)
>  
> full_explanation <- lime::explain(dplyr::select(as.data.frame(full_iris_frame)[1:4,], -Species), full_explainer, n_labels = 3 , n_features = 3)
  |=====================================================================================================| 100%
  |=====================================================================================================| 100%
Error in glmnet(x[, c(features, j), drop = FALSE], y, weights = weights,  : 
  x should be a matrix with 2 or more columns
> 
> packageVersion("h2o")
[1] ‘3.16.0.2> packageVersion("xgboost")
[1] ‘0.6.4.1> packageVersion("lime")
[1] ‘0.3.1

Thanks,
Carlos.

from lime.

coforfe avatar coforfe commented on May 29, 2024

Hello,

There is already a new h2o version (3.18.0.2) and with it everything runs smoothly:

> # XGBOOST
> full_iris_frame <- as.h2o(iris)
  |=========================================================================================================| 100%
> 
> full_xgb <- h2o.xgboost(training_frame = full_iris_frame, y = "Species")
  |=========================================================================================================| 100%
>  
> full_explainer <- lime::lime(dplyr::select(as.data.frame(full_iris_frame), -Species), full_xgb)
>  
> full_explanation <- lime::explain(dplyr::select(as.data.frame(full_iris_frame)[1:4,], -Species), full_explainer, n_labels = 3 , n_features = 3)
  |=========================================================================================================| 100%
  |=========================================================================================================| 100%
> 
> head(full_explanation)
      model_type case      label  label_prob  model_r2 model_intercept model_prediction      feature feature_value
1 classification    1     setosa 0.996033490 0.7474399      0.06413509       0.96476458  Sepal.Width           3.5
2 classification    1     setosa 0.996033490 0.7474399      0.06413509       0.96476458 Petal.Length           1.4
3 classification    1     setosa 0.996033490 0.7474399      0.06413509       0.96476458  Petal.Width           0.2
4 classification    1 versicolor 0.002750067 0.2595668      0.42947763       0.05936985 Sepal.Length           5.1
5 classification    1 versicolor 0.002750067 0.2595668      0.42947763       0.05936985 Petal.Length           1.4
6 classification    1 versicolor 0.002750067 0.2595668      0.42947763       0.05936985  Petal.Width           0.2
  feature_weight         feature_desc               data                            prediction
1    0.033300165    3.3 < Sepal.Width 5.1, 3.5, 1.4, 0.2 0.996033490, 0.002750067, 0.001216384
2    0.827178873 Petal.Length <= 1.60 5.1, 3.5, 1.4, 0.2 0.996033490, 0.002750067, 0.001216384
3    0.040150456   Petal.Width <= 0.3 5.1, 3.5, 1.4, 0.2 0.996033490, 0.002750067, 0.001216384
4    0.001132338  Sepal.Length <= 5.1 5.1, 3.5, 1.4, 0.2 0.996033490, 0.002750067, 0.001216384
5   -0.446456113 Petal.Length <= 1.60 5.1, 3.5, 1.4, 0.2 0.996033490, 0.002750067, 0.001216384
6    0.075215999   Petal.Width <= 0.3 5.1, 3.5, 1.4, 0.2 0.996033490, 0.002750067, 0.001216384
> 
> packageVersion("h2o")
[1] ‘3.18.0.2> packageVersion("xgboost")
[1] ‘0.6.4.1> packageVersion("lime")
[1] ‘0.3.1> 

Thanks!
Carlos.

from lime.

coforfe avatar coforfe commented on May 29, 2024

I close the issue...

from lime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.