mlpy.knowledgerep.cbr.similarity.SimilarityFactory.create¶
-
static
SimilarityFactory.create(_type, **kwargs)[source]¶ Create a feature of the given type.
Parameters: _type : str
The feature type. Valid feature types are:
- knn
A k-nearest-neighbor algorithm is used to determine similarity between cases (
NeighborSimilarity). The valuen_neighborsmust be specified.- radius-n
Similarity between cases is determined by the nearest neighbors within a radius (
NeighborSimilarity). The valueradiusmust be specified.- kmeans
Similarity is determined by a KMeans clustering algorithm (
KMeansSimilarity). The valuen_clustersmust be specified.- exact-match
Only exact matches are considered similar (
ExactMatchSimilarity).- cosine
A cosine similarity measure is used to determine similarity between cases (
CosineSimilarity).
kwargs : dict, optional
Non-positional arguments to pass to the class of the given type for initialization.
Returns: ISimilarity :
A similarity instance of the given type.