如何在Matlab的Classification Learner App中传递数据集 [英] How to pass dataset in Classification Learner App of Matlab

查看:74
本文介绍了如何在Matlab的Classification Learner App中传递数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于将变量(训练数据集、标签和测试变量)作为预测变量和响应传递.我所做的是在matlab的工作区中加载所有3个并启动会话.但是每次我收到错误(在附图中描述)即没有选择响应时,选择响应变量.我的数据集如下:

My question is about passing variables (training dataset ,Labels and test variable) as predictors and responses. What I do is that load all 3 in workspace of matlab and start session. But every time I get the error(Described in attached Image) i.e No responses selected ,select response variable.My dataset is as following:

  1. 人脸 [大小:5000 * 10000(5000 个样本,10000 个特征)]

  1. faces [ size : 5000 * 10000 (5000 samples ,10000 features)]

TrainingLabels [大小:5000 *1]

TrainingLabels [ size :5000 *1]

现在,在我的情况下,预测变量响应应该是什么,我该如何正确使用它们以使分类学习者应用程序正常工作?

Now what should be Predictors and responses in my case and how can I use them correctly in order to make classification Learner app work?

任何有关此事的帮助将不胜感激.谢谢.

Any Kind help regarding this matter will be highly appreciated. Thankyou.

推荐答案

步骤 1): 准备数据!!如果你有 N 个训练数据样本和 M 个测试数据样本,那么把它们组合起来MxN 示例.这里的行代表每个样本,列代表从样本中检测到的不同类型的特征.

Step 1): Prepare the data!! If you have N samples of training data and M samples of test data, then combine it together to make it MxN samples. The rows, here, represent each sample and the columns the different types of features detected from a sample.

步骤 2): 在数据的第一个或最后一个(最好)添加一个额外的列:此列应表示数据所需的标签.所以,现在您将拥有:总列数 = 特征数 + 1.将数据导入Classification Learner App时,建议将数据导入为TABLE.

Step 2): Add an extra column at FIRST or LAST of the data (preferably): This column should represent the desired labels for the data. So, now you will have : total no.of columns= no.of features + 1. While importing the data into the Classification Learner App, it is advised to import the data as a TABLE.

步骤 3):现在,设置分类学习器应用程序要使用的数据!默认情况下,所有列都将被选为预测变量.该应用程序将提示您选择回复.响应是您添加为额外列(标签)的响应.因此,更改标签列以使其指向响应.

Step 3): Now, set up the data to be used by the Classification Learner App!! By default, all columns will be selected as predictors. The app will prompt you to select the responses. A response is the one which you added as an extra column (the label). So, change the label-column to make it point as a response.

步骤 4): 在开始会话之前,您需要设置所采用的交叉验证策略.[ k 折验证将总 MxN 数据分成 k 部分,并从测试的第一部分开始,其余 k-1 部分用于训练.然后,第二部分再次用于测试,其余 k-1 部分用于训练等等.最后取所有精度的平均值作为最终精度].

Step 4): Before starting the session, you need to set up the Cross Validation strategy adopted. [ A k-fold validation divides the total MxN data into k-parts and begins by taking the first part of testing and rest k-1 parts for training. Then, again it takes the second part for testing and rest k-1 parts for training and so on. Finally, average of all the accuracies obtained is taken as final accuracy].

步骤 5): 开始会话,选择您想要的分类器并点击训练按钮!!!

Step 5): Start session, select the classifier you want and the hit the training button!!!

这篇关于如何在Matlab的Classification Learner App中传递数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