MCPcopy Create free account
hub / github.com/datastream/libsvm / SVM_predict

Method SVM_predict

svm.go:2342–2354  ·  view source on GitHub ↗
(model *SVM_Model, x []SVM_Node)

Source from the content-addressed store, hash-verified

2340}
2341
2342func (this *SVM) SVM_predict(model *SVM_Model, x []SVM_Node) float64 {
2343 nr_class := model.nr_class
2344 var dec_values []float64
2345 if model.param.svm_type == ONE_CLASS ||
2346 model.param.svm_type == EPSILON_SVR ||
2347 model.param.svm_type == NU_SVR {
2348 dec_values = make([]float64, 1)
2349 } else {
2350 dec_values = make([]float64, nr_class*(nr_class-1)/2)
2351 }
2352 pred_result := this.SVM_predict_values(model, x, dec_values)
2353 return pred_result
2354}
2355
2356func (this *SVM) SVM_predict_probability(model *SVM_Model, x []SVM_Node, prob_estimates []float64) float64 {
2357 var rst float64

Callers 2

SVM_cross_validationMethod · 0.95

Calls 1

SVM_predict_valuesMethod · 0.95

Tested by

no test coverage detected