predict.Immigrate {Immigrate} | R Documentation |
This function performs the predion for Immigrate(Iterative Max-Min Entropy Margin-Maximization with Interaction Terms) algorithm.
## S3 method for class 'Immigrate' predict(object, xx, yy, newx, sig = 1, type = "both", ...)
object |
result of Immigrate algorithm |
xx |
model matrix of explanatory variables |
yy |
label vector |
newx |
model matrix to be preded |
sig |
sigma used in algorithm, default to be 1 |
type |
the form of final output, default to be "both" |
... |
further arguments passed to or from other methods |
response |
preded probabilities for newx |
class |
preded class for newx |
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<-Immigrate(train_xx,train_yy) res<-predict(re,train_xx,train_yy,test_xx,type="class") print(res)