predict.BIM {Immigrate}R Documentation

predict.BIM

Description

This function performs the predion for BIM algorithm.

Usage

## S3 method for class 'BIM'
predict(object, xx, yy, newx, type = "both", ...)

Arguments

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

Value

response

preded probabilities for xx

class

preded class for xx

Examples

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)


[Package Immigrate version 0.0.2 Index]