ITISFoundation / publication-IEC62209

📝 A Gaussian-process-model-based approach for robust, independent, and implementation-agnostic validation of complex multi-variable measurement systems: application to SAR measurement systems
GNU General Public License v3.0
0 stars 1 forks source link

the measurement area in the report does not match that provided by the user #12

Closed markdouglasphd closed 1 year ago

markdouglasphd commented 1 year ago

v1.0.12

after "Export Model", the report that's generated has a measurement area (106 x 210) that does not match the area that was given by the training set (100 x 200). These should match. 2023-05-01 09_52_20-Downloads

cbujard commented 1 year ago

This requires a change of design since this the domain size is not contained in the csv. This needs to be discussed. Few possible options: 1) allow the user to correct or indicate model domain size by hand; 2) a dummy point could be automatically added to samples to indicate the domain size (visible to the csv user); 3) a new field with some base64 encoded string may be added to the csv (visible to the csv user); 4) serialize samples as json and add functionality to auto extract and create/load a csv file from the json; 5) use two files within a zip (probably a bad idea)

markdouglasphd commented 1 year ago

Hi Cedric,

I like your first answer best. The user enters the dimensions in 'Analysis & Creation' before the model is exported. The user only needs to do this once. All 3 test reports use this size that's in the model. Even if the user puts in a smaller measurement area for the Test Set, the report is based on the size from the model.

Here's how it would look: 2023-05-02 12_55_46-Presentation1 - PowerPoint

markdouglasphd commented 1 year ago

Hi @cbujard. I think that there should be some error checking here. So it should check if x and y are too small (points are outside) or too big (> 10% larger than xmax and ymax?).

cbujard commented 1 year ago

Hi @markdouglasphd , @SCA-ZMT Ok so there are two different layers of checks here:

1) a model always contains a sample: the model.contains(testsample) checks the validity of testsample with respect to the sample that underlines the model. This check is absolutely necessary, for scientific reasons and should not be influenced by the frontend. Note: A model is only defined in the range [-xmax, xmax] for xmax = ceil( max(abs(df[x])) x 1.05) and similarly for y.

2) a model contains a metadata field which is independent from the underlying sample. The backend is not concerned with this data at all, it only saves/reads it to/from serialization and leaves its definition to the caller (who will typically use a dict of his choice). This is where user entered data should be stored. This check is only cosmetic: is only about interfacing with the user.

Point 1) is already implemented and should always be fully performed. Simone can add a function that performs 2).

markdouglasphd commented 1 year ago

Hi @odeimaiz and @SCA-ZMT,

I spoke with Cedric. Let's do the following:

  1. add the measurement area (x,y) fields to the 'Analysis & Creation' window, just above the 'Export Model' button (i.e., as shown in the image above). Let's call them x1 and y1 for the next step.
  2. on input, check that (max(abs(df[x])) <= x1 <= ceil(max(abs(df[x])) x 1.05) and same for y1, where x are the points in the Training Set. For example if the user enters x1 = 120 but the training set has max(abs(df[x])) = 100, then x1 would snap to 105. If the user enters x1 = 80 when max(abs(df[x])) = 100, then x1 is set to 100.
cbujard commented 1 year ago

@markdouglasphd @SCA-ZMT @odeimaiz So just to summarize and correct point 2 above (the above example has incorrect values since inputted xsize and xmax have different magnitudes): a model always contains a sample with auto generated metadata = {'xmax': xmax, 'ymax': ymax}, and the model should contain corresponding metadata parameters (let's say for ex: xsize, ysize) such that:

2 max(abs(x)) <= xsize <= 2 xmax and similarly for y.

Note: this gives a very small margin for the user to pick xsize and ysize

cbujard commented 1 year ago

I'm planning to add smthg today that should really help handle this. A sample will contain two metadata for x and y each: xmax will be changed to be the max absolute value present in the sample, xsup will become what currently is xmax. Many checks will automatically be performed internally. In the end all you have to do in the front end is check that the xsize value given by the user satisfies:

2 xmax <= xsize <= 2 xsup 2 ymax <= ysize <= 2 ysup

and to record this xsize, ysize value as metadata into the model. This will also help in the future when freq becomes adjustable.