Hello scripters,
I'm having some difficulty trying to access some information in a report coming from the XGBoost add-in platform. I have a JSL program where I generate a table of different XGB models -- different depths, learning rates, iterations, etc. This code runs the XGBoost platform and then pulls information from the XGB report to store in a output data table.
The difficulty I'm having is trying and generalize some of the code to pull information using the Outline box() and NumberColBox() commands. Attached is a sample report and a screenshot below.

There are a total of 4 number column boxes I want to pull data from -- outlined in red in the screenshot. Normally, I would write some JSL like the following to define the outline box number and number column box number to then Get the data and have it stored in a list, which I can then assign to columns as needed in my output data table.
o_box = 1;
t_ncol_box = 35;
n_ncol_box = 36;
Tconfrates_ncol_box1 = 28;
Tconfrates_ncol_box2 = 29;
Tdata = w[Outline Box( o_box ), Number Col Box( t_ncol_box )] << Get;
NT = w[Outline Box( o_box ), Number Col Box( n_ncol_box )] << Get;
TConfR1 = w[Outline Box( o_box ), Number Col Box( Tconfrates_ncol_box1 )] << Get;
TConfR2 = w[Outline Box( o_box ), Number Col Box( Tconfrates_ncol_box2 )] << Get;
This JSL works just fine with the following outputs:
Tdata = {0.92503341611747, 0.937048078393258, 0.0137071818977882, 0.0387471836917961,
0.012822908993725, 0}
NT = {6253}
TConfR1 = {1, 0}
TConfR2 = {0, 1}
I know I can also get some of the data by referencing specifically the outline box and number column box like:
Tdata = w[Outline Box( "Fit Details" ), Number Col Box( "Training" )] << Get;
But, because of how the report is organized, it doesn't include the number of rows used in the data set -- the next number column box with the value of 6253 in this example (there is no title). Plus, how would I reference the Confusion Matrix rates -- the pass/pass, pass/fail rates this way? A similar code for the confusion matrix rates
TConfR1 = w[Outline Box( "Training" ), Number Col Box( "Pass" )] << Get;
TConfR2 = w[Outline Box( "Training" ), Number Col Box( "Fail" )] << Get;
will get the confusion matrix counts, not rates (granted I can calculate the rates from the counts, but accessing the information right away would be easier).
But, when the code runs through the next iteration in the table (with different model parameters), number column box values change for the same data in the report. For example, t_ncol_box, is not 35 the second time around, it's now 43.
So, unfortunately, it looks like the "standard" way of referencing the report and outline boxes won't really work. I have not come across this issue with other modeling platforms in JMP, like Boosted Trees, Neural Net, Bootstrap Forest, and others. I was thinking of accessing it via XPath, but I don't know it well enough to know how to correctly extract the values I'm interested in -- especially when the number column box value changes -- and the Number Column Box doesn't always have a title to work with -- for example the number of data points in the training set N, it's just the next iteration in the number column box from the training fit details (Entropy RSquare, RASE, etc.).
I thought I can get around the "old?" or "traditional?" way with a logical statement that changed the value of the number column box variables if the model step == 1 or !=1, but after 16 models, the values changed again -- and again at 34. There must be a more efficient way to access the data without having to include logic statements for specific model step values like at i=16 or i=34. It's not so easy when the number col box value can change, and without understanding why.
Any suggestions on how to do this with a method that is more flexible to how the report keeps changing the number col box value, and for ones without a title, I'd be very grateful. I'd like as generalizable of a solution as possible as the Y column I'm modeling could be a 2-level ordinal/nominal, 3-level ordinal/nominal, or continuous data type.
Thanks!,
DS