Skip to content

Commit

Permalink
owkaplanmeier: fix missing values handling
Browse files Browse the repository at this point in the history
The previous solution did not work when dealing with meta attributes.
  • Loading branch information
JakaKokosar committed Jan 12, 2021
1 parent b88b1c1 commit f76c5ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions orangecontrib/survival_analysis/widgets/owkaplanmeier.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,10 @@ def generate_plot_curves(self) -> List[EstimatedFunctionCurve]:
filter_ = IsDefined(columns=[self.time_var, self.event_var])

# if undefined values are detected in time_var or event_var omit rows with undefined values
if self.data[:, [self.time_var]].has_missing() or self.data[:, [self.event_var]].has_missing():
self._data = filter_(self.data)
self._data = filter_(self.data)
if len(self.data) == len(self._data):
self._data = None
else:
self.Warning.missing_values()

data = self.data if self._data is None else self._data
Expand Down

0 comments on commit f76c5ee

Please sign in to comment.