Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
sibre28 committed Aug 19, 2024
1 parent 3505277 commit b588b53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/safeds/ml/nn/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,7 @@ def _get_best_cnn_model_column(
best_model = None
best_metric_value = None
for fitted_model in list_of_fitted_models:
prediction = self._inverse_one_hot_encode_by_index_of_column(
fitted_model.predict(input_data).get_output(), # type: ignore[attr-defined, arg-type]
)
prediction = fitted_model.predict(input_data).get_output() # type: ignore[attr-defined, arg-type]
if best_model is None:
best_model = fitted_model
match optimization_metric:
Expand Down Expand Up @@ -1280,9 +1278,9 @@ def _get_best_cnn_model_table(
if positive_class is not None:
for column_index in range(labels.column_count):
# TODO Find out if a column is the positive class, maybe by the column name?
# if labels.column_names[column_index] == positive_class:
positive_class = labels.column_names[column_index]
break
if labels.column_names[column_index] == positive_class:
positive_class = labels.column_names[column_index]
break

best_model = None
best_metric_value = None
Expand Down
4 changes: 2 additions & 2 deletions tests/safeds/ml/nn/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def test_should_raise_when_time_series_classification_with_continuous_data(self,
)
model = NeuralNetworkClassifier(
InputConversionTimeSeries(),
[ForwardLayer(neuron_count=4), LSTMLayer(neuron_count=1)],
[ForwardLayer(neuron_count=4), LSTMLayer(neuron_count=3)],
)
with pytest.raises(
NotImplementedError,
Expand Down Expand Up @@ -339,7 +339,7 @@ def test_should_raise_when_time_series_classification_with_continuous_data(self,
)
model = NeuralNetworkClassifier(
InputConversionTimeSeries(),
[ForwardLayer(neuron_count=Choice(2, 4)), LSTMLayer(neuron_count=1)],
[ForwardLayer(neuron_count=Choice(2, 4)), LSTMLayer(neuron_count=3)],
)
with pytest.raises(
NotImplementedError,
Expand Down

0 comments on commit b588b53

Please sign in to comment.