def direction(classifier):
    """Return the DWD direction and intercept. The separating hyperplane is of the
    form 'p.d = d.i', where '.' is the dot product. If 'p.d < d.i', then 'p' is label
    0. If 'p.d > d.i', then 'p' is label 1.
    """

    d = classifier.coef_.reshape(-1)
    i = -float(classifier.intercept_)
    return d, i