_fit¶
This module provides a set of types that can be used as building blocks
in the aggregation of a Clustering
object.
Go to:
Fitter¶
- class commonnn._fit.FitterExtInterface¶
- fit(self, Bundle bundle, **kwargs)¶
- make_parameters(self, **kwargs) Type['ClusterParameters'] ¶
- class commonnn._fit.FitterExtCommonNNInterface¶
- fit(self, Bundle bundle, **kwargs) float ¶
- get_fit_signature(self)¶
- make_parameters(self, **kwargs) Type['ClusterParameters'] ¶
- class commonnn._fit.Fitter¶
Defines the fitter interface
- abstract fit(self, Bundle bundle, **kwargs)¶
Generic clustering outer function
- abstract make_parameters(self, **kwargs) Type['ClusterParameters'] ¶
Create fitter specific cluster parameters
- class commonnn._fit.FitterCommonNN¶
Defines the fitter interface
- fit(self, Bundle bundle, *, purge=True, info=True, **kwargs) -> (float, Type['ClusterParameters'])¶
- get_fit_signature(self)¶
- make_parameters(self, similarity_offset=0, original=False, **kwargs) Type['ClusterParameters'] ¶
- class commonnn._fit.FitterExtCommonNNBFS¶
Concrete implementation of the fitter interface
Realises a CommonNN clustering using a breadth-first-search
- Parameters:
neighbours_getter – Any extension type implementing the neighbours getter interface.
neighbours – Any extension type implementing the neighbours interface.
neighbour_neighbourss – Any extension type implementing the neighbours interface.
similarity_checker – Any extension type implementing the similarity checker interface.
queue – Any extension type implementing the queue interface. Used during the clustering procedure.
- classmethod get_builder_kwargs(type cls)¶
- class commonnn._fit.FitterCommonNNBFS(neighbours_getter: Type['NeighboursGetter'], neighbours: Type['Neighbours'], neighbour_neighbours: Type['Neighbours'], similarity_checker: Type['SimilarityChecker'], queue: Type['Queue'])¶
Concrete implementation of the fitter interface
- Parameters:
neighbours_getter – Any object implementing the neighbours getter interface.
neighbours – Any object implementing the neighbours interface.
neighbour_neighbourss – Any object implementing the neighbours interface.
similarity_checker – Any object implementing the similarity checker interface.
queue – Any object implementing the queue interface.
- classmethod get_builder_kwargs(cls)¶
- class commonnn._fit.FitterCommonNNBFSDebug(neighbours_getter: Type['NeighboursGetter'], neighbours: Type['Neighbours'], neighbour_neighbours: Type['Neighbours'], similarity_checker: Type['SimilarityChecker'], queue: Type['Queue'], verbose=True, yielding=True)¶
Concrete implementation of the fitter interface
Yields/prints information during the clustering.
- Parameters:
neighbours_getter – Any extension type implementing the neighbours getter interface.
neighbours – Any extension type implementing the neighbours interface.
neighbour_neighbourss – Any extension type implementing the neighbours interface.
similarity_checker – Any extension type implementing the similarity checker interface.
queue – Any extension type implementing the queue interface. Used during the clustering procedure.
- classmethod get_builder_kwargs(cls)¶
Hierarchical fitter¶
- class commonnn._fit.HierarchicalFitter¶
Defines the hierarchical fitter interface
- abstract fit(self, Bundle bundle, *args, **kwargs)¶
Generic clustering
- class commonnn._fit.HierarchicalFitterCommonNNMSTPrim(neighbours_getter: Type['NeighboursGetter'], neighbours: Type['Neighbours'], neighbour_neighbours: Type['Neighbours'], similarity_checker: Type['SimilarityChecker'], priority_queue: Type['PriorityQueue'], priority_queue_tree: Type['PriorityQueue'])¶
Concrete implementation of the hierarchical fitter interface
Builds a minimum spanning tree on the density estimate using Prim’s algorithm and creates a cluster hierarchy via single linkage clustering.
Note
This is still experimental.
- fit(self, Bundle bundle, *, sort_by_size: bool = True, member_cutoff: int = None, max_clusters: int = None, info: bool = True, v: bool = True, **kwargs)¶
- classmethod get_builder_kwargs(cls)¶
- make_parameters(self, **kwargs) Type['ClusterParameters'] ¶
Predictor¶
- class commonnn._fit.Predictor¶
Defines the predictor interface
- abstract make_parameters(self, **kwargs) Type['ClusterParameters'] ¶
Create fitter specific cluster parameters
- abstract predict(self, Bundle bundle, Bundle other, **kwargs)¶
Generic prediction
- class commonnn._fit.PredictorCommonNN¶
- get_fit_signature(self)¶
- make_parameters(self, **kwargs) Type['ClusterParameters'] ¶
- predict(self, Bundle bundle, Bundle other, *, clusters=None, purge=True, info=True, **kwargs)¶
- class commonnn._fit.PredictorCommonNNFirstmatch(neighbours_getter: Type['NeighboursGetter'], neighbours_getter_other: Type['NeighboursGetter'], neighbours: Type['Neighbours'], neighbour_neighbours: Type['Neighbours'], similarity_checker: Type['SimilarityChecker'])¶
- classmethod get_builder_kwargs(cls)¶