'Returns the type with the highest probability for the given document.
If the classifier has been trained on LSA concept vectors
you need to supply LSA.transform(document).'

def classify(self, document, discrete=True):

    if (self._model is None):
        self._train()
    p = self._classify(document)
    if (not discrete):
        return Probabilities(self, p)
    try:
        m = max(p.values())
        p = sorted(((self._classes[type], type) for (type, w) in p.items() if (w == m > 0)))
        p = [type for (frequency, type) in p if (frequency == p[0][0])]
        return choice(p)
    except:
        return self.baseline
