same predicted class value REPTree

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

same predicted class value REPTree

Mahnaz
Greetings,

I have created the following decision tree (REPTree) using WEKA (stable 3.8.0):
H < 5.5
|   NP < 21.5
|   |   H < 1.5
|   |   |   NP < 12.5
|   |   |   |   NP < 8.5 : 103.3 (12/7.91) [8/9.69]
|   |   |   |   NP >= 8.5 : 116.64 (32/28.64) [18/31.09]
|   |   |   NP >= 12.5 : 137.98 (25/39.4) [16/52.11]
|   |   H >= 1.5
|   |   |   H < 2.5
|   |   |   |   NP < 16.5
|   |   |   |   |   NP < 14.5 : 180.63 (19/18.05) [8/21.79]
|   |   |   |   |   NP >= 14.5 : 191.41 (12/13.14) [5/29.89]
|   |   |   |   NP >= 16.5
|   |   |   |   |   NP < 18.5 : 202.9 (14/19.2) [6/9.65]
|   |   |   |   |   NP >= 18.5 : 214.96 (18/24.35) [6/64.48]
|   |   |   H >= 2.5 : 262.98 (31/54.32) [13/12.73]
|   NP >= 21.5
|   |   H < 4.5
|   |   |   H < 3.5
|   |   |   |   NP < 24.5 : 280.38 (14/27.17) [7/31.72]
|   |   |   |   NP >= 24.5 : 293.68 (13/10.83) [6/11.12]
|   |   |   H >= 3.5
|   |   |   |   NP < 26.5 : 335.08 (33/41.96) [16/65.07]
|   |   |   |   NP >= 26.5
|   |   |   |   |   NP < 28.5 : 352.27 (19/10.95) [7/29.86]
|   |   |   |   |   NP >= 28.5 : 366.45 (10/12.69) [10/53.21]
|   |   H >= 4.5
|   |   |   NP < 30.5
|   |   |   |   NP < 29.5 : 404.67 (16/23.34) [11/32.4]
|   |   |   |   NP >= 29.5 : 415.25 (11/8.41) [5/12.93]
|   |   |   NP >= 30.5 : 431.78 (39/45.73) [19/104.93]
H >= 5.5
|   NP < 46.5
|   |   H < 6.5
|   |   |   NP < 36.5
|   |   |   |   P < 1.5 : 481 (16/15.96) [11/49.55]
|   |   |   |   P >= 1.5 : 491.59 (14/7.49) [3/6.51]
|   |   |   NP >= 36.5
|   |   |   |   NP < 39.5 : 504.74 (24/25.64) [10/39.28]
|   |   |   |   NP >= 39.5 : 517.27 (17/18.12) [5/5.6]
|   |   H >= 6.5
|   |   |   H < 7.5
|   |   |   |   NP < 41.5
|   |   |   |   |   NP < 38.5 : 552.89 (12/18) [6/15.33]
|   |   |   |   |   NP >= 38.5 : 564.26 (20/21.94) [11/14]
|   |   |   |   NP >= 41.5 : 583.49 (33/28.38) [18/79.99]
|   |   |   H >= 7.5
|   |   |   |   NP < 43.5 : 627.06 (9/13.88) [7/24.93]
|   |   |   |   NP >= 43.5 : 639.94 (17/15.2) [17/8.31]
|   NP >= 46.5
|   |   H < 9.5
|   |   |   H < 8.5 : 660.62 (37/47) [18/47.3]
|   |   |   H >= 8.5
|   |   |   |   NP < 51.5 : 712.31 (37/45.7) [11/23.46]
|   |   |   |   NP >= 51.5
|   |   |   |   |   NP < 53.5 : 728.18 (19/17.58) [3/17.19]
|   |   |   |   |   NP >= 53.5 : 740.33 (18/25.4) [9/35.58]
|   |   H >= 9.5
|   |   |   NP < 56.5
|   |   |   |   NP < 53.5 : 776.27 (9/16.44) [6/28.22]
|   |   |   |   NP >= 53.5 : 789.88 (28/16.81) [14/30.12]
|   |   |   NP >= 56.5
|   |   |   |   NP < 59.5 : 804.77 (18/9.46) [13/10.46]
|   |   |   |   NP >= 59.5 : 818.75 (10/16.81) [6/11.16]

The problem is that regardless of the samples, I get almost always the same predicted class values for the new samples.
I used "classifyInstance" for the classification of one instance.

Some of the results of one instance classification using  classifyInstance  method are as follows:
instance : {P=1, NP=43, PBD=82, H=8, IPD=627}
predicted class value : 293.6842105263158

