mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Fix tests on Python 3.7
This commit is contained in:
@@ -175,14 +175,14 @@ def test_x_y_fit() -> None:
|
|||||||
|
|
||||||
# Should build and train classifier for "default" category
|
# Should build and train classifier for "default" category
|
||||||
classifier_factory.assert_called_once()
|
classifier_factory.assert_called_once()
|
||||||
assert_array_equal(x_actual["default"], classifier.fit.call_args.args[0])
|
assert_array_equal(x_actual["default"], classifier.fit.call_args[0][0])
|
||||||
assert_array_equal(y_actual["default"], classifier.fit.call_args.args[1])
|
assert_array_equal(y_actual["default"], classifier.fit.call_args[0][1])
|
||||||
|
|
||||||
# Should build and train threshold for "default" category
|
# Should build and train threshold for "default" category
|
||||||
threshold_factory.assert_called_once()
|
threshold_factory.assert_called_once()
|
||||||
assert classifier == threshold.fit.call_args.args[0]
|
assert classifier == threshold.fit.call_args[0][0]
|
||||||
assert_array_equal(x_actual["default"], threshold.fit.call_args.args[1])
|
assert_array_equal(x_actual["default"], threshold.fit.call_args[0][1])
|
||||||
assert_array_equal(y_actual["default"], threshold.fit.call_args.args[2])
|
assert_array_equal(y_actual["default"], threshold.fit.call_args[0][2])
|
||||||
|
|
||||||
|
|
||||||
def test_predict() -> None:
|
def test_predict() -> None:
|
||||||
@@ -233,8 +233,8 @@ def test_predict() -> None:
|
|||||||
# Should ask for probabilities and thresholds
|
# Should ask for probabilities and thresholds
|
||||||
clf.predict_proba.assert_called_once()
|
clf.predict_proba.assert_called_once()
|
||||||
thr.predict.assert_called_once()
|
thr.predict.assert_called_once()
|
||||||
assert_array_equal(x["default"], clf.predict_proba.call_args.args[0])
|
assert_array_equal(x["default"], clf.predict_proba.call_args[0][0])
|
||||||
assert_array_equal(x["default"], thr.predict.call_args.args[0])
|
assert_array_equal(x["default"], thr.predict.call_args[0][0])
|
||||||
|
|
||||||
assert solution_actual == {
|
assert solution_actual == {
|
||||||
"x": {
|
"x": {
|
||||||
|
|||||||
Reference in New Issue
Block a user