factory
- Name: cognitivefactory.interactive_clustering.sampling.factory
- Description: The factory method used to easily initialize a constraints sampling algorithm.
- Author: Erwan SCHILD
- Created: 17/03/2021
- Licence: CeCILL (https://cecill.info/licences.fr.html)
sampling_factory(algorithm, **kargs)
¶
A factory to create a new instance of a constraints sampling model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
algorithm |
str
|
The identification of model to instantiate. Can be |
required |
**kargs |
dict
|
Other parameters that can be used in the instantiation. |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
if |
Returns:
Name | Type | Description |
---|---|---|
AbstractConstraintsSampling |
AbstractConstraintsSampling
|
An instance of constraints sampling model. |
Example
# Import.
from cognitivefactory.interactive_clustering.sampling.factory import sampling_factory
# Create an instance of random sampler.
sampler = sampling_factory(
algorithm="random",
)
Source code in src\cognitivefactory\interactive_clustering\sampling\factory.py
22 23 24 25 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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|