JMP 커뮤니티 여러분, 저는 jmp/jsl을 처음 접했습니다(문자 그대로 이번 주에 막 시작했습니다). 행의 특정 값이 3보다 작은 위치를 선택한 다음 해당 행을 삭제하는 스크립트가 있습니다. 내가 해야 할 스크립트는 다음과 같습니다.
dt << select where( :Residual 1 <= 3 );
dt << delete rows;
코드는 내가 원하는 행을 올바르게 선택하지만 행을 삭제하면 스스로 "업데이트"됩니다(그 앞 줄에 신경망 모델이 스크립트되어 있습니다... 아래 코드 참조).
// 1. Creates X1 column, and corresponding Y1 and Ystat columns
Close All( Data Tables, NoSave );
dt = New Table( "SampleRun 3",
Add Rows( 100 ),
New Script(
"Ystat vs. X1",
Graph Builder(
Variables( X( :X1 ), Y( :Ystat ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
)
),
New Column( "X1",
Formula( Random Integer( 50 ) )
),
New Column( "Y1",
Formula( If( :X1 < 25, 2 * :X1, 25 <= :X1 <= 30, 3 * :X1, 4 * :X1 ) )
),
New Column( "Ystat",
Formula( :Y1 )
)
);
// 2. Creates predicted Ystat column, saves formulas into same data table (first iteration)
PredictedYstat = dt << Neural(
Y( :Ystat ),
X( :X1 ),
Informative Missing( 0 ),
Validation Method( "Holdback", 0.3333 ),
Fit( NTanH( 3 ) )
);
PredictedYStat << Save Profile Formulas;
// 3. Adds residual column
dt << New Column( "Residual 1", Formula( Abs( :Predicted Ystat - :Ystat ) ) );
dt << select where( :Residual 1 >= 3 );
dt << delete rows;
이 행을 선택하여 새 테이블에 넣을 수 있지만 이는 비효율적이므로 최후의 수단입니다. 어떤 제안이 있으십니까?
감사해요,
카일
수식을 한 번만 평가하려면 한 가지 옵션은 계산을 강제로 수행한 다음 수식을 삭제하는 것입니다.
dt << Run Formulas;
Column(dt, "X1") << Delete Formula;
Column(dt, "Y1") << Delete Formula;
Column(dt, "Ystat") << Delete Formula;