File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -206,17 +206,12 @@ def split(
206
206
... )))
207
207
... .split(
208
208
... key_column='index',
209
- ... proportions=dict(
210
- ... train=0.7,
211
- ... early_stopping=0.1,
212
- ... public_test=0.1,
213
- ... private_test=0.1,
214
- ... ),
209
+ ... proportions=dict(train=0.8, test=0.2),
215
210
... filepath=split_file,
216
211
... )
217
212
... )
218
213
>>> len(split_datasets['train'])
219
- 70
214
+ 80
220
215
>>> split_file.unlink() # clean up after doctest
221
216
'''
222
217
if filepath is not None :
Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ def split_dataframes(
72
72
split [last_split_name ] += unassigned (dataframe [key_column ], split )
73
73
74
74
if filepath is not None :
75
- filepath .write_text (json .dumps (split ))
75
+ filepath .parent .mkdir (parents = True , exist_ok = True )
76
+ filepath .write_text (json .dumps (split , indent = 4 ))
76
77
77
78
return {
78
79
split_name : (
You can’t perform that action at this time.
0 commit comments