square306 {lazy.tree}R Documentation

Test Data for Classification Tree without Error

Description

Test Data for Classification Tree without Error

Usage

square306

Format

A data frame with 16 observations and 12 variables

x1

num: the horizontal coordinate (regressor variable)

x1

num: the vertical coordinate (regressor variable)

c1

factor: the horizontal coordinate (regressor variable)

c2

factor: the vertical coordinate (regressor variable)

class

num: the name of the regions (1 - 6)

Class

factor: the name of the regions (A - E)

Details

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)

Source

Generated by author.


[Package lazy.tree version 0.1.6 ]