Neural Networks - Simple question ?

2 次查看(过去 30 天)
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

更多回答(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