@@ -49,12 +49,34 @@ test_that("Confusion Matrix table results match", {
49
49
" virginica" , 0 , 0 , 12 ))
50
50
})
51
51
52
+ test_that(" Feature Importance Metrics table results match" , {
53
+ table <- results [[" results" ]][[" featureImportanceTable" ]][[" data" ]]
54
+ jaspTools :: expect_equal_tables(table ,
55
+ list (530.419652531233 , " Petal.Length" , 258.101247632355 , " Petal.Width" ,
56
+ 11.6632506085855 , " Sepal.Width" , 10.7849556008181 , " Sepal.Length"
57
+ ))
58
+ })
59
+
52
60
test_that(" Data Split plot matches" , {
53
61
plotName <- results [[" results" ]][[" plotDataSplit" ]][[" data" ]]
54
62
testPlot <- results [[" state" ]][[" figures" ]][[plotName ]][[" obj" ]]
55
63
jaspTools :: expect_equal_plots(testPlot , " data-split" )
56
64
})
57
65
66
+ test_that(" Additive Explanations for Predictions of Test Set Cases table results match" , {
67
+ table <- results [[" results" ]][[" tableShap" ]][[" data" ]]
68
+ jaspTools :: expect_equal_tables(table ,
69
+ list (0.629688901507271 , 0.0369777616411127 , 2.01684224876431e-11 , 3.29787464004028e-09 ,
70
+ 0.333333333528117 , 1 , " setosa (1)" , 0.608365336494419 , 0.0583013168725895 ,
71
+ 5.75901548671709e-11 , 1.30466177861166e-08 , 0.333333333528117 ,
72
+ 2 , " setosa (1)" , 0.578930644244146 , 0.0877359705540646 , - 1.91210501876427e-08 ,
73
+ 6.96919006948349e-08 , 0.333333333528117 , 3 , " setosa (1)" , 0.644504774615733 ,
74
+ 0.0221618748599225 , 2.48312481687663e-11 , 1.69711121822402e-08 ,
75
+ 0.333333333528117 , 4 , " setosa (1)" , 0.544084722419656 , 0.122581029133867 ,
76
+ 2.34213792804638e-09 , 9.1257324152938e-07 , 0.333333333528117 ,
77
+ 5 , " setosa (1)" ))
78
+ })
79
+
58
80
test_that(" Model Performance Metrics table results match" , {
59
81
table <- results [[" results" ]][[" validationMeasures" ]][[" data" ]]
60
82
jaspTools :: expect_equal_tables(table ,
0 commit comments