You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Ikumasa Mukai (Created) (JIRA)" <ji...@apache.org> on 2011/12/13 04:57:30 UTC

[jira] [Created] (MAHOUT-926) Adding the Tree/Forest Visualizer

Adding the Tree/Forest Visualizer
---------------------------------

                 Key: MAHOUT-926
                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
             Project: Mahout
          Issue Type: Improvement
          Components: Classification
            Reporter: Ikumasa Mukai


TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-926) Add the Tree/Forest Visualizer

Posted by "Ikumasa Mukai (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ikumasa Mukai updated MAHOUT-926:
---------------------------------

    Summary: Add the Tree/Forest Visualizer  (was: Adding the Tree/Forest Visualizer)
    
> Add the Tree/Forest Visualizer
> ------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>              Labels: test
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-926) Add the Tree/Forest Visualizer

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176040#comment-13176040 ] 

Hudson commented on MAHOUT-926:
-------------------------------

Integrated in Mahout-Quality #1273 (See [https://builds.apache.org/job/Mahout-Quality/1273/])
    MAHOUT-926 Tree/Forest Visualizer

adeneche : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1224751
Files : 
* /mahout/trunk/core/src/main/java/org/apache/mahout/classifier/df/tools/ForestVisualizer.java
* /mahout/trunk/core/src/main/java/org/apache/mahout/classifier/df/tools/TreeVisualizer.java
* /mahout/trunk/core/src/test/java/org/apache/mahout/classifier/df/tools
* /mahout/trunk/core/src/test/java/org/apache/mahout/classifier/df/tools/VisualizerTest.java

                
> Add the Tree/Forest Visualizer
> ------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>            Assignee: Deneche A. Hakim
>              Labels: test
>             Fix For: 0.6
>
>         Attachments: MAHOUT-926.patch, MAHOUT-926.patch
>
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-926) Adding the Tree/Forest Visualizer

Posted by "Ikumasa Mukai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168117#comment-13168117 ] 

Ikumasa Mukai commented on MAHOUT-926:
--------------------------------------

We can get the result like this.

i. iris - classification
{noformat}petallength < 3.3 : Iris-setosa
petallength >= 3.3
|   petalwidth < 1.8
|   |   petallength < 5
|   |   |   petalwidth < 1.7 : Iris-versicolor
|   |   |   petalwidth >= 1.7 : Iris-virginica
|   |   petallength >= 5
|   |   |   petalwidth < 1.6 : Iris-virginica
|   |   |   petalwidth >= 1.6
|   |   |   |   sepallength < 7.2 : Iris-versicolor
|   |   |   |   sepallength >= 7.2 : Iris-virginica
|   petalwidth >= 1.8
|   |   petallength < 4.9
|   |   |   sepallength < 6 : Iris-versicolor
|   |   |   sepallength >= 6 : Iris-virginica
|   |   petallength >= 4.9 : Iris-virginica
{noformat} 

ii. cars - regression
{noformat}speed < 30
|   speed < 12
|   |   speed < 3 : 4
|   |   speed >= 3
|   |   |   speed < 7 : 7
|   |   |   speed >= 7 : 6.5
|   speed >= 12
|   |   speed < 23
|   |   |   speed < 21
|   |   |   |   speed < 19
|   |   |   |   |   speed < 15 : 12
|   |   |   |   |   speed >= 15
|   |   |   |   |   |   speed < 16.5 : 8
|   |   |   |   |   |   speed >= 16.5
|   |   |   |   |   |   |   speed < 17.5 : 11
|   |   |   |   |   |   |   speed >= 17.5 : 10
|   |   |   |   speed >= 19 : 13.5
|   |   |   speed >= 21 : 7
|   |   speed >= 23
|   |   |   speed < 27
|   |   |   |   speed < 25 : 12
|   |   |   |   speed >= 25 : 13
|   |   |   speed >= 27 : 11.5
speed >= 30
|   speed < 84.5
---snip---
{noformat}
                
> Adding the Tree/Forest Visualizer
> ---------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>              Labels: test
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MAHOUT-926) Add the Tree/Forest Visualizer

Posted by "Deneche A. Hakim (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175823#comment-13175823 ] 

Deneche A. Hakim commented on MAHOUT-926:
-----------------------------------------

I am checking the patch right now, if no problem is encountered I will commit it right after. This is really a cool addition to Mahout's DF.
                
