quantlab.model.evaluation.scores_volatility_level#

quantlab.model.evaluation.scores_volatility_level(label, scale)[source]#

Return whether a label’s predictions get volatility_level_metrics.

They do when the label’s kind is "volatility" and the prediction is on the label’s own scale (scale is "raw", as a predictor’s label_scales reports it): a level metric on a standardized prediction compares units that differ from the label’s. An object without kind counts as a return label.

Parameters:
labelobject

The label object, such as a Forward.

scalestr or None

The prediction’s scale for that label, "raw" or "standardized".

Returns:
bool

Examples

>>> from quantlab.label.predefined.fret import Return, Volatility
>>> scores_volatility_level(Volatility, "raw"), scores_volatility_level(Volatility, "standardized")
(True, False)
>>> scores_volatility_level(Return, "raw")
False