数据集分为训练验证测试_将数据集分为训练集,验证集和测试集

2023-05-16

数据集分为训练验证测试

测试我们的模型 (Testing Our Model)

Supervised machine learning algorithms are amazing tools capable of making predictions and classifications. However, it is important to ask yourself how accurate those predictions are. After all, it’s possible that every prediction your classifier makes is actually wrong! Luckily, we can leverage the fact that supervised machine learning algorithms, by definition, have a dataset of pre-labeled data points. In order to test the effectiveness of your algorithm, we’ll split this data into:

监督式机器学习算法是能够做出预测和分类的出色工具。 但是,重要的是要问自己这些预测的准确性如何。 毕竟,您的分类器所做的每个预测实际上都是错误的! 幸运的是,根据定义,我们可以利用监督机器学习算法具有预先标记数据点的数据集这一事实。 为了测试您算法的有效性,我们将这些数据分为:

  • training set

    训练集

  • validation set

    验证集

  • test set

    测试集

训练集与验证集 (Training Set vs Validation Set)

The training set is the data that the algorithm will learn from. Learning looks different depending on which algorithm you are using. For example, when using Linear Regression, the points in the training set are used to draw the line of best fit. In K-Nearest Neighbors, the points in the training set are the points that could be the neighbors.

训练集是算法将从中学习的数据。 根据您使用的算法,学习看起来会有所不同。 例如,当使用线性回归时 ,训练集中的点将用于绘制最佳拟合线。 在“ K最近邻 ”中,训练集中的点是可能成为邻居的点。

After training using the training set, the points in the validation set are used to compute the accuracy or error of the classifier. The key insight here is that we know the true labels of every point in the validation set, but we’re temporarily going to pretend like we don’t. We can use every point in the validation set as input to our classifier. We’ll then receive a classification for that point. We can now peek at the true label of the validation point and see whether we got it right or not. If we do this for every point in the validation set, we can compute the validation error!

使用训练集进行训练后,将验证集中的点用于计算分类器的准确性或误差。 此处的关键见解是,我们知道验证集中每个点的真实标签,但是我们暂时假装不知道。 我们可以使用验证集中的每个点作为分类器的输入。 然后,我们将收到该点的分类。 现在,我们可以窥视验证点的真实标签,看看是否正确。 如果我们对验证集中的每个点都执行此操作,则可以计算验证错误!

Validation error might not be the only metric we’re interested in. A better way of judging the effectiveness of a machine learning algorithm is to compute its precision, recall, and F1 score.

验证错误可能不是我们感兴趣的唯一度量标准。判断机器学习算法有效性的更好方法是计算其精度,召回率和F1分数。

如何分裂 (How to Split)

Figuring out how much of your data should be split into your validation set is a tricky question. If your training set is too small, then your algorithm might not have enough data to effectively learn. On the other hand, if your validation set is too small, then your accuracy, precision, recall, and F1 score could have a large variance. You might happen to get a really lucky or a really unlucky split! In general, putting 80% of your data in the training set, and 20% of your data in the validation set is a good place to start.

弄清楚应将多少数据分成验证集是一个棘手的问题。 如果训练集太小,则您的算法可能没有足够的数据来有效学习。 另一方面,如果您的验证集太小,则您的准确性,准确性,召回率和F1得分可能会有较大差异。 您可能碰巧遇到了一个真正幸运或非常不幸的分裂! 通常,将80%的数据放入训练集中,将20%的数据放入验证集中是一个不错的起点。

N折交叉验证 (N-Fold Cross-Validation)

Sometimes your dataset is so small, that splitting it 80/20 will still result in a large amount of variance. One solution to this is to perform N-Fold Cross-Validation. The central idea here is that we’re going to do this entire process N times and average the accuracy. For example, in 10-fold cross-validation, we’ll make the validation set the first 10% of the data and calculate accuracy, precision, recall and F1 score. We’ll then make the validation set the second 10% of the data and calculate these statistics again. We can do this process 10 times, and every time the validation set will be a different chunk of the data. If we then average all of the accuracies, we will have a better sense of how our model does on average.

有时,您的数据集非常小,以至于将其拆分为80/20仍会导致大量差异。 一种解决方案是执行N折交叉验证 。 这里的中心思想是,我们将整个过程进行N次,并取平均精度。 例如,在10倍交叉验证中,我们将验证集设置为数据的前10%,并计算准确性,准确性,召回率和F1得分。 然后,我们将验证设置为数据的后10%,然后再次计算这些统计信息。 我们可以执行10次此过程,并且每次验证集都是不同的数据块。 如果我们随后将所有精度平均,则可以更好地了解我们的模型的平均效果。

