This is documentation for Orange 2.7. For the latest documentation, see Orange 3.

Constant Classifier

Constant classifier always predicts the same value. It is constructed by various learners such as MajorityLearner, and also used in other places.

class Orange.classification.ConstantClassifier

Always predict the specified default_val or default_distribution, disregarding the instance.

class_var

Class variable that the classifier predicts.

default_val

The value returned by the classifier.

default_distribution

Class probabilities returned by the classifier.

__init__(variable, value, distribution)

Constructor can be called without arguments, with a variable, value or both. If the value is given and is of type Orange.data.Value, its attribute Orange.data.Value.variable will either be used for initializing variable or checked against it, if variable is given as an argument.

Parameters:
  • variable (Orange.feature.Descriptor) – Class variable that the classifier predicts.
  • value (Orange.data.Value or int (index) or float) – Value returned by the classifier.
  • distribution – Class probabilities returned by the classifier.
__call__(instance, return_type)

Return default_val and/or default_distribution (depending upon return_type) disregarding the instance.