Control Metrics#
Control Metrics#
Stability and responsiveness metrics for dynamic systems.
Provided metrics#
overshoot: maximum relative overshoot of the response over the target.settling_time: samples required to remain within a tolerance band.robustness: inverse sensitivity to disturbances (MSE-based).
- qmlhc.metrics.control.overshoot(y_true, y_pred)[source]#
Maximum relative overshoot of the response over the reference.
The metric is computed as:
max(0, max(y_pred) - max(y_true)) / |max(y_true)|. If the reference maximum is zero, returns0.0.- Parameters:
y_true (TensorLike) – Reference/target signal, shape
(T,).y_pred (TensorLike) – Response/prediction signal, shape
(T,).
- Returns:
Relative overshoot (unitless,
>= 0).- Return type:
- qmlhc.metrics.control.robustness(y_true, y_pred)[source]#
Inverse sensitivity to disturbances based on mean squared error.
Defined as
1 / (1 + MSE(y_true, y_pred)). Values lie in(0, 1], where larger is better (more robust).- Parameters:
y_true (TensorLike) – Reference/target signal, shape
(T,).y_pred (TensorLike) – Response/prediction signal, shape
(T,).
- Returns:
Robustness score in
(0, 1].- Return type:
- qmlhc.metrics.control.settling_time(y_true, y_pred, tol=0.05)[source]#
Samples until the response stays within a tolerance band around the target.
The tolerance band is defined around the final target value:
[ref*(1 - tol), ref*(1 + tol)], whereref = y_true[-1]. The function scans backward and returns the last index violating the band, plus one. If the entire sequence is within band, returns0.