← 返回卡片

原书出处

Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)

First Edition · 核验版本的摘录快照 · 导入于 2026-11-14T14:46:45.586Z

from pandas._testing import assert_frame_equal def test_normalize_columns_returns_a_dataframe_with_values_between_0_and_1(): loan_applications = pd.DataFrame({"income": [10, 100, 10000]}) result = normalize_columns(loan_applications) expected = pd.DataFrame({"income": [0, 0.009, 1]}) assert_frame_equal(expected, result) For testing dataframe equality, we use assert_frame_equal() or assert​_ser⁠ies_equal() from pandas. By articulating our expectations of a function, we improve our understanding of the code’s behavior. In this example, we may discover that min-max normalization is the wrong data transformation to apply,

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch05.html

EPUB SHA-256:d98501f374a474910f195f0adfd53c1d895ae8ddc5822476c05cd7ba006ac63d