check_rewind_transform_behavior¶
yohou.testing.check_rewind_transform_behavior(transformer, X, y=None)
¶
Check rewind_transform() behavior and contract.
Verifies that rewind_transform(): 1. Produces the same output as transform() on the same input from a freshly fitted clone (i.e. the result depends only on the fitted parameters and the provided input, matching transform()) 2. Calls transform() and discards the first observation_horizon values 3. Resets the internal state to the last observation_horizon input rows
Parameters ¶
| Name | Type | Description | Default |
|---|---|---|---|
transformer
|
BaseActualTransformer
|
Unfitted transformer |
required |
X
|
DataFrame
|
Training data (needs to be long enough) |
required |
y
|
DataFrame
|
Target data |
None
|
Raises ¶
| Type | Description |
|---|---|
AssertionError
|
If rewind_transform doesn't follow the expected contract |