'Predict confidence scores for samples.
The confidence score for a sample is the signed distance of that
sample to the hyperplane.
Parameters
X : {array-like, sparse matrix}, shape = (n_samples, n_features)
Samples.
Returns
array, shape=(n_samples,) if n_classes == 2 else (n_samples, n_classes)
Confidence scores per (sample, class) combination. In the binary
case, confidence score for self.classes_[1] where >0 means this
class would be predicted.'

def decision_function(self, X):

    if ((not hasattr(self, 'coef_')) or (self.coef_ is None)):
        raise NotFittedError(('This    %(name)s    instance    is    not    fitted    yet' % {'name': type(self).__name__}))
    X = check_array(X, accept_sparse='csr')
    n_features = self.coef_.shape[1]
    if (X.shape[1] != n_features):
        raise ValueError(('X    has    %d    features    per    sample;    expecting    %d' % (X.shape[1], n_features)))
    scores = (safe_sparse_dot(X, self.coef_.T, dense_output=True) + self.intercept_)
    return (scores.ravel() if (scores.shape[1] == 1) else scores)
