Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
eec39b4d
Commit
eec39b4d
authored
May 21, 2014
by
Davis King
Browse files
Fixed incorrect requires clause on the cross_validate_trainer() and
cross_validate_trainer_threaded() routines.
parent
16d089d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
dlib/svm/svm.h
dlib/svm/svm.h
+2
-2
dlib/svm/svm_abstract.h
dlib/svm/svm_abstract.h
+2
-1
dlib/svm/svm_threaded.h
dlib/svm/svm_threaded.h
+2
-2
dlib/svm/svm_threaded_abstract.h
dlib/svm/svm_threaded_abstract.h
+2
-1
No files found.
dlib/svm/svm.h
View file @
eec39b4d
...
...
@@ -420,10 +420,10 @@ namespace dlib
// make sure requires clause is not broken
DLIB_ASSERT
(
is_binary_classification_problem
(
x
,
y
)
==
true
&&
1
<
folds
&&
folds
<=
x
.
nr
(
),
1
<
folds
&&
folds
<=
std
::
min
(
sum
(
y
>
0
),
sum
(
y
<
0
)
),
"
\t
matrix cross_validate_trainer()"
<<
"
\n\t
invalid inputs were given to this function"
<<
"
\n\t
x.nr(): "
<<
x
.
nr
()
<<
"
\n\t
std::min(sum(y>0),sum(y<0)): "
<<
std
::
min
(
sum
(
y
>
0
),
sum
(
y
<
0
))
<<
"
\n\t
folds: "
<<
folds
<<
"
\n\t
is_binary_classification_problem(x,y): "
<<
((
is_binary_classification_problem
(
x
,
y
))
?
"true"
:
"false"
)
);
...
...
dlib/svm/svm_abstract.h
View file @
eec39b4d
...
...
@@ -369,7 +369,8 @@ namespace dlib
/*!
requires
- is_binary_classification_problem(x,y) == true
- 1 < folds <= x.nr()
- 1 < folds <= std::min(sum(y>0),sum(y<0))
(e.g. There must be at least as many examples of each class as there are folds)
- trainer_type == some kind of binary classification trainer object (e.g. svm_nu_trainer)
ensures
- performs k-fold cross validation by using the given trainer to solve the
...
...
dlib/svm/svm_threaded.h
View file @
eec39b4d
...
...
@@ -94,11 +94,11 @@ namespace dlib
// make sure requires clause is not broken
DLIB_ASSERT
(
is_binary_classification_problem
(
x
,
y
)
==
true
&&
1
<
folds
&&
folds
<=
x
.
nr
(
)
&&
1
<
folds
&&
folds
<=
std
::
min
(
sum
(
y
>
0
),
sum
(
y
<
0
)
)
&&
num_threads
>
0
,
"
\t
matrix cross_validate_trainer()"
<<
"
\n\t
invalid inputs were given to this function"
<<
"
\n\t
x.nr(): "
<<
x
.
nr
()
<<
"
\n\t
std::min(sum(y>0),sum(y<0)): "
<<
std
::
min
(
sum
(
y
>
0
),
sum
(
y
<
0
))
<<
"
\n\t
folds: "
<<
folds
<<
"
\n\t
num_threads: "
<<
num_threads
<<
"
\n\t
is_binary_classification_problem(x,y): "
<<
((
is_binary_classification_problem
(
x
,
y
))
?
"true"
:
"false"
)
...
...
dlib/svm/svm_threaded_abstract.h
View file @
eec39b4d
...
...
@@ -28,7 +28,8 @@ namespace dlib
/*!
requires
- is_binary_classification_problem(x,y) == true
- 1 < folds <= x.nr()
- 1 < folds <= std::min(sum(y>0),sum(y<0))
(e.g. There must be at least as many examples of each class as there are folds)
- trainer_type == some kind of trainer object (e.g. svm_nu_trainer)
- num_threads > 0
ensures
...
...
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