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

Splitting with hashlib #628

Open
Dess1996 opened this issue May 14, 2021 · 1 comment
Open

Splitting with hashlib #628

Dess1996 opened this issue May 14, 2021 · 1 comment

Comments

@Dess1996
Copy link

Good time a day ageron, you have a very nice book.

Anyway I have one question from Chapter 2. Which of algorithm given in book is more faster:

**- 1) def split_train_test(data, test_ratio)

    1. def test_set_check(identifier, test_ratio, id_column, hash=hashlib.md5)
    1. train_test_split from sklearn**

?

Which function is more save memory?

I would be gratefull if you give comments about this. Thanks for your attention

@ageron
Copy link
Owner

ageron commented May 27, 2021

I haven't run any benchmarks, so I don't know. However, you can try using %timeit to measure speed. To measure RAM usage, you could use the memory_profiler package. If you find the answer, it would be great to share it here. 👍 Thanks!

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

2 participants