Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔓📊 Relax type hint of RankBasedEvaluator's metrics/metrics_kwargs parameter pair to match make_many #1383

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

mberr
Copy link
Member

@mberr mberr commented Mar 29, 2024

This is a small PR to relax the type hint the metric/metric_kwargs parameter-pair of RankBasedEvaluator.__init__ to the one of ClassResolver.make_many.

In particular this indicates that you can also pass a single hint such as

evaluator = RankBasedEvaluator(
  metrics="hits_at_k",
  metric_kwargs=dict(k=50),
)

or use "broadcasting" such as

evaluator = RankBasedEvaluator(
  metrics="hits_at_k",
  metric_kwargs=[dict(k=k) for k in (32, 64, 128)],
)

@mberr mberr marked this pull request as ready for review March 29, 2024 10:47
@mberr mberr enabled auto-merge (squash) March 29, 2024 10:49
@mberr mberr disabled auto-merge March 29, 2024 10:59
@mberr mberr changed the title Relax type hint to match make_many 🔓📊 Relax type hint of RankBasedEvaluator's metrics/metrics_kwargs parameter pair to match make_many Mar 29, 2024
@mberr mberr enabled auto-merge (squash) March 29, 2024 11:00
@mberr mberr merged commit 9b9b59f into master Mar 29, 2024
14 of 23 checks passed
@mberr mberr deleted the update-type-hint branch March 29, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant