predict.Immigrate {Immigrate} | R Documentation |
predict.Immigrate
Description
This function performs the predition for Immigrate(Iterative Max-Min Entropy Margin-Maximization with Interaction Terms) algorithm.
Usage
## S3 method for class 'Immigrate'
predict(object, xx, yy, newx, sig = 1, type = "both", ...)
Arguments
object |
result of Immigrate algorithm |
xx |
model matrix of explanatory variables |
yy |
label vector |
newx |
new model matrix to be predicted |
sig |
sigma used in prediction function, default to be 1. Refer to the prediction function in the link below for more details |
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
Zhao, Ruzhang, Pengyu Hong, and Jun S. Liu. "IMMIGRATE: A Margin-based Feature Selection Method with Interaction Terms." Entropy 22.3 (2020): 291.
See Also
Please refer to https://www.mdpi.com/1099-4300/22/3/291/htm for more details.
Please refer to https://github.com/RuzhangZhao/Immigrate/ for implementation demo.
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<-Immigrate(train_xx,train_yy)
res<-predict(re,train_xx,train_yy,test_xx,type="class")
print(res)