MethodMapping#

classsklearn.utils.metadata_routing.MethodMapping[source]#

Stores the mapping between caller and callee methods for arouter.

This class is primarily used in aget_metadata_routing() of a routerobject when defining the mapping between the router’s methods and a sub-object (asub-estimator or a scorer).

Iterating through an instance of this class yieldsMethodPair(caller,callee) instances.

Added in version 1.3.

add(*,caller,callee)[source]#

Add a method mapping.

Parameters:
callerstr

Parent estimator’s method name in which thecallee is called.

calleestr

Child object’s method name. This method is called incaller.

Returns:
selfMethodMapping

Returns self.

Gallery examples#

Metadata Routing

Metadata Routing