Learn R Programming

DTRlearn (version 1.3)

predict.rbfcl: Predict

Description

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

Usage


# S3 method for 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.

See Also

wsvm, Olearning_Single

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab