Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.libsvm
Commits
11d18a5a
Commit
11d18a5a
authored
Apr 10, 2017
by
André Anjos
💬
Browse files
Implement test unit showing the problem (see
#9
)
parent
c7ac597f
Pipeline
#8432
failed with stages
in 8 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/libsvm/test_trainer.py
View file @
11d18a5a
...
...
@@ -214,4 +214,21 @@ def test_training_one_class():
curr_scores
=
numpy
.
array
(
curr_scores
)
prev_scores
=
numpy
.
array
(
prev_scores
)
assert
numpy
.
all
(
abs
(
curr_scores
-
prev_scores
)
<
1e-8
)
def
test_successive_training
():
# Tests successive training works: i.e., training a couple of machines one
# after the other.
numpy
.
random
.
seed
(
10
)
for
i
in
range
(
2
):
pos
=
numpy
.
random
.
normal
(
0.
,
1
,
size
=
(
100
,
2
))
neg
=
numpy
.
random
.
normal
(
1.
,
1
,
size
=
(
100
,
2
))
data
=
[
pos
,
neg
]
trainer
=
Trainer
()
trainer
.
kernel_type
=
'LINEAR'
trainer
.
cost
=
1
trainer
.
train
(
data
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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