ageron / ageron/handson-ml

Need help understanding crc hash used to explain test train split in Chapter 2

未關閉
#655 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Jupyter Notebook
星號
25.6k
分支
12.7k
PR 合併指標
PR 指標待擷取

描述

Hi there, in the following code, I fail to understand how the hash function is working here and how would it make sure that the test set is randomly selected. Can you shed some light on this please? Thank you.

```python
def test_set_check(identifier,test_ratio):
return crc32(np.int64(identifier)) & 0xffffffff < test_ratio *2**32)
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。