colda.algorithm.strategy package
Subpackages
- colda.algorithm.strategy.custom package
- Submodules
- colda.algorithm.strategy.custom.api module
- colda.algorithm.strategy.custom.custom_factory module
- colda.algorithm.strategy.custom.test_custom module
- colda.algorithm.strategy.custom.train_custom module
- Module contents
Submodules
colda.algorithm.strategy.abstract_algorithm_strategy module
colda.algorithm.strategy.api module
- class colda.algorithm.strategy.api.BaseAlgorithmStrategy
Bases:
object
Base class for algorithm 1. Contains data processing for input and output 2. Contains shared stage:
make_hash make_match_idx
Methods
algorithm_process make_hash make_match_idx
- class colda.algorithm.strategy.api.TestAlgorithm
Bases:
AbstractTestAlgorithmStrategy
,BaseAlgorithmStrategy
Strategy pattern to manage test algorithm
Attributes
train_custom
Methods
get_instance make_test_local make_test make_eval
- classmethod get_instance() TestAlgorithm
Singleton pattern. Get instance of current class.
Returns
TestAlgorithm
- class colda.algorithm.strategy.api.TrainAlgorithm
Bases:
AbstractTrainAlgorithmStrategy
,BaseAlgorithmStrategy
Strategy pattern to manage train algorithm
Attributes
train_custom
Methods
get_instance make_train_local make_train make_result
- classmethod get_instance() TrainAlgorithm
Singleton pattern. Get instance of current class.
Returns
type[TrainAlgorithm]
- make_residual(**kwargs) None
strategy interface
- make_result(**kwargs) None
strategy interface
- make_train(**kwargs) None
strategy interface
- make_train_local(**kwargs) None
strategy interface
colda.algorithm.strategy.base module
- class colda.algorithm.strategy.base.BaseAlgorithmStrategy
Bases:
object
Base class for algorithm 1. Contains data processing for input and output 2. Contains shared stage:
make_hash make_match_idx
Methods
algorithm_process make_hash make_match_idx
colda.algorithm.strategy.dp module
- class colda.algorithm.strategy.dp.DP
Bases:
object
class for data processing
- classmethod process_input(**kwargs)
- classmethod process_input_recursion(data: Any)
Change list to np.array
- classmethod process_output(res: tuple) dict | list | tuple | str | int | float | bool | None
Process the output that generated from all the algorithm methods.
All the output are tuple form. We first change the tuple to list form, then process the each element in the list
Parameters
res : tuple[Any]
Returns
Serializable_Datatype
colda.algorithm.strategy.test_algorithm module
- class colda.algorithm.strategy.test_algorithm.TestAlgorithm
Bases:
AbstractTestAlgorithmStrategy
,BaseAlgorithmStrategy
Strategy pattern to manage test algorithm
Attributes
train_custom
Methods
get_instance make_test_local make_test make_eval
- classmethod get_instance() TestAlgorithm
Singleton pattern. Get instance of current class.
Returns
TestAlgorithm
colda.algorithm.strategy.train_algorithm module
- class colda.algorithm.strategy.train_algorithm.TrainAlgorithm
Bases:
AbstractTrainAlgorithmStrategy
,BaseAlgorithmStrategy
Strategy pattern to manage train algorithm
Attributes
train_custom
Methods
get_instance make_train_local make_train make_result
- classmethod get_instance() TrainAlgorithm
Singleton pattern. Get instance of current class.
Returns
type[TrainAlgorithm]
- make_residual(**kwargs) None
strategy interface
- make_result(**kwargs) None
strategy interface
- make_train(**kwargs) None
strategy interface
- make_train_local(**kwargs) None
strategy interface
colda.algorithm.strategy.utils module
- colda.algorithm.strategy.utils.algorithm_process(func: Callable) Callable
- Wrapper that has following properties:
1. Process the input that pass into all the algorithm methods. Mainly change list to np.array 2. Process the output that generated from all the algorithm methods. Mainly change np.array to list
Parameters
func : Callable
Returns
JSONType
Module contents
- class colda.algorithm.strategy.BaseAlgorithmStrategy
Bases:
object
Base class for algorithm 1. Contains data processing for input and output 2. Contains shared stage:
make_hash make_match_idx
Methods
algorithm_process make_hash make_match_idx
- class colda.algorithm.strategy.TestAlgorithm
Bases:
AbstractTestAlgorithmStrategy
,BaseAlgorithmStrategy
Strategy pattern to manage test algorithm
Attributes
train_custom
Methods
get_instance make_test_local make_test make_eval
- classmethod get_instance() TestAlgorithm
Singleton pattern. Get instance of current class.
Returns
TestAlgorithm
- class colda.algorithm.strategy.TrainAlgorithm
Bases:
AbstractTrainAlgorithmStrategy
,BaseAlgorithmStrategy
Strategy pattern to manage train algorithm
Attributes
train_custom
Methods
get_instance make_train_local make_train make_result
- classmethod get_instance() TrainAlgorithm
Singleton pattern. Get instance of current class.
Returns
type[TrainAlgorithm]
- make_residual(**kwargs) None
strategy interface
- make_result(**kwargs) None
strategy interface
- make_train(**kwargs) None
strategy interface
- make_train_local(**kwargs) None
strategy interface