필터 지우기
필터 지우기

How do I link my data with the training and validation set indices I have created using 'dividerand' function?

조회 수: 7 (최근 30일)
I have a dataset of 200 values. I want to randomly split the data into training (70%) and validation (30%) sets. I used the 'dividerand' function to create random indices for both sets. But now I am unsure as to how to link my data with the indices in order to proceed further with my analysis.

답변 (1개)

Manan Mishra
Manan Mishra 2017년 10월 10일
편집: Manan Mishra 2017년 10월 10일
You can pass the vectors created by "dividerand" as index to extract training and validation sets from your dataset.
For example, if "ds" is your dataset of 200 values and you use the following command to create random indices:
[trainInd,valInd,~] = dividerand(3000,0.7,0.3,0);
Then you can extract the training and validation sets as follows:
trainSet = ds(trainInd);
valSet = ds(valInd);
  댓글 수: 1
LE-LE YANG
LE-LE YANG 2018년 3월 31일
trainSet = ds(trainInd); valSet = ds(valInd);
But how to use these datasets for train and validate? I know the train is like: net=train(net,x,t) But how to validate the net?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by