factory
- Name: cognitivefactory.interactive_clustering.clustering.factory
- Description: The factory method used to easily initialize a constrained clustering algorithm.
- Author: Erwan SCHILD
- Created: 17/03/2021
- Licence: CeCILL-C License v1.0 (https://cecill.info/licences.fr.html)
clustering_factory(algorithm='kmeans', **kargs)
¶
A factory to create a new instance of a constrained clustering model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
algorithm |
str
|
The identification of model to instantiate. Can be |
'kmeans'
|
**kargs |
dict
|
Other parameters that can be used in the instantiation. |
{}
|
Warns:
Type | Description |
---|---|
FutureWarning
|
|
Raises:
Type | Description |
---|---|
ValueError
|
if |
Returns:
Name | Type | Description |
---|---|---|
AbstractConstraintsClustering |
AbstractConstrainedClustering
|
An instance of constrained clustering model. |
Example
# Import.
from cognitivefactory.interactive_clustering.clustering.factory import clustering_factory
# Create an instance of kmeans.
clustering_model = clustering_factory(
algorithm="kmeans",
model="COP",
random_seed=42,
)
Source code in src\cognitivefactory\interactive_clustering\clustering\factory.py
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|