当前位置:网站首页>Introduction of linear regression 01 - API use cases
Introduction of linear regression 01 - API use cases
2022-08-04 06:05:00 【I'm fine please go away thank you】
- API介绍

- 案例
- 给定一个数据集

- 代码
from sklearn.linear_model import LinearRegression
# 1.获取数据
x = [[80, 86],
[82, 80],
[85, 78],
[90, 90],
[86, 82],
[82, 90],
[78, 80],
[92, 94]]
y = [84.2, 80.6, 80.1, 90, 83.2, 87.6, 79.4, 93.4]
# 2.数据基本处理(略)
# 3.特征工程(略)
# 4.机器学习
# 4.1 创建模型
estimator = LinearRegression()
#4.2 训练模型
estimator.fit(x, y)
#5.模型评估(略)
# 获取回归系数
estimator.coef_
# 回归预测
estimator.predict([[100, 80]])
# get offset (接近于0)
estimator.intercept_
- 部分运行截图

边栏推荐
猜你喜欢

8.30难题留坑:计数器问题和素数等差数列问题

多项式回归(PolynomialFeatures)

Lombok的一些使用心得

Install dlib step pit record, error: WARNING: pip is configured with locations that require TLS/SSL

安装dlib踩坑记录,报错:WARNING: pip is configured with locations that require TLS/SSL

lmxcms1.4

Th in thymeleaf: href use notes

自动化运维工具Ansible(2)ad-hoc

postgresql 事务隔离级别与锁

NFT市场可二开开源系统
随机推荐
oracle临时表与pg临时表的区别
剑指 Offer 2022/7/5
智能合约安全——delegatecall (1)
纳米级完全删除MYSQL5.7以及一些吐槽
SQL练习 2022/7/4
Logistic Regression --- Introduction, API Introduction, Case: Cancer Classification Prediction, Classification Evaluation, and ROC Curve and AUC Metrics
with recursive用法
IvNWJVPMLt
关系型数据库-MySQL:体系结构
剑指 Offer 2022/7/8
进程、线程、协程的区别和联系?
【深度学习21天学习挑战赛】1、我的手写被模型成功识别——CNN实现mnist手写数字识别模型学习笔记
RecyclerView的用法
flink-sql大量使用案例
CTFshow—Web入门—信息(1-8)
Androd Day02
(十)树的基础部分(二)
【树 图 科 技 头 条】2022年6月28日 星期二 伊能静做客树图社区
TensorFlow2 study notes: 4. The first neural network model, iris classification
Androd Day02