Hallo,
Ich denke, Sie müssen die Matrix in Ihrer letzten New Column-Anweisung angeben (siehe unten). Ich konnte es nicht testen, weil Ihr Skript andere Fehler enthält.
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...>
Entschuldigung für den Tippfehler im JSL-Skript. Hier ist die korrekte Syntax.
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...>
Nochmals Entschuldigung, ich habe versucht, zu schnell zu antworten. Ich habe nicht die richtige Version von JMP, um das Problem zu testen, aber ich glaube, ich habe das Problem gelöst.
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...>
Hallo,
Um alle Möglichkeiten zu erkunden, haben Sie versucht, eine transponierte Matrix zu generieren?
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...>
Ich kann nicht sagen, ob die Formel akzeptiert wird, da ich JMP Pro nicht zur Verfügung habe, aber zumindest wird eine durch Kommas getrennte Matrix in der Formel generiert.
Tut mir leid, dass ich keine größere Hilfe war.
Am besten,
TS
Hallo Thierry,
Ihr Vorschlag war in der Tat sehr nah dran. Sie haben vorgeschlagen, eine 1x3-Matrix zu erstellen, obwohl eine 3x1-Matrix benötigt wurde
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>Im Prozess der Bewertung der Leistung des ML-Modells versuche ich, eine Benutzeroberfläche zu erstellen, die die Anzahl der Durchläufe angibt, die das Modell durchführen wird, und den Anteil der Trainings- und Validierungsdaten angibt.
Ich versuche, diese Informationen an eine for-Schleife zu übergeben, die die Spalten basierend auf der angegebenen Anzahl von Durchläufen erstellt und auch die Proportionen übergibt. Die Schleife funktioniert gut, wenn ich den Anteil spezifiziere (zweites Beispiel), aber nicht, wenn ich Variablen (nTraining, nVal) verwende.
Einige Vorschläge wären sehr dankbar.
Danke.
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...>