sslSelfTrain: Self-Training

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/SSL.R

Description

Self-Training

Usage

1
sslSelfTrain(xl, yl, xu, n = 10, nrounds, ...)

Arguments

xl

a n * p matrix or data.frame of labeled data

yl

a n * 1 integer vector of labels(begin from 1).

xu

a m * p matrix or data.frame of unlabeled data

n

number of unlabeled examples to add into labeled data in each iteration

nrounds

the maximal number of iterations, see more in xgb.train

...

other parameters

Details

In self-training a classifier is first trained with the small amount of labeled data using extreme gradient boosting. The classifier is then used to classify the unlabeled data. The most confident unlabeled points, together with their predicted labels, are added to the training set. The classifier is re-trained and the procedure repeats.

Value

a m * 1 integer vector representing the predictions of unlabeled data.

Author(s)

Junxiang Wang

References

Rosenberg, C., Hebert, M., & Schneiderman, H. (2005). Semi-supervised selftraining of object detection models. Seventh IEEE Workshop on Applications of Computer Vision.

See Also

xgb.train

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(iris)
xl<-iris[,1:4]
#Suppose we know the first twenty observations of each class
#and we want to predict the remaining with self-training
# 1 setosa, 2 versicolor, 3 virginica
yl<-rep(1:3,each = 20)
known.label <-c(1:20,51:70,101:120)
xu<-xl[-known.label,]
xl<-xl[known.label,]
yu<-sslSelfTrain(xl,yl,xu,nrounds = 100,n=30)

Example output



SSL documentation built on May 29, 2017, 7:14 p.m.

Related to sslSelfTrain in SSL...