Skip to content

Commit

Permalink
Merge pull request #9 from biolab/kaplan-meier/missing_values
Browse files Browse the repository at this point in the history
[FIX] owkaplanmeier: fix missing values handling
  • Loading branch information
JakaKokosar authored Jan 12, 2021
2 parents 3f02dce + f76c5ee commit 62e2ae9
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 @@ -494,8 +494,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 62e2ae9

Please sign in to comment.