check_similarity_to_weights_rows_reserve_mass¶
yohou.testing.check_similarity_to_weights_rows_reserve_mass(similarity, y_calib, y_pred_calib)
¶
Check each predicted weight row is non-negative and sums below 1.
Pins the BaseSimilarity._to_weights / _reserve_mass invariant: a
softmax of negative distances re-normalized as raw / (sum(raw) + 1), so
every row reserves mass for the (hypothetical) test point.
Parameters ¶
| Name | Type | Description | Default |
|---|---|---|---|
similarity
|
BaseSimilarity
|
Similarity instance. |
required |
y_calib
|
DataFrame
|
Calibration target frame. |
required |
y_pred_calib
|
DataFrame
|
Calibration prediction frame. |
required |
Raises ¶
| Type | Description |
|---|---|
AssertionError
|
If any row is negative or sums to 1 or more. |