madsjulia
SVR.jl
C++

Support Vector Regression for Unsupervised Machine Learning

Last updated May 9, 2025
20
Stars
6
Forks
0
Issues
0
Stars/day
Attention Score
9
Language breakdown
No language data available.
Files click to expand
README

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
🔗 More in this category

© 2026 GitRepoTrend · madsjulia/SVR.jl · Updated daily from GitHub