nredell / shapflex Goto Github PK
View Code? Open in Web Editor NEWAn R package for computing asymmetric Shapley values to assess causality in any trained machine learning model
License: Other
An R package for computing asymmetric Shapley values to assess causality in any trained machine learning model
License: Other
At present, the package only works with single-outcome regression models. This isn't stated anywhere and, well, the logo seems to imply otherwise. Fix.
Hello,
thanks a lot for implementing the idea of decomposing the R2 Shapley decomposition in R.
I've tried to understand and implement all steps you mention in your paper.
The main important thing for me is the calculation of the sigma unique (due to feature correlations). However, by applying the formula in the paper I receive values higher than one.
So I was wondering whether I have to replace the real y by the predicted y in the counter of the formula?
I'm a big fan of the future
package(s) in R. I'm going to ditch mclapply
if favor of futures.
Within setup.py, the opening of README.md requires utf-8 encoding. Otherwise installation fails.
The package should work as intended, but I need to go back through and tighten up the API. I also need to add tests and generally more clarity and flexibility with what can and can't be tuned.
The sampling method(s) in the package need to be more clearly spelled out. There are a of couple related methods in the literature that I'd like to incorporate. Namely, there should be a clear trade-off that the user can make between sampling instances vs. features. Right now, the stochastic-ness in the algorithm is to sample a random instance and shuffle its features in one go...but there might be benefit to sampling one instance and shuffling its features multiple times. Seems like both approaches would converge in the limit but the whole point of the Monte Carlo approach is that we're nowhere near "the limit". Also, the impact of feature dependence needs to be worked out. I've done some reading here but I'm not confident about what the best approach is.
Hi, I've tried to extract the pairwise shap interaction returned by the shap.scatter plot. I've noticed that shap_interaction(X_i, X_j) != shap_interaction(X_j, X_i), Thus if we immagine a MxM interaction matrix, it's not symmetric. Is It normal o r I've done something wrong? And if it's ok, why is that?
Thanks in Advance, Lorenzo
Hello. I am trying to use your package to assess healthcare attrition on a large scale, However, I am unable to install this package.
install.packages("shapFlex")
Warning in install.packages :
package ‘shapFlex’ is not available for this version of R
What should I do?
I dumped the adult_dataset
that you mention in ReadMe into a csv and run a RandomForestClassifier with almost same settings and calculate shap values from the SHAP package library in python (as given by the author of SHAP paper). I then compare these results with the symmetric counterpart of your library.
Pseudo Code:
import numpy as np
import pandas as pd
import shap
from sklearn.ensemble import RandomForestClassifier
df = pd.read_csv('adult_dataset.csv')
# encode categorical variables and get features and labels in X, y
X, y = preprocess(df)
model = RandomForestClassifier(max_depth=6, random_state=0, n_estimators=300)
model.fit(X, y)
shap.initjs()
explainer= shap.TreeExplainer(model, data=X)
shap_values = explainer.shap_values(X)
# Global shapley values
gsv = np.mean(np.abs(shap_values[1]), axis=0)
As a side note, TreeExplainer finds exact shap values but your results don't match with KernelExplainer even.
Thanks in advance.
Show how the package works with multiple datasets, not simply two models in an ensemble. Also, be more explicit about the dataset weighting when I do this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.