madsjulia / SVR.jl

Support Vector Regression for Unsupervised Machine Learning

Home Page:http://mads.gitlab.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Support Vector Regression for Unsupervised Machine Learning

http://mads.gitlab.io

License:GNU General Public License v3.0


Languages

Language:C++ 31.8%Language:Julia 27.5%Language:HTML 19.8%Language:Python 13.5%Language:C 7.2%Language:Makefile 0.2%