machine learning - Why is Decision tree not working as expected in WEKA? -


i following book "machine learning: hands-on developers , technical professionals" create decision tree weka. though followed same process shown in book, not getting same decision tree. using c4.5 (j48) algorithm.

data (arff file)

@relation ladygaga  @attribute placement {end_rack, cd_spec, std_rack} @attribute prominence numeric @attribute pricing numeric @attribute eye_level {true, false} @attribute customer_purchase {yes, no}  @data end_rack,85,85,false,yes end_rack,80,90,true,yes cd_spec,83,86,false,no std_rack,70,96,false,no std_rack,68,80,false,no std_rack,65,70,true,yes cd_spec,64,65,true,yes end_rack,72,95,false,yes end_rack,69,70,false,no std_rack,75,80,false,no end_rack,75,70,true,no cd_spec,72,90,true,no cd_spec,81,75,false,yes std_rack,71,91,true,yes 

expected output expected output

my output my output

what doing wrong?

it problem book (keeping answer on here can other readers of book).

book expects 1 negative case in end_rack category (look (5,1) in author's tree diagram). in data provided in book , on book website, there 2 negative cases (5,2). removed 1 negative case , got same decision tree book.

here corrected data arff file

@relation ladygaga  @attribute placement {end_rack, cd_spec, std_rack} @attribute prominence numeric @attribute pricing numeric @attribute eye_level {true, false} @attribute customer_purchase {yes, no}  @data end_rack,85,85,false,yes end_rack,80,90,true,yes cd_spec,83,86,false,no std_rack,70,96,false,no std_rack,68,80,false,no std_rack,65,70,true,yes cd_spec,64,65,true,yes end_rack,72,95,false,yes end_rack,69,70,false,yes std_rack,75,80,false,no end_rack,75,70,true,no cd_spec,72,90,true,no cd_spec,81,75,false,yes std_rack,71,91,true,yes 

correct output decision tree corrected data


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -