Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
fc6d6744
Commit
fc6d6744
authored
Apr 09, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated comments
parent
bbefbc17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
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