'A base class for Naive Bayes, k-NN and SVM.
Trains a classifier on the given list of Documents or (document, type)-tuples,
where document can be a Document, Vector, dict or string
(dicts and strings are implicitly converted to vectors).'

def __init__(self, train=[], baseline=MAJORITY, **kwargs):

    data = getattr(self, '_data', {})
    self.description = ''
    self._data = data
    self._vectors = []
    self._classes = {}
    self._baseline = baseline
    for d in (((isinstance(d, Document) and (d, d.type)) or d) for d in train):
        self.train(*d)
    self.test = self._test
