项目作者: madsjulia

项目描述 :
Support Vector Regression for Unsupervised Machine Learning
高级语言: Julia
项目地址: git://github.com/madsjulia/SVR.jl.git
创建时间: 2016-12-20T00:07:57Z
项目社区:https://github.com/madsjulia/SVR.jl

开源协议:Other

下载


SVR

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

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

Installation

  1. import Pkg; Pkg.add("SVR")

Examples

Matching sine function:

  1. import SVR
  2. import Mads
  3. X = sort(rand(40) * 5)
  4. y = sin.(X)

Predict y based on X using RBF

  1. 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

  1. 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

  1. 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:

  1. import SVR
  2. x, y = SVR.readlibsvmfile(joinpath(dirname(pathof(SVR)), "..", "test", "mg.libsvm")) # read a libSVM input file
  3. pmodel = SVR.train(y, permutedims(x)) # train a libSVM model
  4. y_pr = SVR.predict(pmodel, permutedims(x)); # predict based on the libSVM model
  5. SVR.savemodel(pmodel, "mg.model") # save the libSVM model
  6. SVR.freemodel(pmodel) # free the memory allocation of the libSVM model

Projects using SVR

Publications, Presentations, Projects