ageron / ageron/handson-ml2

[QUESTION]

Open
#523 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
30k
Forks
13.1k
PR merge metrics
No merged PRs in 30d

Description

In chapter 2 on page 54, you define a test_set_change using a hash. If I understand the code correctly, you include a data point depending on whether it's hash value is below or above the 20% of maximal hash value.
But that assumes that the hash function is creating an even distribution of hash values.

Consider the following example for a small set:
```
train_set, test_set = split_train_test_by_id(housing_with_id.iloc[:40], 0.2, "index")
len(test_set)
```
returns 9 - so the test set is 29% of the overall set, not 20%.
For bigger sets, the deviation will occur less often and will be smaller, but it may still be there, I guess.

Or do I miss something?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.