Neural Networks - Simple question ?

2 views (last 30 days)
Dink
Dink on 14 Apr 2013
What is the difference between 'dividerand' and 'divideint' ??

Accepted Answer

Greg Heath
Greg Heath on 15 Apr 2013
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

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!