sklearn 線性迴歸簡單應用

樣本準備 import numpy as np import matplotlib.pyplot as plt # 樣本準備 train_X = np.linspace(-1, 1, 100) train_Y = 2 * train_X + np.random.randn(*train_X.shape) * 0.3 # y=2x,但是加入了噪聲 # 顯示模擬數據點 plt.plot(train
相關文章
相關標籤/搜索