Lets assume for now that (for whatever reason) you end up with n0 = 5 and n1 = 5. If such was the case you wilt end up with something like this (replacing variables with actual values):
The reason why the code will crash is because the last line in the sample code above is looking for a range of [2:], which really translates to [2:3]. When that is the case, (ntrn1+2) should be (ntrn1+3). Basically you are being inconsistent in the way you truncate the values throughout the procedure.
The end result is that you end up with a similar error as the one shown below.
On listing 4-1 code to construct the subsets using a 90/5/5 split of the original data (page 71).
Lets assume for now that (for whatever reason) you end up with
n0 = 5
andn1 = 5
. If such was the case you wilt end up with something like this (replacing variables with actual values):The reason why the code will crash is because the last line in the sample code above is looking for a range of
[2:]
, which really translates to[2:3].
When that is the case,(ntrn1+2)
should be(ntrn1+3)
. Basically you are being inconsistent in the way you truncate the values throughout the procedure.The end result is that you end up with a similar error as the one shown below.
Thanks.