[R] interpreting output from predict.blackboost

Kirsten Barrett kbarrett at usgs.gov
Tue Nov 11 01:11:41 CET 2008


I would like to use blackboost on a training data set, then use the
output to predict a testing dataset, and finally evaluate the errors.
An example of the code I have written is the following:

train <- read.csv ("train.csv")
test <- read.csv ("test.csv")

boost <- blackboost (ogred ~ elev + slope + aspect, data = train)
pred <- predict (boost, newdata = test)

pred yields the following matrix:

 [1] 2.697689 3.551352 2.761541 3.271642 2.313459 2.207247 1.591521 3.752257
 [9] 2.976793 2.522219 1.988676 2.092666 3.550917 2.134925 2.534842 2.922136
[17] 2.277653 2.922136 2.922136 4.593132 2.922136 3.773274 4.647789 3.773274
[25] 4.647789 2.369810 2.645859 2.344808 1.760087 2.918108 2.714825 2.972284
[33] 3.466973 2.001098 1.706958 1.749830 1.960923 1.960923 2.451370 2.835255
[41] 2.443585 3.392883 3.164294 2.615430

I would like to know how to use this output to classify data the
testing dataset. Any advice is much appreciated.

Thank you,
Kirsten


-- 
Kirsten Barrett
Mendenhall Postdoctoral Fellow, USGS
Alaska Science Center
4210 University Drive
Anchorage, AK

phone (907) 786 7419
fax (907) 786 7401

kbarrett at usgs.gov



More information about the R-help mailing list