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