predict.BIM {Immigrate} | R Documentation |
This function performs the predion for BIM algorithm.
## S3 method for class 'BIM' predict(object, xx, yy, newx, type = "both", ...)
object |
result of BIM algorithm |
xx |
model matrix of explanatory variables |
yy |
label vector |
newx |
test data |
type |
the form of final output |
... |
further arguments passed to or from other methods |
response |
preded probabilities for xx |
class |
preded class for xx |
data(park) xx<-park$xx yy<-park$yy index<-c(1:floor(nrow(xx)*0.3)) train_xx<-xx[-index,] test_xx<-xx[index,] train_yy<-yy[-index] test_yy<-yy[index] re<-BIM(train_xx,train_yy) res<-predict(re,train_xx,train_yy,test_xx,type="class") print(res)