GBT regression MSE check
@@ -10,6 +10,7 @@ import unittest
import numpy as np
from daal4py import __daal_link_version__ as dv
daal_version = tuple(map(int, (dv[0:4], dv[4:8])))
+import sklearn.metrics
# let's try to use pandas' fast csv reader
try:
@@ -73,12 +74,11 @@ class Test(unittest.TestCase):
(_, predict_result, _) = get_results()
self.assertTrue(np.allclose(predict_result.prediction, testdata))
- @unittest.skipIf(sys.platform != 'linux', reason="variations of results in non-linux OS")
def test_gradient_boosted_regression_batch(self):
testdata = read_csv(os.path.join(unittest_data_path, "gradient_boosted_regression_batch.csv"), range(1))
from gradient_boosted_regression_batch import main as get_results
(_, predict_result, _) = get_results()
- self.assertTrue(np.allclose(predict_result.prediction, testdata))
+ self.assertTrue(sklearn.metrics.mean_squared_error(predict_result.prediction, testdata) < 1e-2)
def test_kmeans_batch(self):
testdata = read_csv(os.path.join(unittest_data_path, "kmeans_batch.csv"), range(20))