> Add the Tree/Forest Visualizer
> ------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>              Labels: test
>         Attachments: MAHOUT-926.patch, MAHOUT-926.patch
>
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-926) Add the Tree/Forest Visualizer

Posted by "Ikumasa Mukai (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ikumasa Mukai updated MAHOUT-926:
---------------------------------

    Attachment: MAHOUT-926.patch
    
> Add the Tree/Forest Visualizer
> ------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>              Labels: test
>         Attachments: MAHOUT-926.patch, MAHOUT-926.patch
>
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MAHOUT-926) Add the Tree/Forest Visualizer

Posted by "Deneche A. Hakim (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deneche A. Hakim resolved MAHOUT-926.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.6
         Assignee: Deneche A. Hakim
    
> Add the Tree/Forest Visualizer
> ------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>            Assignee: Deneche A. Hakim
>              Labels: test
>             Fix For: 0.6
>
>         Attachments: MAHOUT-926.patch, MAHOUT-926.patch
>
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MAHOUT-926) Add the Tree/Forest Visualizer

Posted by "Ikumasa Mukai (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ikumasa Mukai updated MAHOUT-926:
---------------------------------

    Attachment: MAHOUT-926.patch

I made a patch which can be used on your code like this.
Sorry for late to attach.

To dump tree:
{code}
DecisionTreeBuilder builder = new DecisionTreeBuilder();
Node tree = builder.build(RandomUtils.getRandom(), data);
TreeVisualizer.print(tree, data.getDataset(),
 new String[] {"sepallength", "sepalwidth", "petallength", "petalwidth", "class"});
{code}

To check the route:
{code}
TreeVisualizer.predictTracePrint(tree, testData,
  new String[] {"sepallength", "sepalwidth", "petallength", "petalwidth", "class"});
{code}
The result for predictTracePrint.
{noformat}
(petallength = 4.7) >= 3.3 -> (petalwidth = 1.4) < 1.8 -> (petallength = 4.7) < 5 -> (petalwidth = 1.4) < 1.7 -> Iris-versicolor
{noformat}

In addition, ForestVisualizer can be used as a cli tool.
{noformat}
.. ForestVisualizer -ds dataset/iris.info -m model/iris -n sepallength sepalwidth petallength petalwidth class
{noformat}
The result.
{noformat}
Tree[1]:
petallength < 3.5 : Iris-setosa
petallength >= 3.5
|   petalwidth < 1.8
|   |   petallength < 5 : Iris-versicolor
|   |   petallength >= 5
|   |   |   petalwidth < 1.7 : Iris-virginica
|   |   |   petalwidth >= 1.7 : Iris-versicolor
|   petalwidth >= 1.8
|   |   petallength < 4.9
|   |   |   sepallength < 6 : Iris-versicolor
|   |   |   sepallength >= 6 : Iris-virginica
|   |   petallength >= 4.9 : Iris-virginica
Tree[2]:
petallength < 3.3 : Iris-setosa
petallength >= 3.3
|   petalwidth < 1.8
|   |   sepalwidth < 2.3 : Iris-virginica
|   |   sepalwidth >= 2.3
|   |   |   petallength < 5.6
|   |   |   |   sepallength < 5.5
|   |   |   |   |   sepalwidth < 2.5 : Iris-versicolor
|   |   |   |   |   sepalwidth >= 2.5 : Iris-virginica
|   |   |   |   sepallength >= 5.5 : Iris-versicolor
|   |   |   petallength >= 5.6 : Iris-virginica
|   petalwidth >= 1.8 : Iris-virginica
Tree[3]:
petallength < 3.3 : Iris-setosa
petallength >= 3.3
|   petalwidth < 1.8
|   |   petallength < 5 : Iris-versicolor
|   |   petallength >= 5
|   |   |   petalwidth < 1.7 : Iris-virginica
|   |   |   petalwidth >= 1.7 : Iris-versicolor
|   petalwidth >= 1.8 : Iris-virginica
Tree[4]:
.
-snip-
.
{noformat}

All trees in the forest are dumped.
                
> Add the Tree/Forest Visualizer
> ------------------------------
>
>                 Key: MAHOUT-926
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-926
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Classification
>            Reporter: Ikumasa Mukai
>              Labels: test
>         Attachments: MAHOUT-926.patch
>
>
> TreePrinter and ForestPrinter are made for checking the model on MAHOUT-840.
> I think they are useful for checking the model and making unit testing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira