diff options
| author | Shulhan <ms@kilabit.info> | 2021-03-14 22:37:59 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-03-14 22:40:05 +0700 |
| commit | e7552ad0189f761875bc1c2ca3dd716d43a01e0d (patch) | |
| tree | fd68ec29d23fb9a807a7382088020e3b17d446fd /lib/mining/classifier | |
| parent | 882727d89c8e7f9b9761009ccdca1af8c18d0a30 (diff) | |
| download | pakakeh.go-e7552ad0189f761875bc1c2ca3dd716d43a01e0d.tar.xz | |
all: refactoring the test.Assert and test.AssertBench signature
Previously, the test.Assert and test.AssertBench functions has the
boolean parameter to print the stack trace of test in case its not equal.
Since this parameter is not mandatory and its usually always set to
"true", we remove them from function signature to simplify the call
to Assert and AssertBench.
Diffstat (limited to 'lib/mining/classifier')
| -rw-r--r-- | lib/mining/classifier/cart/cart_test.go | 4 | ||||
| -rw-r--r-- | lib/mining/classifier/cm_test.go | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/mining/classifier/cart/cart_test.go b/lib/mining/classifier/cart/cart_test.go index 5159e4c4..264efb6b 100644 --- a/lib/mining/classifier/cart/cart_test.go +++ b/lib/mining/classifier/cart/cart_test.go @@ -32,7 +32,7 @@ func TestCART(t *testing.T) { // copy target to be compared later. targetv := ds.GetClassAsStrings() - test.Assert(t, "", NRows, ds.GetNRow(), true) + test.Assert(t, "", NRows, ds.GetNRow()) // Build CART tree. CART, e := New(&ds, SplitMethodGini, 0) @@ -58,5 +58,5 @@ func TestCART(t *testing.T) { t.Fatal(e) } - test.Assert(t, "", targetv, testset.GetClassAsStrings(), true) + test.Assert(t, "", targetv, testset.GetClassAsStrings()) } diff --git a/lib/mining/classifier/cm_test.go b/lib/mining/classifier/cm_test.go index 6fd47d93..30041388 100644 --- a/lib/mining/classifier/cm_test.go +++ b/lib/mining/classifier/cm_test.go @@ -21,10 +21,10 @@ func TestComputeNumeric(t *testing.T) { cm.ComputeNumeric(vs, actuals, predics) - test.Assert(t, "", exp[0], cm.TP(), true) - test.Assert(t, "", exp[1], cm.FN(), true) - test.Assert(t, "", exp[2], cm.TN(), true) - test.Assert(t, "", exp[3], cm.FP(), true) + test.Assert(t, "", exp[0], cm.TP()) + test.Assert(t, "", exp[1], cm.FN()) + test.Assert(t, "", exp[2], cm.TN()) + test.Assert(t, "", exp[3], cm.FP()) fmt.Println(cm) } @@ -39,10 +39,10 @@ func TestComputeStrings(t *testing.T) { cm.ComputeStrings(vs, actuals, predics) - test.Assert(t, "", exp[0], cm.TP(), true) - test.Assert(t, "", exp[1], cm.FN(), true) - test.Assert(t, "", exp[2], cm.TN(), true) - test.Assert(t, "", exp[3], cm.FP(), true) + test.Assert(t, "", exp[0], cm.TP()) + test.Assert(t, "", exp[1], cm.FN()) + test.Assert(t, "", exp[2], cm.TN()) + test.Assert(t, "", exp[3], cm.FP()) fmt.Println(cm) } @@ -62,8 +62,8 @@ func TestGroupIndexPredictions(t *testing.T) { cm.GroupIndexPredictions(testIds, actuals, predics) - test.Assert(t, "", exp[0], cm.TPIndices(), true) - test.Assert(t, "", exp[1], cm.FNIndices(), true) - test.Assert(t, "", exp[2], cm.FPIndices(), true) - test.Assert(t, "", exp[3], cm.TNIndices(), true) + test.Assert(t, "", exp[0], cm.TPIndices()) + test.Assert(t, "", exp[1], cm.FNIndices()) + test.Assert(t, "", exp[2], cm.FPIndices()) + test.Assert(t, "", exp[3], cm.TNIndices()) } |
