get_weights
get_weights()Inspect or clear the session weighting scheme.
Companions to set_weights(): read the stored scheme, test whether one is set, or remove it. has_weights() is the safe check before get_weights(), which errors when no scheme is set. clear_weights() turns weighting off again, so the helpers return purely unweighted results.
Returns
| Name | Type | Description |
|---|---|---|
| dict | get_weights() returns the scheme (normalised targets keyed by variable); has_weights() returns a bool; clear_weights() returns True. |
See Also
set_weights, weight_vector
Examples
>>> has_weights()
>>> set_weights({"variable": "region", "Europe": 0.5, "North America": 0.5})
>>> get_weights()
>>> clear_weights()