Skip to content

Commit

Permalink
Merge pull request #6533 from noahnovsak/dask-fix-testandscore
Browse files Browse the repository at this point in the history
Test & Score - fix data error conditions
  • Loading branch information
markotoplak committed Nov 6, 2023
2 parents f655849 + bac8818 commit fbce8ba
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 fbce8ba

Please sign in to comment.