안녕,
마지막 New Column 문에 행렬을 지정해야 한다고 생각합니다(아래 참조). 스크립트에 다른 오류가 있어서 테스트할 수 없습니다.
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...>
JSL 스크립트의 오타에 대한 SOrry. 올바른 구문은 다음과 같습니다.
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...>
다시 한 번 죄송합니다. 너무 빨리 답변하려고 했습니다. 문제를 테스트할 올바른 버전의 JMP가 없지만 문제를 해결한 것 같습니다.
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...>
안녕,
모든 방법을 탐색하기 위해 전치 행렬을 생성하려고 했습니까?
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...>
JMP Pro를 사용할 수 없기 때문에 공식이 허용되는지 여부는 알 수 없지만 최소한 공식에 쉼표로 구분된 행렬이 생성됩니다.
더 큰 도움이 되지 못해서 죄송합니다.
최상의,
TS
안녕 티에리,
귀하의 제안은 실제로 매우 가깝습니다. 3x1 행렬이 필요할 때 1x3 행렬을 만들 것을 제안했습니다.
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>ML 모델의 성능을 평가하는 과정에서 모델이 수행할 실행 횟수를 지정하고 교육 및 검증 데이터의 비율을 지정하는 UI를 만들려고 합니다.
지정된 실행 횟수를 기반으로 열을 생성하고 비율을 전달하는 for 루프에 해당 정보를 전달하려고 합니다. 비율(두 번째 예)을 지정하면 루프가 제대로 작동하지만 변수(nTraining, nVal)를 사용할 때는 그렇지 않습니다.
일부 제안은 대단히 감사하겠습니다.
감사해요.
에스
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...>