nredell/shapFlex

Add multi-class/outcome support

nredell opened this issue · 3 comments

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.

Hi, thanks for developing such a cool and handy tool! This is indeed amazing work.
By the way, I have a question. I have a model(random-forest classifier)and shap values(N*T matrix) calculated from the model(I used python for these values [slunderg/shap]). I try to take benefit from your code and decompose r2_shap by features but am not sure how I can set an intercept. Can I just set this as 0 in my case? Looking forward to hearing back from you.

mw_fcs_xall <- read.csv("../test_X.csv")
mw_fcs_yall <- read.csv("../y_all.csv", sep="") 
mw_fcs_yall = as.integer(unlist(mw_fcs_yall))
typeof(mw_fcs_yall)

colnames(test_X)

price_var = test_X %>%
  select(starts_with("lag"))
asset_var = test_X %>%
  select(cell_phone,number_celphones,roof_not_natural,roof_iron,Refrigerator,Radio,Television,Car, Bicycle, Motorcycle, Car )
weather_var = test_X %>%
  select(raincytot, day1rain, maxdaysnorain,lhz_day1rain,day1rain, gdd, tmean, lhz_raincytot, lhz_maxdaysnorain, heatdays)

shapFlex::r2(price_var, y_test, 0)
shapFlex::r2(asset_var, y_test, 0)
shapFlex::r2(weather_var, y_test, 0)

+1

Sorry about the delayed response. Unfortunately, I'm not able to support this package right now. I'm out of the open source game for the time being.