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

Method test

pattern/vector/__init__.py:1789–1797  ·  view source on GitHub ↗
(cls, corpus=[], d=0.65, folds=1, **kwargs)

Source from the content-addressed store, hash-verified

1787
1788 @classmethod
1789 def test(cls, corpus=[], d=0.65, folds=1, **kwargs):
1790 # Backwards compatibility.
1791 # In Pattern 2.5-, Classifier.test() is a classmethod.
1792 # In Pattern 2.6+, it is replaced with Classifier._test() once instantiated.
1793 if folds > 1:
1794 return K_fold_cross_validation(cls, documents=corpus, folds=folds, **kwargs)
1795 i = int(round(max(0.0, min(1.0, d)) * len(corpus)))
1796 d = shuffled(corpus)
1797 return cls(train=d[:i]).test(d[i:])
1798
1799 def _test(self, documents=[], target=None, **kwargs):
1800 """ Returns an (accuracy, precision, recall, F1-score)-tuple for the given documents,

Callers 9

K_fold_cross_validationFunction · 0.95
canvas.jsFile · 0.80
graph.jsFile · 0.80
test_intertextualityMethod · 0.80
test_model_reduceMethod · 0.80
test_bayesMethod · 0.80
test_knnMethod · 0.80
test_svmMethod · 0.80
03-lsa.pyFile · 0.80

Calls 3

K_fold_cross_validationFunction · 0.85
lenFunction · 0.85
shuffledFunction · 0.85

Tested by 5

test_intertextualityMethod · 0.64
test_model_reduceMethod · 0.64
test_bayesMethod · 0.64
test_knnMethod · 0.64
test_svmMethod · 0.64