コード例 #1
0
 def test_returns_zero_as_lower_bound(self):
     model.predict.return_value = [-23.4324]
     engine = RegressionPredictor(model)
     inference = engine.predict([vals])[0]
     assert inference == 0, 'Inference lower bound should be zero'
コード例 #2
0
 def test_return_specified_decimal_points(self):
     engine = RegressionPredictor(model)
     inference = engine.predict([vals], decimals=4)[0]
     assert number_of_decimals(inference) == 4, 'number of decimal points \
コード例 #3
0
 def test_returns_prediction(self):
     engine = RegressionPredictor(model)
     inference = engine.predict([vals])[0]
     assert inference == 23.43, 'Prediction value is incorrect'
コード例 #4
0
 def test_return_two_decimal_points(self):
     engine = RegressionPredictor(model)
     inference = engine.predict([vals])[0]
     assert number_of_decimals(inference) == 2, 'default number of decimal \
コード例 #5
0
 def test_return_float(self):
     engine = RegressionPredictor(model)
     inference = engine.predict([vals])[0]
     assert type(inference) == float, 'Inferences should be real numbers'