Difference between revisions of "Orange: Constant"

From OnnoWiki
Jump to navigation Jump to search
Line 7: Line 7:
  
 
     Data: input dataset
 
     Data: input dataset
 
 
     Preprocessor: preprocessing method(s)
 
     Preprocessor: preprocessing method(s)
  
Line 13: Line 12:
  
 
     Learner: majority/mean learning algorithm
 
     Learner: majority/mean learning algorithm
 
 
     Model: trained model
 
     Model: trained model
  
Line 24: Line 22:
 
The widget is typically used as a baseline for other models.
 
The widget is typically used as a baseline for other models.
  
../../_images/Constant-stamped.png
+
[[File:Constant-stamped.png|center|200px|thumb]]
  
 
This widget provides the user with two options:
 
This widget provides the user with two options:
  
 
     The name under which it will appear in other widgets. Default name is “Constant”.
 
     The name under which it will appear in other widgets. Default name is “Constant”.
 
 
     Produce a report.
 
     Produce a report.
  
Line 37: Line 34:
 
In a typical classification example, we would use this widget to compare the scores of other learning algorithms (such as kNN) with the default scores. Use iris dataset and connect it to Test & Score. Then connect Constant and kNN to Test & Score and observe how well kNN performs against a constant baseline.
 
In a typical classification example, we would use this widget to compare the scores of other learning algorithms (such as kNN) with the default scores. Use iris dataset and connect it to Test & Score. Then connect Constant and kNN to Test & Score and observe how well kNN performs against a constant baseline.
  
../../_images/Constant-classification.png
+
[[File:Constant-classification.png|center|200px|thumb]]
  
 
For regression, we use Constant to construct a predictor in Predictions. We used the housing dataset. In Predictions, you can see that Mean Learner returns one (mean) value for all instances.
 
For regression, we use Constant to construct a predictor in Predictions. We used the housing dataset. In Predictions, you can see that Mean Learner returns one (mean) value for all instances.
  
../../_images/Constant-regression.png
+
[[File:Constant-regression.png|center|200px|thumb]]
 +
 
  
  

Revision as of 08:35, 23 January 2020

Sumber: https://docs.biolab.si//3/visual-programming/widgets/model/constant.html


Predict the most frequent class or mean value from the training set.

Inputs

   Data: input dataset
   Preprocessor: preprocessing method(s)

Outputs

   Learner: majority/mean learning algorithm
   Model: trained model

This learner produces a model that always predicts themajority for classification tasks and mean value for regression tasks.

For classification, when predicting the class value with Predictions, the widget will return relative frequencies of the classes in the training set. When there are two or more majority classes, the classifier chooses the predicted class randomly, but always returns the same class for a particular example.

For regression, it learns the mean of the class variable and returns a predictor with the same mean value.

The widget is typically used as a baseline for other models.

Constant-stamped.png

This widget provides the user with two options:

   The name under which it will appear in other widgets. Default name is “Constant”.
   Produce a report.

If you change the widget’s name, you need to click Apply. Alternatively, tick the box on the left side and changes will be communicated automatically. Examples

In a typical classification example, we would use this widget to compare the scores of other learning algorithms (such as kNN) with the default scores. Use iris dataset and connect it to Test & Score. Then connect Constant and kNN to Test & Score and observe how well kNN performs against a constant baseline.

Constant-classification.png

For regression, we use Constant to construct a predictor in Predictions. We used the housing dataset. In Predictions, you can see that Mean Learner returns one (mean) value for all instances.

Constant-regression.png



Referensi

Pranala Menarik