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

Best Of ensemble: solve mixer ties with runtime as second criterion #1135

Closed
paxcema opened this issue Apr 25, 2023 · 4 comments
Closed

Best Of ensemble: solve mixer ties with runtime as second criterion #1135

paxcema opened this issue Apr 25, 2023 · 4 comments
Labels
Community Community-led efforts enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed wontfix Will not fix / very low priority

Comments

@paxcema
Copy link
Contributor

paxcema commented Apr 25, 2023

The predictor object stores an up-to-date dictionary with runtimes for each phase. This could be used in the mixer selection within BestOf to solve ties on accuracy by choosing the fastest option.

@paxcema paxcema added the enhancement New feature or request label Apr 25, 2023
@paxcema paxcema added help wanted Extra attention is needed good first issue Good for newcomers Community Community-led efforts labels May 21, 2023
@paxcema paxcema removed their assignment May 21, 2023
@noraa-july-stoke
Copy link
Contributor

noraa-july-stoke commented Jun 4, 2023

@paxcema
thought I could take a stab at this if I may bounce my initial thoughts on some first steps off of you...

1. add runtime field to the SubmodelData class:

@dataclass_json
@dataclass
class SubmodelData:
    name: str
    accuracy: float
    is_best: bool
    runtime: float  # new field for storing the runtime of each submodel
    
2. Store  the runtime in SubmodelData for each mixer:

self.submodel_data.append(SubmodelData(
    name=type(mixer).__name__,
    accuracy=avg_score,
    runtime=runtime,  # store the runtime here
    is_best=False
))

3. Add runtime to the JSON serialization of SubmodelData:

def to(self, *args, **kwargs):
    return {
        'name': self.name,
        'accuracy': self.accuracy,
        'is_best': self.is_best,
        'runtime': self.runtime,  # add this line
    }

if you wanted more from this, let me know!

@paxcema
Copy link
Contributor Author

paxcema commented Jun 7, 2023

Looks good! Only thing that comes to mind is that perhaps there is a small functionality duplicity with the runtime_log that every predictor has and fills, but the solution above seems to me, by far, the simplest to achieve what we need.

@noraa-july-stoke
Copy link
Contributor

@paxcema okay I'll send in a PR soon! Maybe I can work maybe cleaning up a bit more as a follow-up...

@paxcema paxcema added the wontfix Will not fix / very low priority label Jan 22, 2024
@paxcema
Copy link
Contributor Author

paxcema commented Jan 22, 2024

Closing for now.

@paxcema paxcema closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Community-led efforts enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed wontfix Will not fix / very low priority
Projects
None yet
Development

No branches or pull requests

2 participants