Update synthetic environment
This commit is contained in:
		| @@ -13,15 +13,15 @@ print("library path: {:}".format(lib_dir)) | ||||
| if str(lib_dir) not in sys.path: | ||||
|     sys.path.insert(0, str(lib_dir)) | ||||
|  | ||||
| from datasets import QuadraticFunction | ||||
| from datasets import QuadraticFunc | ||||
| from datasets import SynAdaptiveEnv | ||||
|  | ||||
|  | ||||
| class TestQuadraticFunction(unittest.TestCase): | ||||
| class TestQuadraticFunc(unittest.TestCase): | ||||
|     """Test the quadratic function.""" | ||||
|  | ||||
|     def test_simple(self): | ||||
|         function = QuadraticFunction([[0, 1], [0.5, 4], [1, 1]]) | ||||
|         function = QuadraticFunc([[0, 1], [0.5, 4], [1, 1]]) | ||||
|         print(function) | ||||
|         for x in (0, 0.5, 1): | ||||
|             print("f({:})={:}".format(x, function[x])) | ||||
| @@ -31,7 +31,7 @@ class TestQuadraticFunction(unittest.TestCase): | ||||
|         self.assertTrue(abs(function[1] - 1) < thresh) | ||||
|  | ||||
|     def test_none(self): | ||||
|         function = QuadraticFunction() | ||||
|         function = QuadraticFunc() | ||||
|         function.fit([[0, 1], [0.5, 4], [1, 1]], max_iter=3000, verbose=True) | ||||
|         print(function) | ||||
|         thresh = 0.2 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user