Join/Login

Business Software

Open Source Software

For Vendors

Blog

About

More

Articles

Create

SourceForge Podcast

Site Documentation

Subscribe to our Newsletter

Support Request

For Vendors Help Create Join Login

Business Software

Open Source Software

SourceForge Podcast

Resources

Articles

Case Studies

Blog

Menu

Help

Create

Join

Login

Home

Browse

The Simple SVM toolbox

Code

The Simple SVM toolbox Code

Brought to you by: gloosli

Summary

Files

Reviews

Support

Code

Menu ▾ ▴

Browse Commits

Browse Files

[r9]: / OCSVM / projectSolution.m  Maximize  Restore  History

Download this file

27 lines (24 with data), 1.5 kB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

function projectSolution

global svModel;

dir = svModel.model.alpha - svModel.temp.x; % projection direction

indad = find(svModel.model.alpha < 0);

indsup = find(svModel.model.alpha > svModel.C(svModel.temp.active));

[tI indmin] = min(-svModel.temp.x(indad)./dir(indad));

[tS indS] = min((svModel.C(svModel.temp.active(indsup))-svModel.temp.x(indsup))./dir(indsup)); % descent step

if isempty(tI) , tI = tS + 1; end;

if isempty(tS) , tS = tI + 1; end;

t = min(tI,tS);

svModel.temp.x = svModel.temp.x + t*dir; % projection into the admissible set

if t==tI

svModel.temp.new_active = -svModel.temp.active(indad(indmin));

svModel.temp.inactive = sort([svModel.temp.inactive , svModel.temp.active(indad(indmin))]); % the point is taken off the active set to the inactive set

svModel.temp.active(indad(indmin)) = []; % the associate svModel.tempiable is set to 0

svModel.temp.x(indad(indmin)) = [];

svModel.model.alpha(indad(indmin)) = []; % ajout du 27 janvier

else

svModel.temp.bounded = sort([svModel.temp.bounded ; svModel.temp.active(indsup(indS))]); % the point is taken off the active set to the bounded set

svModel.temp.new_active = -svModel.temp.active(indsup(indS));

svModel.temp.active(indsup(indS))= []; % the associate svModel.tempiable is set to 0

svModel.temp.x(indsup(indS))= [];

svModel.model.alpha(indsup(indS)) = []; % ajout du 27 janvier

end

SourceForge

Create a Project

Open Source Software

Business Software

Top Downloaded Projects

Company

About

Team

SourceForge Headquarters
225 Broadway Suite 1600
San Diego, CA 92101
+1 (858) 422-6466

Resources

Support

Site Documentation

Site Status

SourceForge Reviews

© 2025 Slashdot Media. All Rights Reserved.

Terms Privacy Opt Out Advertise

×
Want the latest updates on software, tech news, and AI?

Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.

Submit