predict.gausspr.RdPrediction of test data using Gaussian Processes
# S4 method for class 'gausspr'
predict(object, newdata, type = "response", coupler = "minpair")an S4 object of class gausspr created by the
gausspr function
a data frame or matrix containing new data
one of response, probabilities
indicating the type of output: predicted values or matrix of class
probabilities
Coupling method used in the multiclass case, can be one
of minpair or pkpd (see reference for more details).
predicted classes (the classes with majority vote) or the response value in regression.
matrix of class probabilities (one column for each class and one row for each input).
C. K. I. Williams and D. Barber
Bayesian classification with Gaussian processes.
IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(12):1342-1351, 1998
https://homepages.inf.ed.ac.uk/ckiw/postscript/pami_final.ps.gz
T.F. Wu, C.J. Lin, R.C. Weng.
Probability estimates for Multi-class Classification by
Pairwise Coupling
https://www.csie.ntu.edu.tw/~cjlin/papers/svmprob/svmprob.pdf
## example using the promotergene data set
data(promotergene)
## create test and training set
ind <- sample(1:dim(promotergene)[1],20)
genetrain <- promotergene[-ind, ]
genetest <- promotergene[ind, ]
## train a support vector machine
gene <- gausspr(Class~.,data=genetrain,kernel="rbfdot",
kpar=list(sigma=0.015))
gene
#> Gaussian Processes object of class "gausspr"
#> Problem type: classification
#>
#> Gaussian Radial Basis kernel function.
#> Hyperparameter : sigma = 0.015
#>
#> Number of training instances learned : 86
#> Train error : 0
## predict gene type probabilities on the test set
genetype <- predict(gene,genetest,type="probabilities")
genetype
#> + -
#> [1,] 0.4269409 0.5730591
#> [2,] 0.5716976 0.4283024
#> [3,] 0.5492203 0.4507797
#> [4,] 0.5407478 0.4592522
#> [5,] 0.4271836 0.5728164
#> [6,] 0.4226627 0.5773373
#> [7,] 0.5421514 0.4578486
#> [8,] 0.4658427 0.5341573
#> [9,] 0.4321380 0.5678620
#> [10,] 0.5640181 0.4359819
#> [11,] 0.4222259 0.5777741
#> [12,] 0.5576972 0.4423028
#> [13,] 0.4948712 0.5051288
#> [14,] 0.5984662 0.4015338
#> [15,] 0.6127960 0.3872040
#> [16,] 0.5661059 0.4338941
#> [17,] 0.3860378 0.6139622
#> [18,] 0.5810530 0.4189470
#> [19,] 0.3629991 0.6370009
#> [20,] 0.4266471 0.5733529