Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

madsjulia/SVR.jl

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVR

Support Vector Regression (SVR) analysis in Julia utilizing the libSVM library.

SVR is a module of MADS (Model Analysis & Decision Support).

Installation

import Pkg; Pkg.add("SVR")

Examples

Matching sine function:

import SVR
import Mads

X = sort(rand(40) * 5)
y = sin.(X)

Predict y based on X using RBF

Mads.plotseries([y SVR.fit(y, permutedims(X); kernel_type=SVR.RBF)], "figures/rbf.png"; title="RBF", names=["Truth", "Prediction"])

Predict y based on X using LINEAR

Mads.plotseries([y SVR.fit(y, permutedims(X); kernel_type=SVR.LINEAR)], "figures/linear.png"; title="Linear", names=["Truth", "Prediction"])

Predict y based on X using POLY

Mads.plotseries([y SVR.fit(y, permutedims(X); kernel_type=SVR.POLY, coef0=1.)], "figures/poly.png"; title="Polynomial", names=["Truth", "Prediction"])

libSVM test example:

import SVR

x, y = SVR.readlibsvmfile(joinpath(dirname(pathof(SVR)), "..", "test", "mg.libsvm")) # read a libSVM input file

pmodel = SVR.train(y, permutedims(x)) # train a libSVM model

y_pr = SVR.predict(pmodel, permutedims(x)); # predict based on the libSVM model

SVR.savemodel(pmodel, "mg.model") # save the libSVM model

SVR.freemodel(pmodel) # free the memory allocation of the libSVM model

Projects using SVR

Publications, Presentations, Projects

Morty Proxy This is a proxified and sanitized view of the page, visit original site.