필터 지우기
필터 지우기

Neural Networks - Simple question ?

조회 수: 2 (최근 30일)
Dink
Dink 2013년 4월 14일
What is the difference between 'dividerand' and 'divideint' ??

채택된 답변

Greg Heath
Greg Heath 2013년 4월 15일
1.Read the command line documentation:
help dividerand
doc dividerand
type dividerand % If you have permission
and
help divideint
doc divideint
type divideint % If you have permission
My naive interpretation:
dividerand: randomly rearranges the integers 1:N ( e.g., with randperm) and with the default ratios 0.7/0.15/0.15, assigns the last Ntst = round(0.15*N) to the test set, the middle Nval = round(0.15*N) to the validation set and the first Ntrn = N - Nval - Ntst to the training set.
Example: choose a value for N and numtrials
N = 30
numtrials = 10
rng(0) % Initialize the RNG so that the example can be duplicated
for n =1:numtrials
[trnind,valind,tstind] = dividerand(N,0.7,0.15,0.15) % no semicolon
end
divideint: assigns members of the three sets to be as interleaved as possible. For example, if N = 30 then Nval = Ntst = round(0.15*30) = 5 and Ntrn = 20. I don't know the algorithm used by MATLAB (you can check type divideint) but, you could choose the spacing of valind and tstind to be uniform (e.g., = 6), and starting with a number in 1:6.
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 1
Dink
Dink 2013년 4월 15일
Thanks very much Greg!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by