predict.IM4E {Immigrate}R Documentation

predict.IM4E

Description

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

Usage

## 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

model matrix to be predicted

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

Value

response

preded probabilities for newx

class

preded class for newx

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<-IM4E(train_xx,train_yy)
res<-predict(re,train_xx,train_yy,test_xx,type="class")
print(res)


[Package Immigrate version 0.0.2 Index]