Skip to content

Commit 2ee03eb

Browse files
fix: do coherence analysis only if there are non-fk columns in tgt (#131)
1 parent 5660b25 commit 2ee03eb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mostlyai/qa/reporting.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ def report(
252252
)
253253
)
254254

255-
do_coherence = setup == "1:N"
255+
# do coherence analysis only if there are non-fk columns in the target data
256+
do_coherence = setup == "1:N" and len(trn_tgt_data.columns) > 1
256257
if do_coherence:
257258
_LOG.info("prepare training data for coherence started")
258259
trn_coh, trn_coh_bins = pull_data_for_coherence(

tests/end_to_end/test_report.py

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def make_dfs(
213213
{"dfs": make_dfs(ctx_rows=100, tgt_rows=100, shift=100, tgt_cols=["tgt_col"]), "early_term": True},
214214
# other setups should produce report
215215
{"dfs": make_dfs(ctx_rows=100, tgt_rows=100), "early_term": False},
216+
{"dfs": make_dfs(ctx_rows=101, tgt_rows=100), "early_term": False},
216217
{"dfs": make_dfs(ctx_rows=100, tgt_rows=100, ctx_cols=["ctx_col"], tgt_cols=["tgt_col"]), "early_term": False},
217218
]
218219

0 commit comments

Comments
 (0)