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
c0c1995d
Commit
c0c1995d
authored
Jul 27, 2013
by
Davis King
Browse files
Clarified example
parent
ed9f00ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
python_examples/svm_rank.py
python_examples/svm_rank.py
+5
-2
No files found.
python_examples/svm_rank.py
View file @
c0c1995d
...
...
@@ -67,14 +67,17 @@ print "ranking score for a non-relevant vector: ", rank(data.nonrelevant[0])
# metrics, indicating that the rank function outputs a perfect ranking.
print
dlib
.
test_ranking_function
(
rank
,
data
)
# We can also see the ranking weights:
# The ranking scores are computed by taking the dot product between a learned
# weight vector and a data vector. If you want to see the learned weight vector
# you can display it like so:
print
"weights:
\n
"
,
rank
.
weights
# In this case the
y
are:
# In this case the
weights
are:
# 0.5
# -0.5
# In the above example, our data contains just two sets of objects. The
# relevant set and non-relevant set. The trainer is attempting to find a
# ranking function that gives every relevant vector a higher score than every
...
...
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