更改模型/测试集 (Changing The Model / Test Set)

Understanding the accuracy of your model is invaluable because you can begin to tune the parameters of your model to increase its performance. For example, in the K-Nearest Neighbors algorithm, you can watch what happens to accuracy as you increase or decrease K. (You can try out all of this in our K-Nearest Neighbors lesson!)

了解模型的准确性非常重要,因为您可以开始调整模型的参数以提高其性能。 例如,在“ K最近邻”算法中,您可以观察增加或减小K时精度的变化。(您可以在我们的“ K最近邻”课程中尝试所有这些方法!)

Once you’re happy with your model’s performance, it is time to introduce the test set. This is part of your data that you partitioned away at the very start of your experiment. It’s meant to be a substitute for the data in the real world that you’re actually interested in classifying. It functions very similarly to the validation set, except you never touched this data while building or tuning your model. By finding the accuracy, precision, recall, and F1 score on the test set, you get a good understanding of how well your algorithm will do in the real world.

对模型的性能满意后,就该介绍测试集了。 这是您在实验开始时就将数据分区的一部分。 它旨在替代您实际上对分类感兴趣的现实世界中的数据。 它的功能与验证集非常相似,只不过您在构建或调整模型时从未接触过此数据。 通过在测试集上找到准确性,准确性,召回率和F1分数,您可以很好地了解算法在现实世界中的表现。

翻译自: https://medium.com/@vinaykumarpaspula/splitting-a-data-set-into-training-validation-and-test-sets-f1654b7574c

数据集分为训练验证测试

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

