abstract
- Name: cognitivefactory.interactive_clustering.sampling.abstract
- Description: The abstract class used to define constraints sampling algorithms.
- Author: Erwan SCHILD
- Created: 17/03/2021
- Licence: CeCILL (https://cecill.info/licences.fr.html)
AbstractConstraintsSampling
¶
Bases: ABC
Abstract class that is used to define constraints sampling algorithms.
The main inherited method is sample
.
Source code in src\cognitivefactory\interactive_clustering\sampling\abstract.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
sample(constraints_manager, nb_to_select, clustering_result=None, vectors=None, **kargs)
abstractmethod
¶
(ABSTRACT METHOD) An abstract method that represents the main method used to sample couple of data IDs for constraints annotation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constraints_manager |
AbstractConstraintsManager
|
A constraints manager over data IDs. |
required |
nb_to_select |
int
|
The number of couple of data IDs to select. |
required |
clustering_result |
Optional[Dict[str, int]]
|
A dictionary that represents the predicted cluster for each data ID. The keys of the dictionary represents the data IDs. If |
None
|
vectors |
Optional[Dict[str, csr_matrix]]
|
vectors (Dict[str, csr_matrix]): The representation of data vectors. The keys of the dictionary represents the data IDs. This keys have to refer to the list of data IDs managed by the |
None
|
**kargs |
dict
|
Other parameters that can be used in the sampling. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
if some parameters are incorrectly set or incompatible. |
Returns:
Type | Description |
---|---|
List[Tuple[str, str]]
|
List[Tuple[str,str]]: A list of couple of data IDs. |
Source code in src\cognitivefactory\interactive_clustering\sampling\abstract.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|