@@ -383,7 +383,7 @@ def _compute_kernel(self, X):
383
383
return X
384
384
385
385
def _decision_function (self , X ):
386
- """Distance of the samples X to the separating hyperplane .
386
+ """Evaluates the decision function for the samples in X .
387
387
388
388
Parameters
389
389
----------
@@ -528,7 +528,7 @@ def _validate_targets(self, y):
528
528
return np .asarray (y , dtype = np .float64 , order = 'C' )
529
529
530
530
def decision_function (self , X ):
531
- """Distance of the samples X to the separating hyperplane .
531
+ """Evaluates the decision function for the samples in X .
532
532
533
533
Parameters
534
534
----------
@@ -540,7 +540,16 @@ def decision_function(self, X):
540
540
Returns the decision function of the sample for each class
541
541
in the model.
542
542
If decision_function_shape='ovr', the shape is (n_samples,
543
- n_classes)
543
+ n_classes).
544
+
545
+ Notes
546
+ ------
547
+ If decision_function_shape='ovo', the function values are proportional
548
+ to the distance of the samples X to the separating hyperplane. If the
549
+ exact distances are required, divide the function values by the norm of
550
+ the weight vector (``coef_``). See also `this question
551
+ <https://stats.stackexchange.com/questions/14876/
552
+ interpreting-distance-from-hyperplane-in-svm>`_ for further details.
544
553
"""
545
554
dec = self ._decision_function (X )
546
555
if self .decision_function_shape == 'ovr' and len (self .classes_ ) > 2 :
0 commit comments