instance : {P=1, NP=35, PBD=61, H=6, IPD=495}
The predicted value : 293.6842105263158

instance : {P=1, NP=22, PBD=43, H=4, IPD=328}
predicted class value : 293.6842105263158

instance : {P=1, NP=15, PBD=19, H=2, IPD=193}
predicted class value : 137.97560975609755

I would appreciate it if someone can tell me what I am doing wrong.

Best regards,
Mahnaz

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: same predicted class value REPTree

Michael Hall


On Jul 28, 2020, at 6:43 AM, Mahnaz Ghafari <[hidden email]> wrote:

|   NP >= 21.5
|   |   H < 4.5
|   |   |   H < 3.5
|   |   |   |   NP < 24.5 : 280.38 (14/27.17) [7/31.72]
|   |   |   |   NP >= 24.5 : 293.68 (13/10.83) [6/11.12]

To get 293.68 in the decision tree as shown only depends on NP and H 

Some of the results of one instance classification using  classifyInstance  method are as follows:
instance : {P=1, NP=43, PBD=82, H=8, IPD=627}
predicted class value : 293.6842105263158

instance : {P=1, NP=35, PBD=61, H=6, IPD=495}
The predicted value : 293.6842105263158

instance : {P=1, NP=22, PBD=43, H=4, IPD=328}
predicted class value : 293.6842105263158

instance : {P=1, NP=15, PBD=19, H=2, IPD=193}
predicted class value : 137.97560975609755

Different PBD or P or IPD values aren’t going to get a different result on the tree.
Would be my guess. Although I haven’’t actually tried checking the decision tree for your specific instance values.

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: same predicted class value REPTree

Mahnaz
Thank you Michael for your answer. You are right. The value of PBD does not matter (but P does). Still the results do not make sense.
At the first level tree branches over the value of H. (H < 5.5 or not ). 
For example, the correct predicted value for some of the instances should be as follows:
instance : {P=1, NP=43, PBD=82, H=8, IPD=627}
predicted class value : 293.6842105263158
correct class value :  627.06

instance : {P=1, NP=35, PBD=61, H=6, IPD=495}
The predicted value : 293.6842105263158
correct class value :  481

I can not see why they get a different predicted class value. 

On Wed, Jul 29, 2020 at 1:32 AM Michael Hall <[hidden email]> wrote:


On Jul 28, 2020, at 6:43 AM, Mahnaz Ghafari <[hidden email]> wrote:

|   NP >= 21.5
|   |   H < 4.5
|   |   |   H < 3.5
|   |   |   |   NP < 24.5 : 280.38 (14/27.17) [7/31.72]
|   |   |   |   NP >= 24.5 : 293.68 (13/10.83) [6/11.12]

To get 293.68 in the decision tree as shown only depends on NP and H 

Some of the results of one instance classification using  classifyInstance  method are as follows:
instance : {P=1, NP=43, PBD=82, H=8, IPD=627}
predicted class value : 293.6842105263158

instance : {P=1, NP=35, PBD=61, H=6, IPD=495}
The predicted value : 293.6842105263158

instance : {P=1, NP=22, PBD=43, H=4, IPD=328}
predicted class value : 293.6842105263158

instance : {P=1, NP=15, PBD=19, H=2, IPD=193}
predicted class value : 137.97560975609755

Different PBD or P or IPD values aren’t going to get a different result on the tree.
Would be my guess. Although I haven’’t actually tried checking the decision tree for your specific instance values.
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: same predicted class value REPTree

Michael Hall


On Jul 29, 2020, at 2:13 AM, Mahnaz Ghafari <[hidden email]> wrote:

Thank you Michael for your answer. You are right. The value of PBD does not matter (but P does). Still the results do not make sense.
At the first level tree branches over the value of H. (H < 5.5 or not ). 
For example, the correct predicted value for some of the instances should be as follows:
instance : {P=1, NP=43, PBD=82, H=8, IPD=627}
predicted class value : 293.6842105263158
correct class value :  627.06

instance : {P=1, NP=35, PBD=61, H=6, IPD=495}
The predicted value : 293.6842105263158
correct class value :  481

I can not see why they get a different predicted class value. 


P does not seem to matter for the part of the tree that you posted. 
I did step through one instance and seemed to get a different result from what you posted. I thought it might be difficult to determine why the difference occurs, so stopped there.
Is the data somewhere you are allowed to post it?  If so are you using any non default classifier settings.
Otherwise, it is difficult to say what might account for any unexpected results. 


_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html