Package jazzparser :: Package formalisms :: Package music_halfspan :: Package semantics :: Module distance :: Class TonalSpaceEditDistance
[hide private]
[frames] | no frames]

Class TonalSpaceEditDistance

source code

                            object --+        
                                     |        
base.semantics.distance.DistanceMetric --+    
                                         |    
      base.semantics.distance.FScoreMetric --+
                                             |
                                            TonalSpaceEditDistance

Original tonal space distance metric computed as the edit distance of the step vectors and functions of the path through the tonal space implied by the semantics.

Instance Methods [hide private]
 
fscore_match(self, sem1, sem2)
Subclasses must provide this.
source code
 
_get_identifier(self)
A human-readable identifier for the metric represented by this instance.
source code
 
distance(self, sem1, sem2)
Compares the two semantics instances and returns a float distance between them.
source code
 
print_computation(self, sem1, sem2)
Shows the optimal alignment of the paths that the score comes from.
source code
 
total_distance(self, input_pairs)
Handle the 'dist' output specially (just sum up distances).
source code
 
format_distance(self, dist)
Format a distance value (as returned from distance or total_distance) as a string suitable for human-readable output.
source code

Inherited from base.semantics.distance.DistanceMetric: __init__

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

Class Variables [hide private]
  OPTIONS = [ModuleOption('output', filter= choose_from_list(['f...
  name = 'tsed'
Properties [hide private]
  identifier
A human-readable identifier for the metric represented by this instance.

Inherited from object: __class__

Method Details [hide private]

fscore_match(self, sem1, sem2)

source code 

Subclasses must provide this. It should return a tuple. The first three values must be floats: score given to the matching between the two inputs; max score that could be given to the first; max score for the second. There may be more values in the tuple.

Overrides: base.semantics.distance.FScoreMetric.fscore_match
(inherited documentation)

_get_identifier(self)

source code 

A human-readable identifier for the metric represented by this instance.

Overrides: base.semantics.distance.DistanceMetric._get_identifier
(inherited documentation)

distance(self, sem1, sem2)

source code 

Compares the two semantics instances and returns a float distance between them.

Overrides: base.semantics.distance.DistanceMetric.distance
(inherited documentation)

print_computation(self, sem1, sem2)

source code 

Shows the optimal alignment of the paths that the score comes from.

Overrides: base.semantics.distance.DistanceMetric.print_computation

See Also: jazzparser.formalisms.music_halfspan.semantics.distance.DistanceMetric.print_computation

total_distance(self, input_pairs)

source code 

Handle the 'dist' output specially (just sum up distances).

Overrides: base.semantics.distance.DistanceMetric.total_distance

format_distance(self, dist)

source code 

Format a distance value (as returned from distance or total_distance) as a string suitable for human-readable output.

Overrides: base.semantics.distance.DistanceMetric.format_distance
(inherited documentation)

Class Variable Details [hide private]

OPTIONS

Value:
[ModuleOption('output', filter= choose_from_list(['f', 'precision', 'r\
ecall', 'inversef', 'dist']), usage= "output=O, where O is one of 'f',\
 'precision', " "'recall', 'inversef', 'dist'", default= 'dist', help_\
text= "Select what metric to output. Choose recall " "or precision for\
 asymmetric metrics. F-score ('f') " "combines these two. This is inve\
rted ('inversef') " "to get a distance, rather than similarity. " "Alt\
ernatively, use the edit distance of the alignment " "('dist', default\
)"),]

Property Details [hide private]

identifier

A human-readable identifier for the metric represented by this instance.

Get Method:
_get_identifier(self) - A human-readable identifier for the metric represented by this instance.