Skip to content

Commit

Permalink
owranksurvivalfeatures: add Features output
Browse files Browse the repository at this point in the history
  • Loading branch information
JakaKokosar committed Dec 6, 2022
1 parent 35c2a26 commit 1fea249
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from Orange.widgets.utils.concurrent import ConcurrentWidgetMixin, TaskState
from Orange.widgets.utils.itemmodels import PyTableModel
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.widget import Input, Output, OWWidget
from Orange.widgets.widget import Input, Output, OWWidget, AttributeList
from Orange.data import Table, Domain
from Orange.widgets.data.owrank import TableView

Expand Down Expand Up @@ -210,6 +210,7 @@ class Inputs:

class Outputs:
reduced_data = Output('Reduced Data', Table, default=True)
features = Output("Features", AttributeList, dynamic=False)

def __init__(self):
OWWidget.__init__(self)
Expand Down Expand Up @@ -311,12 +312,14 @@ def start_worker(self):
def commit(self):
if not self.selected_attrs:
self.Outputs.reduced_data.send(None)
self.Outputs.features.send(None)
else:
reduced_domain = Domain(
self.selected_attrs, self.data.domain.class_vars, self.data.domain.metas
)
data = self.data.transform(reduced_domain)
self.Outputs.reduced_data.send(data)
self.Outputs.features.send(AttributeList(self.selected_attrs))

def on_done(self, worker_result):
self.model.wrap(worker_result)
Expand Down

0 comments on commit 1fea249

Please sign in to comment.