'Compute the decision function of ``X``.
Parameters
X : array-like or sparse matrix, shape = [n_samples, n_features]
The input samples. Internally, it will be converted to
``dtype=np.float32`` and if a sparse matrix is provided
to a sparse ``csr_matrix``.
Returns
score : array, shape = [n_samples, n_classes] or [n_samples]
The decision function of the input samples. The order of the
classes corresponds to that in the attribute `classes_`.
Regression and binary classification produce an array of shape
[n_samples].'

def decision_function(self, X):

    X = check_array(X, dtype=DTYPE, order='C', accept_sparse='csr')
    score = self._decision_function(X)
    if (score.shape[1] == 1):
        return score.ravel()
    return score
