how to split dataset

조회 수: 6 (최근 30일)
muhammad ismat
muhammad ismat 2015년 7월 9일
답변: muhammad ismat 2016년 4월 15일
can I select 90% of the data for training and the remaining (10%) for test set then repeat the split 10 times?How I do that?
and how to calculate final accuracy in this case.
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 9일
편집: Azzi Abdelmalek 2015년 7월 9일
What is your data? a matrix or what? how your data will be stored? Post an example and show the expected result

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

답변 (2개)

muhammad ismat
muhammad ismat 2016년 4월 15일
n = size(data,1);
data_rand = data(randperm(n),:);
m = ceil(n/10);
k = 1:m:n-m;
test = data_rand(k:k+m-1,:);
train = [data_rand(1:k-1,:); data_rand(k+m:end,:)];
adj=edge(train,data);

muhammad ismat
muhammad ismat 2015년 7월 9일
i assume that dataset is k=[1 2;3 4;8 5;8 9;6 5] then train set is t=[1 2;3 4;6 5] and test set is the remaining i.e test=[8 5;8 9]
i want repeat this process 10 times with different choice but the same percentage
  댓글 수: 2
muhammad ismat
muhammad ismat 2015년 7월 10일
i have dataset say karate=[6 7;5 4;9 8;1 2;9 8;4 5;1 2;3 4;8 7;6 2] then i want splitting karate to train=90% random of dataset say=[6 7;5 4;9 8;1 2;9 8;1 2;3 4;8 7;6 2] the remaining will be test , test= [4 5] then i repeat this process 10 times
muhammad ismat
muhammad ismat 2015년 7월 10일
No one responded

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

카테고리

Help CenterFile Exchange에서 Testing Frameworks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by