Skip to content

Commit

Permalink
linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerhardsa0 committed Jul 15, 2024
1 parent 060f0f5 commit e0eb11a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/safeds/ml/nn/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_should_return_input_size(self, device: Device) -> None:
).fit(
Table.from_dict({"a": [1], "b": [2]}).to_tabular_dataset("a"),
)
device.type
device.type #noqa
assert model.input_size == 1

def test_should_raise_if_epoch_size_out_of_bounds(self, device: Device) -> None:
Expand Down Expand Up @@ -264,7 +264,7 @@ def test_should_return_input_size(self, device: Device) -> None:
Table.from_dict({"a": [1, 2, 3, 4], "b": [0, 1, 0, 1]}).to_tabular_dataset("b"),
"accuracy",
)
device.type
device.type # noqa
assert model.input_size == 1

def test_should_raise_if_epoch_size_out_of_bounds_when_fitting_by_exhaustive_search(
Expand Down Expand Up @@ -334,6 +334,7 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type(
self,
metric: Literal["accuracy", "precision", "recall", "f1_score"],
positive_class: Any,
device: Device
) -> None:
model = NeuralNetworkClassifier(InputConversionTable(), [ForwardLayer(Choice(2, 4)), ForwardLayer(1)])
assert not model.is_fitted
Expand All @@ -342,6 +343,7 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type(
optimization_metric=metric,
positive_class=positive_class,
)
device.type #noqa
assert fitted_model.is_fitted
assert isinstance(fitted_model, NeuralNetworkClassifier)

Expand Down Expand Up @@ -617,7 +619,7 @@ def test_should_return_input_size(self, device: Device) -> None:
).fit(
Table.from_dict({"a": [1], "b": [2]}).to_tabular_dataset("a"),
)
device.type
device.type # noqa
assert model.input_size == 1

def test_should_raise_if_epoch_size_out_of_bounds(self, device: Device) -> None:
Expand Down Expand Up @@ -809,7 +811,7 @@ def test_should_return_input_size(self, device: Device) -> None:
Table.from_dict({"a": [1, 2, 3, 4], "b": [1.0, 2.0, 3.0, 4.0]}).to_tabular_dataset("b"),
"mean_squared_error",
)
device.type
device.type # noqa
assert model.input_size == 1

def test_should_raise_if_epoch_size_out_of_bounds_when_fitting_by_exhaustive_search(
Expand Down Expand Up @@ -876,13 +878,15 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type(
"median_absolute_deviation",
"coefficient_of_determination",
],
device: Device
) -> None:
model = NeuralNetworkRegressor(InputConversionTable(), [ForwardLayer(Choice(2, 4)), ForwardLayer(1)])
assert not model.is_fitted
fitted_model = model.fit_by_exhaustive_search(
Table.from_dict({"a": [1, 2, 3, 4], "b": [1.0, 2.0, 3.0, 4.0]}).to_tabular_dataset("b"),
optimization_metric=metric,
)
device.type #noqa
assert fitted_model.is_fitted
assert isinstance(fitted_model, NeuralNetworkRegressor)

Expand Down

0 comments on commit e0eb11a

Please sign in to comment.