MetadataRequest#
- class sklearn.utils.metadata_routing.MetadataRequest(owner)[source]#
Contains the metadata request info of a consumer.
Instances of
MethodMetadataRequestare used in this class for each available method undermetadatarequest.{method}.Consumer-only classes such as simple estimators return a serialized version of this class as the output of
get_metadata_routing().Added in version 1.3.
- Parameters:
- ownerobject
The object to which these requests belong.
- consumes(method, params)[source]#
Return params consumed as metadata in a consumer.
This method returns the subset of given
paramsthat are consumed by the givenmethod. It can be used to check if parameters are used as metadata in the specified method of the consumer that owns thisMetadataRequestinstance.Added in version 1.4.
- Parameters:
- methodstr
The name of the method for which to determine consumed parameters.
- paramsiterable of str
An iterable of parameter names to test for consumption.
- Returns:
- consumed_paramsset of str
A subset of parameters from
paramswhich are consumed by the given method.