数据集分为训练验证测试_将数据集分为训练集,验证集和测试集 的相关文章

  • Esxi\CentOS7.6虚机\2080ti驱动 Unable to determine the device handle for GPU 0000:0B:00:00: Unknown ERROR

    整体背景 服务器使用Esxi虚拟出CentOS7 6的虚机 xff0c 然后在虚机中给2080ti显卡安装驱动 安装过程 1 配置显卡直通 此部分由运维完成 xff0c 未参与其中 xff0c 可参考攻略 xff1a https blog
  • 从断舍离中整理生活

    前言 公众号有一个多月未更文 xff0c 主要思考了后续更文的方向 xff0c 最终确定了以读书笔记分享为主题 xff0c 和大家一起学习 一起成长 今天开始 xff0c 每周至少更新一篇文章 xff0c 大家有想看的书可以在后台留言 xf
  • Android Studio升级到 3.2.0,部分依赖库报错 android.arch.lifecycle:runtime:1.0.3,解决办法

    Android Studio升级到 3 2 0 xff0c 部分依赖库报错 问题描述 xff1a Cannot find a version of android arch lifecycle runtime that satisfies
  • OpenCV4.7.0、FFmpeg5.1 Nvidia GPU视频硬解码

    1 环境 操作系统 xff1a Ubuntu18 04 GPU xff1a Nvidia GeForce RTX 2080TI 2 安装2080TI驱动 请参考文章 158条消息 NVIDIA GPU 驱动程序安装 洪流之源的博客 CSDN
  • MQ-2烟雾传感器的使用

    一 MQ 2烟雾传感器简介 MQ 2 烟雾传感器采用在清洁空气中电导率较低的二氧化锡 SnO2 xff0c 属于表面离子式N型半导体 当MQ 2烟雾传感器在200到300摄氏度环境时 xff0c 二氧化锡吸附空气中的氧 xff0c 形成氧的
  • HC-SR04超声波测距模块介绍

    超声波简介 超声波是由机械振动产生的 可在不同介质中以不同的速度传播 具有定向性好 能量集中 传输过程中衰减较小 反射能力较强等优点 超声波传感器可广泛应用于非接触式检测方法 它不受光线 被测物颜色等影响 对恶劣的工作环境具有一定的适应能力
  • 液晶12864显示图片

    液晶12864简介 12864是128 64点阵液晶模块的点阵数简称 基本参数 1 低电源电压 xff08 VDD 43 3 0 xff5e 43 5 5V xff09 2 显示分辨率 128 64 点 3 内置汉字字库 xff0c 提供8
  • 液晶12864显示字符

    液晶12864简介 12864是128 64点阵液晶模块的点阵数简称 基本参数 1 低电源电压 xff08 VDD 43 3 0 xff5e 43 5 5V xff09 2 显示分辨率 128 64点 3 内置汉字字库 xff0c 提供81
  • Bash:command:未找到命令

    前言 在Linux系统中 xff0c 经常会遇到这样的问题 xff1a bash xff1a command xff1a 未找到命令 这个真的很烧脑 xff0c 遇到的次数多 xff0c 在网上也查了好多 xff0c 答案五花八门 xff0
  • S32K148----SDK笔记----CAN收发

    文章目录 前言建立工程ProcessorExpert配置发送CAN报文CAN接收中断工程代码微信公众号 前言 S32K148自带3路CAN 官方的SDK给了can pal的例程 本文更基础一点 直接用flexcan组件相关的函数 CANFD
  • TC397开发板KIT_A2G_TC397_5V_TFT简介

    开发板简介 照片资料调试资源供电扩展CAN 用的开发板是KIT A2G TC397 5V TFT 其实更推荐KIT A2G TC397 3V3 TFT 售价 1 670 59 照片 正面 背面 5V的板子和3 3V的板子主要是下面几个器件不
  • AURIX TC397 Flash编程

    目录 Flash编程基础知识Flash Programming微信公众号 Flash编程基础知识 参考 Flash Programming 1 for KIT AURIX TC397 TFT 本例展示了如何烧写PFLASH Program
  • 周立功USBCAN-II的Python调用

    目录 USBCAN II环境配置CAN收发运行zcanpro微信公众号 USBCAN II USBCAN II 或者叫USBCAN2是周立功 致远电子 比较经典的USB接口的CAN卡 有两路标准CAN 最高支持到1M波特率 单用USB就可以
  • 拒绝丧偶式育儿,正确「养育男孩」

    前言 如何养育男孩 xff1f 当写下这几个字的时候 xff0c 我已在心里默念了好几遍 xff0c 不知道该如何回答 在2年前的某个凌晨2点18分 xff0c 第一声婴儿地啼哭 xff0c 护士告诉我 是个男孩 开始 xff0c 我就买了
  • Pandoc 多Markdown转单PDF

    文章目录 Pandoc 简介Pandoc 安装pandoc latex template字体安装Powershell 脚本Ubuntu PandocMarkdown 合并 Pandoc 简介 Pandoc 免费的文档转换器 支持常见的各种文
  • SocketCAN 命名空间 VCAN VXCAN CANGW 举例

    文章目录 NAMESPACESocketCAN最新 can utils 安装VCAN 举例VXCAN 举例CANGW 举例参考 NAMESPACE namespaces 命名空间 将全局系统资源包装在抽象中 使命名空间中的进程看起来拥有自己
  • slcan 协议 脚本 测试

    文章目录 slcan 协议kernel slcancan utils slcanptycan utils slcandcan utils slcan attachpython slcan slcan 协议 slcan 基于文本 ASCII
  • Notepad++直接编译运行Java

    安装Notepad 43 43 和JDK xff08 略 xff09 xff1b Notepad 43 43 的菜单栏 xff1a 插件 gt Plugin Manager gt Show Plugin Manager xff0c Avai
  • 几款自带编码器的直流电机

    不少小伙伴做两轮自平衡车或者机器人或者各种比赛时 xff0c 经常需要用到直流电机带编码器 xff0c 有的自己可以做外置的编码器 xff0c 但是否有自带编码器或码盘的直流电机 xff1f 答案是肯定的 xff0c 这里就推荐几款带编码器
  • 四大编辑器 -- Sublime, Atom, VS Code和Notepad++

    主要介绍3个跨平台的 Sublime Atom VS Code 一个Windows的 Notepad 43 43 Sublime Text 官网 https www sublimetext com Sublime Text is a sop

