Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Describeset_{method}_request() API, expose_MetadataRequester, or expose_BaseScorer #31360

Open
Labels
@Jacob-Stevens-Haas

Description

@Jacob-Stevens-Haas

Describe the issue linked to the documentation

TL;DR: Metadata routing for scoring could either use a base class or documentation of how to writeset_score_request().

Currently theMetadata Estimator Dev Guide has examples of a metadata-consuming estimator and a metadata-routing estimator. However, the metadata routing is also designed for scorers and CV splitters which may or may not be estimators. Fortunately,sklearn.model_selection exposesBaseCrossValidator, which likeBaseEstimator, subclasses_MetadataRequester. Unfortunately,there's no base class for scorers. the base class for scorers,_BaseScorer, is not public.

I don't understand how to string together the relevant methods that should be a part ofset_score_params, The current workaround is to simply subclassBaseEstimator, even if I'm not making an estimator, or to subclass_MetadataRequester, even though its not part of the public API.Or usemake_scorer to pin the kwargs when instantiating the meta-estimator, rather than infit()

My use case is for scoring a time-series model where the data generating mechanism is known to the experiment, but not the model, and I need to compare the fit model to the true data generating mechanism. I understand how to use a custom scorer inRandomizedSearchCV, and themetadata API explains how meta estimators likeRandomizedSearchCV can pass additional arguments to my custom scorer.

Suggest a potential alternative/fix

  • publicly exposing_MetadataRequester
  • publicly exposing_BaseScorer
  • Document how to write theset_{method}_request() methods. It looks like_MetadataRequester uses a descriptorRequestMethod, which relies on an instance having a_get_metadata_request method and a_metadata_request attribute (which it doesn't really describe).

EDIT: Found out about_BaseScorer. Also, removedmake_scorer workaround, as it doesn't result in passing the fitted estimator to the_score_func

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp