We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eebbf00 commit 822d44eCopy full SHA for 822d44e
datastream/tools/split_dataframes.py
@@ -4,6 +4,7 @@
4
import json
5
import numpy as np
6
import pandas as pd
7
+import warnings
8
9
10
def split_dataframes(
@@ -46,6 +47,15 @@ def split_dataframes(
46
47
if frozen:
48
if sum(map(len, split.values())) == 0:
49
raise ValueError('Frozen split is empty')
50
+ n_unassigned = (~key_dataframe[key_column].isin(sum(split.values(), []))).sum()
51
+ if n_unassigned > 0:
52
+ warnings.warn(
53
+ (
54
+ f'Found {n_unassigned} unassigned examples when splitting the dataset.'
55
+ ' The split is frozen so they will will be discarded'
56
+ ),
57
+ UserWarning,
58
+ )
59
else:
60
split_proportions = tuple(proportions.items())
61
0 commit comments