adding text message for assertions; remove value check for regression test, see comment
authorgebele <gebele@in-silico.ch>
Tue, 2 Jul 2019 09:04:47 +0000 (09:04 +0000)
committergebele <gebele@in-silico.ch>
Tue, 2 Jul 2019 09:04:47 +0000 (09:04 +0000)
test/classification-validation.rb
test/regression-validation.rb

index 5995c88..b913e1e 100644 (file)
@@ -50,17 +50,17 @@ class ClassificationValidationTest < MiniTest::Test
             cv[type][key].each do |arr|
               arr.each do |a|
                 refute_nil a
-                assert a > 0
+                assert a > 0, "#{cv[type][key]} values should be greater than 0."
               end
             end
           when "predictivity", "true_rate"
             av.each do |v|
               refute_nil cv[type][key][v]
-              assert cv[type][key][v] > 0
+              assert cv[type][key][v] > 0, "#{cv[type][key]} values should be greater than 0."
             end
           else
             refute_nil cv[type][key]
-            assert cv[type][key] > 0
+            assert cv[type][key] > 0, "#{cv[type][key]} value should be greater than 0."
           end
         end
       end
index 94ef7b5..9a2da8f 100644 (file)
@@ -86,6 +86,8 @@ class RegressionValidationTest < MiniTest::Test
     repeated_cv.crossvalidations.each do |cv|
       assert cv.r_squared[:all] > 0.34, "R^2 (#{cv.r_squared[:all]}) should be larger than 0.34"
       assert cv.rmse[:all] < 1.5, "RMSE (#{cv.rmse[:all]}) should be smaller than 0.5"
+=begin
+      #actually some values can be 0 or nil depending on the random folds in this small dataset
       keys = cv.rmse.keys
       types = ["rmse", \
                "r_squared", \
@@ -100,6 +102,7 @@ class RegressionValidationTest < MiniTest::Test
           assert cv[type][key] > 0
         end
       end
+=end
     end
   end