Database Reference
In-Depth Information
irisForest
<
cforest(Species ˜ ., data =trainData ,
control = cforest unbiased( ntree =
10, mtry = 2))
testPrediction
<
predict (irisForest ,
newdata = testData)
table (testPrediction , testData $ Species )
10.3.3
Other Types of Trees
With party package, it is possible to train different types of trees other
than classification trees using the Model-based Recursive Partitioning
functionality. The mob() function provides a specific implementation of
recursive partitioning based on parametric models for building linear
regression trees, logistic regression trees or survival trees.
With mob() function [Zeileis et al . (2008)] some input attributes are
used for fitting the model while others are used for partitioning. For
example, the following script trains a tree using the attributes Sepal.Width,
Species and Petal.Width as partitioning attributes. Each leaf tries to
predict the value of Sepal.Length by fitting a simple linear regression with
Petal.Length serving as an explanatory variable. Figure 10.11 presents the
resulting regression tree. The regression coecients for each leaf node can
be obtained by the function coef(SepalLengthRegression).
Fig. 10.11 Regression tree.
Search WWH ::




Custom Search