Comments (8)
Hi @bgu1997, intercept
is the mean prediction on the inputted dataset (or a subset of it). Running your code gives indeed (almost) the same intercepts, see:
library(DALEX)
library(modelStudio)
library(caret)
library(glmnet)
data(mtcars)
set.seed(42)
model <- train(
form = mpg ~ .,
data = mtcars,
method = 'glmnet',
trControl = trainControl(method = 'LOOCV'),
tuneLength = 100
)
explainer <- explain(model,
data = mtcars,
y = mtcars$mpg,
label = 'Elastic Net')
mean(predict(explainer$model, explainer$data)) # 20.09063
set.seed(42)
model2 <- train(
form = mpg ~ .,
data = mtcars,
method = 'glmnet',
trControl = trainControl(method = 'LOOCV'),
tuneGrid = expand.grid(alpha = 1,
lambda = seq(0, 100, by = 1))
)
explainer2 <- explain(model2,
data = mtcars,
y = mtcars$mpg,
label = 'LASSO')
mean(predict(explainer2$model, explainer2$data)) # 20.09062
from modelstudio.
I apologize I can't include my own data because there is patient information contained. I looked at the output for mean(predict(explainer$model, explainer$data)) for my two models. The intercept for the LASSO modelStudio plot matches the mean prediction for the LASSO model. However, the intercept for the Elastic Net modelStudio plot is the same as that of the LASSO, yet the mean prediction returned by mean(predict(explainer$model, explainer$data)) is different from that of LASSO.
from modelstudio.
As per documentation https://modelstudio.drwhy.ai/articles/ms-perks-features.html#more-calculations-means-more-time, modelStudio
has a default parameter of N=300
where 300
observations are sampled from explainer$data
for faster explanation estimation.
Perhaps pass a subset of data, e.g. 500 rows to explain()
and then use modelStudio(..., N=NULL)
to use all data inputted to the explainer. Check if now mean(predict(explainer$model, explainer$data))
equals intercept
?
from modelstudio.
It would be easier to debug the ibreakdown::break_down()
function https://modeloriented.github.io/iBreakDown/reference/break_down.html, not the whole modelStudio()
, if you find a reproducible example on one observation of interest.
from modelstudio.
By 300 observations does this mean it is agnostic of the dimensions of the data? My data only has 50 rows but >300 columns. How should I perform the test with explain()
and modelStudio(..., N = NULL)
in my scenario?
Sorry I'm an amateur data scientist, and I very much appreciate your help debugging.
from modelstudio.
@bgu1997, unfortunately, I didn't understand your goal.
Can you reproduce the potential bug on one of the openly-available datasets?
from modelstudio.
Sorry for the delay, I wasn't able to recreate the bug on openly-available datasets. I will reach out again if further assistance is needed. Thank you very much for answering my questions up to this point!
from modelstudio.
No problem, best tag me @hbaniecki here or submit a new issue
from modelstudio.
Related Issues (20)
- There is a plan to export modelStudio to python? HOT 2
- add `verbose` as an alias to `show_info`
- add `ms_merge_observations()` function to merge multiple modelStudio into one
- add `happiness` dataset
- update DALEX, ingredients, and iBreakDown versions? HOT 1
- add information about css needed for a proper modelStudio rendering in rmd -> html (vignette)
- update GIFs with the happiness demo example
- modelStudio fails on R v4.2 (devel) due to changes in logical operators HOT 1
- multiple modelstudio objects overlap HOT 3
- model_diagnostics fails due to no rows to aggregate HOT 10
- add `variable_splits` to modelStudio HOT 1
- Add a parameter to set, which plots to open and on which positions
- Error in check_explainer(explainer): For Python support, use precalculate=True in Explainer init HOT 5
- Is 4x4 panels the only way to present ModelStudio? HOT 2
- smart choosing of observations
- v2.1.0 release checklist
- Support for explainer objects from the `survex` package HOT 2
- Error in R - Error in eval(predvars, data, env) : object 'Breach' not found HOT 1
- Parsing error for only one variable model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelstudio.