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...) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:290

Arguments:

  • y :: AbstractVector{Float64} : Vector of dependent variables
  • x :: AbstractArray{Float64} : Array of independent variables

Return:

  • predicted dependent variables
source
SVR.freemodelMethod

Free a libSVM model

Methods:

  • SVR.freemodel(pmodel::SVR.svmmodel) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:358

Arguments:

  • pmodel :: SVR.svmmodel : Svm model
source
SVR.get_prediction_maskMethod

Get prediction mask

Methods:

  • SVR.get_prediction_mask(ns::Number, ratio_prediction::Number; keepcases, debug) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:247

Arguments:

  • ns :: Number : Number of samples
  • ratio_prediction :: Number : Prediction ratio prediction

Keywords:

  • keepcases : Keepcases
  • debug : Debug

Return:

  • prediction mask
source
SVR.loadmodelMethod

Load a libSVM model

Methods:

  • SVR.loadmodel(filename::AbstractString) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:321

Arguments:

  • filename :: AbstractString : Input file name

Returns:

  • SVM model
source
SVR.mapnodesMethod

Methods:

  • SVR.mapnodes(x::AbstractArray) : ~/.julia/packages/SVR/r4194/src/SVRlib.jl:63

Arguments:

  • x :: AbstractArray :
source
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) : ~/.julia/packages/SVR/r4194/src/SVRlib.jl:23

Keywords:

  • svm_type : SVM type [default=EPSILON SVR]
  • kernel_type : Kernel type [default=RBF]
  • degree : Degree of the polynomial kernel [default=3]
  • gamma : Coefficient for RBF, POLY and SIGMOND kernel types [default=1.0]
  • coef0 : Independent term in kernel function; important only in POLY and SIGMOND kernel types [default=0.0]
  • C : Cost; penalty parameter of the error term [default=1.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]
  • 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]
  • cache_size : Size of the kernel cache [default=100.0]
  • tolerance : Tolerance; stopping criteria[default=0.001]
  • shrinking : Apply shrinking heuristic [default=true]
  • probability : Train to estimate probabilities [default=false]
  • nr_weight : [default=0]
  • weight_label : [default=Ptr{Cint}(0x0000000000000000)]
  • weight : [default=Ptr{Cdouble}(0x0000000000000000)]

Returns:

  • parameter
source
SVR.predictMethod

Predict based on a libSVM model

Methods:

  • SVR.predict(pmodel::SVR.svmmodel, x::AbstractArray{Float64}) : ~/.julia/packages/SVR/r4194/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
source
SVR.r2Method

Compute the coefficient of determination (r2)

Methods:

  • SVR.r2(x::AbstractVector, y::AbstractVector) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:403

Arguments:

  • x :: AbstractVector : Observed data
  • y :: AbstractVector : Predicted data

Returns:

  • coefficient of determination (r2)
source
SVR.readlibsvmfileMethod

Read a libSVM file

Methods:

  • SVR.readlibsvmfile(file::AbstractString) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:377

Arguments:

  • file :: AbstractString : File name

Returns:

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

Save a libSVM model

Methods:

  • SVR.savemodel(pmodel::SVR.svmmodel, filename::AbstractString) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:343

Arguments:

  • pmodel :: SVR.svmmodel : Svm model
  • filename :: AbstractString : Output file name

Dumps:

  • file with saved model
source
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) : ~/.julia/packages/SVR/r4194/src/SVRfunctions.jl:32

Arguments:

  • y :: AbstractVector{Float64} : Vector of dependent variables
  • x :: AbstractArray{Float64} : Array of independent variables

Keywords:

  • svm_type : SVM type [default=EPSILON SVR]
  • kernel_type : Kernel type [default=RBF]
  • degree : Degree of the polynomial kernel [default=3]
  • gamma : Coefficient for RBF, POLY and SIGMOND kernel types [default=1/size(x, 1)]
  • coef0 : Independent term in kernel function; important only in POLY and SIGMOND kernel types [default=0.0]
  • C : Cost; penalty parameter of the error term [default=1.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]
  • 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]
  • cache_size : Size of the kernel cache [default=100.0]
  • tol : Tolerance of termination criterion [default=0.001]
  • shrinking : Apply shrinking heuristic [default=true]
  • probability : Train to estimate probabilities [default=false]
  • verbose : Verbose output [default=false]

Returns:

  • SVM model
source