当前位置:网站首页>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_
- 部分运行截图
边栏推荐
猜你喜欢
NFT市场开源系统
iptables防火墙
TensorFlow2学习笔记:6、过拟合和欠拟合,及其缓解方案
剑指 Offer 2022/7/1
TensorFlow2 study notes: 4. The first neural network model, iris classification
TensorFlow2学习笔记:4、第一个神经网模型,鸢尾花分类
智能合约安全——delegatecall (1)
MySql的concat和group_concat的区别
Logistic Regression --- Introduction, API Introduction, Case: Cancer Classification Prediction, Classification Evaluation, and ROC Curve and AUC Metrics
Kubernetes基础入门(完整版)
随机推荐
pgsql函数中的return类型
Simple and clear, the three paradigms of database design
win云服务器搭建个人博客失败记录(wordpress,wamp)
flink-sql大量使用案例
Jupyter Notebook安装库;ModuleNotFoundError: No module named ‘plotly‘解决方案。
Briefly say Q-Q map; stats.probplot (QQ map)
WARNING: sql version 9.2, server version 11.0.Some psql features might not work.
Vulnhub:Sar-1
RecyclerView的用法
【CV-Learning】卷积神经网络预备知识
iptables防火墙
ISCC2021———MISC部分复现(练武)
oracle的number与postgresql的numeric对比
剑指 Offer 2022/7/5
剑指 Offer 2022/7/12
Lombok的一些使用心得
剑指 Offer 20226/30
【CV-Learning】卷积神经网络
智能合约安全——delegatecall (1)
剑指 Offer 2022/7/3