MCPcopy Index your code
hub / github.com/clips/pattern / __init__

Method __init__

pattern/vector/__init__.py:1864–1870  ·  view source on GitHub ↗

Returns the matrix of classes x predicted classes as a dictionary.

(self, classify=lambda document: True, documents=[])

Source from the content-addressed store, hash-verified

1862class ConfusionMatrix(defaultdict):
1863
1864 def __init__(self, classify=lambda document: True, documents=[]):
1865 """ Returns the matrix of classes x predicted classes as a dictionary.
1866 """
1867 defaultdict.__init__(self, lambda: defaultdict(int))
1868 for document, type1 in documents:
1869 type2 = classify(document)
1870 self[type1][type2] += 1
1871
1872 def split(self):
1873 """ Returns an iterator over one-vs-all (type, TP, TN, FP, FN)-tuples.

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected