如何使用 jsl 选择分位数范围异常值的列嗨,JMP 团队,
我计划使用 Explore Outliers 进行自动异常值分析。 此自动化的目标是获得一个整洁、易于查看的表格,以仅显示具有异常值的行项目和列项目(这需要过滤掉那些非异常值列和行)。 下面以水处理为例,剔除没有异常值的行项目。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );
obj = dt << Explore Outliers(
Y( dt << Get Column Group( "Sensor Measurements" ) )
);
obj << Show only columns with outliers(1);
obj << Tail Quantile( 0.1 );
obj << Q(3);
obj << Quantile Range Outliers;
obj << ColorCells(dt << Get Column Group( "Sensor Measurements" ));
obj << SelectRows(dt << Get Column Group( "Sensor Measurements" ));
obj << ExcludeRows(dt << Get Column Group( "Sensor Measurements" ));
dt << select where( Excluded(Row State()) != 1 );
dt << Delete rows;
问题如何使用jsl代码过滤掉非异常值列?

问候,
XH低
自动化和脚本编写视窗回复:如何使用 jsl 选择分位数范围异常值的列伟大的!! 现在可以了。
谢谢吉姆。

回复:如何使用 jsl 选择分位数范围异常值的列默认情况下,JMP 15 中探索离群值平台的输出仅显示具有离群值的列。我提供的脚本假定显示指定用于分析的所有列。我修改了代码以强制显示所有列,以便正确填充“allEvaluatedList”。我在 JMP 15 中测试了代码,iit 现在可以工作。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );
obj = dt << Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
obj << Show only columns with outliers( 1 );
obj << Tail Quantile( 0.1 );
obj << Q( 3 );
obj << Quantile Range Outliers;
obj << ColorCells( dt << Get Column Group( "Sensor Measurements" ) );
obj << SelectRows( dt << Get Column Group( "Sensor Measurements" ) );
obj << ExcludeRows( dt << Get Column Group( "Sensor Measurements" ) );
dt << select where( Excluded( Row State() ) != 1 );
dt << Delete rows;
obj << Show only columns with outliers( 0 );
allEvaluatedList = Report( obj )["Quantile Range Outliers", String Col Box( "Column" )] << get;
obj << Show only columns with outliers( 1 );
colList = Report( obj )["Quantile Range Outliers", String Col Box( "Column" )] << get;
For( i=1, i <= N Items(allEvaluatedList), i++, col=allEvaluatedList[i];
If( Contains( colList, col ) == 0 ,
dt << delete columns( col )
)
);
回复:如何使用 jsl 选择分位数范围异常值的列嗨吉姆,
感谢您的代码。
我尝试了上面的代码,我的 JMP15 不支持 For Each()。 我对 For Each 进行了一些更改为 For 循环。
但仍然无法删除非异常值列。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );
obj = dt << Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
obj << Show only columns with outliers( 1 );
obj << Tail Quantile( 0.1 );
obj << Q( 3 );
obj << Quantile Range Outliers;
obj << ColorCells( dt << Get Column Group( "Sensor Measurements" ) );
obj << SelectRows( dt << Get Column Group( "Sensor Measurements" ) );
obj << ExcludeRows( dt << Get Column Group( "Sensor Measurements" ) );
dt << select where( Excluded( Row State() ) != 1 );
dt << Delete rows;
allEvaluatedList = Report( obj )["Quantile Range Outliers", String Col Box( "Column" )] << get;
obj << Show only columns with outliers( 1 );
colList = Report( obj )["Quantile Range Outliers", String Col Box( "Column" )] << get;
For( i=1, i <= N Items(allEvaluatedList), i++, col=allEvaluatedList[i];
If( Contains( colList, col ) == 0 ,
dt << delete columns( col )
)
);
非离群值列仍然存在于下面的数据表中。

我错过了什么吗?
回复:如何使用 jsl 选择分位数范围异常值的列我在脚本底部添加了几行代码,用于删除没有异常值的列。

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Water Treatment.jmp" );
obj = dt << Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
obj << Show only columns with outliers( 1 );
obj << Tail Quantile( 0.1 );
obj << Q( 3 );
obj << Quantile Range Outliers;
obj << ColorCells( dt << Get Column Group( "Sensor Measurements" ) );
obj << SelectRows( dt << Get Column Group( "Sensor Measurements" ) );
obj << ExcludeRows( dt << Get Column Group( "Sensor Measurements" ) );
dt << select where( Excluded( Row State() ) != 1 );
dt << Delete rows;
allEvaluatedList = Report( obj )["Quantile Range Outliers", String Col Box( "Column" )] << get;
obj << Show only columns with outliers( 1 );
colList = Report( obj )["Quantile Range Outliers", String Col Box( "Column" )] << get;
For Each( {col, i}, allEvaluatedList,
If( Contains( colList, col ) == 0,
dt << delete columns( col )
)
);