@@ -335,10 +335,12 @@ def predict(self, pairs):
335
335
return - 2 * (self .decision_function (pairs ) > self .threshold_ ) + 1
336
336
337
337
def decision_function (self , pairs ):
338
- """Returns the learned metric between input pairs.
338
+ """Returns the decision function used to classify the pairs.
339
339
340
- Returns the learned metric value between samples in every pair. It should
341
- ideally be low for similar samples and high for dissimilar samples.
340
+ Returns the opposite of the learned metric value between samples in every
341
+ pair. Hence it should ideally be low for dissimilar samples and high for
342
+ similar samples. This is the decision function that is used to classify
343
+ pairs as similar (+1), or dissimilar (-1).
342
344
343
345
Parameters
344
346
----------
@@ -350,7 +352,7 @@ def decision_function(self, pairs):
350
352
Returns
351
353
-------
352
354
y_predicted : `numpy.ndarray` of floats, shape=(n_constraints,)
353
- The predicted learned metric value between samples in every pair.
355
+ The predicted decision function value for each pair.
354
356
"""
355
357
pairs = check_input (pairs , type_of_inputs = 'tuples' ,
356
358
preprocessor = self .preprocessor_ ,
@@ -426,8 +428,12 @@ def predict(self, quadruplets):
426
428
def decision_function (self , quadruplets ):
427
429
"""Predicts differences between sample distances in input quadruplets.
428
430
429
- For each quadruplet of samples, computes the difference between the learned
430
- metric of the first pair minus the learned metric of the second pair.
431
+ For each quadruplet in the samples, computes the difference between the
432
+ learned metric of the second pair minus the learned metric of the first
433
+ pair. The higher it is, the more probable it is that the pairs in the
434
+ quadruplet are presented in the right order, i.e. that the label of the
435
+ quadruplet is 1. The lower it is, the more probable it is that the label of
436
+ the quadruplet is -1.
431
437
432
438
Parameters
433
439
----------
0 commit comments