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)
| 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 |