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

Method table

pattern/vector/__init__.py:1897–1909  ·  view source on GitHub ↗
(self, padding=1)

Source from the content-addressed store, hash-verified

1895
1896 @property
1897 def table(self, padding=1):
1898 k = sorted(self)
1899 n = max(map(lambda x: len(decode_utf8(x)), k))
1900 n = max(n, *(len(str(self[k1][k2])) for k1 in k for k2 in k)) + padding
1901 s = "".ljust(n)
1902 for t1 in k:
1903 s += decode_utf8(t1).ljust(n)
1904 for t1 in k:
1905 s += "\n"
1906 s += decode_utf8(t1).ljust(n)
1907 for t2 in k:
1908 s += str(self[t1][t2]).ljust(n)
1909 return s
1910
1911def K_fold_cross_validation(Classifier, documents=[], folds=10, **kwargs):
1912 """ For 10-fold cross-validation, performs 10 separate tests of the classifier,

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
decode_utf8Function · 0.85
strFunction · 0.85

Tested by

no test coverage detected