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

[r1]: / HMSVM / relaxConstraintHM.m  Maximize  Restore  History

Download this file

38 lines (29 with data), 1.4 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
27
28
29
30
31
32
33
34
35
36

function relaxConstraintHM

global svModel;

n = length(svModel.data.trainlab);

svModel.temp.xt = zeros(n,1);

svModel.temp.xt(svModel.temp.active) = svModel.model.alpha;

% Are the points well classified?

%===================================================================

fx=kernelPol(svModel.kernel,svModel.data.trainvec(:,svModel.temp.indpoints), ...

svModel.data.trainvec(:,svModel.temp.active),...

svModel.data.trainlab(svModel.temp.indpoints),...

svModel.data.trainlab(svModel.temp.active));

nu = fx*svModel.temp.xt(svModel.temp.active) -...

ones(length(svModel.temp.indpoints),1)+ ...

svModel.data.trainlab(svModel.temp.indpoints)*svModel.model.mu;

[mm mpos]=min(nu);

% in case not

%===================================================================

if (mm < -svModel.gap) % make another point become active

svModel.temp.active = sort([svModel.temp.active ; svModel.temp.indpoints(mpos)]);

svModel.temp.x = svModel.temp.xt(svModel.temp.active);

svModel.temp.new_active = svModel.temp.indpoints(mpos);

svModel.temp.inactive = setdiff(svModel.temp.inactive,svModel.temp.new_active);

svModel.temp.countVS(svModel.temp.new_active) = svModel.temp.countVS(svModel.temp.new_active)+1;

svModel.temp.test=1;

svModel.temp.nb_test=0;

else

svModel.temp.new_active = 0;

svModel.temp.nb_test = svModel.temp.nb_test + 1;

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