嘿 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;