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

Spearman as metric #1919

Closed
fdzr opened this issue Dec 10, 2024 · 8 comments
Closed

Spearman as metric #1919

fdzr opened this issue Dec 10, 2024 · 8 comments

Comments

@fdzr
Copy link

fdzr commented Dec 10, 2024

I'm confused about how to create a metric (function or program) that accumulates predictions and gold data to compute the Spearman correlation. My confusion stems from the concept of accuracy, which evaluates each individual prediction. I want to ensure that all predictions are considered collectively at the end of the evaluation process.

I need help!

@okhat
Copy link
Collaborator

okhat commented Dec 10, 2024

You may need to make your individual examples contain entire batches of sub-examples :D

@fdzr
Copy link
Author

fdzr commented Dec 10, 2024

@okhat any clue on how to code this?

@okhat
Copy link
Collaborator

okhat commented Dec 10, 2024

trainset = [dspy.Example(examples=[...])]

@fdzr
Copy link
Author

fdzr commented Dec 10, 2024

@okhat thank you so much!!!!

@fdzr fdzr closed this as completed Dec 10, 2024
@fdzr fdzr reopened this Dec 10, 2024
@fdzr fdzr closed this as completed Dec 15, 2024
@fdzr fdzr reopened this Dec 18, 2024
@fdzr
Copy link
Author

fdzr commented Dec 18, 2024

@okhat When using the MIPROV2 optimizer, I need to provide a metric as a parameter, but I'm uncertain about the format or structure of the metric. Any clue considering that the target is optimize Spearman?

@okhat
Copy link
Collaborator

okhat commented Dec 18, 2024

You need a batch metric! That takes example, pred, trace=None and looks inside example.batch for a batch of things and in pred.batch for a batch of predictions.

@fdzr
Copy link
Author

fdzr commented Dec 18, 2024

@okhat Essentially, the Spearman score is being reported. The MiproV2 optimizer, operating in the background, recognizes that a higher score indicates a better program. It then utilizes these weights to identify and report the optimal program, correct?

@okhat
Copy link
Collaborator

okhat commented Jan 1, 2025

Yeah

@okhat okhat closed this as completed Jan 1, 2025
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

No branches or pull requests

2 participants