SVR.jl

SVR.jl performs Support Vector Regression (SVR) using libSVM library.

SVR.jl functions:

SVR.apredictMethod

Predict based on a libSVM model

Methods:

  • SVR.apredict(y::AbstractVector{Float64}, x::AbstractArray{Float64}; kw...) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:290

Arguments:

  • x::AbstractArray{Float64} : array of independent variables
  • y::AbstractVector{Float64} : vector of dependent variables

Return:

  • predicted dependent variables
SVR.freemodelMethod

Free a libSVM model

Methods:

  • SVR.freemodel(pmodel::SVR.svmmodel) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:358

Arguments:

  • pmodel::SVR.svmmodel : svm model
SVR.get_prediction_maskMethod

Get prediction mask

Methods:

  • SVR.get_prediction_mask(ns::Number, ratio::Number; keepcases, debug) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:247

Arguments:

  • ns::Number : number of samples
  • ratio::Number : prediction ratio

Keywords:

  • debug
  • keepcases

Return:

  • prediction mask
SVR.loadmodelMethod

Load a libSVM model

Methods:

  • SVR.loadmodel(filename::AbstractString) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:321

Arguments:

  • filename::AbstractString : input file name

Returns:

  • SVM model
SVR.mapnodesMethod

Methods:

  • SVR.mapnodes(x::AbstractArray) : /home/travis/.julia/packages/SVR/hERUd/src/SVRlib.jl:63

Arguments:

  • x::AbstractArray :
SVR.mapparamMethod

Methods:

  • SVR.mapparam(; svm_type, kernel_type, degree, gamma, coef0, C, nu, epsilon, cache_size, tolerance, shrinking, probability, nr_weight, weight_label, weight) : /home/travis/.julia/packages/SVR/hERUd/src/SVRlib.jl:23

Keywords:

  • C : cost; penalty parameter of the error term [default=1.0]
  • cache_size : size of the kernel cache [default=100.0]
  • coef0 : independent term in kernel function; important only in POLY and SIGMOND kernel types [default=0.0]
  • degree : degree of the polynomial kernel [default=3]
  • epsilon : epsilon for EPSILON_SVR model; defines an epsilon-tube within which no penalty is associated in the training loss function with points predicted within a distance epsilon from the actual value [default=1e-9]
  • gamma : coefficient for RBF, POLY and SIGMOND kernel types [default=1.0]
  • kernel_type : kernel type [default=RBF]
  • nr_weight : [default=0]
  • nu : upper bound on the fraction of training errors / lower bound of the fraction of support vectors; acceptable range (0, 1]; applied if NU_SVR model [default=0.5]
  • probability : train to estimate probabilities [default=false]
  • shrinking : apply shrinking heuristic [default=true]
  • svm_type : SVM type [default=EPSILON_SVR]
  • tolerance : tolerance; stopping criteria[default=0.001]
  • weight : [default=Ptr{Cdouble}(0x0000000000000000)]
  • weight_label : [default=Ptr{Cint}(0x0000000000000000)]

Returns:

  • parameter
SVR.predictMethod

Predict based on a libSVM model

Methods:

  • SVR.predict(pmodel::SVR.svmmodel, x::AbstractArray{Float64}) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:69

Arguments:

  • pmodel::SVR.svmmodel : the model that prediction is based on
  • x::AbstractArray{Float64} : array of independent variables

Return:

  • predicted dependent variables
SVR.r2Method

Compute the coefficient of determination (r2)

Methods:

  • SVR.r2(x::AbstractVector, y::AbstractVector) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:403

Arguments:

  • x::AbstractVector : observed data
  • y::AbstractVector : predicted data

Returns:

  • coefficient of determination (r2)
SVR.readlibsvmfileMethod

Read a libSVM file

Methods:

  • SVR.readlibsvmfile(file::AbstractString) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:377

Arguments:

  • file::AbstractString : file name

Returns:

  • array of independent variables
  • vector of dependent variables
SVR.savemodelMethod

Save a libSVM model

Methods:

  • SVR.savemodel(pmodel::SVR.svmmodel, filename::AbstractString) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:343

Arguments:

  • filename::AbstractString : output file name
  • pmodel::SVR.svmmodel : svm model

Dumps:

  • file with saved model
SVR.trainMethod

Train based on a libSVM model

Methods:

  • SVR.train(y::AbstractVector{Float64}, x::AbstractArray{Float64}; svm_type, kernel_type, degree, gamma, coef0, C, nu, epsilon, cache_size, tol, shrinking, probability, verbose) : /home/travis/.julia/packages/SVR/hERUd/src/SVRfunctions.jl:32

Arguments:

  • x::AbstractArray{Float64} : array of independent variables
  • y::AbstractVector{Float64} : vector of dependent variables

Keywords:

  • C : cost; penalty parameter of the error term [default=1.0]
  • cache_size : size of the kernel cache [default=100.0]
  • coef0 : independent term in kernel function; important only in POLY and SIGMOND kernel types [default=0.0]
  • degree : degree of the polynomial kernel [default=3]
  • epsilon : epsilon in the EPSILON_SVR model; defines an epsilon-tube within which no penalty is associated in the training loss function with points predicted within a distance epsilon from the actual value [default=1e-9]
  • gamma : coefficient for RBF, POLY and SIGMOND kernel types [default=1/size(x, 1)]
  • kernel_type : kernel type [default=RBF]
  • nu : upper bound on the fraction of training errors / lower bound of the fraction of support vectors; acceptable range (0, 1]; applied if NU_SVR model [default=0.5]
  • probability : train to estimate probabilities [default=false]
  • shrinking : apply shrinking heuristic [default=true]
  • svm_type : SVM type [default=EPSILON_SVR]
  • tol : tolerance of termination criterion [default=0.001]
  • verbose : verbose output [default=false]

Returns:

  • SVM model