square306 {lazy.tree} | R Documentation |
Test Data for Classification Tree without Error
square306
A data frame with 16 observations and 12 variables
num: the horizontal coordinate (regressor variable)
num: the vertical coordinate (regressor variable)
factor: the horizontal coordinate (regressor variable)
factor: the vertical coordinate (regressor variable)
num: the name of the regions (1 - 6)
factor: the name of the regions (A - E)
This data consist of 25 observations of two dimensional data.
A plane was divided into 5 regeons.
Use below to see the structure:
plot(square306$x1,square306$x2, type="n") text(square306$x1,square306$x2,square306$Class, cex=2) SQ2=matrix(square306$class, 5,, byrow=1) heatmap( t(SQ2), Rowv=NA, Colv=NA, reorderfun=NA, symm=1 , labRow=5:1, labCol=1:5, revC=TRUE )
Examples of DecTree analysis
# fit tree: continuous X res=DecTree( square306$Class, v[,c("x1","x2")], maxdepth=4 , majestic=0, rf=0 , print=3, plot=1, title="b", impfuncname="entropy") ni=node_info_dt( res, depth=400 ) plot(square306$x1,square306$x2, type="n") text(square306$x1,square306$x2,res$yhat, cex=2) # fit tree: categorical X res=DecTree( square306$Class, square306[,c("c1","c2")], maxdepth=5, method=4 , majestic=0, rf=0 , print=3, plot=1, title="b", impfuncname="entropy") ni=node_info_dt( res, depth=400 ) plot(square306$x1,square306$x2, type="n") text(square306$x1,square306$x2,res$yhat, cex=2)
Generated by author.