mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2026-05-14 11:17:53 +00:00
18 lines
455 B
Matlab
18 lines
455 B
Matlab
function [w, b] = Train_SVR(samples, labels)
|
|
%Train_SVR creating a linear support vector regressor
|
|
|
|
% liblinear training
|
|
addpath('C:\liblinear\matlab');
|
|
|
|
% Remove redundant data
|
|
[samples, inds] = unique(samples, 'rows');
|
|
labels = labels(inds,:);
|
|
|
|
cmd = ['-s 11 -B 1 -q'];
|
|
|
|
svr_regressor = train(labels, sparse(double(samples)), cmd);
|
|
|
|
w = svr_regressor.w(1:end-1)';
|
|
b = svr_regressor.w(end);
|
|
|
|
end |