skcriteria.core.methods module
Foundational module for the creation of multi-criteria methods.
This module provides the basic components for the entire library. It defines the abstract base classes that encapsulate the logic of the transformers and aggregators.
Transformers: These are classes in charge of pre-processing the decision matrix. They take a DecisionMatrix and return a new, modified one. Examples include data normalization, weighting, or filtering of alternatives/criteria.
Aggregators: These classes implement the core of the multi-criteria decision-making methods. They take a DecisionMatrix and return a result, which is usually a ranking of the alternatives.
By providing this common structure, it is possible to create new methods that are compatible with the entire scikit-criteria ecosystem and, at the same time, to assemble complex decision-making processes through pipelines.
- class skcriteria.core.methods.SKCMethodABC[source]
Bases:
objectBase class for all class in scikit-criteria.
Notes
All subclasses should specify:
_skcriteria_dm_type: The type of the decision maker._skcriteria_parameters: Availebe parameters._skcriteria_abstract_class: If the class is abstract.
If the class is abstract all validations are turned off.
- copy(**kwargs)[source]
Create a copy of the current SKCMethodABC instance.
Deprecated since version 0.9: Using kwargs with copy() is deprecated. Use SKCMethodABC.replace() instead.
- Parameters:
**kwargs (dict, optional) – Keyword arguments to modify attributes in the copied instance. This parameter is deprecated.
- Returns:
A new instance with the same data as the original.
- Return type:
See also
replacePreferred method to create a copy with modifications.
Examples
>>> method = SKCMethodABC(...) >>> method_copy = method.copy()
- replace(**kwargs)[source]
Create a new instance with updated parameters.
This method creates a new instance of the class with the same parameters as the current instance, but with the option to override specific parameters through kwargs.
- Parameters:
**kwargs (dict) – Keyword arguments to override in the new instance. Any parameter that is valid for the class constructor can be specified.
- Returns:
A new instance with updated parameters.
- Return type:
Examples
>>> method = SKCMethodABC(...) >>> new_method = method.replace(parameter=new_value)