안녕하세요 여러분,
예를 들어 Distribution 플랫폼은 Graph Builder와 같은 방식으로 열 참조를 허용하지 않는 것 같습니다.
Column(dtname, number) 형식을 사용하여 데이터 테이블 내의 다른 열을 참조하는 코드가 있습니다. 예를 들어, 다음은 GB를 사용하여 수행한 약간의 코드이며 잘 작동합니다.
Graph Builder(
Size( 500, 350 ),
Show Control Panel( 0 ),
Variables(
X( Column( dt_results, NNxcol ) ),
Y( Column( dt_results, NNYCol + N Items( NNXList ) ) ),
Y( Column( dt_results, NNYCol + 1 + N Items( NNXlist ) ), Position( 1 ) ),
Y( Column( dt_results, NNYCol + 2 + N Items( NNXList ) ) )
),
Elements(
Position( 1, 1 ),
Points( X, Y( 1 ), Y( 2 ), Legend( 8 ) ),
Smoother( X, Y( 1 ), Y( 2 ), Legend( 9 ) )
),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 10 ) ), Smoother( X, Y, Legend( 11 ) ) ),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( NNYList[NNYCol] || " Stats vs. " || NNXList[NNxcol] )}
),
Dispatch( {}, "Y title", TextEditBox, {Set Text( NNYList[NNYCol] || " Train & Valid" )} )
)
)
그런데 Distribution 플랫폼에서 비슷한 작업을 하려고 하면 아무 일도 일어나지 않는데, Continuous Distribution() 호출이 이런 방식으로 열을 참조하는 것을 좋아하지 않는 것 같아서 그런 것 같습니다. 컬럼을 Column(컬럼 이름)으로 참조하는 것이 좋은 것 같습니다.
Distribution(
Continuous Distribution( Column( dt_results, NNYCol + NNcolshift ), Quantiles( 0 ) ),
Continuous Distribution( Column( dt_results, NNYCol + 1 + NNcolshift ), Quantiles( 0 ) ),
Continuous Distribution( Column( dt_results, NNYCol + 2 + NNcolshift ), Quantiles( 0 ) )
)
열 이름 자체를 하드 코딩하는 것보다 코드에서 더 유연하기 때문에 플랫폼을 호출할 때 변수를 사용하고 싶습니다. 배포 플랫폼이 다르게 동작하는 이유나 의도한 출력을 얻기 위해 열을 올바르게 참조하는 방법을 아시나요?
어떤 생각/의견이라도 감사하겠습니다.
감사해요!,
DS
데이터 테이블에 메시지를 보내고 Column() 함수에서 테이블 참조를 제거하면 됩니다.Graph Builder와 함께 작동하는 스크립트의 구문이 마음에 들지 않는 이유는 모르겠습니다.
dt_results << Distribution(
Continuous Distribution( Column( NNYCol + NNcolshift ), Quantiles( 0 ) ),
Continuous Distribution( Column( NNYCol + 1 + NNcolshift ), Quantiles( 0 ) ),
Continuous Distribution( Column( NNYCol + 2 + NNcolshift ), Quantiles( 0 ) )
)
다음과 같이 재미있고 혼란스러운 구문을 사용할 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col1 = "height";
col2 = "weight";
dist = dt << Distribution(
Continuous Distribution(Column(Column(dt, col1)), Quantiles(0)),
Continuous Distribution(Column(Column(dt, col2)), Quantiles(0))
);
아니면 이거
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col1 = "height";
col2 = "weight";
Eval(EvalExpr(
dist = dt << Distribution(
Continuous Distribution(Column(Eval(col1)), Quantiles(0)),
Continuous Distribution(Column(Eval(col2)), Quantiles(0))
);
));
편집: 위 스크립트에서는 Eval(EvalExpr())이 필요하지 않습니다. 나는 다른 옵션을 테스트할 때 우연히 그것을 거기에 두었습니다(Name Expr(AsColumn())을 가지고 놀고 있었습니다).
아니면 다음 중 하나:
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col1 = "height";
col2 = "weight";
Distribution(Continuous Distribution(Column(Eval(col1))));
colList={col1,col2};
Distribution(column(EvalList(colList)));
자세한 내용은 여기에서 확인할 수 있습니다.
https://www.pega-analytics.co.uk/blog/handling-lists-of-columns/ (감사해요 @레셀
그리고 여기:
https://community.jmp.com/t5/Discussions/Updating-column-list-box-using-list-stored-in-variable-not/mp/687314/highlight/true#M87301
혼란이 일어나는 이유는 (잘 알려져 있음) 열 의 이름으로 사용된다 명명된 인수 ~에 지속적인 배포 . 많은 Jmp 사용자는 이것이 열() 기능을 확인하고 그에 따라 사용하세요.
Col List Box의 Data Table()과 동일: 변수에 저장된 목록을 사용하여 열 목록 상자를 업데이트하면 예상대로 작동하지 않습니다. 이게 원래 그런 뜻인가요?
안녕하세요 여러분,
이에 대한 빠른 피드백과 도움을 주셔서 감사합니다. 나는 결국 혼합으로 갔다. @mmarchandTSI 그리고 @jthi 의 두 번째 제안. 불행히도, 당신의 제안은 @mmarchandTSI 자체적으로 작동하지 않았지만 플랫폼은 여전히 Column() 참조 내의 열 번호에 대한 변수를 좋아하지 않았습니다. 그러나 Column() 참조 내의 숫자 변수에 대해 Eval()을 수행하면 제대로 작동했습니다. 따라서 Column(Eval())을 사용하면 다음과 같습니다. @jthi 그리고 @호기 그랬더니 결국 의도한 대로 작동하게 됐어요.
좋은 제안에 감사드립니다!,
DS