Git Product home page Git Product logo

Comments (8)

thormic avatar thormic commented on May 21, 2024 1

If anyone still had troubles with the first error (even after updating breakDown) - check if you are using explain from DALEX or from dplyr. If the latter is the case, just use DALEX::explain.

from dalex.

pbiecek avatar pbiecek commented on May 21, 2024

Try breakDown 1.4 from github
https://github.com/pbiecek/breakDown
Version 1.3 supports only lm and glm model while 1.4 is model agnostic

from dalex.

kransom14 avatar kransom14 commented on May 21, 2024

from dalex.

pbiecek avatar pbiecek commented on May 21, 2024

Would you provide the full example for gbm? Will be easier to debug

from dalex.

pbiecek avatar pbiecek commented on May 21, 2024

Ok, I guess that your new observation is neither a data.frame nor matrix?

from dalex.

kransom14 avatar kransom14 commented on May 21, 2024

from dalex.

pbiecek avatar pbiecek commented on May 21, 2024

n.trees argument is required by predict.gbm but was not correctly passed from DALEX to breakDown.
Please update both packages and following example is working for me

library(gbm)
library(DALEX)
library(breakDown)

# create a gbm model
model <- gbm(quality ~ pH + residual.sugar + sulphates + alcohol, data = wine,
             distribution = "gaussian",
             n.trees = 1000,
             interaction.depth = 4,
             shrinkage = 0.01,
             n.minobsinnode = 10,
             verbose = FALSE)

# make an explainer for the model
explainer_gbm <- explain(model, data = wine)

# create a new observation
new.wine <- data.frame(citric.acid = 0.35,
                       sulphates = 0.6,
                       alcohol = 12.5,
                       pH = 3.36,
                       residual.sugar = 4.8)

exp_sgn <- single_prediction(explainer_gbm, observation = new.wine, n.trees = 1000)

exp_sgn
plot(exp_sgn)

from dalex.

kransom14 avatar kransom14 commented on May 21, 2024

This fixes it, thank you. I will close the issue.

from dalex.

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.