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

Slow recursive file split. #259

Open
aashis-ns opened this issue Jun 14, 2022 · 0 comments
Open

Slow recursive file split. #259

aashis-ns opened this issue Jun 14, 2022 · 0 comments

Comments

@aashis-ns
Copy link

split_ratio = np.array(split_ratio)
ix = np.argsort(split_ratio)
ixx = np.argsort(ix)
sm = (np.cumsum(split_ratio[ix])[:-1] * len(files)).astype(int)
split = np.split(files, sm)
for key, data_ix in zip(['train', 'validation', 'test'], ixx):
data[key] = split[data_ix].tolist()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant