R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

library(readr)
credit <- read_csv("/Users/bezatilahun/Downloads/credit.csv")
## Rows: 1000 Columns: 17
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (10): checking_balance, credit_history, purpose, savings_balance, employ...
## dbl  (7): months_loan_duration, amount, percent_of_income, years_at_residenc...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(credit)
library(dplyr)
## 
## Attaching package: 'dplyr'
## 
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(readr)
library(C50)
library(gmodels)
table(credit$checking_balance)
## 
##     < 0 DM   > 200 DM 1 - 200 DM    unknown 
##        274         63        269        394
table(credit$savings_balance)
## 
##      < 100 DM     > 1000 DM  100 - 500 DM 500 - 1000 DM       unknown 
##           603            48           103            63           183
summary(credit$months_loan_duration)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     4.0    12.0    18.0    20.9    24.0    72.0
summary(credit$amount)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     250    1366    2320    3271    3972   18424
table(credit$default)
## 
##  no yes 
## 700 300
train_sample <- sample(1000, 900)
str(train_sample)
##  int [1:900] 969 611 795 749 16 895 794 753 356 232 ...
credit_train <- credit[train_sample, ]
credit_test  <- credit[-train_sample, ]
prop.table(table(credit_train$default))
## 
##        no       yes 
## 0.7055556 0.2944444
#Splittinb the dataset in training and test dataset
credit_train <- credit[train_sample, ]
credit_test  <- credit[-train_sample, ]
credit_train$default <- factor(credit_train$default)
prop.table(table(credit_train$default))
## 
##        no       yes 
## 0.7055556 0.2944444
prop.table(table(credit_test$default))
## 
##   no  yes 
## 0.65 0.35
library(C50)
credit_model <- C5.0(credit_train[-17], credit_train$default)
credit_model
## 
## Call:
## C5.0.default(x = credit_train[-17], y = credit_train$default)
## 
## Classification Tree
## Number of samples: 900 
## Number of predictors: 16 
## 
## Tree size: 61 
## 
## Non-standard options: attempt to group attributes
summary(credit_model)
## 
## Call:
## C5.0.default(x = credit_train[-17], y = credit_train$default)
## 
## 
## C5.0 [Release 2.07 GPL Edition]      Tue Mar 26 20:28:56 2024
## -------------------------------
## 
## Class specified by attribute `outcome'
## 
## Read 900 cases (17 attributes) from undefined.data
## 
## Decision tree:
## 
## checking_balance = unknown: no (362/43)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...credit_history in {very good,perfect}:
##     :...savings_balance in {100 - 500 DM,< 100 DM}: yes (53/13)
##     :   savings_balance in {unknown,500 - 1000 DM,> 1000 DM}:
##     :   :...purpose in {furniture/appliances,car,business,
##     :       :           renovations}: no (9)
##     :       purpose in {education,car0}: yes (2)
##     credit_history in {good,critical,poor}:
##     :...months_loan_duration <= 15: no (199/51)
##         months_loan_duration > 15:
##         :...savings_balance = 500 - 1000 DM: yes (3/1)
##             savings_balance = > 1000 DM: no (10/1)
##             savings_balance = 100 - 500 DM:
##             :...credit_history in {critical,poor}: no (13/2)
##             :   credit_history = good:
##             :   :...months_loan_duration > 27: yes (6)
##             :       months_loan_duration <= 27:
##             :       :...housing = rent: yes (2)
##             :           housing in {own,other}: no (10/2)
##             savings_balance = unknown:
##             :...amount <= 1546: yes (6)
##             :   amount > 1546:
##             :   :...existing_loans_count > 1: no (14)
##             :       existing_loans_count <= 1:
##             :       :...credit_history in {critical,poor}: no (5)
##             :           credit_history = good:
##             :           :...months_loan_duration <= 33: no (15/3)
##             :               months_loan_duration > 33:
##             :               :...other_credit in {none,store}: yes (4)
##             :                   other_credit = bank: no (1)
##             savings_balance = < 100 DM:
##             :...months_loan_duration > 47: yes (18/2)
##                 months_loan_duration <= 47:
##                 :...housing = other:
##                     :...credit_history = poor: yes (3)
##                     :   credit_history in {good,critical}:
##                     :   :...amount > 11590: yes (2)
##                     :       amount <= 11590:
##                     :       :...amount <= 2746: yes (4/1)
##                     :           amount > 2746: no (12)
##                     housing = rent:
##                     :...age > 45: no (3)
##                     :   age <= 45:
##                     :   :...existing_loans_count > 1: yes (6)
##                     :       existing_loans_count <= 1:
##                     :       :...employment_duration = 4 - 7 years: no (4/1)
##                     :           employment_duration in {unemployed,> 7 years,
##                     :           :                       < 1 year}: yes (10/1)
##                     :           employment_duration = 1 - 4 years:
##                     :           :...years_at_residence <= 3: no (3)
##                     :               years_at_residence > 3: yes (3)
##                     housing = own:
##                     :...purpose = renovations: no (3)
##                         purpose = education:
##                         :...checking_balance in {< 0 DM,> 200 DM}: yes (4)
##                         :   checking_balance = 1 - 200 DM: no (1)
##                         purpose = car0:
##                         :...checking_balance in {< 0 DM,> 200 DM}: no (2)
##                         :   checking_balance = 1 - 200 DM: yes (3/1)
##                         purpose = business:
##                         :...credit_history = poor: yes (3)
##                         :   credit_history in {good,critical}:
##                         :   :...amount <= 2186: yes (2)
##                         :       amount > 2186: no (8/1)
##                         purpose = car:
##                         :...employment_duration in {4 - 7 years,
##                         :   :                       unemployed}: yes (5)
##                         :   employment_duration = 1 - 4 years:
##                         :   :...years_at_residence <= 3: yes (3)
##                         :   :   years_at_residence > 3: no (3)
##                         :   employment_duration = < 1 year:
##                         :   :...amount <= 5511: yes (7/1)
##                         :   :   amount > 5511: no (2)
##                         :   employment_duration = > 7 years:
##                         :   :...other_credit = store: no (0)
##                         :       other_credit = bank: yes (2)
##                         :       other_credit = none:
##                         :       :...months_loan_duration <= 22: no (3)
##                         :           months_loan_duration > 22:
##                         :           :...amount <= 2629: yes (2)
##                         :               amount > 2629: no (2)
##                         purpose = furniture/appliances:
##                         :...months_loan_duration > 36: yes (4)
##                             months_loan_duration <= 36:
##                             :...existing_loans_count > 1:
##                                 :...credit_history = good: yes (1)
##                                 :   credit_history in {critical,poor}: no (7)
##                                 existing_loans_count <= 1:
##                                 :...other_credit = bank: yes (4/1)
##                                     other_credit = store:
##                                     :...amount <= 2241: yes (3)
##                                     :   amount > 2241: no (2)
##                                     other_credit = none: [S1]
## 
## SubTree [S1]
## 
## employment_duration in {4 - 7 years,unemployed}: yes (6/2)
## employment_duration = > 7 years: no (11/2)
## employment_duration = < 1 year:
## :...amount <= 3422: yes (5/1)
## :   amount > 3422: no (4)
## employment_duration = 1 - 4 years:
## :...credit_history = poor: no (0)
##     credit_history = critical: yes (1)
##     credit_history = good:
##     :...months_loan_duration > 21: no (8/1)
##         months_loan_duration <= 21:
##         :...checking_balance in {< 0 DM,> 200 DM}: yes (5)
##             checking_balance = 1 - 200 DM: no (2)
## 
## 
## Evaluation on training data (900 cases):
## 
##      Decision Tree   
##    ----------------  
##    Size      Errors  
## 
##      59  131(14.6%)   <<
## 
## 
##     (a)   (b)    <-classified as
##    ----  ----
##     611    24    (a): class no
##     107   158    (b): class yes
## 
## 
##  Attribute usage:
## 
##  100.00% checking_balance
##   59.78% credit_history
##   52.67% months_loan_duration
##   37.67% savings_balance
##   20.00% housing
##   14.33% purpose
##   13.78% existing_loans_count
##   11.11% amount
##   10.11% employment_duration
##    7.22% other_credit
##    3.22% age
##    1.33% years_at_residence
## 
## 
## Time: 0.0 secs
credit_pred <- predict(credit_model, credit_test)
library(gmodels)
CrossTable(credit_test$default, credit_pred,
           prop.chisq = FALSE, prop.c = FALSE, prop.r = FALSE,
           dnn = c('actual default', 'predicted default'))
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  100 
## 
##  
##                | predicted default 
## actual default |        no |       yes | Row Total | 
## ---------------|-----------|-----------|-----------|
##             no |        57 |         8 |        65 | 
##                |     0.570 |     0.080 |           | 
## ---------------|-----------|-----------|-----------|
##            yes |        17 |        18 |        35 | 
##                |     0.170 |     0.180 |           | 
## ---------------|-----------|-----------|-----------|
##   Column Total |        74 |        26 |       100 | 
## ---------------|-----------|-----------|-----------|
## 
## 
credit_boost10 <- C5.0(credit_train[-17], credit_train$default,
                       trials = 10)
