Ex 3: Isotonic Regression

通用範例/範例三: Isotonic Regression

http://scikit-learn.org/stable/auto_examples/plot_isotonic_regression.html

迴歸函數採用遞增函數。

  • y[] are inputs (real numbers)

  • y_[] are fitted

這個範例的主要目的:

比較

  • Isotonic Fit

  • Linear Fit

(一) Regression「迴歸」

「迴歸」就是找一個函數,盡量符合手邊的一堆數據。此函數稱作「迴歸函數」。

(二) Linear Regression「線性迴歸」

迴歸函數採用線性函數。誤差採用平方誤差。

class sklearn.linear_model.LinearRegression

二維數據,迴歸函數是直線。

(三) Isotonic Regression「保序迴歸」

具有分段迴歸的效果。迴歸函數採用遞增函數。

class sklearn.isotonic.IsotonicRegression

採用平方誤差,時間複雜度 O(N) 。

(四) 完整程式碼

Python source code: plot_isotonic_regression.py

http://scikit-learn.org/stable/auto_examples/plot_isotonic_regression.html

Last updated