Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.pad.base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.pad.base
Commits
769e96af
Commit
769e96af
authored
Oct 19, 2018
by
Guillaume HEUSCH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added data normalization to prevent libSVM sparse format to crash
parent
172d46e0
Pipeline
#24451
passed with stage
in 10 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
bob/pad/base/algorithm/SVM.py
bob/pad/base/algorithm/SVM.py
+13
-0
No files found.
bob/pad/base/algorithm/SVM.py
View file @
769e96af
...
...
@@ -277,6 +277,13 @@ class SVM(Algorithm):
machine
=
trainer
.
train
(
data
)
# train the machine
# TODO: find a proper way to handle this - Guillaume HEUSCH, 08-08-2018
if
machine
.
shape
[
0
]
!=
data
[
0
].
shape
[
1
]:
data
[
0
]
+=
1
data
[
1
]
+=
1
machine
=
trainer
.
train
(
data
)
# train the machine
precision_cv
=
self
.
comp_prediction_precision
(
machine
,
np
.
copy
(
real_cv
),
np
.
copy
(
attack_cv
))
...
...
@@ -370,6 +377,12 @@ class SVM(Algorithm):
machine
=
trainer
.
train
(
data
)
# train the machine
# TODO: find a proper way to handle this - Guillaume HEUSCH, 08-08-2018
if
machine
.
shape
[
0
]
!=
data
[
0
].
shape
[
1
]:
data
[
0
]
+=
1
data
[
1
]
+=
1
machine
=
trainer
.
train
(
data
)
# train the machine
if
mean_std_norm_flag
:
machine
.
input_subtract
=
features_mean
# subtract the mean of train data
machine
.
input_divide
=
features_std
# divide by std of train data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment