@@ -14,7 +14,7 @@ bg_X <- diamonds[seq(1, nrow(diamonds), 450), ]
1414# Subset of 1018 diamonds to explain
1515X_small <- diamonds [seq(1 , nrow(diamonds ), 53 ), c(" carat" , ord )]
1616
17- # Exact KernelSHAP (2s )
17+ # Exact KernelSHAP (1.8s )
1818system.time(
1919 ks <- kernelshap(fit , X_small , bg_X = bg_X )
2020)
2525# [1,] -2.050074 -0.28048747 0.1281222 0.01587382
2626# [2,] -2.085838 0.04050415 0.1283010 0.03731644
2727
28- # Pure sampling version takes a bit longer (7 seconds)
28+ # Pure sampling version takes a bit longer (6.6 seconds)
2929system.time(
3030 ks2 <- kernelshap(fit , X_small , bg_X = bg_X , exact = FALSE , hybrid_degree = 0 )
3131)
3232ks2
3333
3434bench :: mark(kernelshap(fit , X_small , bg_X = bg_X , verbose = F ))
35- # 2.17s 1.64GB -> 1.72s 1.44GB
35+ # 2.17s 1.64GB -> 1.79s 1.43GB
3636
3737bench :: mark(kernelshap(fit , X_small , bg_X = bg_X , verbose = F , exact = F , hybrid_degree = 1 ))
3838# 4.88s 2.79GB -> 4.38s 2.48GB
3939
4040bench :: mark(permshap(fit , X_small , bg_X = bg_X , verbose = F ))
41- # 1.97s 1.64GB -> 1.8s 1.43GB
41+ # 1.97s 1.64GB -> 1.9s 1.43GB
4242
4343bench :: mark(permshap(fit , X_small , bg_X = bg_X , verbose = F , exact = F ))
44- # 3.04s 1.88GB -> 2.9s 1.64GB
44+ # 3.04s 1.88GB -> 2.8s 1.64GB
4545
4646# SHAP values of first 2 observations:
4747# carat clarity color cut
0 commit comments