'Returns the confusion matrix for the given test data,
which is a list of Documents or (document, type)-tuples.'

def confusion_matrix(self, documents=[]):

    documents = [((isinstance(d, Document) and (d, d.type)) or d) for d in documents]
    return ConfusionMatrix(self.classify, documents)
