Skip to content

Commit

Permalink
import libsvm_predict_probability and libsvm_predict_values from #76
Browse files Browse the repository at this point in the history
Co-authored-by: Iblis Lin <iblis@hs.ntnu.edu.tw>
  • Loading branch information
barucden and iblislin committed Jun 11, 2021
1 parent e4c64c3 commit c7df763
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/LIBSVM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,18 @@ function svmpredict(model::SVM{T}, X::AbstractMatrix{U}; nt::Integer = 0) where
(pred, decvalues)
end

function libsvm_predict_probability(model::SVMModel, node::Ptr{SVMNode}, dec::Ref{Cdouble})
ccall((:svm_predict_probability, libsvm), Cdouble,
(Ref{SVMModel}, Ptr{SVMNode}, Ref{Cdouble}),
model, node, dec)
end

function libsvm_predict_values(model::SVMModel, node::Ptr{SVMNode}, dec::Ref{Cdouble})
ccall((:svm_predict_values, libsvm), Cdouble,
(Ref{SVMModel}, Ptr{SVMNode}, Ref{Cdouble}),
model, node, dec)
end

include("ScikitLearnTypes.jl")
include("ScikitLearnAPI.jl")

Expand Down

0 comments on commit c7df763

Please sign in to comment.