Spaces:
Paused
Paused
Add previous changes
Browse files- dashboard.py +0 -14
- opendashboards/utils/plotting.py +6 -1
dashboard.py
CHANGED
@@ -39,19 +39,8 @@ st.markdown('#')
|
|
39 |
with st.spinner(text=f'Checking wandb...'):
|
40 |
df_runs = io.load_runs(project=DEFAULT_PROJECT, filters=DEFAULT_FILTERS, min_steps=10)
|
41 |
|
42 |
-
|
43 |
-
### Wandb Runs ###
|
44 |
-
# with st.sidebar:
|
45 |
-
|
46 |
-
# st.markdown('#')
|
47 |
-
# st.sidebar.header(":violet[Select] Runs")
|
48 |
-
|
49 |
-
# df_runs_subset = io.filter_dataframe(df_runs, demo_selection=df_runs.id.isin(DEFAULT_SELECTED_RUNS))
|
50 |
-
# n_runs = len(df_runs_subset)
|
51 |
-
|
52 |
metric.wandb(df_runs)
|
53 |
|
54 |
-
|
55 |
# add vertical space
|
56 |
st.markdown('#')
|
57 |
st.markdown('#')
|
@@ -65,9 +54,6 @@ with tab1:
|
|
65 |
st.subheader(":violet[Run] Data")
|
66 |
with st.expander(f'Show :violet[raw] wandb data'):
|
67 |
|
68 |
-
# filter_selected_checkbox = st.checkbox('Filter to selected runs', value=True)
|
69 |
-
# df_to_show = df_runs_subset if filter_selected_checkbox else df_runs
|
70 |
-
|
71 |
edited_df = st.data_editor(
|
72 |
df_runs.assign(Select=False).set_index('Select'),
|
73 |
column_config={"Select": st.column_config.CheckboxColumn(required=True)},
|
|
|
39 |
with st.spinner(text=f'Checking wandb...'):
|
40 |
df_runs = io.load_runs(project=DEFAULT_PROJECT, filters=DEFAULT_FILTERS, min_steps=10)
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
metric.wandb(df_runs)
|
43 |
|
|
|
44 |
# add vertical space
|
45 |
st.markdown('#')
|
46 |
st.markdown('#')
|
|
|
54 |
st.subheader(":violet[Run] Data")
|
55 |
with st.expander(f'Show :violet[raw] wandb data'):
|
56 |
|
|
|
|
|
|
|
57 |
edited_df = st.data_editor(
|
58 |
df_runs.assign(Select=False).set_index('Select'),
|
59 |
column_config={"Select": st.column_config.CheckboxColumn(required=True)},
|
opendashboards/utils/plotting.py
CHANGED
@@ -44,7 +44,7 @@ def plot_throughput(df: pd.DataFrame, n_minutes: int = 10) -> go.Figure:
|
|
44 |
|
45 |
|
46 |
def plot_weights(scores: pd.DataFrame, ntop: int = 20, uids: List[Union[str, int]] = None) -> go.Figure:
|
47 |
-
"""
|
48 |
|
49 |
Args:
|
50 |
scores (pd.DataFrame): Dataframe of scores. Should be indexed by timestamp and have one column per uid.
|
@@ -310,11 +310,15 @@ def plot_completion_length_time(
|
|
310 |
uid_col: str = "answer_uids",
|
311 |
completion_col: str = "answer_completions",
|
312 |
time_col: str = "answer_times",
|
|
|
313 |
words: bool = False,
|
314 |
) -> go.Figure:
|
315 |
|
316 |
df = df[[uid_col, completion_col, time_col]].explode(column=[uid_col, completion_col, time_col])
|
317 |
df["time"] = df[time_col].astype(float)
|
|
|
|
|
|
|
318 |
if words:
|
319 |
df["completion_length"] = df[completion_col].str.split().str.len()
|
320 |
else:
|
@@ -324,6 +328,7 @@ def plot_completion_length_time(
|
|
324 |
df,
|
325 |
x='completion_length',
|
326 |
y='time',
|
|
|
327 |
labels={"completion_length": f"Completion Length, {'Words' if words else 'Characters'}", "time": "Time (s)"},
|
328 |
title=f"Completion Length vs Time, {'Words' if words else 'Characters'}",
|
329 |
marginal_x="histogram",
|
|
|
44 |
|
45 |
|
46 |
def plot_weights(scores: pd.DataFrame, ntop: int = 20, uids: List[Union[str, int]] = None) -> go.Figure:
|
47 |
+
"""Plot weights of uids.
|
48 |
|
49 |
Args:
|
50 |
scores (pd.DataFrame): Dataframe of scores. Should be indexed by timestamp and have one column per uid.
|
|
|
310 |
uid_col: str = "answer_uids",
|
311 |
completion_col: str = "answer_completions",
|
312 |
time_col: str = "answer_times",
|
313 |
+
uids: List[int] = None,
|
314 |
words: bool = False,
|
315 |
) -> go.Figure:
|
316 |
|
317 |
df = df[[uid_col, completion_col, time_col]].explode(column=[uid_col, completion_col, time_col])
|
318 |
df["time"] = df[time_col].astype(float)
|
319 |
+
if uids is not None:
|
320 |
+
df = df.loc[df[uid_col].isin(uids)]
|
321 |
+
|
322 |
if words:
|
323 |
df["completion_length"] = df[completion_col].str.split().str.len()
|
324 |
else:
|
|
|
328 |
df,
|
329 |
x='completion_length',
|
330 |
y='time',
|
331 |
+
color=uid_col if uids is not None else None,
|
332 |
labels={"completion_length": f"Completion Length, {'Words' if words else 'Characters'}", "time": "Time (s)"},
|
333 |
title=f"Completion Length vs Time, {'Words' if words else 'Characters'}",
|
334 |
marginal_x="histogram",
|