电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

FAFU机器学习03-2 Linear Regression课件VIP免费

FAFU机器学习03-2 Linear Regression课件FAFU机器学习03-2 Linear Regression课件FAFU机器学习03-2 Linear Regression课件FAFU机器学习03-2 Linear Regression课件FAFU机器学习03-2 Linear Regression课件
Foundations of Machine LearningRegressionFoundations of Machine LearningRegressionSimple linear regression (简单线性回归)Evaluating the modelMultiple linear regression (多元线性回归)Polynomial regression (多项式回归)Regularization (正则化)Applying linear regressionFitting models with gradient descent (梯度下降)Linear RegressionLesson 3 - 2Simple linear regressionSimple linear regression can be used to model a linear relationship between one response variable and one explanatory variable. Suppose you wish to know the price of a pizza.Linear RegressionLesson 3 - 3Observe the dataLinear RegressionLesson 3 - 4import matplotlib.pyplot as pltX = [[6], [8], [10], [14], [18]]y = [[7], [9], [13], [17.5], [18]]plt.figure()plt.title('Pizza price plotted against diameter')plt.xlabel('Diameter in inches')plt.ylabel('Price in dollars')plt.plot(X, y, 'k.')plt.axis([0, 25, 0, 25])plt.grid(True)plt.show()Sklearn.linear_model.LinearRegressionLinear RegressionLesson 3 - 5# import sklearnfrom sklearn.linear_model import LinearRegression# Training dataX = [[6], [8], [10], [14], [18]]y = [[7], [9], [13], [17.5], [18]]# Create and fit the modelmodel = LinearRegression()model.fit(X, y)print('A 12" pizza should cost: $%.2f' % model.predict([12])[0])# A 12" pizza should cost: $13.68Sklearn.linear_model.LinearRegressionThe sklearn.linear_model.LinearRegression class is an estimator. Estimators predict a value based on the observed data. In scikit-learn, all estimators implement the fit() and predict() methods. The former method is used to learn the parameters of a model, and the latter method is used to predict the value of a response variable for an explanatory variable using the learned parameters. It is easy to experiment with different models using scikit-learn because ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

FAFU机器学习03-2 Linear Regression课件

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部