120万行x 16列
环境温度列显示了许多观察结果(按天),这些观察结果在图形构建器中位于框和晶须顶部尾部的上方,被分类为离群值。 不幸的是,但这很可能是由于环境温度测量探针在行驶中的车辆上的放置。
目标是在使用神经网络对数据进行建模以将小部件A与小部件B的性能进行比较之前,正确识别和抑制具有环境温度异常值的数据行。
我在这里读了一些线程,但是找不到与解决方案类似的问题。
轻轻松松
调出离群值框
将光标拖到所有异常点上,这将在数据表中选择所有异常点。
现在转到数据表中的RowState列,然后转到已选择的行之一。
将鼠标悬停在所选行上时,右键单击鼠标,然后选择“排除”
所有选定的行将被排除
您可能要选择“隐藏和排除”
你好 @ 4MUL8R
我曾经写过一个脚本,如果行在任何变量的任何组中都是异常值,则将它们指定为专用行。我已将其更新为在一次专栏和几列温度中包括不同的日期。它会产生一个新的二进制列,该列指示每个原始列的异常值,另外一个二进制列指示该观察值在任何变量中是否为异常值。
让我们知道它是否有效。
罗恩
Names Default To Here( 1 );
// make a sample data table
dt = New Table( "Data",
add rows( 10000 ),
New Column( "it", Numeric, Ordinal, Format( "Best", 8 ), Formula( Row() ) ),
New Column( "Day", Numeric, Ordinal, Format( "Best", 8 ), formula( Random Integer( 110 ) ) ),
New Column( "temp1", Numeric, Continues, Format( "Best", 8 ), formula( Random Lognormal( :Day / 10, 5 ) ) ),
New Column( "temp2", Numeric, Continues, Format( "Best", 8 ), formula( Random Lognormal( :Day / 10, 5 ) ) ),
New Column( "Out",
Numeric,
Ordinal,
Format( "Best", 8 ),
Set Property( "Value Colors", {0 = -13977687, 1 = -4222943} ),
Color Cell by Value,
formula( 0 )
),
New Column( "Outtemp1",
Numeric,
Ordinal,
Format( "Best", 8 ),
Set Property( "Value Colors", {0 = -13977687, 1 = -4222943} ),
Color Cell by Value,
formula( 0 )
),
New Column( "Outtemp2",
Numeric,
Ordinal,
Format( "Best", 8 ),
Set Property( "Value Colors", {0 = -13977687, 1 = -4222943} ),
Color Cell by Value,
formula( 0 )
),
);
dt << run formulas;
Column( dt, "it" ) << delete formula;
Column( dt, "Day" ) << delete formula;
Column( dt, "temp1" ) << delete formula;
Column( dt, "temp2" ) << delete formula;
Column( dt, "Out" ) << delete formula;
Column( dt, "Outtemp1" ) << delete formula;
Column( dt, "Outtemp2" ) << delete formula;
// now we get to work
// make a list of days
byvarlist = Associative Array( dt:Day ) << get keys;
// make a list of columns
cols = dt << get column names( Continuous ); //List all Numeric columns
// loop through the days
For( i = 1, i <= N Items( byvarlist ), i++,
// select each Day
dt << select where( dt:Day == byvarlist[i] );
// subset each Day
subdt = dt << Subset( Selected Rows( 1 ) );
// clear selection for smooth workflow
dt << clear select;
// fined outliers in each variable within each Day
For( ii = 1, ii <= N Items( cols ), ii++,
out = Eval(
Parse(
"subdt << get rows where(
subdt:" || Char( cols[ii] ) || " > Col Quantile( subdt:" || Char( cols[ii] ) ||
", 0.75 ) + 1.5 * (Col Quantile( subdt:" || Char( cols[ii] ) || ", 0.75 ) - Col Quantile( subdt:" || Char( cols[ii] ) ||
", 0.25 )) | subdt:" || Char( cols[ii] ) || " <
Col Quantile( subdt:" || Char( cols[ii] ) ||
", 0.25 ) - 1.5 * (Col Quantile( subdt:" || Char( cols[ii] ) || ", 0.75 ) - Col Quantile( subdt:" || Char( cols[ii] ) ||
", 0.25 )));"
)
)`;
Eval( Parse( "column (subdt, \!"Out" || Char( cols[ii] || "\!" )[" || Char( out ) || "] = 1;" ) ) );
// also indicate the global outlier
Column( subdt, "Out" )[out] = 1;
//wait (0.00001);
);
// update original data table with new information for the Day
subdt << delete columns( "Day" );
subdt << delete columns( cols );
dt << Update( With( subdt ), Match Columns( :it = :it ) );
Close( subdt, No Save );
//Wait( 0.00001 );
);
dt << color by column( :Out );
我想提出一种不同的方法。
也许尝试编写脚本探索异常值平台,如下所示:
dt=current data table();<BR />obj=dt<<EXPLORE outliers=""></EXPLORE>
要进行设置,请使用“探索异常值”平台确定条件,然后将脚本保存到脚本窗口。
用你的条件代替我的条件,你就很好了。
您也可以只选择离群值,然后反转选择范围,然后制作要保留的数据子集。