Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] owranksurvivalfeatures: add Features output #58

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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