sklearn.utils.metadata_routing.get_routing_for_object¶
- sklearn.utils.metadata_routing.get_routing_for_object(obj=None)[source]¶
Get a
Metadata{Router, Request}instance from the given object.This function returns a
MetadataRouteror aMetadataRequestfrom the given input.This function always returns a copy or an instance constructed from the input, such that changing the output of this function will not change the original object.
New in version 1.3.
- Parameters:
- objobject
- If the object is already a
MetadataRequestor aMetadataRouter, return a copy of that.
- If the object provides a
get_metadata_routingmethod, return a copy of the output of that method.
- If the object provides a
- Returns an empty
MetadataRequest otherwise.
- Returns an empty
- Returns:
- objMetadataRequest or MetadataRouting
A
MetadataRequestor aMetadataRoutingtaken or created from the given object.