随机推荐

  • AD绘制四层板

    原理图导入PCB后 默认是双层板 可以Design gt Layer Stack Manager 点击Top Layer 然后点击Add Plane 负片层 电脑上在此层走线表示把铜挖空 这里把一整层都当作GND 非GND的过孔打到这一层
  • 群晖(Synology)配置 NAS + 软路由

    文章目录 背景结论软路由配置 背景 老板上周兴致勃勃的找到我 说Macbook存储不够用了 帮他找个存东西的 不是移动硬盘 我也很懵逼 我搞活动捡便宜充的百度网盘超级会员 觉得自己很是尾巴翘上天的土豪了 但想到老板的身价 又不太清楚macb
  • 各种类型的Writable

    各种类型的Writable xff08 Text ByteWritable NullWritable ObjectWritable GenericWritable ArrayWritable MapWritable SortedMapWri
  • C++ strtok的用法

    size 61 large align 61 center strtok的用法 align size 函数原型 xff1a char strtok char s char delim 函数功能 xff1a 把字符串s按照字符串delim进行
  • 读《遇见未知的自己》笔记

    为什么我不快乐 xff1f 为什么我不能拥有自己想要的生活 xff1f 此刻屏幕前的你 是否想过 xff0c 自己为什么会出现这种情况呢 xff1f 张德芬在 遇见未知的自己 一书给出了解释 xff1a 我们人类所有受苦的根源就是来自不清楚
  • PX4飞控问题汇总

    接触PX4飞控代码一年多了 xff0c 代码都是模块化 开发起来比APM的方便 xff0c 使用过程中也出现过各种怪异问题 xff0c 用的硬件是V5 nano 和V5 43 xff0c 测试的代码版本是1 9和1 10 今天总结一下遇到过
  • Sumo 搭建交叉路口交通流仿真平台

    Sumo安装 注意事项 xff1a 需要工具的使用需要环境变量的设置 需要包含文件Sumo安装路径下的bin和tools Sumo配置文件 Sumo中项目的配置文件的组成如下所示 节点文件 图 1 节点及边的拓扑图 Node的属性主要有id
  • OpenWRT 各种烧录方式及量产(三)

    界面烧录 不更新uboot 电脑连接WIFI xff08 或者通过网线连接电脑与路由器 xff09 通过浏览器访问路由器管理界面 xff0c 进行升级 注意不要断电 xff01 xff01 xff01 xff08 断电只能通过tftp方式恢
  • 华为手机root

    首先手机已解锁 xff42 xff4c 此方法针对 华为手机 可使用 xff0c 其他手机没有测试 xff0c 但应该也可以 官方的twrp没有对mate xff19 进行配适 xff0c 可以使用奇兔 twrp 提取码 ax6d 如果你没
  • 阿里云ubuntu 16.04 Server配置方案 2 远程控制桌面

    通过远程控制 xff0c 更好的管理服务器 1 XRDP远程控制 为了更好的远程管理 xff0c linux一般情况都用VNC进行远程连接 xff0c 如 TightVNC X11VNC ReadVNC等 Xrdp 是开放原始码的远端桌面通
  • 自顶向下(top down)简介

    无论是在实际生活中还是在学术问题上 xff0c 复杂的问题比比皆是 xff0c 当我们对此类问题毫无头绪的时候 xff0c 自顶向下 xff08 top down xff09 为我们提供了一种可靠的解决方法 自顶向下法将复杂的大问题分解为相
  • SecureCRT图形界面(通过设置调用Xmanager - Passive程序)

    首先 xff0c 在服务器进行设置 如果服务器是图形化界面启动的 xff0c xhost 43 命令可以不用执行 root 64 test xhost 43 xhost unable to open display 34 34 设置disp
  • 一种GPS辅助的多方位相机的VIO——Slam论文阅读

    34 A GPS aided Omnidirectional Visual Inertial State Estimator in Ubiquitous Environments 34 论文阅读 这里写目录标题 34 A GPS aided
  • docker & LXC

    目录 一 LXC1 了解Docker的前生LXC2 LXC与docker的关系3 与传统虚拟化对比4 LXC部署4 1 安装LXC软件包和依赖包4 2 启动服务4 3 创建虚拟机 5 LXC常用命令 二 doker1 什么是docker2
  • curl命令总结

    curl no cache d Users Administrator Desktop curl 7 73 0 3 win64 mingw bin gt curl Iv http abc gkmang cn 8081 index php l
  • 使用FastJSON 对Map/JSON/String 进行互转

    前言 Fastjson是一个Java语言编写的高性能功能完善的JSON库 xff0c 由阿里巴巴公司团队开发的 1 主要特性 高性能 fastjson采用独创的算法 xff0c 将parse的速度提升到极致 xff0c 超过所有json库
  • ai面向分析_2020年面向企业的顶级人工智能平台

    ai面向分析 In the long term artificial intelligence and automation are going to be taking over so much of what gives humans
  • 回答问题人工智能源码_回答21个最受欢迎的人工智能问题

    回答问题人工智能源码 Artificial intelligence sets the stage for a new era of solutions to be made with computers It allows us to s
  • 人工智能药物设计_用AI革新药物安全

    人工智能药物设计 介绍 Introduction Advances in the life sciences have brought about a transformative impact on healthcare with lif
  • 数据集分为训练验证测试_将数据集分为训练集,验证集和测试集

    数据集分为训练验证测试 测试我们的模型 Testing Our Model Supervised machine learning algorithms are amazing tools capable of making predict