Immigrate (version 0.2.1)

predict.IM4E: predict.IM4E

Description

This function performs the predition for IM4E(Iterative Margin-Maximization under Max-Min Entropy) algorithm.

Usage

# S3 method for IM4E
predict(object, xx, yy, newx, sig = 1, type = "both", ...)

Arguments

object

weight or result of IM4E algorithm

xx

model matrix of explanatory variables

yy

label vector

newx

new model matrix to be predicted

sig

sigma used in algorithm, default to be 1

type

the form of final output, default to be "both". One can also choose "response"(predicted probabilities) or "class"(predicted labels).

...

further arguments passed to or from other methods

Value

response

predicted probabilities for new data (newx)

class

predicted class labels for new data (newx)

References

Bei Y, Hong P. Maximizing margin quality and quantity[C]//Machine Learning for Signal Processing (MLSP), 2015 IEEE 25th International Workshop on. IEEE, 2015: 1-6.

Examples

Run this code
# NOT RUN {
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<-IM4E(train_xx,train_yy)
res<-predict(re,train_xx,train_yy,test_xx,type="class")
print(res)
# }

Run the code above in your browser using DataLab