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

Method train

pattern/vector/__init__.py:2332–2338  ·  view source on GitHub ↗

Trains the classifier with the given document of the given type (i.e., class). A document can be a Document, Vector, dict, list or string. If no type is given, Document.type will be used instead.

(self, document, type=None)

Source from the content-addressed store, hash-verified

2330 return p[0][0]
2331
2332 def train(self, document, type=None):
2333 """ Trains the classifier with the given document of the given type (i.e., class).
2334 A document can be a Document, Vector, dict, list or string.
2335 If no type is given, Document.type will be used instead.
2336 """
2337 Classifier.train(self, document, type)
2338 self._model = None
2339
2340 def classify(self, document, discrete=True):
2341 """ Returns the type with the highest probability for the given document.

Callers

nothing calls this directly

Calls 1

trainMethod · 0.45

Tested by

no test coverage detected