credit_boost10
## 
## Call:
## C5.0.default(x = credit_train[-17], y = credit_train$default, trials = 10)
## 
## Classification Tree
## Number of samples: 900 
## Number of predictors: 16 
## 
## Number of boosting iterations: 10 
## Average tree size: 48.1 
## 
## Non-standard options: attempt to group attributes
summary(credit_boost10)
## 
## Call:
## C5.0.default(x = credit_train[-17], y = credit_train$default, trials = 10)
## 
## 
## C5.0 [Release 2.07 GPL Edition]      Tue Mar 26 20:28:56 2024
## -------------------------------
## 
## Class specified by attribute `outcome'
## 
## Read 900 cases (17 attributes) from undefined.data
## 
## -----  Trial 0:  -----
## 
## Decision tree:
## 
## checking_balance = unknown: no (362/43)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...credit_history in {very good,perfect}:
##     :...savings_balance in {100 - 500 DM,< 100 DM}: yes (53/13)
##     :   savings_balance in {unknown,500 - 1000 DM,> 1000 DM}:
##     :   :...purpose in {furniture/appliances,car,business,
##     :       :           renovations}: no (9)
##     :       purpose in {education,car0}: yes (2)
##     credit_history in {good,critical,poor}:
##     :...months_loan_duration <= 15: no (199/51)
##         months_loan_duration > 15:
##         :...savings_balance = 500 - 1000 DM: yes (3/1)
##             savings_balance = > 1000 DM: no (10/1)
##             savings_balance = 100 - 500 DM:
##             :...credit_history in {critical,poor}: no (13/2)
##             :   credit_history = good:
##             :   :...months_loan_duration > 27: yes (6)
##             :       months_loan_duration <= 27:
##             :       :...housing = rent: yes (2)
##             :           housing in {own,other}: no (10/2)
##             savings_balance = unknown:
##             :...amount <= 1546: yes (6)
##             :   amount > 1546:
##             :   :...existing_loans_count > 1: no (14)
##             :       existing_loans_count <= 1:
##             :       :...credit_history in {critical,poor}: no (5)
##             :           credit_history = good:
##             :           :...months_loan_duration <= 33: no (15/3)
##             :               months_loan_duration > 33:
##             :               :...other_credit in {none,store}: yes (4)
##             :                   other_credit = bank: no (1)
##             savings_balance = < 100 DM:
##             :...months_loan_duration > 47: yes (18/2)
##                 months_loan_duration <= 47:
##                 :...housing = other:
##                     :...credit_history = poor: yes (3)
##                     :   credit_history in {good,critical}:
##                     :   :...amount > 11590: yes (2)
##                     :       amount <= 11590:
##                     :       :...amount <= 2746: yes (4/1)
##                     :           amount > 2746: no (12)
##                     housing = rent:
##                     :...age > 45: no (3)
##                     :   age <= 45:
##                     :   :...existing_loans_count > 1: yes (6)
##                     :       existing_loans_count <= 1:
##                     :       :...employment_duration = 4 - 7 years: no (4/1)
##                     :           employment_duration in {unemployed,> 7 years,
##                     :           :                       < 1 year}: yes (10/1)
##                     :           employment_duration = 1 - 4 years:
##                     :           :...years_at_residence <= 3: no (3)
##                     :               years_at_residence > 3: yes (3)
##                     housing = own:
##                     :...purpose = renovations: no (3)
##                         purpose = education:
##                         :...checking_balance in {< 0 DM,> 200 DM}: yes (4)
##                         :   checking_balance = 1 - 200 DM: no (1)
##                         purpose = car0:
##                         :...checking_balance in {< 0 DM,> 200 DM}: no (2)
##                         :   checking_balance = 1 - 200 DM: yes (3/1)
##                         purpose = business:
##                         :...credit_history = poor: yes (3)
##                         :   credit_history in {good,critical}:
##                         :   :...amount <= 2186: yes (2)
##                         :       amount > 2186: no (8/1)
##                         purpose = car:
##                         :...employment_duration in {4 - 7 years,
##                         :   :                       unemployed}: yes (5)
##                         :   employment_duration = 1 - 4 years:
##                         :   :...years_at_residence <= 3: yes (3)
##                         :   :   years_at_residence > 3: no (3)
##                         :   employment_duration = < 1 year:
##                         :   :...amount <= 5511: yes (7/1)
##                         :   :   amount > 5511: no (2)
##                         :   employment_duration = > 7 years:
##                         :   :...other_credit = store: no (0)
##                         :       other_credit = bank: yes (2)
##                         :       other_credit = none:
##                         :       :...months_loan_duration <= 22: no (3)
##                         :           months_loan_duration > 22:
##                         :           :...amount <= 2629: yes (2)
##                         :               amount > 2629: no (2)
##                         purpose = furniture/appliances:
##                         :...months_loan_duration > 36: yes (4)
##                             months_loan_duration <= 36:
##                             :...existing_loans_count > 1:
##                                 :...credit_history = good: yes (1)
##                                 :   credit_history in {critical,poor}: no (7)
##                                 existing_loans_count <= 1:
##                                 :...other_credit = bank: yes (4/1)
##                                     other_credit = store:
##                                     :...amount <= 2241: yes (3)
##                                     :   amount > 2241: no (2)
##                                     other_credit = none: [S1]
## 
## SubTree [S1]
## 
## employment_duration in {4 - 7 years,unemployed}: yes (6/2)
## employment_duration = > 7 years: no (11/2)
## employment_duration = < 1 year:
## :...amount <= 3422: yes (5/1)
## :   amount > 3422: no (4)
## employment_duration = 1 - 4 years:
## :...credit_history = poor: no (0)
##     credit_history = critical: yes (1)
##     credit_history = good:
##     :...months_loan_duration > 21: no (8/1)
##         months_loan_duration <= 21:
##         :...checking_balance in {< 0 DM,> 200 DM}: yes (5)
##             checking_balance = 1 - 200 DM: no (2)
## 
## -----  Trial 1:  -----
## 
## Decision tree:
## 
## checking_balance in {unknown,> 200 DM}:
## :...other_credit in {store,bank}:
## :   :...purpose = renovations: yes (0)
## :   :   purpose in {furniture/appliances,car0}: no (31.1/7.4)
## :   :   purpose in {car,business,education}:
## :   :   :...age <= 44: yes (43.6/8.7)
## :   :       age > 44: no (7.8/2.2)
## :   other_credit = none:
## :   :...employment_duration in {4 - 7 years,> 7 years}: no (137.7/14.1)
## :       employment_duration in {unemployed,1 - 4 years,< 1 year}:
## :       :...credit_history in {critical,poor,very good,perfect}: no (75.8/15.7)
## :           credit_history = good:
## :           :...existing_loans_count > 1: yes (12.7/1.6)
## :               existing_loans_count <= 1:
## :               :...job in {skilled,management,unemployed}: no (74.8/17.7)
## :                   job = unskilled:
## :                   :...percent_of_income <= 3: no (15.4/5.2)
## :                       percent_of_income > 3: yes (6.7)
## checking_balance in {< 0 DM,1 - 200 DM}:
## :...credit_history = critical: no (91.9/27.9)
##     credit_history in {good,poor,very good,perfect}:
##     :...housing = rent:
##         :...credit_history in {good,very good,perfect}: yes (77/22.7)
##         :   credit_history = poor: no (6.3/0.8)
##         housing = other:
##         :...existing_loans_count > 1: yes (6.3)
##         :   existing_loans_count <= 1:
##         :   :...years_at_residence <= 1: no (3.8)
##         :       years_at_residence > 1:
##         :       :...other_credit in {none,store}: yes (24.1/8.7)
##         :           other_credit = bank: no (8.6/2.4)
##         housing = own:
##         :...checking_balance = 1 - 200 DM:
##             :...job in {skilled,unskilled}: no (117.1/43.1)
##             :   job in {management,unemployed}: yes (26/7.9)
##             checking_balance = < 0 DM:
##             :...purpose in {business,car0}: no (9.4/3.2)
##                 purpose in {education,renovations}: yes (7.6/2.2)
##                 purpose = car:
##                 :...months_loan_duration > 40: no (3)
##                 :   months_loan_duration <= 40:
##                 :   :...savings_balance in {unknown,500 - 1000 DM,
##                 :       :                   < 100 DM}: yes (37.2/5.5)
##                 :       savings_balance in {100 - 500 DM,
##                 :                           > 1000 DM}: no (5.4)
##                 purpose = furniture/appliances:
##                 :...savings_balance in {unknown,100 - 500 DM}: yes (17.9/1.6)
##                     savings_balance in {500 - 1000 DM,> 1000 DM}: no (3.2)
##                     savings_balance = < 100 DM:
##                     :...years_at_residence <= 1: no (10.8/2.4)
##                         years_at_residence > 1:
##                         :...percent_of_income <= 1: no (3.2)
##                             percent_of_income > 1:
##                             :...other_credit in {store,bank}: yes (9.4/0.8)
##                                 other_credit = none:
##                                 :...months_loan_duration <= 16: no (7.1)
##                                     months_loan_duration > 16: yes (19.3/7.6)
## 
## -----  Trial 2:  -----
## 
## Decision tree:
## 
## checking_balance = unknown:
## :...other_credit = bank: yes (52/20.3)
## :   other_credit in {none,store}:
## :   :...employment_duration in {4 - 7 years,> 7 years}: no (112.2/11.6)
## :       employment_duration in {unemployed,1 - 4 years,< 1 year}:
## :       :...months_loan_duration > 33:
## :           :...phone = yes: yes (19.7/2.6)
## :           :   phone = no: no (6.1)
## :           months_loan_duration <= 33:
## :           :...credit_history in {critical,poor,very good}: no (52.4/7.6)
## :               credit_history = perfect: yes (1.8)
## :               credit_history = good:
## :               :...existing_loans_count > 1: yes (10.3/2.9)
## :                   existing_loans_count <= 1:
## :                   :...phone = yes: no (21.2/2.9)
## :                       phone = no:
## :                       :...years_at_residence <= 2: no (20.4/4.7)
## :                           years_at_residence > 2:
## :                           :...percent_of_income <= 2: no (8.8/2.9)
## :                               percent_of_income > 2: yes (13.7/1.3)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...savings_balance in {unknown,500 - 1000 DM,> 1000 DM}:
##     :...purpose = business: no (10.3)
##     :   purpose in {car0,renovations}: yes (5/0.7)
##     :   purpose in {furniture/appliances,car,education}:
##     :   :...credit_history in {critical,poor,very good,perfect}: no (32/8.6)
##     :       credit_history = good:
##     :       :...months_loan_duration > 33: yes (6.2/0.7)
##     :           months_loan_duration <= 33:
##     :           :...savings_balance = > 1000 DM: no (7.5)
##     :               savings_balance in {unknown,500 - 1000 DM}:
##     :               :...phone = yes: no (20.6/6.6)
##     :                   phone = no:
##     :                   :...percent_of_income <= 3: no (14.9/2.5)
##     :                       percent_of_income > 3: yes (19/4.7)
##     savings_balance in {100 - 500 DM,< 100 DM}:
##     :...months_loan_duration > 42: yes (38.5/8.3)
##         months_loan_duration <= 42:
##         :...purpose in {car0,renovations}: no (13.3/4.9)
##             purpose = education:
##             :...amount <= 409: no (3.5)
##             :   amount > 409: yes (22.1/5.3)
##             purpose = business:
##             :...months_loan_duration <= 18: no (12.1/1.5)
##             :   months_loan_duration > 18:
##             :   :...phone = yes: yes (16.1/3.3)
##             :       phone = no: no (9.1/2.8)
##             purpose = furniture/appliances:
##             :...savings_balance = 100 - 500 DM: yes (17.6/3.4)
##             :   savings_balance = < 100 DM:
##             :   :...job = unemployed: yes (1.5)
##             :       job = management:
##             :       :...percent_of_income <= 1: yes (2.9)
##             :       :   percent_of_income > 1:
##             :       :   :...employment_duration in {4 - 7 years,unemployed,
##             :       :       :                       1 - 4 years,
##             :       :       :                       < 1 year}: no (21.8/2.8)
##             :       :       employment_duration = > 7 years: yes (4.3)
##             :       job = skilled:
##             :       :...months_loan_duration <= 7: no (5.9)
##             :       :   months_loan_duration > 7:
##             :       :   :...housing = rent: yes (19.1/6.4)
##             :       :       housing = other: no (3.4/0.7)
##             :       :       housing = own:
##             :       :       :...credit_history in {critical,poor,
##             :       :           :                  perfect}: no (22.5/8.6)
##             :       :           credit_history = very good: yes (2.8)
##             :       :           credit_history = good: [S1]
##             :       job = unskilled:
##             :       :...existing_loans_count > 1: no (4.6)
##             :           existing_loans_count <= 1:
##             :           :...percent_of_income <= 1: no (3.4)
##             :               percent_of_income > 1:
##             :               :...checking_balance = > 200 DM: yes (7.9/0.7)
##             :                   checking_balance in {< 0 DM,1 - 200 DM}:
##             :                   :...phone = yes: yes (2.8)
##             :                       phone = no: no (25.2/8.8)
##             purpose = car:
##             :...amount <= 1297:
##                 :...age <= 61: yes (41.3/7.2)
##                 :   age > 61: no (3.1)
##                 amount > 1297:
##                 :...checking_balance = > 200 DM: no (6.1)
##                     checking_balance in {< 0 DM,1 - 200 DM}:
##                     :...amount > 7980: yes (11.5/0.7)
##                         amount <= 7980:
##                         :...amount > 5248: no (15.7/0.7)
##                             amount <= 5248:
##                             :...percent_of_income <= 1: no (12/1.5)
##                                 percent_of_income > 1:
##                                 :...age <= 29: yes (23.4/2.1)
##                                     age > 29: no (36.2/14.5)
## 
## SubTree [S1]
## 
## checking_balance in {< 0 DM,> 200 DM}: no (33.4/12.7)
## checking_balance = 1 - 200 DM: yes (22.6/5.2)
## 
## -----  Trial 3:  -----
## 
## Decision tree:
## 
## checking_balance = unknown:
## :...employment_duration in {4 - 7 years,> 7 years}: no (135.6/24)
## :   employment_duration in {unemployed,1 - 4 years,< 1 year}:
## :   :...purpose in {business,education,renovations}:
## :       :...amount <= 1778: no (7)
## :       :   amount > 1778: yes (35.5/6.5)
## :       purpose in {furniture/appliances,car,car0}:
## :       :...months_loan_duration > 28:
## :           :...dependents <= 1: yes (23/7.6)
## :           :   dependents > 1: no (2)
## :           months_loan_duration <= 28:
## :           :...credit_history in {critical,poor,very good}: no (38/1.5)
## :               credit_history = perfect: yes (1.5)
## :               credit_history = good:
## :               :...phone = yes: no (15.9/1.5)
## :                   phone = no:
## :                   :...years_at_residence > 3: yes (13.7/3.2)
## :                       years_at_residence <= 3:
## :                       :...housing = other: no (0)
## :                           housing = rent: yes (9.9/3.7)
## :                           housing = own:
## :                           :...savings_balance in {unknown,100 - 500 DM,
## :                               :                   < 100 DM,
## :                               :                   > 1000 DM}: no (21/2.7)
## :                               savings_balance = 500 - 1000 DM: yes (3.7)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...savings_balance in {500 - 1000 DM,> 1000 DM}: no (37.6/16)
##     savings_balance = 100 - 500 DM:
##     :...credit_history in {critical,poor}: no (20.5/3)
##     :   credit_history in {good,very good,perfect}:
##     :   :...housing in {rent,other}: yes (15.5/3.5)
##     :       housing = own:
##     :       :...other_credit = store: yes (1.2)
##     :           other_credit = bank: no (4.7)
##     :           other_credit = none:
##     :           :...purpose in {furniture/appliances,car,education,
##     :               :           car0}: yes (20.3/6)
##     :               purpose in {business,renovations}: no (4.8)
##     savings_balance = unknown:
##     :...months_loan_duration > 45: no (8.3)
##     :   months_loan_duration <= 45:
##     :   :...purpose in {business,education,renovations}: no (6.1/0.5)
##     :       purpose = car0: yes (1.2)
##     :       purpose = car:
##     :       :...amount <= 1372: yes (5.8)
##     :       :   amount > 1372: no (18.8/4.2)
##     :       purpose = furniture/appliances:
##     :       :...housing = other: yes (3.7)
##     :           housing in {rent,own}:
##     :           :...existing_loans_count > 1: no (4.9)
##     :               existing_loans_count <= 1:
##     :               :...housing = rent: yes (3)
##     :                   housing = own:
##     :                   :...amount <= 2528: no (7.8)
##     :                       amount > 2528: yes (16.1/5.1)
##     savings_balance = < 100 DM:
##     :...years_at_residence <= 1:
##         :...job = management: no (9)
##         :   job in {skilled,unskilled,unemployed}:
##         :   :...other_credit = store: yes (2.9/0.5)
##         :       other_credit = bank: no (9.3/1.2)
##         :       other_credit = none:
##         :       :...housing in {rent,other}: yes (10/2.3)
##         :           housing = own:
##         :           :...job in {unskilled,unemployed}: yes (13.4/4.6)
##         :               job = skilled:
##         :               :...dependents > 1: no (3)
##         :                   dependents <= 1:
##         :                   :...phone = yes: yes (8.4/2)
##         :                       phone = no: no (18.7/4.9)
##         years_at_residence > 1:
##         :...months_loan_duration > 36: yes (30.2/4.9)
##             months_loan_duration <= 36:
##             :...other_credit in {store,bank}: yes (67.1/20.7)
##                 other_credit = none:
##                 :...percent_of_income <= 2:
##                     :...purpose in {furniture/appliances,
##                     :   :           education}: no (44.7/18.8)
##                     :   purpose in {business,car0,renovations}: yes (11.3/2.7)
##                     :   purpose = car:
##                     :   :...amount <= 8086: no (27.2/5.2)
##                     :       amount > 8086: yes (3.1)
##                     percent_of_income > 2:
##                     :...credit_history in {poor,very good,
##                         :                  perfect}: yes (17.4/1.2)
##                         credit_history in {good,critical}:
##                         :...years_at_residence <= 2:
##                             :...months_loan_duration <= 8: no (3.1)
##                             :   months_loan_duration > 8: yes (44.3/9.8)
##                             years_at_residence > 2:
##                             :...job in {unskilled,management,
##                                 :       unemployed}: no (31.2/9)
##                                 job = skilled:
##                                 :...checking_balance in {> 200 DM,
##                                     :                    1 - 200 DM}: no (24.5/8.3)
##                                     checking_balance = < 0 DM:
##                                     :...percent_of_income <= 3: yes (8.4/0.5)
##                                         percent_of_income > 3: [S1]
## 
## SubTree [S1]
## 
## employment_duration in {4 - 7 years,unemployed,1 - 4 years,
## :                       < 1 year}: yes (20.5/5.6)
## employment_duration = > 7 years: no (5.6)
## 
## -----  Trial 4:  -----
## 
## Decision tree:
## 
## checking_balance = unknown:
## :...other_credit = store: no (16.6/5.8)
## :   other_credit = none:
## :   :...credit_history in {very good,perfect}: no (2.6)
## :   :   credit_history = good:
## :   :   :...existing_loans_count <= 1: no (91.9/22.7)
## :   :   :   existing_loans_count > 1: yes (18.4/6.8)
## :   :   credit_history = critical:
## :   :   :...amount <= 11816: no (66.9/5)
## :   :   :   amount > 11816: yes (4.5)
## :   :   credit_history = poor:
## :   :   :...percent_of_income <= 3: no (9.6)
## :   :       percent_of_income > 3: yes (22.3/6.5)
## :   other_credit = bank:
## :   :...existing_loans_count > 2: no (3.6)
## :       existing_loans_count <= 2:
## :       :...purpose in {furniture/appliances,business,car0}: no (35.4/13)
## :           purpose in {car,education,renovations}: yes (22.6/8)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...savings_balance = 500 - 1000 DM: yes (21.2/8.3)
##     savings_balance = > 1000 DM: no (17.8/8.5)
##     savings_balance = unknown:
##     :...amount > 7980: yes (10.2/4.2)
##     :   amount <= 7980:
##     :   :...job in {unskilled,unemployed}: no (14/1.2)
##     :       job in {skilled,management}:
##     :       :...checking_balance in {< 0 DM,> 200 DM}: yes (23.9/9.8)
##     :           checking_balance = 1 - 200 DM: no (24.6/7.4)
##     savings_balance = 100 - 500 DM:
##     :...existing_loans_count > 3: yes (3.5)
##     :   existing_loans_count <= 3:
##     :   :...amount <= 790: yes (3.7)
##     :       amount > 790:
##     :       :...percent_of_income <= 1: yes (8.8/3.1)
##     :           percent_of_income > 1: no (48.7/14.1)
##     savings_balance = < 100 DM:
##     :...years_at_residence <= 1:
##         :...job = management: no (7.4)
##         :   job in {skilled,unskilled,unemployed}:
##         :   :...credit_history in {critical,perfect}: no (12.1/3.3)
##         :       credit_history in {poor,very good}: yes (8.5/2.4)
##         :       credit_history = good:
##         :       :...other_credit = store: yes (3.2/1.3)
##         :           other_credit = bank: no (2.2)
##         :           other_credit = none:
##         :           :...phone = yes: no (8.1/2.4)
##         :               phone = no:
##         :               :...age <= 26: no (14.6/3.4)
##         :                   age > 26: yes (18.5/5)
##         years_at_residence > 1:
##         :...employment_duration = < 1 year: yes (46.8/14.6)
##             employment_duration = unemployed:
##             :...credit_history in {poor,very good,perfect}: yes (5.9)
##             :   credit_history in {good,critical}:
##             :   :...dependents <= 1: no (19.9/3.3)
##             :       dependents > 1: yes (3.5/0.4)
##             employment_duration = 4 - 7 years:
##             :...months_loan_duration <= 11: no (10.7)
##             :   months_loan_duration > 11:
##             :   :...dependents > 1: no (10.9/2.1)
##             :       dependents <= 1:
##             :       :...checking_balance in {< 0 DM,1 - 200 DM}: yes (31/7.6)
##             :           checking_balance = > 200 DM: no (3.6)
##             employment_duration = > 7 years:
##             :...checking_balance = > 200 DM: no (6.6/1)
##             :   checking_balance in {< 0 DM,1 - 200 DM}:
##             :   :...purpose in {car,business,education}: yes (42/10)
##             :       purpose in {car0,renovations}: no (2.2)
##             :       purpose = furniture/appliances:
##             :       :...job = unemployed: no (0)
##             :           job = management: yes (3.9)
##             :           job in {skilled,unskilled}:
##             :           :...dependents > 1: yes (8.2/1.3)
##             :               dependents <= 1:
##             :               :...other_credit in {none,bank}: no (20.1/3.5)
##             :                   other_credit = store: yes (2.2)
##             employment_duration = 1 - 4 years:
##             :...amount > 7721: yes (6.9)
##                 amount <= 7721:
##                 :...purpose in {business,education}: yes (11.8/3.9)
##                     purpose in {car0,renovations}: no (3.6)
##                     purpose = car:
##                     :...percent_of_income <= 2: no (9.1)
##                     :   percent_of_income > 2:
##                     :   :...dependents <= 1: yes (18.3/5.9)
##                     :       dependents > 1: no (6.4/1.2)
##                     purpose = furniture/appliances:
##                     :...existing_loans_count > 1: no (14.1/4.7)
##                         existing_loans_count <= 1:
##                         :...credit_history in {critical,poor,
##                             :                  perfect}: yes (6)
##                             credit_history in {good,very good}:
##                             :...job = unemployed: yes (0)
##                                 job = management: no (2.9)
##                                 job in {skilled,unskilled}:
##                                 :...age <= 22: yes (7.7)
##                                     age > 22:
##                                     :...housing = rent: no (3.8/0.4)
##                                         housing in {own,other}: yes (46.5/21.3)
## 
## -----  Trial 5:  -----
## 
## Decision tree:
## 
## months_loan_duration <= 11:
## :...amount > 4280: yes (11.5/2.5)
## :   amount <= 4280:
## :   :...age > 34: no (61.6/5.6)
## :       age <= 34:
## :       :...purpose = car0: no (0)
## :           purpose = education: yes (6.4)
## :           purpose in {furniture/appliances,car,business,renovations}:
## :           :...dependents > 1: no (7.8)
## :               dependents <= 1:
## :               :...months_loan_duration <= 7: no (14.5/0.8)
## :                   months_loan_duration > 7:
## :                   :...other_credit = store: no (2.8)
## :                       other_credit = bank: yes (2.8/0.4)
## :                       other_credit = none:
## :                       :...purpose in {car,renovations}: yes (8/1.8)
## :                           purpose = business: no (2.3)
## :                           purpose = furniture/appliances:
## :                           :...months_loan_duration <= 9: yes (21.1/8.1)
## :                               months_loan_duration > 9: no (5.7)
## months_loan_duration > 11:
## :...savings_balance = unknown: no (126.8/41.5)
##     savings_balance in {100 - 500 DM,500 - 1000 DM,< 100 DM,> 1000 DM}:
##     :...credit_history = very good:
##         :...amount <= 5003: no (24.5/8.5)
##         :   amount > 5003: yes (6.2)
##         credit_history = perfect:
##         :...housing in {rent,other}: yes (9.2)
##         :   housing = own:
##         :   :...age <= 35: no (16/3.3)
##         :       age > 35: yes (6.1)
##         credit_history = critical:
##         :...age > 33:
##         :   :...months_loan_duration <= 45: no (67.7/13.4)
##         :   :   months_loan_duration > 45: yes (2.6)
##         :   age <= 33:
##         :   :...purpose in {business,car0,renovations}: no (9.7/1.6)
##         :       purpose = education: yes (8.8/2.1)
##         :       purpose = furniture/appliances:
##         :       :...months_loan_duration <= 16: no (8.7)
##         :       :   months_loan_duration > 16: yes (21.8/9)
##         :       purpose = car:
##         :       :...existing_loans_count <= 1: no (2.4)
##         :           existing_loans_count > 1: yes (26.8/5.6)
##         credit_history = poor:
##         :...percent_of_income <= 1: no (6)
##         :   percent_of_income > 1:
##         :   :...employment_duration in {> 7 years,< 1 year}: yes (22/2.5)
##         :       employment_duration in {4 - 7 years,unemployed,1 - 4 years}:
##         :       :...savings_balance in {100 - 500 DM,
##         :           :                   500 - 1000 DM}: no (10.1)
##         :           savings_balance in {< 100 DM,> 1000 DM}:
##         :           :...job = unemployed: yes (0)
##         :               job = unskilled: no (4.9)
##         :               job in {skilled,management}:
##         :               :...percent_of_income <= 2: no (5.6/1.2)
##         :                   percent_of_income > 2: yes (21.9/4.5)
##         credit_history = good:
##         :...existing_loans_count > 1:
##             :...dependents <= 1: yes (40.6/13.6)
##             :   dependents > 1: no (4.7)
##             existing_loans_count <= 1:
##             :...savings_balance = > 1000 DM: no (6.7)
##                 savings_balance in {100 - 500 DM,500 - 1000 DM,< 100 DM}:
##                 :...purpose in {business,car0}: no (18.3/6.1)
##                     purpose in {education,renovations}: yes (18.9/4.6)
##                     purpose = car:
##                     :...percent_of_income <= 1: no (12.5/2.5)
##                     :   percent_of_income > 1:
##                     :   :...job in {skilled,unskilled,
##                     :       :       unemployed}: yes (62.3/22.3)
##                     :       job = management: no (15.9/4.3)
##                     purpose = furniture/appliances:
##                     :...job = management: no (18.5/5.7)
##                         job = unemployed: yes (1.5)
##                         job = unskilled:
##                         :...percent_of_income <= 1: no (2.5)
##                         :   percent_of_income > 1: yes (43.2/18.5)
##                         job = skilled:
##                         :...housing = other: no (4.9)
##                             housing in {rent,own}:
##                             :...savings_balance = 500 - 1000 DM: no (4.8)
##                                 savings_balance in {100 - 500 DM,< 100 DM}: [S1]
## 
## SubTree [S1]
## 
## checking_balance in {unknown,> 200 DM}: no (25.8/6.5)
## checking_balance = 1 - 200 DM: yes (24.2/9.9)
## checking_balance = < 0 DM:
## :...savings_balance = 100 - 500 DM: yes (3)
##     savings_balance = < 100 DM:
##     :...years_at_residence <= 1: no (6.7)
##         years_at_residence > 1:
##         :...age <= 23: yes (4.8)
##             age > 23:
##             :...months_loan_duration <= 16: no (5.3)
##                 months_loan_duration > 16: yes (22.5/9.2)
## 
## -----  Trial 6:  -----
## 
## Decision tree:
## 
## credit_history in {very good,perfect}: yes (86.1/35.1)
## credit_history in {good,critical,poor}:
## :...amount > 10875: yes (29.8/6.6)
##     amount <= 10875:
##     :...months_loan_duration <= 11: no (120.7/28.3)
##         months_loan_duration > 11:
##         :...other_credit = store:
##             :...amount <= 2337: yes (20.1/2)
##             :   amount > 2337: no (19.5/3.4)
##             other_credit = bank:
##             :...years_at_residence <= 1: no (5.2)
##             :   years_at_residence > 1:
##             :   :...age > 44: no (17.2/2.3)
##             :       age <= 44:
##             :       :...dependents > 1: yes (17.4/2)
##             :           dependents <= 1:
##             :           :...job in {unskilled,management,
##             :               :       unemployed}: no (18.7/6.4)
##             :               job = skilled:
##             :               :...employment_duration in {unemployed,
##             :                   :                       > 7 years}: yes (12.5/0.3)
##             :                   employment_duration in {4 - 7 years,
##             :                   :                       1 - 4 years,< 1 year}:
##             :                   :...months_loan_duration <= 16: no (8/0.8)
##             :                       months_loan_duration > 16: yes (17/5)
##             other_credit = none:
##             :...checking_balance in {unknown,> 200 DM,1 - 200 DM}:
##                 :...employment_duration in {4 - 7 years,> 7 years}:
##                 :   :...existing_loans_count <= 2: no (123.9/23.6)
##                 :   :   existing_loans_count > 2: yes (7.2/2.5)
##                 :   employment_duration in {unemployed,1 - 4 years,< 1 year}:
##                 :   :...housing = rent:
##                 :       :...months_loan_duration <= 16: no (17.7/5.8)
##                 :       :   months_loan_duration > 16: yes (25.1/4)
##                 :       housing in {own,other}:
##                 :       :...job = unemployed: no (2.2)
##                 :           job = management:
##                 :           :...housing = own: yes (22.3/5.2)
##                 :           :   housing = other: no (4.4)
##                 :           job in {skilled,unskilled}:
##                 :           :...checking_balance = unknown: no (65.9/15.8)
##                 :               checking_balance = > 200 DM: yes (18.1/9)
##                 :               checking_balance = 1 - 200 DM:
##                 :               :...years_at_residence <= 1: no (16.7/1.3)
##                 :                   years_at_residence > 1:
##                 :                   :...percent_of_income <= 3: no (17.5/3.3)
##                 :                       percent_of_income > 3: yes (20.3/8.1)
##                 checking_balance = < 0 DM:
##                 :...savings_balance in {100 - 500 DM,> 1000 DM}: no (12.1/4.8)
##                     savings_balance = 500 - 1000 DM: yes (2.9/0.8)
##                     savings_balance = unknown:
##                     :...percent_of_income <= 2: no (7.9/2.4)
##                     :   percent_of_income > 2: yes (13.9/1.3)
##                     savings_balance = < 100 DM:
##                     :...job = unemployed: yes (4.3/0.9)
##                         job = unskilled:
##                         :...years_at_residence <= 3: no (25.8/7.2)
##                         :   years_at_residence > 3: yes (10.4/2.7)
##                         job = management:
##                         :...amount <= 7629: no (15.2/1)
##                         :   amount > 7629: yes (6.2/1.4)
##                         job = skilled:
##                         :...credit_history = poor: yes (5.2)
##                             credit_history in {good,critical}:
##                             :...dependents > 1: no (13.4/2.6)
##                                 dependents <= 1:
##                                 :...age <= 24: yes (15.7/5.7)
##                                     age > 24:
##                                     :...phone = yes: yes (12.5/3.3)
##                                         phone = no:
##                                         :...age <= 28: no (15.7/1.7)
##                                             age > 28: yes (25.3/8.3)
## 
## -----  Trial 7:  -----
## 
## Decision tree:
## 
## checking_balance in {unknown,> 200 DM}:
## :...employment_duration = unemployed: yes (17.9/7.1)
## :   employment_duration = 4 - 7 years:
## :   :...existing_loans_count <= 2: no (45.5/7.6)
## :   :   existing_loans_count > 2: yes (3.1/0.5)
## :   employment_duration = 1 - 4 years:
## :   :...purpose in {furniture/appliances,car,business,car0,
## :   :   :           renovations}: no (122.3/39.1)
## :   :   purpose = education: yes (8/0.8)
## :   employment_duration = > 7 years:
## :   :...dependents <= 1: no (51.8/8)
## :   :   dependents > 1:
## :   :   :...months_loan_duration <= 13: yes (15.4/4.1)
## :   :       months_loan_duration > 13: no (10.2/1.3)
## :   employment_duration = < 1 year:
## :   :...purpose in {car,car0}: no (13.8)
## :       purpose in {furniture/appliances,business,education,renovations}:
## :       :...age > 40: yes (8.7/0.5)
## :           age <= 40:
## :           :...dependents > 1: no (3)
## :               dependents <= 1:
## :               :...amount > 6681: yes (4.7)
## :                   amount <= 6681:
## :                   :...other_credit in {store,bank}: no (2.9)
## :                       other_credit = none:
## :                       :...months_loan_duration > 22: no (7.3)
## :                           months_loan_duration <= 22:
## :                           :...phone = yes: no (5.5/1.1)
## :                               phone = no: yes (16.2/3.9)
## checking_balance in {< 0 DM,1 - 200 DM}:
## :...housing = other:
##     :...age <= 45: no (37.9/13)
##     :   age > 45: yes (23.1/6.9)
##     housing = rent:
##     :...credit_history in {critical,very good,perfect}: yes (31.1/10.9)
##     :   credit_history = poor: no (7.5/1.3)
##     :   credit_history = good:
##     :   :...existing_loans_count > 1: yes (9.9/1.7)
##     :       existing_loans_count <= 1:
##     :       :...other_credit in {store,bank}: no (2.9)
##     :           other_credit = none:
##     :           :...employment_duration in {4 - 7 years,unemployed,
##     :               :                       > 7 years}: no (18.8/4.5)
##     :               employment_duration in {1 - 4 years,
##     :                                       < 1 year}: yes (33.6/12.7)
##     housing = own:
##     :...age <= 25:
##         :...months_loan_duration > 30: yes (15.8)
##         :   months_loan_duration <= 30:
##         :   :...purpose in {car,education,car0}: yes (14.3/0.8)
##         :       purpose in {business,renovations}: no (6.5)
##         :       purpose = furniture/appliances:
##         :       :...other_credit = bank: yes (6.9/0.2)
##         :           other_credit in {none,store}:
##         :           :...job in {unskilled,management}: no (11.3)
##         :               job = unemployed: yes (1)
##         :               job = skilled:
##         :               :...checking_balance = < 0 DM: yes (13.6/3.9)
##         :                   checking_balance = 1 - 200 DM: no (17.6/5.7)
##         age > 25:
##         :...job = management: yes (49.8/21.8)
##             job = unemployed: no (5.2)
##             job in {skilled,unskilled}:
##             :...months_loan_duration <= 8: no (20.3/1.2)
##                 months_loan_duration > 8:
##                 :...percent_of_income <= 2:
##                     :...amount <= 1381: yes (9.7/2.2)
##                     :   amount > 1381: no (70.6/14.5)
##                     percent_of_income > 2:
##                     :...credit_history in {critical,very good}: no (46.9/16.6)
##                         credit_history in {poor,perfect}: yes (16.4/5.6)
##                         credit_history = good:
##                         :...existing_loans_count > 1: no (8.1/1.3)
##                             existing_loans_count <= 1:
##                             :...years_at_residence > 3: no (20.5/5.3)
##                                 years_at_residence <= 3:
##                                 :...age <= 27: no (15.6/3.7)
##                                     age > 27: yes (47.9/12.4)
## 
## -----  Trial 8:  -----
## 
## Decision tree:
## 
## checking_balance = unknown:
## :...employment_duration in {4 - 7 years,> 7 years}:
## :   :...other_credit in {none,store}: no (60.1/3.1)
## :   :   other_credit = bank:
## :   :   :...age <= 41: yes (18/7)
## :   :       age > 41: no (11.5)
## :   employment_duration in {unemployed,1 - 4 years,< 1 year}:
## :   :...other_credit in {store,bank}:
## :       :...amount <= 1503: no (4.7)
## :       :   amount > 1503:
## :       :   :...employment_duration in {unemployed,1 - 4 years}: yes (28.9/4.8)
## :       :       employment_duration = < 1 year: no (6.5/2)
## :       other_credit = none:
## :       :...credit_history in {critical,very good,perfect}: no (35.8/4.4)
## :           credit_history in {good,poor}:
## :           :...purpose in {car,education,car0}: no (33.4/9)
## :               purpose in {business,renovations}: yes (13.8/5.4)
## :               purpose = furniture/appliances:
## :               :...job = unemployed: no (0)
## :                   job in {unskilled,management}: yes (14.2/2.8)
## :                   job = skilled:
## :                   :...amount <= 4594: no (21.9/3.3)
## :                       amount > 4594: yes (5.6)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...savings_balance = 500 - 1000 DM: no (23.6/6.2)
##     savings_balance = > 1000 DM:
##     :...months_loan_duration <= 39: no (18.8/3.7)
##     :   months_loan_duration > 39: yes (3.1)
##     savings_balance = unknown:
##     :...amount <= 1372: yes (15.3/2.2)
##     :   amount > 1372:
##     :   :...credit_history in {critical,poor,very good,perfect}: no (22.9)
##     :       credit_history = good:
##     :       :...amount <= 7980: no (37.4/14.2)
##     :           amount > 7980: yes (4.8)
##     savings_balance = 100 - 500 DM:
##     :...phone = yes: no (21.4/5.9)
##     :   phone = no:
##     :   :...job in {unskilled,management,unemployed}: yes (14.3/1.8)
##     :       job = skilled:
##     :       :...purpose in {business,education,car0,renovations}: no (6)
##     :           purpose in {furniture/appliances,car}:
##     :           :...housing = other: no (2.4)
##     :               housing in {rent,own}:
##     :               :...credit_history in {good,poor,very good,
##     :                   :                  perfect}: yes (18.1/4)
##     :                   credit_history = critical: no (3.3)
##     savings_balance = < 100 DM:
##     :...months_loan_duration <= 22:
##         :...existing_loans_count > 1:
##         :   :...job = unskilled: no (15.4)
##         :   :   job in {skilled,management,unemployed}:
##         :   :   :...credit_history in {good,very good,perfect}: yes (14.6/5.1)
##         :   :       credit_history = poor: no (4.3/1.4)
##         :   :       credit_history = critical:
##         :   :       :...purpose in {furniture/appliances,car,business,
##         :   :           :           car0}: no (39.1/5.5)
##         :   :           purpose in {education,renovations}: yes (3.8)
##         :   existing_loans_count <= 1:
##         :   :...credit_history in {critical,poor}: yes (16.7/4.6)
##         :       credit_history in {very good,perfect}: no (17.1/5.5)
##         :       credit_history = good:
##         :       :...other_credit = store: yes (7/1.1)
##         :           other_credit in {none,bank}:
##         :           :...purpose in {furniture/appliances,business,car0,
##         :               :           renovations}: no (94.3/32.6)
##         :               purpose = education: yes (4.7/1.1)
##         :               purpose = car:
##         :               :...checking_balance = > 200 DM: no (3)
##         :                   checking_balance in {< 0 DM,1 - 200 DM}:
##         :                   :...housing = rent: no (9.8/1.9)
##         :                       housing in {own,other}: yes (32.3/8.5)
##         months_loan_duration > 22:
##         :...credit_history in {poor,very good,perfect}: yes (42.7/10.4)
##             credit_history = critical:
##             :...existing_loans_count > 2: no (4.3)
##             :   existing_loans_count <= 2:
##             :   :...age <= 61: yes (25.1/6.5)
##             :       age > 61: no (3.3)
##             credit_history = good:
##             :...age > 48: no (9.2/0.9)
##                 age <= 48:
##                 :...months_loan_duration > 47: yes (14.9/2.4)
##                     months_loan_duration <= 47:
##                     :...purpose in {business,education,car0}: no (7.6/2.1)
##                         purpose = renovations: yes (0.6)
##                         purpose = car:
##                         :...months_loan_duration <= 24: yes (13.9/2.8)
##                         :   months_loan_duration > 24: no (14.2/5.7)
##                         purpose = furniture/appliances:
##                         :...age > 30: yes (15.5/3.7)
##                             age <= 30:
##                             :...dependents > 1: yes (2.2)
##                                 dependents <= 1:
##                                 :...percent_of_income <= 1: yes (2.5)
##                                     percent_of_income > 1: no (30.9/5.7)
## 
## -----  Trial 9:  -----
## 
## Decision tree:
## 
## checking_balance = unknown:
## :...employment_duration in {4 - 7 years,> 7 years}:
## :   :...other_credit in {none,store}: no (47.1)
## :   :   other_credit = bank:
## :   :   :...amount <= 1048: yes (3.3)
## :   :       amount > 1048: no (27.1/3.2)
## :   employment_duration in {unemployed,1 - 4 years,< 1 year}:
## :   :...other_credit = bank:
## :       :...existing_loans_count <= 1: yes (11.6/0.5)
## :       :   existing_loans_count > 1: no (14.1/6.2)
## :       other_credit in {none,store}:
## :       :...credit_history in {critical,poor,very good,perfect}: no (58/10.6)
## :           credit_history = good:
## :           :...existing_loans_count > 1: yes (11.6/2.9)
## :               existing_loans_count <= 1:
## :               :...percent_of_income <= 2: no (18.1/2.5)
## :                   percent_of_income > 2:
## :                   :...age <= 23: yes (9/0.8)
## :                       age > 23:
## :                       :...job in {skilled,unemployed}: no (12.3/0.8)
## :                           job in {unskilled,management}:
## :                           :...housing in {rent,other}: no (9.8/2.2)
## :                               housing = own: yes (14.8/2.8)
## checking_balance in {< 0 DM,> 200 DM,1 - 200 DM}:
## :...credit_history = very good: yes (44/15.8)
##     credit_history = poor:
##     :...savings_balance = 500 - 1000 DM: yes (0)
##     :   savings_balance = unknown: no (6.6)
##     :   savings_balance in {100 - 500 DM,< 100 DM,> 1000 DM}:
##     :   :...percent_of_income <= 2: no (21.8/6.2)
##     :       percent_of_income > 2: yes (22.2/5.3)
##     credit_history = perfect:
##     :...housing in {rent,other}: yes (7.1)
##     :   housing = own:
##     :   :...percent_of_income <= 3: no (23/3.9)
##     :       percent_of_income > 3: yes (3.6)
##     credit_history = critical:
##     :...other_credit = store: no (4.3/0.9)
##     :   other_credit = bank: yes (20.5/7.6)
##     :   other_credit = none:
##     :   :...savings_balance in {unknown,100 - 500 DM,> 1000 DM}: no (18/2.7)
##     :       savings_balance = 500 - 1000 DM: yes (7.5/2)
##     :       savings_balance = < 100 DM:
##     :       :...purpose = furniture/appliances: no (33.2/7.9)
##     :           purpose in {business,education,car0,
##     :           :           renovations}: yes (13.3/4.9)
##     :           purpose = car:
##     :           :...age <= 29: yes (5.9)
##     :               age > 29: no (29.5/2.4)
##     credit_history = good:
##     :...amount > 8086: yes (23.6/2.6)
##         amount <= 8086:
##         :...savings_balance = > 1000 DM: no (8.3)
##             savings_balance in {unknown,100 - 500 DM,500 - 1000 DM,< 100 DM}:
##             :...purpose in {business,education,car0,
##                 :           renovations}: no (38.8/14.6)
##                 purpose = car:
##                 :...employment_duration = unemployed: no (11.8)
##                 :   employment_duration in {4 - 7 years,> 7 years,1 - 4 years,
##                 :   :                       < 1 year}:
##                 :   :...amount <= 1103: yes (11.3)
##                 :       amount > 1103:
##                 :       :...dependents > 1: no (16.2/4.4)
##                 :           dependents <= 1:
##                 :           :...percent_of_income <= 2: no (24/6.6)
##                 :               percent_of_income > 2:
##                 :               :...amount <= 1203: no (6.5)
##                 :                   amount > 1203: yes (38/7.2)
##                 purpose = furniture/appliances:
##                 :...amount <= 708: no (11.1/1)
##                     amount > 708:
##                     :...amount <= 999: yes (25.8/4.2)
##                         amount > 999:
##                         :...amount <= 1209: no (11.2)
##                             amount > 1209:
##                             :...existing_loans_count > 1: yes (6.5/1.4)
##                                 existing_loans_count <= 1:
##                                 :...housing = rent: yes (33.9/14.1)
##                                     housing = other: no (7/2.7)
##                                     housing = own:
##                                     :...months_loan_duration <= 15: no (32.1/9.5)
##                                         months_loan_duration > 15: [S1]
## 
## SubTree [S1]
## 
## checking_balance in {> 200 DM,1 - 200 DM}: no (28.6/9.7)
## checking_balance = < 0 DM:
## :...other_credit = store: no (4.7/0.9)
##     other_credit = bank: yes (3.3)
##     other_credit = none:
##     :...percent_of_income <= 1: no (6.9/1.7)
##         percent_of_income > 1: yes (39.8/11)
## 
## 
## Evaluation on training data (900 cases):
## 
## Trial        Decision Tree   
## -----      ----------------  
##    Size      Errors  
## 
##    0     59  131(14.6%)
##    1     30  178(19.8%)
##    2     51  163(18.1%)
##    3     51  169(18.8%)
##    4     56  213(23.7%)
##    5     52  199(22.1%)
##    6     39  193(21.4%)
##    7     43  204(22.7%)
##    8     52  159(17.7%)
##    9     48  152(16.9%)
## boost             24( 2.7%)   <<
## 
## 
##     (a)   (b)    <-classified as
##    ----  ----
##     633     2    (a): class no
##      22   243    (b): class yes
## 
## 
##  Attribute usage:
## 
##  100.00% checking_balance
##  100.00% months_loan_duration
##  100.00% credit_history
##   98.56% amount
##   96.89% other_credit
##   92.89% savings_balance
##   90.44% employment_duration
##   88.11% purpose
##   84.67% existing_loans_count
##   80.89% age
##   75.22% housing
##   75.00% job
##   63.67% percent_of_income
##   55.89% years_at_residence
##   53.33% dependents
##   36.67% phone
## 
## 
## Time: 0.0 secs
credit_boost10_pred<-predict(credit_boost10, credit_test)
CrossTable(credit_test$default, credit_boost10_pred,
           prop.chisq = FALSE, prop.c = FALSE, prop.r = FALSE,
           dnn = c('actual default', 'predicted default'))
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  100 
## 
##  
##                | predicted default 
## actual default |        no |       yes | Row Total | 
## ---------------|-----------|-----------|-----------|
##             no |        52 |        13 |        65 | 
##                |     0.520 |     0.130 |           | 
## ---------------|-----------|-----------|-----------|
##            yes |        17 |        18 |        35 | 
##                |     0.170 |     0.180 |           | 
## ---------------|-----------|-----------|-----------|
##   Column Total |        69 |        31 |       100 | 
## ---------------|-----------|-----------|-----------|
## 
## 
matrix_dimensions <- list(c("no", "yes"), c("no", "yes"))
names(matrix_dimensions) <- c("predicted", "actual")
matrix_dimensions
## $predicted
## [1] "no"  "yes"
## 
## $actual
## [1] "no"  "yes"
error_cost <- matrix(c(0, 1, 4, 0), nrow = 2, dimnames = matrix_dimensions)
error_cost
##          actual
## predicted no yes
##       no   0   4
##       yes  1   0
credit_cost <- C5.0(credit_train[-17], credit_train$default,
                    costs = error_cost)
credit_cost_pred <- predict(credit_cost, credit_test)
CrossTable(credit_test$default, credit_cost_pred,
           prop.chisq = FALSE, prop.c = FALSE, prop.r = FALSE,
           dnn = c('actual default', 'predicted default'))
## 
##  
##    Cell Contents
## |-------------------------|
## |                       N |
## |         N / Table Total |
## |-------------------------|
## 
##  
## Total Observations in Table:  100 
## 
##  
##                | predicted default 
## actual default |        no |       yes | Row Total | 
## ---------------|-----------|-----------|-----------|
##             no |        37 |        28 |        65 | 
##                |     0.370 |     0.280 |           | 
## ---------------|-----------|-----------|-----------|
##            yes |         7 |        28 |        35 | 
##                |     0.070 |     0.280 |           | 
## ---------------|-----------|-----------|-----------|
##   Column Total |        44 |        56 |       100 | 
## ---------------|-----------|-----------|-----------|
## 
## 

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.