Skip to content

Commit

Permalink
fix data error conditions in owtestandscore for dask
Browse files Browse the repository at this point in the history
  • Loading branch information
noahnovsak committed Aug 16, 2023
1 parent c1aa47f commit 5aa667e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Orange/widgets/evaluate/owtestandscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ def set_train_data(self, data):
"Train data input requires a target variable.",
not data.domain.class_vars
),
("Target variable has no values.", np.isnan(data.Y).all()),
("Target variable has no values.", np.asarray(np.isnan(data.Y)).all()),
(
"Target variable has only one value.",
data.domain.has_discrete_class and len(unique(data.Y)) < 2
data.domain.has_discrete_class and len(np.asarray(unique(data.Y))) < 2
),
("Data has no features to learn from.", data.X.shape[1] == 0),
("Data has no features to learn from.", len(data.domain.attributes) == 0),
]

for error_msg, cond in data_errors:
Expand Down

0 comments on commit 5aa667e

Please sign in to comment.