Il seguente codice avvia la piattaforma Bivariate e quindi salva i valori previsti in una colonna. Funziona bene. Tuttavia, vorrei personalizzare il nome della colonna per la colonna save predicteds. La Scripting Guide suggerisce di inviare messaggi nidificati, ma non riesco a farlo funzionare.
Quindi le domande sono...
1) È possibile personalizzare il nome della colonna Salva previsioni nelle opzioni della piattaforma?
2) In caso contrario, come faccio ad acquisire il nome in modo da poterlo personalizzare nei passaggi successivi?
Grazie mille per qualsiasi aiuto possiate fornirmi.
Names Default to Here(1);
// SETUP
dt2 = New Table( "Interpolated Data",
Add Rows( 60 ),
New Column( "Timestamp",
Numeric,
"Continuous",
Format( "m/d/y h:m", 19 ),
Input Format( "m/d/y h:m" ),
Set Values(
[3742070400, 3742070460, 3742070520, 3742070580, 3742070640, 3742070700,
3742070760, 3742070820, 3742070880, 3742070940, 3742071000, 3742071060,
3742071120, 3742071180, 3742071240, 3742071300, 3742071360, 3742071420,
3742071480, 3742071540, 3742071600, 3742071660, 3742071720, 3742071780,
3742071840, 3742071900, 3742071960, 3742072020, 3742072080, 3742072140,
3742072200, 3742072260, 3742072320, 3742072380, 3742072440, 3742072500,
3742072560, 3742072620, 3742072680, 3742072740, 3742072800, 3742072860,
3742072920, 3742072980, 3742073040, 3742073100, 3742073160, 3742073220,
3742073280, 3742073340, 3742073400, 3742073460, 3742073520, 3742073580,
3742073640, 3742073700, 3742073760, 3742073820, 3742073880, 3742073940]
),
Set Display Width( 250 )
),
New Column( "Data",
Numeric,
"Continuous",
Format( "Best", 15 ),
Set Values(
[899.08410644531295, ., ., ., ., ., ., ., 897.38671875, ., ., ., ., ., .,
., 898.518310546875, ., ., ., ., ., ., ., 897.57525634765602, ., ., ., .,
., ., ., 897.38671875, ., ., ., ., ., ., ., 896.63226318359398, ., ., .,
., ., ., ., 896.25506591796898, ., ., ., ., ., ., ., 896.44366455078102,
., ., .]
),
Set Display Width( 250 )
)
);
// RUN PLATFORM
// QUESTION 1: Is it possible to customize the name of the Save Predicteds column within the platform options?
// QUESTION 2: If not, how do I capture the name so I can customize it is subesquent steps?
dt2 << Bivariate( Y( :Data ) , X( :Timestamp ), Fit Spline( 1e-15, {Save Predicteds} ), Invisible );Un'opzione un po' più generica è quella di utilizzare array associativi. Ad esempio, se si adattano i modelli a più Y contemporaneamente, si finirà con più colonne
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Diabetes.jmp");
original_columns = dt << Get Column Names("String");
obj = dt << Neural(
Y(:Y, :BMI),
X(:Age, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose),
Go
);
obj << Save Formulas;
obj << Close Window;
new_columns = Associative Array(dt << Get Column Names("String"));
new_columns << Remove(Associative Array(original_columns));
new_columns = new_columns << get keys; // Note that these are in alphabetical order
// If the order causes issues, it can be mitigated with some tricks
<BR />// This will rename also the hidden layers which could potentially cause issues
For Each({colname}, new_columns,
Column(dt, colname) << Set Name((dt << get name) || " " || colname);
);