当前位置: 首页 > news >正文

Sklearn DAY1 人工智能机器学习深度学习 机器学习基本术语

机器学习基本术语

# 机器学习基本术语图例
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
# 显示plt.show()的图片,如若不使用jupyter,请注释
%matplotlib inline
# 中文字体设置,找到与之对应的中文字体路径
font = FontProperties(fname='/Library/Fonts/Heiti.ttc')# 样本
plt.text(1, 70, s='{身高(180),体重(70),年龄(19),五官(精致)',fontproperties=font, fontsize=13, color='g')
plt.annotate(text='样本', xytext=(90, 70), xy=(78, 71), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='特征', xytext=(30, 90), xy=(10, 73), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='', xytext=(30, 90), xy=(30, 73), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='', xytext=(30, 90), xy=(50, 73), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='', xytext=(30, 90), xy=(70, 73), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')plt.hlines(67, 0, 100, linestyle='--', color='gray')# 特征
plt.text(1, 40, s='{身高(180),体重(70),年龄(19),五官(精致),帅}',fontproperties=font, fontsize=10, color='g')
plt.annotate(text='样例(实例)', xytext=(90, 40), xy=(70, 41), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='特征', xytext=(30, 60), xy=(8, 43), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='', xytext=(30, 60), xy=(23, 43), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='', xytext=(30, 60), xy=(38, 43), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='', xytext=(30, 60), xy=(53, 43), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='标记', xytext=(67, 60), xy=(67, 43), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')plt.hlines(37, 0, 100, linestyle='--', color='gray')# 特征空间
plt.text(1, 30, s='$\{(x_1^{(1)},x_1^{(2)},\cdots,x_1^{(n)}),(x_2^{(1)},x_2^{(2)},\cdots,x_2^{(n)}),\cdots,(x_m^{(1)},x_m^{(2)},\cdots,x_m^{(n)})\}$',fontproperties=font, fontsize=10, color='g')
plt.annotate(text='特征空间($m$个样本)', xytext=(90, 15), xy=(92, 30), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')
plt.annotate(text='特征向量($n$维特征)', xytext=(15, 15), xy=(15, 28), ha='center', arrowprops=dict(arrowstyle="<-", color='b'), fontproperties=font, fontsize=15, color='r')plt.xlim(0, 100)
plt.ylim(10, 100)
plt.title('机器学习基本术语图例', fontproperties=font, fontsize=20)
plt.show()

通过上图,我们可以习得以下机器学习的基本术语:

  • 特征(feature):描述一件事物的特性,如一个人的身高、体重、年龄和五官。
  • 样本(sample):由一个人的特征组成的数据,如${180,70,19,精致}$。
  • 标记(label):描述一件事物的特性,如一个人帅或丑、一个人的财富数量。注:特征和标记没有明确的划分,由于问题的不同可能导致A问题的特征是B问题的标记,B问题的标记是A问题的特征。
  • 样例(example):由一个人的特征和标记组成的数据,如${180,70,19,精致,帅}$。
  • 特征空间(feature space):由${x{(1)},x,\cdots,x^{(n)}}$这n个特征张成的n维空间,如以身高张成的一维空间(线);以身高和体重张成的二维空间(面);以身高、体重和年龄张成的三维空间(体)。
  • 特征向量(feature vector):特征空间内的某一个具体的向量,即特种空间中的某一个具体的点,
$$
\{x_i^{(1)},x_i^{(2)},\cdots,x_i^{(n)}\},\,i\in{R}
$$

其中$x_m^{(n)}$表示第m个人的第n个特征。如身高、体重、年龄张成的三维空间中的某一个具体的点$(180,70,19)$。

http://www.sczhlp.com/news/5496/

相关文章:

  • 实现二叉排序树的前中后序遍历
  • 微信支付宝支付实现 (基于Elegent-pay框架) - 2025/7/29
  • EI检索第十四届先进材料与工程材料国际会议(ICAMEM 2025)
  • Python 3.14 下载安装教程,一步安装到位,新手也能变编程大师
  • 2460. 对数组执行操作
  • 跑步记录
  • 417——字典序路径 - love
  • 《苏秦以连横说秦》
  • 软工8.4
  • Verilog学习笔记-20250802
  • P8523 [IOI 2021] 位移寄存器 题解
  • 情绪
  • 8-4
  • GraphPad Prism 10 mac+win安装包
  • Flutter plugin开发小知识之:ActivityAware 详解
  • Motion 5 for mac(视频后期特效)v5.10中文版
  • 完整教程:【加解密与C】HASH系列(四)SHA-3
  • 8月4日总结
  • 22222222
  • 关于本人在博客园平台停更的公告
  • 8/4
  • Pwn2Own Automotive 2025 第二日战报:38.5万美元奖金与16个零日漏洞
  • 图分割算法荣获SC21时间检验奖
  • P6246 [IOI 2000] 邮局
  • k8s学习2
  • K8S学习(day1)
  • 单调栈
  • MySQL 常用SQL语句
  • 试卷最后一小问 sillation 造题的几分钟 | CTOI 成立两周年
  • 7-26 小测