pub fn qq_plot_data<F, S1, S2, D1, D2>(
y_true: &ArrayBase<S1, D1>,
y_pred: &ArrayBase<S2, D2>,
n_quantiles: usize,
) -> Result<QQPlotData<F>>Expand description
Calculates Q-Q plot data for residuals
§Arguments
y_true- Ground truth (correct) target valuesy_pred- Estimated target valuesn_quantiles- Number of quantiles to calculate
§Returns
- A
QQPlotDatastruct containing the Q-Q plot data
§Examples
use scirs2_core::ndarray::array;
use scirs2_metrics::regression::qq_plot_data;
let y_true = array![3.0, -0.5, 2.0, 7.0, 5.0, 8.0, 1.0, 4.0];
let y_pred = array![2.5, 0.0, 2.0, 8.0, 4.5, 7.5, 1.5, 3.5];
let qq_data = qq_plot_data(&y_true, &y_pred, 20).unwrap();
assert_eq!(qq_data.theoretical_quantiles.len(), qq_data.sample_quantiles.len());