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

Method train

pattern/vector/__init__.py:2061–2066  ·  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

2059 Classifier.__init__(self, train, baseline)
2060
2061 def train(self, document, type=None):
2062 """ Trains the classifier with the given document of the given type (i.e., class).
2063 A document can be a Document, Vector, dict, list or string.
2064 If no type is given, Document.type will be used instead.
2065 """
2066 Classifier.train(self, document, type)
2067
2068 def classify(self, document, discrete=True):
2069 """ Returns the type with the highest probability for the given document.

Callers 5

trainMethod · 0.45
trainFunction · 0.45
05-bayes.pyFile · 0.45
06-svm.pyFile · 0.45
04-KNN.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected