如果缺少异常值 jsl 中没有异常值,如何忽略?我有一个在大型数据库上运行的探索异常值 jsl。 有时explore outlier找不到任何异常值(因为数据分布相当紧密),jsl报错。 如何在以下脚本中添加 ignore 或 try 语句以跳过探索异常值代码?
dt1 = Current Data Table();
eo = dt1 << Explore Outliers(
Y( :var1 ),
K Sigma( 2 ),
Robust Fit Outliers,
Where(
:x == 1
),
Invisible
);
eoRep = Report(eo);
table = eoRep[TableBox(1)];
colList = eoRep[StringColBox(1)];
// Loop over these columns . . .
nCols = NItems(colList << get);
for(c=1, c<=nCols, c++,
// Select this column (described by a row)
CMD = Expr( table << setSelectedRows({colTBD}) );
SubstituteInto(CMD, Expr(colTBD), Eval(c));
CMD;
// Update dt2 for this column: Cells that were considered outliers are coloured red
eo << ColorCells(1);
eo << ChangeToMissing(1);
);数据表脚本视窗回复:如果缺少异常值 jsl 中没有异常值,如何忽略?我相信您可以通过简单地检查是否已找到零异常值来绕过处理
For( c = 1, c <= nCols, c++,
If( (eoRep[Number Col Box( 3 )] << get)[c] != 0,
// Select this column (described by a row)
CMD = Expr(
table << setSelectedRows( {colTBD} )
);
Substitute Into( CMD, Expr( colTBD ), Eval( c ) );
CMD;
// Update dt2 for this column: Cells that were considered outliers are coloured red
eo << ColorCells( 1 );
eo << ChangeToMissing( 1 );
)
);