Class: MethodMapping

Stores the mapping between caller and callee methods for a router.

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

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

Python Reference

Constructors

new MethodMapping()

new MethodMapping(opts?): MethodMapping

Parameters

ParameterTypeDescription
opts?object-
opts.callee?stringChild object’s method name. This method is called in caller.
opts.caller?stringParent estimator’s method name in which the callee is called.

Returns MethodMapping

Defined in generated/utils/metadata_routing/MethodMapping.ts:25

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/utils/metadata_routing/MethodMapping.ts:23
_isInitializedbooleanfalsegenerated/utils/metadata_routing/MethodMapping.ts:22
_pyPythonBridgeundefinedgenerated/utils/metadata_routing/MethodMapping.ts:21
idstringundefinedgenerated/utils/metadata_routing/MethodMapping.ts:18
optsanyundefinedgenerated/utils/metadata_routing/MethodMapping.ts:19

Accessors

py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/utils/metadata_routing/MethodMapping.ts:40


self

Get Signature

get self(): Promise<any>

Returns self.

Returns Promise<any>

Defined in generated/utils/metadata_routing/MethodMapping.ts:146

Methods

add()

add(opts): Promise<any>

Add a method mapping.

Parameters

ParameterTypeDescription
optsobject-
opts.callee?stringChild object’s method name. This method is called in caller.
opts.caller?stringParent estimator’s method name in which the callee is called.

Returns Promise<any>

Defined in generated/utils/metadata_routing/MethodMapping.ts:109


dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/utils/metadata_routing/MethodMapping.ts:92


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/utils/metadata_routing/MethodMapping.ts:53