mlpy.knowledgerep.cbr.engine.CaseBaseEntry

class mlpy.knowledgerep.cbr.engine.CaseBaseEntry(model, validity_check=True)[source]

Bases: object

The case base entry class.

The entry maintains a similarity model from which similar cases can be derived.

Internally the similarity model maintains an indexing structure dependent on the similarity model type for efficient computation of the similarity between cases. The case base is responsible for updating the indexing structure as cases are added and removed.

Parameters:

model : ISimilarity

The similarity model.

validity_check : bool

This flag controls whether the dirty flag is being checked before determining whether to rebuild the model or not.

Attributes

dirty (bool) A flag which identifies whether the model needs to be rebuild. The indexing structure of the similarity model is always rebuild unless a validity check is required. If a validity check is required the indexing structure is only rebuild if the entry is considered dirty.

Methods

compute_similarity(data_point, **kwargs) Computes the similarity.