predict.IM4E: predict.IM4E

Description Usage Arguments Value References Examples

View source: R/predict.IM4E.R

Description

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

Usage

1
2
## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

RuzhangZhao/Immigrate documentation built on May 24, 2020, 5:38 a.m.