mlpy.knowledgerep.cbr.engine.CaseBase.retrieve

CaseBase.retrieve(case, names=None, validity_check=True, **kwargs)[source]

Retrieve cases similar to the query case.

Parameters:

case : Case

The query case.

names : str or list[str]

The name(s) of the features for which to retrieve similar cases.

validity_check : bool

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

Returns:

dict[int, CaseMatch] :

The solution to the problem-solving experience.

Other Parameters:
 

cases : dict[int, Case]

The complete case base from which to build the indexing structure used by the similarity model.

data : ndarray[ndarray[float]]

If this keyword is set, the cases in the case base are ignored and the data entries specified in this variable are used to build the indexing structure.

names : str or list[str]

The feature name(s) relevant for the similarity computation. This field is only required if the cases for building the indexing structure comes from the cases field.

id_map : dict[int, int]

The mapping from the data stored in the data field to their case ids. This field is only required if the data for building the indexing structure comes from the data field.