Hola,
Creo que debe especificar la matriz en su última declaración de Nueva columna (ver más abajo). No pude probarlo porque su script tiene otros errores.
nrun=10;
nTraining = 0.75;
nVal = 0.25;
mat = J(1,3);
mat [1,1] = nTraining;
mat [1,2] = nVal;
mat [1,3] = 0;
//getting this error
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], <<ST... for=""></ST...>
Lo siento por el error tipográfico en el script JSL. Aquí está la sintaxis correcta.
nrun=10;
nTraining = 0.75;
nVal = 0.25;
mat = J(1,3);
mat [1,1] = nTraining;
mat [1,2] = nVal;
mat [1,3] = 0;
//getting this error
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], <<ST... for=""></ST...>
Lo siento de nuevo, traté de responder demasiado rápido. No tengo la versión correcta de JMP para probar el problema, pero creo que resolví el problema.
nrun=10;
nTraining = 0.75;
nVal = 0.25;
mat = J(1,3);
mat [1,1] = nTraining;
mat [1,2] = nVal;
mat [1,3] = 0;
//getting this error
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], <<ST... for=""></ST...>
Hola,
En aras de explorar todas las vías, ¿ha intentado generar una matriz transpuesta?
nTraining = 0.75;
nVal = 0.25;
mat = J(3,1);
show (mat);
mat [1,1] = nTraining;
mat [2,1] = nVal;
mat [3,1] = 0;
show (mat);
//getting this error
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], <<ST... for=""></ST...>
No puedo decir si se aceptará la fórmula porque no tengo JMP Pro disponible, pero al menos genera una matriz delimitada por comas en la fórmula.
Perdón por no ser de mayor ayuda.
Mejor,
TS
Hola Thierry,
De hecho, su sugerencia estuvo muy cerca. Usted sugirió construir una matriz de 1x3 cuando necesitaba una matriz de 3x1
dtstub= data table("test");
nrun=3;
nTraining = 0.75;
nVal = 0.25;
// Create the matrix
mat = J(3,1, {.}); // 1x3 matrix with missing values
mat [1,1] = nTraining;
mat [2,1] = nVal;
mat [3,1] = 0;
show (mat);
For( i = 1, i <= nrun, i++,
data table("test") <<
New Column( "Val",
Numeric,
"Nominal",
Format( "Best", 12 ),
Formula(
EVal (Eval Expr (Make Validation Formula(
expr(mat),
// [0.75, 0.25, 0],
<<STRATIFICATION columns=""></STRATIFICATION>En el proceso de evaluar el rendimiento del modelo ML, estoy tratando de crear una interfaz de usuario que especificará la cantidad de ejecuciones que realizará el modelo y especificará la proporción de datos de capacitación y validación.
Estoy tratando de pasar esa información a un bucle for que creará las columnas en función del número de ejecución especificado y también para pasar las proporciones. El ciclo funciona bien cuando especifico la proporción (segundo ejemplo) pero no cuando uso variables (nTraining, nVal).
Algunas sugerencias serían muy apreciadas.
Gracias.
S
dtsub=New Table( "test",
Add Rows( 34 ),
New Column( "test_article",
Character( 7 ),
"Nominal",
Set Values(
{"1269442", "1100729", "1269449", "1269448", "1100723", "1100728",
"1269456", "1269457", "1269458", "1269454", "1269468", "1269469",
"1269466", "1269471", "1100397", "1100405", "1100406", "1100407",
"1100528", "1100534", "1100535", "1100540", "1100542", "1100566",
"1100585", "1100590", "1100725", "1100873", "1100914", "1100915",
"1100920", "1100990", "1100991", "1101101"}
),
Set Display Width( 61 )
),
New Column( "basic_class",
Character,
"Nominal",
Set Values(
{"0_Active", "0_Active", "0_Active", "0_Active", "0_Active", "0_Active",
"0_Active", "0_Active", "0_Active", "0_Active", "0_Active", "0_Active",
"1_MarginalActive", "1_MarginalActive", "1_MarginalActive",
"1_MarginalActive", "1_MarginalActive", "1_MarginalActive", "2_Inactive",
"1_MarginalActive", "2_Inactive", "1_MarginalActive", "2_Inactive",
"1_MarginalActive", "1_MarginalActive", "1_MarginalActive", "0_Active",
"1_MarginalActive", "0_Active", "0_Active", "2_Inactive", "0_Active",
"0_Active", "0_Active"}
),
Set Display Width( 90 )
),
Set Row States(
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1,
1, 0, 1, 0, 0, 0, 0, 0, 0]
)
);
nrun=10;
//the proportion forthe valdation column are specified here
nTraining = 0.75;
nVal = 0.25;
//getting this error
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], <<ST... for=""></ST...>