Package jazzparser :: Package taggers :: Package segmidi :: Package chordclass :: Class ChordClassTaggerModel
[hide private]
[frames] | no frames]

Class ChordClassTaggerModel

source code

        object --+    
                 |    
models.TaggerModel --+
                     |
                    ChordClassTaggerModel

Model class to go with ChordClassMidiTagger. This is where the real meat of the model is implemented.

Instance Methods [hide private]
 
__init__(self, model_name, *args, **kwargs)
Creates an empty, untrained model.
source code
 
train(self, inputs, grammar=None, logger=None)
Trains the loaded model using the data in the list of sequences.
source code
 
_get_model_data(self)
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.
source code
 
_get_readable_parameters(self)
Produce a human-readable repr of the params of the model
source code
 
__get_description(self)
Overridden to add history onto description.
source code

Inherited from models.TaggerModel: delete, get_extra_filenames, process_training_options, save

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from models.TaggerModel: list_models, load_model

Inherited from models.TaggerModel (private): _get_model_dir

Static Methods [hide private]
 
_load_model(data)
Subclasses should implement this method to load up the model data given in the argument data.
source code
Class Variables [hide private]
  MODEL_TYPE = 'chordclass'
hash(x)
  TRAINING_OPTIONS = TaggerModel.TRAINING_OPTIONS+ [ModuleOption...
Properties [hide private]
  readable_parameters
Produce a human-readable repr of the params of the model
  description
Overridden to add history onto description.

Inherited from models.TaggerModel: options

Inherited from models.TaggerModel (private): _filename

Inherited from object: __class__

Method Details [hide private]

__init__(self, model_name, *args, **kwargs)
(Constructor)

source code 

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.

Overrides: object.__init__
(inherited documentation)

train(self, inputs, grammar=None, logger=None)

source code 

Trains the loaded model using the data in the list of sequences.

Parameters:
Overrides: models.TaggerModel.train

_load_model(data)
Static Method

source code 

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.

Overrides: models.TaggerModel._load_model
(inherited documentation)

_get_model_data(self)

source code 

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

Overrides: models.TaggerModel._get_model_data
(inherited documentation)

Class Variable Details [hide private]

TRAINING_OPTIONS

Value:
TaggerModel.TRAINING_OPTIONS+ [ModuleOption('ccprob', filter= float, h\
elp_text= "Initialization of the emission distribution.", usage= "ccpr\
ob=P, P is a probability. Prob P is distributed " "over the pitch clas\
ses that are in the chord class.", required= True), ModuleOption('metr\
ic', filter= str_to_bool, help_text= "Create the model with a metrical\
 component, as in the " "original Raphael & Stoddard model", usage= "m\
etric=True, or metric=False (default False)", default= False), ModuleO\
ption('contprob', filter= (float, choose_from_list(["learn"])), help_t\
...

Property Details [hide private]

readable_parameters

Produce a human-readable repr of the params of the model

Get Method:
_get_readable_parameters(self) - Produce a human-readable repr of the params of the model

description

Overridden to add history onto description.

Get Method:
__get_description(self) - Overridden to add history onto description.