Ben Goren wrote:
Would that be time and resources that us non-C-hackers could help with? If it means, for example, some grunt work of creating and measuring charts or hacking together Perl programs or spreadsheets to analyze them, I'd be more than happy to volunteer.As it looks like you are obviously pretty interested in finding the best -r value, probably you could do something for this purpose.
Pseudocode:
parse command line arguments: - get measurements (.ti3 file) - get options which are passed through to the profile command - ...
k = 10 (just an example, 10-fold is IMO a good starting point)
Split the measurements into k subsets S[1]...S[k], with approx. the same number of elements in each subset
(You may also want to put them into a random order before splitting into subsets, to avoid that e.g. all samples from a gray ramp or color ramp in the measurement set fall into the same subset; or alternatively you could interleave them in a round robin manner, i.e. 1st data point -> S[1], 2nd data point -> S[2], ..., k+1-th data point goes again into S[1], etc.)
best_avgdev = -1; best_sse = -1
for avgdev in all "-r" numbers wou want to try {
sse = 0
for i in 1..k {
training_set = empty
for j = 1..k { if (j != i) { add all elements of S[j] to training_set } }
create .ti3 file from the training_set
create a profile from this .ti3 file, using the desired profile options, augmented with -r<avgdev> and -B, but exclude -s, -S, -t, -T, -c, -d, -g options since you don't need to waste time for creating B2A tables and gamut mapping, which are irrelevant for this consideration.
create a .ti3 file from the subset S[i]
run profcheck to verify the profile against the subset S[i], extract the RMS dE from the profcheck output
sse += rms_dE * rms_dE }
printf "avgdev=%g, SSE=%g, RMSE=%g", avgdev, sse, sqrt(sse/k)
if (best_sse < 0 || sse <= best_sse) { best_sse = sse best_avgdev = avgdev } }
Finally create the actual profile, from the original .ti3 file, using -r<best_avgdev>