Skip to content

Commit edcff6b

Browse files
committed
Update test-mlclassificationlogisticmultinomial.R
1 parent 2986b2c commit edcff6b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/testthat/test-mlclassificationlogisticmultinomial.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,34 @@ test_that("Confusion Matrix table results match", {
4949
"virginica", 0, 0, 12))
5050
})
5151

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+
5260
test_that("Data Split plot matches", {
5361
plotName <- results[["results"]][["plotDataSplit"]][["data"]]
5462
testPlot <- results[["state"]][["figures"]][[plotName]][["obj"]]
5563
jaspTools::expect_equal_plots(testPlot, "data-split")
5664
})
5765

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+
5880
test_that("Model Performance Metrics table results match", {
5981
table <- results[["results"]][["validationMeasures"]][["data"]]
6082
jaspTools::expect_equal_tables(table,

0 commit comments

Comments
 (0)