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
fc6d6744
"...text-generation-inference.git" did not exist on "53729b74acb89c272ab449bf9e0b55859a8430cb"
Commit
fc6d6744
authored
Apr 09, 2013
by
Davis King
Browse files
updated comments
parent
bbefbc17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
examples/svm_rank_ex.cpp
examples/svm_rank_ex.cpp
+12
-8
No files found.
examples/svm_rank_ex.cpp
View file @
fc6d6744
...
...
@@ -84,12 +84,14 @@ int main()
*/
// If we want an overall measure of ranking accuracy, we can find out
// how often a non-relevant vector was ranked ahead of a relevant
// vector using test_ranking_function(). In this case, it returns a
// value of 1, indicating that the rank function outputs a perfect
// ranking.
cout
<<
"accuracy: "
<<
test_ranking_function
(
rank
,
data
)
<<
endl
;
// If we want an overall measure of ranking accuracy we can compute the
// ordering accuracy and mean average precision values by calling
// test_ranking_function(). In this case, the ordering accuracy tells
// us how often a non-relevant vector was ranked ahead of a relevant
// vector. This function will return a 1 by 2 matrix containing these
// measures. In this case, it returns 1 1 indicating that the rank
// function outputs a perfect ranking.
cout
<<
"testing (ordering accuracy, mean average precision): "
<<
test_ranking_function
(
rank
,
data
)
<<
endl
;
// We can also see the ranking weights:
cout
<<
"learned ranking weights:
\n
"
<<
rank
.
basis_vectors
(
0
)
<<
endl
;
...
...
@@ -135,8 +137,10 @@ int main()
// splitting the queries up into folds. That is, it lets the trainer
// train on a subset of ranking_pair instances and tests on the rest.
// It does this over 4 different splits and returns the overall ranking
// accuracy based on the held out data.
cout
<<
"cv-accuracy: "
<<
cross_validate_ranking_trainer
(
trainer
,
queries
,
4
)
<<
endl
;
// accuracy based on the held out data. Just like test_ranking_function(),
// it reports both the ordering accuracy and mean average precision.
cout
<<
"cross-validation (ordering accuracy, mean average precision): "
<<
cross_validate_ranking_trainer
(
trainer
,
queries
,
4
)
<<
endl
;
}
catch
(
std
::
exception
&
e
)
...
...
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