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

Dataframe name #472

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d438a21
Created an Intake Source for DataframePlotDataSource for reading Dat…
jhui18 Jul 17, 2024
ca45344
fixing typing errors
jhui18 Jul 18, 2024
a3d353d
update styling issues
jhui18 Jul 18, 2024
0b6a15a
update environment.yml
jhui18 Jul 18, 2024
dae7f49
remove nvm files
jhui18 Jul 18, 2024
6e2c4ac
update test_viz.py for dataframe test
jhui18 Jul 18, 2024
b9d0b91
update parameters in test_viz.py for dataframe test
jhui18 Jul 18, 2024
73beb27
merging branch to main
jhui18 Jul 17, 2024
da0e44f
resolve merge conflicts
jhui18 Jul 18, 2024
b715d05
remove nvm files
jhui18 Jul 18, 2024
e0e2d65
resolving merge conflicts
jhui18 Jul 18, 2024
9147bdf
moved imports in viz.py and added dataframe plot tests in test_publis…
jhui18 Jul 18, 2024
a01c3e9
add dataframe argumentfor publish tests
jhui18 Jul 18, 2024
9095c84
debugging test_viz.py
jhui18 Jul 19, 2024
823d775
removed experiments check in test_viz
jhui18 Jul 19, 2024
9c639ba
Created an intake source for MetricListComparisonDataSource for readi…
jhui18 Jul 22, 2024
f474b20
Merge branch 'metric-list' of https://github.com/jeh362/rubicon-ml in…
jhui18 Jul 22, 2024
a61a268
updated formatting
jhui18 Jul 22, 2024
7fda1c9
removed duplicate test in test_viz.py
jhui18 Jul 22, 2024
39912be
edit metriclist types and removing experiments from metriclistcompari…
jhui18 Jul 22, 2024
f19ae27
edit test_viz.py metric list parameter names
jhui18 Jul 22, 2024
df99dcd
update metric list tests
jhui18 Jul 22, 2024
48236da
edit comments
jhui18 Jul 22, 2024
fbf69f9
remove error for no dataframe logged to each experiment
jhui18 Jul 25, 2024
5084131
update code styling
jhui18 Jul 25, 2024
5d8e610
make dataframe_name default to 'None' and take the dataframe name of …
jhui18 Jul 25, 2024
a941483
Merge branch 'capitalone:main' into dataframe-name
jeh362 Jul 25, 2024
62a5629
Merge branch 'main' into dataframe-name
jeh362 Jul 30, 2024
3fd1802
Merge branch 'main' into dataframe-name
jeh362 Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions rubicon_ml/viz/dataframe_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,22 @@ class DataframePlot(VizBase):

def __init__(
self,
dataframe_name,
dataframe_name=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please add type hints as we go through these? Thanks.

experiments=None,
plotting_func=px.line,
plotting_func_kwargs={},
x=None,
y=None,
):
super().__init__(dash_title="plot dataframes")

self.dataframe_name = dataframe_name
self.experiments = experiments
if experiments != None:
if len(experiments[0].dataframes()) == 0:
raise Exception("No dataframe logged to experiment")
else:
self.dataframe_name = self.experiments[0].dataframes()[0].name
else:
self.dataframe_name = dataframe_name
self.plotting_func = plotting_func
self.plotting_func_kwargs = plotting_func_kwargs
self.x = x
Expand Down Expand Up @@ -89,8 +94,15 @@ def load_experiment_data(self):
`dataframe_name` must have the same schema.
"""
self.data_df = None
count = 0

for experiment in self.experiments:
if len(experiment.dataframes()) == 0:
print(
f"WARNING: Experiment {experiment.name} does not have any dataframes logged to it. "
)
continue
count += 1
dataframe = experiment.dataframe(name=self.dataframe_name)

data_df = dataframe.get_data()
Expand All @@ -116,6 +128,9 @@ def load_experiment_data(self):
len(self.experiments),
)

if count == 0:
raise Exception(f"No dataframe with name {self.dataframe_name} found!")

def register_callbacks(self, link_experiment_table=False):
outputs = [
Output("dataframe-plot", "figure"),
Expand Down
Loading