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

Add title to drift plot #867

Merged
merged 5 commits into from Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions deepchecks/utils/distribution/drift.py
Expand Up @@ -147,9 +147,9 @@ def calc_drift_and_plot(train_column: pd.Series, test_column: pd.Series, plot_ti
# Should never reach here
raise DeepchecksValueError(f'Unsupported column type for drift: {column_type}')

fig = make_subplots(rows=2, cols=1, vertical_spacing=0.4, shared_yaxes=False, shared_xaxes=False,
fig = make_subplots(rows=2, cols=1, vertical_spacing=0.2, shared_yaxes=False, shared_xaxes=False,
row_heights=[0.1, 0.9],
subplot_titles=['Drift Score - ' + scorer_name, plot_title])
subplot_titles=['Drift Score - ' + scorer_name, 'Distribution Plot'])

fig.add_traces(bar_traces, rows=[1] * len(bar_traces), cols=[1] * len(bar_traces))
fig.add_traces(dist_traces, rows=[2] * len(dist_traces), cols=[1] * len(dist_traces))
Expand All @@ -164,7 +164,8 @@ def calc_drift_and_plot(train_column: pd.Series, test_column: pd.Series, plot_ti
yanchor='top',
y=0.6),
width=700,
height=400
height=400,
title=plot_title
)

fig.update_layout(shared_layout)
Expand Down
Expand Up @@ -458,9 +458,9 @@ def calc_drift_and_plot(train_distribution: dict, test_distribution: dict, plot_
raise DeepchecksValueError(
f'column_type must be one of ["numerical", "categorical"], instead got {column_type}')

fig = make_subplots(rows=2, cols=1, vertical_spacing=0.4, shared_yaxes=False, shared_xaxes=False,
fig = make_subplots(rows=2, cols=1, vertical_spacing=0.2, shared_yaxes=False, shared_xaxes=False,
row_heights=[0.1, 0.9],
subplot_titles=['Drift Score - ' + scorer_name, plot_title])
subplot_titles=['Drift Score - ' + scorer_name, 'Distribution Plot'])

fig.add_traces(bar_traces, rows=[1] * len(bar_traces), cols=[1] * len(bar_traces))
fig.add_traces(dist_traces, rows=[2] * len(dist_traces), cols=[1] * len(dist_traces))
Expand All @@ -475,7 +475,8 @@ def calc_drift_and_plot(train_distribution: dict, test_distribution: dict, plot_
yanchor='top',
y=0.6),
width=700,
height=400
height=400,
title=plot_title
)

fig.update_layout(shared_layout)
Expand Down