| Trees | Indices | Help |
|
|---|
|
|
object --+
|
TaggerModel
A trainable model used by a ModelTagger.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
MODEL_TYPE = Nonehash(x) |
|||
TRAINING_OPTIONS =
|
|||
|
|||
| _filename | |||
|
options Instead of processing training options when instantiating (which makes it impossible to have required options, since we're not always training when instantiating), we process the training options the first time they're needed. |
|||
| description | |||
|
Inherited from |
|||
|
|||
Creates an empty, untrained model. To load a previously stored model, use from_file(). Optionally stores some custom descriptive text. This will be included in the descriptive text that gets stored along with the model.
|
Verifies and processes the training option values. Access them in self.options. |
Instead of processing training options when instantiating (which makes it impossible to have required options, since we're not always training when instantiating), we process the training options the first time they're needed. If you want to do this ahead of time to verify the validity of the values, call process_training_options. |
Should return a list of all the files that are stored along with the main model file (not including the main file). By default this is an empty list, but some subclasses may want to put some names in this list. These should just be filenames, not full paths. The files are assumed to be in the model type's directory. |
Removes all the model's data. It is assumed that the tagger will not be used at all after this has been called. |
Don't override this. You can add your own information into the descriptive text (per subclass, for example) by calling __init__ with the description kwarg, or by setting the model_description attribute. You might, for example, want to do this at training time. |
Subclasses should implement this method to load up the model data given in the argument data. They should return an instance of themselves. The data will be in the form of a dictionary, as returned by the class' _get_model_data(). A default implementation that just uses simple pickling is provided. It assumes that the class can be instantiated using no arguments. |
Subclasses should implement this method to return the raw data of the model in a form that can be pickled and written out to a file. A default implementation to complement the implementation of _load_model is provided. *** IMPORTANT: *** Some implementations perform part of the model storage in their _get_model_data method, so you shouldn't use this just to get the data if you don't plan to store it. (Not sure why you'd want the raw data anyway and this is a private method - just warning you!) |
|
|||
_filename
|
optionsInstead of processing training options when instantiating (which makes it impossible to have required options, since we're not always training when instantiating), we process the training options the first time they're needed. If you want to do this ahead of time to verify the validity of the values, call process_training_options.
|
description
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:58 2012 | http://epydoc.sourceforge.net |