1.15. 保序回归#

IsotonicRegression 将非递减实函数与一维数据进行匹配。它解决了以下问题:

\[\min \sum_i w_i(y_i - \hat{y}_i)#2\]

subject to \(\hat{y}_i \le \hat{y}_j\) whenever \(X_i \le X_j\), where the weights \(w_i\) are strictly positive, and both X and y are arbitrary real quantities.

The increasing parameter changes the constraint to \(\hat{y}_i \ge \hat{y}_j\) whenever \(X_i \le X_j\). Setting it to 'auto' will automatically choose the constraint based on Spearman's rank correlation coefficient.

IsotonicRegression 产生一系列预测 \(\hat{y}_i\) 对于最接近目标的训练数据 \(y\) 就均方误差而言。这些预测被内插以预测未见的数据。的预测 IsotonicRegression 从而形成分段线性的函数:

../_images/sphx_glr_plot_isotonic_regression_001.png

示例