Skip to content

Instantly share code, notes, and snippets.

@dashapetr
Created October 23, 2021 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dashapetr/ceca329c381978da99b0205ebc9edf1a to your computer and use it in GitHub Desktop.
Save dashapetr/ceca329c381978da99b0205ebc9edf1a to your computer and use it in GitHub Desktop.
@pytest.mark.parametrize("input_array, list_with_predictions",
[
(np.array([1, 2, 3, 4]), [6.17, 6.71, 7.25, 7.79]),
(np.array([5, 10, 15, 20]), [8.33, 11.03, 13.73, 16.43]),
(np.array([12, 22, 23, 24]), [12.11, 17.51, 18.05, 18.59]),
])
def test_make_prediction_on_unseen_data(input_array, list_with_predictions, regression):
predicted_array = regression.make_prediction_on_unseen_data(input_array)
predicted_list = []
for a in range(len(predicted_array)):
predicted_list.append(round(predicted_array[a], 2))
assert predicted_list == list_with_predictions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment