(self, padding=1)
| 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 | |
| 1911 | def K_fold_cross_validation(Classifier, documents=[], folds=10, **kwargs): |
| 1912 | """ For 10-fold cross-validation, performs 10 separate tests of the classifier, |
nothing calls this directly
no test coverage detected