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

[r6]: / CSVM / initialize.m  Maximize  Restore  History

Download this file

69 lines (60 with data), 2.8 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

function initialize

global svModel;

if length(svModel.model.indices)>0

a = find(svModel.model.alpha==max(svModel.model.alpha)); % probably bounded points

svModel.temp.bounded = svModel.model.indices(a);

svModel.temp.active = setdiff(svModel.model.indices,svModel.temp.bounded);

if size(svModel.temp.active,2)>1

svModel.temp.active = svModel.temp.active';

end

svModel.temp.lbase = max([500,length(svModel.model.indices)+100]);

else

svModel.temp.active = sort([min(find(svModel.data.trainlab==1));min(find(svModel.data.trainlab==-1))]);

svModel.temp.lbase = 500;

svModel.temp.bounded = [];

end

svModel.temp.nb_test = 0;

svModel.temp.j = 0;

svModel.temp.nb_boucle = 0;

svModel.temp.n = length(svModel.data.trainlab);

svModel.temp.objectif=0;

svModel.temp.lpas = 250;

if length(svModel.C)==1

svModel.C = svModel.C*ones(svModel.temp.n,1);

end

svModel.model.G1 = zeros(svModel.temp.lbase,svModel.temp.lbase);

svModel.temp.n_H = [1:length(svModel.temp.active)];

svModel.model.G1(svModel.temp.n_H,svModel.temp.n_H) = inv(kernelPol(svModel.kernel,...

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

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

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

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

svModel.temp.x = (svModel.C(svModel.temp.active)/length(svModel.temp.active)).*ones(length(svModel.temp.active),1);

svModel.temp.inactive = setdiff([1:length(svModel.data.trainlab)],[svModel.temp.active;svModel.temp.bounded]);

svModel.temp.n_active=length(svModel.temp.active);

svModel.temp.n_inactive=length(svModel.temp.inactive);

svModel.temp.n_bounded=length(svModel.temp.bounded);

A = svModel.data.trainlab([svModel.temp.active]);

be = 0;

ce = ones(1,svModel.temp.n_active);

if svModel.temp.n_bounded > 0

% mise à jour de GC

svModel.temp.GC = svModel.C(svModel.temp.bounded)'*(kernelPol(svModel.kernel,...

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

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

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

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

ce= ce - svModel.temp.GC;

be= be - svModel.C(svModel.temp.bounded)'*svModel.data.trainlab(svModel.temp.bounded);

end

M = svModel.model.G1(svModel.temp.n_H,svModel.temp.n_H)*A;

N = svModel.model.G1(svModel.temp.n_H,svModel.temp.n_H)*ce';

svModel.model.mu = (-be+ce*M)/(A'*M);

svModel.model.alpha=N-svModel.model.mu*M;

svModel.temp.free(1) = length(svModel.temp.active)+1;

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

svModel.temp.relative(svModel.temp.active) = svModel.temp.n_H;

svModel.temp.inverse = svModel.temp.n_H;

svModel.temp.reverse = svModel.temp.n_H;

svModel.temp.new_active = [];

svModel.temp.boundedback = 0;

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