predict.rbfcl: Predict

Description Usage Arguments Value Author(s) See Also Examples

View source: R/predict.R

Description

It predicts the optimal treatments with model of class 'rbfcl', which is estimated by wsvm with 'rbf' kernel.

Usage

1
2
## S3 method for class 'rbfcl'
predict(object, x,...)

Arguments

object

model of class 'rbfcl'

x

a matrix of feature variables, n by p, p is the dimension of feature variables

...

further arguments passed to or from other methods.

Value

a vector of optimal treatments, each entry is for a row in x, the matrix of new feature variables.

Author(s)

Ying Liu yl2802@cumc.columbia.edu http://www.columbia.edu/~yl2802/

See Also

wsvm, Olearning_Single

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
n_cluster=5
pinfo=10
pnoise=10
n=50
m=20
example1=make_classification(n_cluster,pinfo,pnoise,n)
test=make_classification(n_cluster,pinfo,pnoise,m,example1$centroids)
model1=Olearning_Single(example1$X,example1$A,example1$R)
Atp=predict(model1,test$X)
V1=mean(test$R[Atp==test$A])

model2=wsvm(example1$X,example1$A,example1$R,'rbf',0.05)
model2=Olearning_Single(example1$X,example1$A,example1$R,kernel='rbf',m=3)
Atp=predict(model2,test$X)

DTRlearn documentation built on April 6, 2018, 1:04 a.m.