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

Method classify

pattern/vector/__init__.py:2340–2347  ·  view source on GitHub ↗

Returns the type with the highest probability for the given document. If the classifier has been trained on LSA concept vectors you need to supply LSA.transform(document).

(self, document, discrete=True)

Source from the content-addressed store, hash-verified

2338 self._model = None
2339
2340 def classify(self, document, discrete=True):
2341 """ Returns the type with the highest probability for the given document.
2342 If the classifier has been trained on LSA concept vectors
2343 you need to supply LSA.transform(document).
2344 """
2345 if self._model is None:
2346 self._train()
2347 return self._classify(document, probability=not discrete)
2348
2349 def save(self, path):
2350 svm, model = self._svm, self._model

Callers

nothing calls this directly

Calls 2

_trainMethod · 0.95
_classifyMethod · 0.95

Tested by

no test coverage detected