Difference between revisions of "Orange: Tree Viewer"

From OnnoWiki
Jump to navigation Jump to search
Line 5: Line 5:
 
A visualization of classification and regression trees.
 
A visualization of classification and regression trees.
  
Inputs
+
==Input==
  
    Tree: decision tree
+
Tree: decision tree
  
Outputs
+
==Output==
  
    Selected Data: instances selected from the tree node
+
Selected Data: instances selected from the tree node
    Data: data with an additional column showing whether a point is selected
+
Data: data with an additional column showing whether a point is selected
  
 
This is a versatile widget with 2-D visualization of classification and regression trees. The user can select a node, instructing the widget to output the data associated with the node, thus enabling explorative data analysis.
 
This is a versatile widget with 2-D visualization of classification and regression trees. The user can select a node, instructing the widget to output the data associated with the node, thus enabling explorative data analysis.
Line 18: Line 18:
 
[[File:TreeViewer-stamped.png|center|200px|thumb]]
 
[[File:TreeViewer-stamped.png|center|200px|thumb]]
  
    Information on the input.
+
* Information on the input.
 +
* Display options:
  
    Display options:
+
** Zoom in and zoom out
        Zoom in and zoom out
+
** Select the tree width. The nodes display information bubbles when hovering over them.
        Select the tree width. The nodes display information bubbles when hovering over them.
+
** Select the depth of your tree.
        Select the depth of your tree.
+
** Select edge width. The edges between the nodes in the tree graph are drawn based on the selected edge width.
        Select edge width. The edges between the nodes in the tree graph are drawn based on the selected edge width.
+
 
            All the edges will be of equal width if Fixed is chosen.
+
*** All the edges will be of equal width if Fixed is chosen.
            When Relative to root is selected, the width of the edge will correspond to the proportion of instances in the corresponding node with respect to all the instances in the training data. Under this selection, the edge will get thinner and thinner when traversing toward the bottom of the tree.
+
*** When Relative to root is selected, the width of the edge will correspond to the proportion of instances in the corresponding node with respect to all the instances in the training data. Under this selection, the edge will get thinner and thinner when traversing toward the bottom of the tree.
            Relative to parent makes the edge width correspond to the proportion of instances in the nodes with respect to the instances in their parent node.
+
*** Relative to parent makes the edge width correspond to the proportion of instances in the nodes with respect to the instances in their parent node.
        Define the target class, which you can change based on classes in the data.
+
 
    Press Save image to save the created tree graph to your computer as a .svg or .png file.
+
**        Define the target class, which you can change based on classes in the data.
    Produce a report.
+
 
 +
* Press Save image to save the created tree graph to your computer as a .svg or .png file.
 +
* Produce a report.
  
 
==Contoh==
 
==Contoh==

Revision as of 09:20, 28 January 2020

Sumber: https://docs.biolab.si//3/visual-programming/widgets/visualize/treeviewer.html


A visualization of classification and regression trees.

Input

Tree: decision tree

Output

Selected Data: instances selected from the tree node
Data: data with an additional column showing whether a point is selected

This is a versatile widget with 2-D visualization of classification and regression trees. The user can select a node, instructing the widget to output the data associated with the node, thus enabling explorative data analysis.

TreeViewer-stamped.png
  • Information on the input.
  • Display options:
    • Zoom in and zoom out
    • Select the tree width. The nodes display information bubbles when hovering over them.
    • Select the depth of your tree.
    • Select edge width. The edges between the nodes in the tree graph are drawn based on the selected edge width.
      • All the edges will be of equal width if Fixed is chosen.
      • When Relative to root is selected, the width of the edge will correspond to the proportion of instances in the corresponding node with respect to all the instances in the training data. Under this selection, the edge will get thinner and thinner when traversing toward the bottom of the tree.
      • Relative to parent makes the edge width correspond to the proportion of instances in the nodes with respect to the instances in their parent node.
    • Define the target class, which you can change based on classes in the data.
  • Press Save image to save the created tree graph to your computer as a .svg or .png file.
  • Produce a report.

Contoh

Below, is a simple classification schema, where we have read the data, constructed the decision tree and viewed it in our Tree Viewer. If both the viewer and Tree are open, any re-run of the tree induction algorithm will immediately affect the visualization. You can thus use this combination to explore how the parameters of the induction algorithm influence the structure of the resulting tree.

TreeViewer-classification.png

Clicking on any node will output the related data instances. This is explored in the schema below that shows the subset in the data table and in the Scatter Plot. Make sure that the tree data is passed as a data subset; this can be done by connecting the Scatter Plot to the File widget first, and connecting it to the Tree Viewer widget next. Selected data will be displayed as bold dots.

Tree Viewer can also export labeled data. Connect Data Table to Tree Viewer and set the link between widgets to Data instead of Selected Data. This will send the entire data to Data Table with an additional meta column labeling selected data instances (Yes for selected and No for the remaining).

TreeViewer-selection.png

Finally, Tree Viewer can be used also for visualizing regression trees. Connect Random Forest to File widget using housing.tab dataset. Then connect Pythagorean Forest to Random Forest. In Pythagorean Forest select a regression tree you wish to further analyze and pass it to the Tree Viewer. The widget will display the constructed tree. For visualizing larger trees, especially for regression, Pythagorean Tree could be a better option.

TreeViewer-regression.png


Referensi

Pranala Menarik