//
//Decision Tree command
//
//This command makes decision tree of target variable by explanation variable.
//

//Syntax
tree [target] by [explanations]/
target/[binominal values]
[options]
;
//(caution) target variable must be binominal values;

//Options
enforce/[variable]           //[variable] is divided forcibly at first tree branch.
test=0.xx                    //xx is test data share which is used for inspection of precision.
terminal=nn                  //nn is minimum records at terminal node(default 100).
[variable]:code              //if variable type is numeric code you have to define code.
[variable]:continuous        //if numeric type  you don't need to define explicitly.
[variable]:moji              //if character type  you don't need to define explicitly.
[variable]:


//Example 1 is golfpay dicision at condition.
hand outlook temperature humidity windy status/
sunny    85  85  false  Don'tPlay
sunny    80  90  true   Don'tPlay
overcast 83  78  false  Play
rain     70  96  false  Play
rain     68  80  false  Play
rain     65  70  true   Don'tPlay
overcast 64  65  true   Play
sunny    72  95  false  Don'tPlay
sunny    69  70  false  Play
rain     75  80  false  Play
sunny    75  70  true   Play
overcast 72  90  true   Play
overcast 81  75  false  Play
rain     71  80  true   Don'tPlay
;

tree status by outlook temperature humidity windy/ target/Play,Don'tPlay terminal=1 ;

//Eample 2 is credit card /***/ This file concerns credit card applications. Some attribute names and values have been changed to meaningless symbols to protect confidentiality of the data. ***/ get credit.csv@;

/* //At first,select meaningful variable by aic command. aic status by sex old span a4 - 7 rate a9 a10 jobcode a12 a13 debt amount/ jobcode:code ; */ //execute Decision Tree function by selected meaningful variable by aic; tree status by sex old span a4 - 7 rate a9 a10 jobcode a12 a13 debt amount/ target/+,- jobcode:code terminal=10 ;

Show dicsion tree


Show precison by effective table

//get score of decision tree from outputs get freq@ana //graph for inspection of precision plot line distincRate distincRatio by countRate;