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

[FIX] : Add Explicit flag to supplementary Table learner output #1617

Merged
merged 2 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Orange/widgets/classify/owlogisticregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from Orange.data import Table, Domain, ContinuousVariable, StringVariable
from Orange.classification.logistic_regression import LogisticRegressionLearner
from Orange.widgets import settings, gui
from Orange.widgets import widget, settings, gui
from Orange.widgets.utils.owlearnerwidget import OWBaseLearner


Expand All @@ -18,7 +18,7 @@ class OWLogisticRegression(OWBaseLearner):

LEARNER = LogisticRegressionLearner

outputs = [("Coefficients", Table)]
outputs = [("Coefficients", Table, widget.Explicit)]

penalty_type = settings.Setting(1)
C_index = settings.Setting(61)
Expand Down
4 changes: 2 additions & 2 deletions Orange/widgets/classify/owsvmclassification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from Orange.data import Table
from Orange.classification.svm import SVMLearner, NuSVMLearner
from Orange.widgets import settings, gui
from Orange.widgets import widget, settings, gui
from Orange.widgets.utils.owlearnerwidget import OWBaseLearner


Expand Down Expand Up @@ -127,7 +127,7 @@ class OWSVMClassification(OWBaseSVM):

LEARNER = SVMLearner

outputs = [("Support vectors", Table)]
outputs = [("Support vectors", Table, widget.Explicit)]

C_SVC, Nu_SVC = 0, 1
svmtype = settings.Setting(0)
Expand Down
4 changes: 2 additions & 2 deletions Orange/widgets/regression/owlinearregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from Orange.regression.linear import (
LassoRegressionLearner, LinearRegressionLearner,
RidgeRegressionLearner, ElasticNetLearner)
from Orange.widgets import settings, gui
from Orange.widgets import widget, settings, gui
from Orange.widgets.utils.owlearnerwidget import OWBaseLearner


Expand All @@ -19,7 +19,7 @@ class OWLinearRegression(OWBaseLearner):

LEARNER = LinearRegressionLearner

outputs = [("Coefficients", Table)]
outputs = [("Coefficients", Table, widget.Explicit)]

#: Types
REGULARIZATION_TYPES = ["No regularization", "Ridge regression (L2)",
Expand Down
4 changes: 2 additions & 2 deletions Orange/widgets/regression/owsvmregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from Orange.data import Table
from Orange.regression import SVRLearner, NuSVRLearner
from Orange.widgets import settings, gui
from Orange.widgets import widget, settings, gui
from Orange.widgets.classify.owsvmclassification import OWBaseSVM


Expand All @@ -19,7 +19,7 @@ class OWSVMRegression(OWBaseSVM):

LEARNER = SVRLearner

outputs = [("Support vectors", Table)]
outputs = [("Support vectors", Table, widget.Explicit)]

#: SVR types
Epsilon_SVR, Nu_SVR = 0, 1
Expand Down
2 changes: 2 additions & 0 deletions Orange/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,8 @@ def __init__(self, text, persistent_id, icon=None, moreurl=None):
#: Signal handlers with this flag have (object, id: object) -> None signature.
Multiple = widget_description.Multiple
#: Applies to user interaction only.
#: Only connected if specifically requested (in a dedicated "Links" dialog)
#: or it is the only possible connection.
Explicit = widget_description.Explicit
#: Dynamic output type.
#: Specifies that the instances on the output will in general be
Expand Down
13 changes: 13 additions & 0 deletions doc/development/source/tutorial-channels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,16 @@ and - nothing will really happen:

That is, no window with a query on which channels to connect to will
open, as the default *"Train Data"* was selected.


*****************
Explicit Channels
*****************


Some times when a widget has multiple outputs of different types, some
of them should not be subject to this automatic default connection selection.
An example of this is in Orange's `Logistic Regression` widget that outputs
a suplimentary 'Coefficients' data table. Such outputs can be marked with
and :attr:`~Orange.widgets.widget.Explicit` flag ensuring they are never
selected for a default connection.
7 changes: 7 additions & 0 deletions doc/development/source/widget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ Input/Output flags:
can be connected to any input which can accept a subtype of the
declared output type.

.. attribute:: Explicit

Outputs with an explicit flag are never selected (auto connected) among
candidate connections. Connections are only established when there is
one unambiguous connection possible or through a dedicated 'Links'
dialog.

.. autoclass:: InputSignal

.. autoclass:: OutputSignal
Expand Down