当前位置:网站首页>机器学习概述
机器学习概述
2022-08-05 04:08:00 【米卡粒】
1.1人工智能概述
达特茅斯会议-人工智能的起点
机器学习是人工智能的一个实现途径
深度学习是机器学习的一个方法发展而来
1.1.2机器学习、深度学习能做些什么
传统预测
图像识别
自然语言处理
1.2什么是机器学习
数据、模型、预测
从历史数据中获得规律?这些历史数据是怎么的格式?
1.2.3数据集构成
特征值+目标值
1.3机器学习算法分类
监督学习
目标值:类别——分类问题
k-近邻算法、贝叶斯分类、决策树与随机森林、逻辑回归
目标值:连续型的数据-回归问题
线性回归、岭回归
目标值:无-无监督学习
聚类 k-means
1、预测明天的气温是多少? 回归
2、预测明天是阴、晴、雨? 分类
3、人脸年龄预测? 回归/分类
4、人脸识别 ? 分类
2.1数据集
2.1.1可用数据集
公司内部 百度
数据接口 花钱
数据集
学习阶段可以用的数据集:
1、sklearn
2、kaggle
3、UCI
1 Scikit-learn工具介绍
2.1.2sklearn数据集
sklearn.datasets
load_* 获取小规模数据集
from sklearn.datasets import load_iris
def datasets_demo():
"""
sklearn数据集使用
:return:
"""
# 获取数据集
iris = load_iris()
print("鸢尾花数据集:\n",iris)
print("鸢尾花数据集描述:\n", iris["DESCR"])
print("鸢尾花特征值的名字:\n", iris.feature_names)
print("鸢尾花特征值:\n", iris.data.shape)
return None
if __name__ == "__main__":
# 代码1:sklearn数据集使用
datasets_demo()
运行如下(数据过多,展示部分)
fetch_* 获取大规模数据集
2 sklearn小数据集
sklearn.datasets.load_iris()
3 sklearn大数据集
sklearn.datasets.fetch_20newsgroups(data_home=None)
4 数据集的返回值
datasets.base.Bunch(继承自字典)
dict["key"] = values
bunch.key = values
思考:拿到的数据是否都用来训练一个模型?
2.1.3数据集的划分
训练数据集:用于训练、构建模型
测试数据:在模型检验是使用,用于评估模型是否有效
测试集 20%~30%
sklearn.model_selection.train_test_split(arrays,*options)
训练集特征值,测试集特征值,训练集目标值,测试集目标值
x_train, x_test, y_train, y_test
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
def datasets_demo():
"""
sklearn数据集使用
:return:
"""
# 获取数据集
iris = load_iris()
print("鸢尾花数据集:\n",iris)
print("鸢尾花数据集描述:\n", iris["DESCR"])
print("鸢尾花特征值的名字:\n", iris.feature_names)
print("鸢尾花特征值:\n", iris.data.shape)
# 数据集的划分
x_train, x_test, y_train, y_test = train_test_split(iris.data, iris.target, test_size=0.2, random_state=22)
print("训练数据集的特征:\n", x_train, x_train.shape)
return None
if __name__ == "__main__":
# 代码1:sklearn数据集使用
datasets_demo()
部分运行结果如下
边栏推荐
- Industry Status?Why do Internet companies prefer to spend 20k to recruit people rather than raise their salary to retain old employees~
- Ali's local life's single-quarter revenue is 10.6 billion, Da Wenyu's revenue is 7.2 billion, and Cainiao's revenue is 12.1 billion
- SkiaSharp 之 WPF 自绘 粒子花园(案例版)
- [MRCTF2020]Ezpop(详解)
- bytebuffer put flip compact clear 方法演示
- 36-Jenkins-Job迁移
- 【测量学】速成汇总——摘录高数帮
- Increasing leetcode - a daily topic 1403. The order of the boy sequence (greed)
- [MRCTF2020]PYWebsite
- 多御安全浏览器 V10.8.3.1 版正式发布,优化多项内容
猜你喜欢
Open-Falcon of operation and maintenance monitoring system
【 8.4 】 source code - [math] [calendar] [delete library 】 【 is not a simple sequence (Bonus) 】
【8.1】代码源 - 【第二大数字和】【石子游戏 III】【平衡二叉树】
Use CH341A to program external Flash (W25Q16JV)
UE4 第一人称角色模板 添加蹲伏功能
The most effective seven performance testing techniques of software testing techniques
【Mysql进阶优化篇02】索引失效的10种情况及原理
2022-08-04T17:50:58.296+0800 ERROR Announcer-3 io.airlift.discovery.client.Announcer appears after successful startup of presto
[Software testing] unittest framework for automated testing
新人如何入门和学习软件测试?
随机推荐
flink reads mongodb data source
YYGH-13-Customer Service Center
Industry Status?Why do Internet companies prefer to spend 20k to recruit people rather than raise their salary to retain old employees~
Fifteen. Actual combat - MySQL database building table character set and collation
Ffmpeg - sources analysis
[BJDCTF2020]EasySearch
2022 Hangzhou Electric Multi-School 1st Game
The most comprehensive exam questions for software testing engineers in 2022
How to solve complex distribution and ledger problems?
905. Interval selection
【树莓派】树莓派调光
Swing有几种常用的事件处理方式?如何监听事件?
Confessing the era of digital transformation, Speed Cloud engraves a new starting point for value
Redis1:Redis介绍、Redis基本特性、关系型数据库、非关系型数据库、数据库发展阶段
token、jwt、oauth2、session解析
UE4 opens door via interaction (keyboard key)
How to solve the three major problems of bank data collection, data supplementary recording and index management?
ffmpeg enumeration decoders, encoders analysis
开发属于自己的node包
[Software testing] unittest framework for automated testing