
574
21 章 分類モデル
Length Class Mode
formula 3 formula call
trees 100 -none- list
votes 6440 -none- numeric
class 3220 -none- character
samples 322000 -none- numeric
importance 57 -none- numeric
> table(actual=spambase.training$is_spam,
+ predicted=predict(spam.bag, newdata=spambase.training)$class)
predicted
actual 0 1
0 1878 73
1 344 925
> table(actual=spambase.validation$is_spam,
+ predicted=predict(spam.bag, newdata=spambase.validation)$class)
predicted
actual 0 1
0 804 33
1 162 382
ipred
ライブラリの
bagging
関数も試せます。この関数は、「
20.7.1.3
回帰のため
のバギング」で使用しています。
21.2.2.2
ブースティング
ada
パッケージの
ada
関数を使うと、分類のためのブースティングモデルを構築で
きます(この関数は回帰問題には使えません)。
##
デフォルト
S3
メソッド:
ada(x, y,test.x, test.y=NULL, ...