Commit c0c1995d authored by Davis King's avatar Davis King

Clarified example

parent ed9f00ba
...@@ -67,14 +67,17 @@ print "ranking score for a non-relevant vector: ", rank(data.nonrelevant[0]) ...@@ -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. # metrics, indicating that the rank function outputs a perfect ranking.
print dlib.test_ranking_function(rank, data) 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 print "weights: \n", rank.weights
# In this case they are: # In this case the weights are:
# 0.5 # 0.5
# -0.5 # -0.5
# In the above example, our data contains just two sets of objects. The # 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 # 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 # ranking function that gives every relevant vector a higher score than every
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment