skcriteria.core.methods module

Core functionalities of scikit-criteria.

class skcriteria.core.methods.SKCMethodABC[source]

Bases: object

Base 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.

get_method_name()[source]

Return the name of the method as string.

get_parameters()[source]

Return the parameters of the method as dictionary.

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:

SKCMethodABC

See also

replace

Preferred 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:

SKCMethodABC

Examples

>>> method = SKCMethodABC(...)
>>> new_method = method.replace(parameter=new_value)