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

BAI-1141 Experiment Ordering #1376

Merged
merged 6 commits into from
Jul 8, 2024
Merged

BAI-1141 Experiment Ordering #1376

merged 6 commits into from
Jul 8, 2024

Conversation

bw27492
Copy link
Member

@bw27492 bw27492 commented Jul 1, 2024

No description provided.

@bw27492 bw27492 requested a review from GB27247 July 2, 2024 13:08
Comment on lines 499 to 514
if len(self.raw):
for run in self.raw:
if run["run"] == run_id:
sel_run = run
break
else:
raise NameError(f"Run {run_id} does not exist.")
if (select_by is None) and (run_id is None):
raise BailoException(
"Either select_by (e.g. 'MIN|MAX:accuracy) or run_id is required to publish an experiment run."
)
if (select_by is not None) and (run_id is None):
sel_run = self.__select_run(select_by=select_by)
if run_id is not None:
for run in self.raw:
if run["run"] == run_id:
sel_run = run
break
else:
raise NameError(f"Run {run_id} does not exist.")
else:
raise BailoException(f"This experiment has no runs to publish.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this flat rather than nested.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

def publish(
self,
mc_loc: str,
semver: str = "0.1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid giving a default. It's not used anywhere else in the application.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed

runs = self.raw
for run in runs:
metrics = run["metrics"]
for m in metrics:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use for metric in metrics: for clarity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 154 to 162
@pytest.mark.integration
def test_publish_experiment_standard_ordered(standard_experiment):
standard_experiment.publish(mc_loc="performance.performanceMetrics", select_by="MAX:accuracy")

model_card = standard_experiment.model.model_card
model_card = NestedDict(model_card)
metrics_array = model_card[("performance", "performanceMetrics")][0]["datasetMetrics"]

expected_accuracy = 0.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test for failure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

:param semver: Semantic version of release to create (if artifacts present), defaults to 0.1.0 or next
:param notes: Notes for release, defaults to ""
:param run_id: Local experiment run ID to be selected, defaults to None
:param select_by: String describing experiment to be selected (e.g. "MIN|MAX:accuracy"), defaults to None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format with this in accordance with MLFlow

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, now accuracy MIN|MAX

@bw27492 bw27492 merged commit e545e53 into main Jul 8, 2024
14 checks passed
@bw27492 bw27492 deleted the BAI-1141-experiment-ordering branch July 8, 2024 15:33
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.

2 participants