Learn R Programming

SSL (version 0.1)

sslRegress: Regression on graphs

Description

sslRegress develops a regularization framework on graphs.It supports many kinds of distance measurements and graph representations. However, it only supports binary classifications.

Usage

sslRegress(xl, yl, xu, graph.type = "exp", dist.type = "Euclidean", alpha, alpha1, alpha2, p = 2, method = "Tikhonov", gamma = 1)

Arguments

xl
a n * p matrix or data.frame of labeled data.
yl
a n * 1 binary labels(1 or -1).
xu
a m * p matrix or data.frame of unlabeled data.
graph.type
character string; which type of graph should be created? Options includetanh and exp.
  • exp :exp-weighted graphs.w(i,j) = exp(-d(i,j)^2/alpha^2),where d(i,j) denotes the distance between point i and j. Hyperparameter alpha controls the decay rate.
dist.type
character string; this parameter controls the type of distance measurement.(see dist or pr_DB).
alpha
numeric parameter needed when graph.type = exp
alpha1
numeric parameter needed when graph.type = tanh
alpha2
numeric parameter needed when graph.type = tanh
p
an ineger parameter controls the power of Laplacian for regularization.
method
character string; this parameter choose two possible algorithms:"Tikhonov" means Tikhonov regularization;"Interpolated" means Interpolated regularization.
gamma
a parameter of Tikhonov regularization.

Value

a m * 1 integer vector representing the predicted labels of unlabeled data(1 or -1).

References

Belkin, M., Matveeva, I., & Niyogi, P. (2004a). Regularization and semisupervised learning on large graphs. COLT

See Also

pr_DB dist

Examples

Run this code
data(iris)
xl<-iris[c(1:20,51:70),-5]
xu<-iris[c(21:50,71:100),-5]
yl<-rep(c(1,-1),each=20)
# Tikhonov regularization
yu1<-sslRegress(xl,yl,xu,graph.type="tanh",alpha1=-2,alpha2=1)
yu2<-sslRegress(xl,yl,xu,graph.type="exp",alpha = 1)
# Interpolated regularization
yu3<-sslRegress(xl,yl,xu,graph.type="tanh",alpha1=-2,alpha2=1,method="Interpolated")
yu4<-sslRegress(xl,yl,xu,graph.type="exp",alpha = 1,method="Interpolated")

Run the code above in your browser using DataLab