coverforest.metrics.average_interval_length_loss#
- coverforest.metrics.average_interval_length_loss(y_true, y_pred)[source]#
Compute the average length of regression prediction intervals.
For each sample, the interval length is the difference between the upper and lower bounds.
- Parameters:
- Returns:
score – Returns the average interval length. Minimum possible value is 0, no maximum value.
- Return type:
Examples
>>> import numpy as np >>> from metrics import average_interval_length_loss >>> y_pred = np.array([[0.5, 2.5], [1.5, 4.5], [2.5, 3.5]]) >>> average_interval_length_loss(y_pred) 2.0