[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wekalist
Subject:    [Wekalist] J48 Decision Tree Pruning - Removing Entire Bag of Distribution
From:       chew yee jian <chewyeejian () gmail ! com>
Date:       2018-07-31 7:38:13
Message-ID: CAJkkojPbF_n7cZMH40j5dkYYGorfj4WUq=H5AQm+g9xD1VvFNw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


In *C45PruneableClassifierTree.java [public void prune()],*
are there any way to remove the entire "BAG" of Distribution?

For example (using weather dataset in weka),
On the first pruning procedure, the output of the results are as follows:

*System.out.println(localModel().dumpModel(m_train));*


*humidity = high: no (3.0)humidity = normal: yes (2.0)*


*System.out.println(localModel().m_distribution.dumpDistribution());*






*Bag num 0Class num 0 0.0Class num 1 3.0Bag num 1Class num 0 2.0Class num 1
0.0*

I would like to achieve something like removing the entire "*Bag num 0*", I
have tried to remove the instances / distribution by using the following
commands:
#1



*m_train.remove(0);m_train.remove(0);                m_train.remove(0);   *
*newDistribution(m_train);   *

#2
*localModel().distribution().delRange(0, m_train, 0, 3);  *//remove
distribution 0~2 in bag num 0

Output:






*Bag num 0Class num 0 0.0Class num 1 0.0Bag num 1Class num 0 2.0Class num 1
0.0*

Although the instances/distribution available in bag num 0 are already
empty, the final output of the tree still consists of the Bag itself.

Final Output:
outlook = sunny
*|   humidity = high: yes (0.0)*
|   humidity = normal: yes (2.0)
outlook = overcast: yes (4.0)
outlook = rainy
|   windy = TRUE: no (2.0)
|   windy = FALSE: yes (3.0)


I would hope that it is possible to achieve something as below by removing
the entire bag of distribution.

Expected Output:
outlook = sunny : *No (5.0,2.0)*
*|   humidity = high: yes(0.0)   (Remove this line)*
|   humidity = normal: yes (2.0)
outlook = overcast: yes (4.0)
outlook = rainy
|   windy = TRUE: no (2.0)
|   windy = FALSE: yes (3.0)

[Attachment #5 (text/html)]

<div dir="ltr"><div></div><div>In <b>C45PruneableClassifierTree.java [public void \
prune()],</b></div><div>are there any way to remove the entire &quot;BAG&quot; of \
Distribution?</div><div><br></div><div>For example (using weather dataset in \
weka),</div><div>On the first pruning procedure, the output of the results are as \
follows:<br></div><div \
style="margin-left:40px"><i><b>System.out.println(localModel().dumpModel(m_train));</b><br></i></div><div \
style="margin-left:80px"><i>humidity = high: no (3.0)<br>humidity = normal: yes \
(2.0)<br></i></div><div style="margin-left:80px"><i><br></i></div><div \
style="margin-left:40px"><i><b>System.out.println(localModel().m_distribution.dumpDistribution());</b><br></i></div><div \
style="margin-left:80px"><i>Bag num 0<br>Class num 0 0.0<br>Class num 1 3.0<br>Bag \
num 1<br>Class num 0 2.0<br>Class num 1 0.0<br></i></div><div \
style="margin-left:80px"><i><br></i></div><div>I would like to achieve something like \
removing the entire &quot;<i>Bag num 0</i>&quot;, I have tried to remove the \
instances / distribution by using the following commands:</div><div><div \
style="margin-left:40px">#1                   <br></div><div \
style="margin-left:40px"><b>m_train.remove(0);<br>m_train.remove(0);                  \
<br>m_train.remove(0);     <br></b></div><div \
style="margin-left:40px"><b>newDistribution(m_train);     </b><br></div><div \
style="margin-left:80px"><br></div><div style="margin-left:40px">#2 \
<br></div><div><div style="margin-left:40px"><b>localModel().distribution().delRange(0, \
m_train, 0, 3);   </b>//remove distribution 0~2 in bag num 0 <br></div><div \
style="margin-left:80px"><br></div><div \
style="margin-left:40px">Output:<br></div><div style="margin-left:80px"><i><span \
style="color:rgb(255,0,0)"><b>Bag num 0<br>Class num 0 0.0<br>Class num 1 \
0.0</b></span><br>Bag num 1<br>Class num 0 2.0<br>Class num 1 0.0<br></i></div><div \
style="margin-left:80px"><i><br></i></div>Although the instances/distribution \
available in bag num 0 are already empty, the final output of the tree still consists \
of the Bag itself.</div><div><br></div><div style="margin-left:40px">Final \
Output:</div><div style="margin-left:80px">outlook = sunny<br><span \
style="color:rgb(255,0,0)"><b><i>|     humidity = high: yes (0.0)</i></b></span><br>| \
humidity = normal: yes (2.0)<br>outlook = overcast: yes (4.0)<br>outlook = rainy<br>| \
windy = TRUE: no (2.0)<br>|     windy = FALSE: yes (3.0)</div><div \
style="margin-left:80px"><br></div><div \
style="margin-left:80px"><br></div></div><div>I would hope that it is possible to \
achieve something as below by removing the entire bag of distribution. \
<br></div><div><br></div><div style="margin-left:40px">Expected Output:</div><div \
style="margin-left:80px"> outlook = sunny : <b>No (5.0,2.0)</b><br><span \
style="color:rgb(255,0,0)"><b><i>|     <strike>humidity = high: yes(0.0) </strike>   \
(Remove this line)</i></b></span><br>|     humidity = normal: yes (2.0)<br>outlook = \
overcast: yes (4.0)<br>outlook = rainy<br>|     windy = TRUE: no (2.0)<br>|     windy \
= FALSE: yes (3.0)

<br></div><div><div style="margin-left:80px"><br></div><div><br></div></div></div>



_______________________________________________
Wekalist mailing list
Send posts to: Wekalist@list.waikato.ac.nz
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic