Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.libsvm
Commits
ef0e26ed
Commit
ef0e26ed
authored
Mar 29, 2014
by
André Anjos
💬
Browse files
Fix file finding
parent
c43bc87b
Changes
1
Hide whitespace changes
Inline
Side-by-side
xbob/learn/libsvm/test_trainer.py
View file @
ef0e26ed
...
...
@@ -17,12 +17,9 @@ import nose.tools
from
.
import
File
,
Machine
,
Trainer
def
F
(
f
,
module
=
None
):
def
F
(
f
):
"""Returns the test file on the "data" subdirectory"""
if
module
is
None
:
return
pkg_resources
.
resource_filename
(
__name__
,
os
.
path
.
join
(
'data'
,
f
))
return
pkg_resources
.
resource_filename
(
'bob.%s.test'
%
module
,
os
.
path
.
join
(
'data'
,
f
))
return
pkg_resources
.
resource_filename
(
__name__
,
os
.
path
.
join
(
'data'
,
f
))
def
tempname
(
suffix
,
prefix
=
'bobtest_'
):
(
fd
,
name
)
=
tempfile
.
mkstemp
(
suffix
,
prefix
)
...
...
@@ -30,11 +27,11 @@ def tempname(suffix, prefix='bobtest_'):
os
.
unlink
(
name
)
return
name
TEST_MACHINE_NO_PROBS
=
F
(
'heart_no_probs.svmmodel'
,
'machine'
)
TEST_MACHINE_NO_PROBS
=
F
(
'heart_no_probs.svmmodel'
)
HEART_DATA
=
F
(
'heart.svmdata'
,
'machine'
)
#13 inputs
HEART_MACHINE
=
F
(
'heart.svmmodel'
,
'machine'
)
#supports probabilities
HEART_EXPECTED
=
F
(
'heart.out'
,
'machine'
)
#expected probabilities
HEART_DATA
=
F
(
'heart.svmdata'
)
#13 inputs
HEART_MACHINE
=
F
(
'heart.svmmodel'
)
#supports probabilities
HEART_EXPECTED
=
F
(
'heart.out'
)
#expected probabilities
def
test_initialization
():
...
...
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