中位數絕對偏差 --> 匯出到表以進一步 tSNE各位,
我目前正在開發一個使用 57 個樣本和 >800 000 個變數的專案(請參閱附圖)。 現在我想透過僅使用中位數絕對偏差 (MAD) 最高的變數來減少變數。 目標是使用 PC Analysis 進一步處理數據,然後使用 t-SNE(我正在使用良好的 JMP 插件)。
到目前為止,我正在努力識別具有最高 MAD 的變量,並將這些變量直接匯出到資料表中。
先感謝,最誠摯的問候
拍
回覆:中位數絕對偏差 --> 匯出到表格進一步 tSNE多謝@tx尼爾森和@ian_jmp原則上你的建議有效。 不幸的是,我使用較慢的工作站進行測試,因此我無法處理所有變量,必須在更快的系統上檢查它。 祝一切順利,帕特
回覆:中位數絕對偏差 --> 匯出到表格進一步 tSNE我最初將“中位數”誤讀為“平均值”,並寫下了以下內容:在我的 Mac 上需要幾秒鐘,但幾乎所有時間都在製作範例表中:
NamesDefaultToHere(1);
// Make a table with 'nc' columns and 'nr' rows to use . . .
nc = 1000;
nr = 57;
dt = NewTable("MAD Example");
for(c=1, c<=nc, c++,
dt << NewColumn("Col "||Char(c), Numeric, Continuous, Formula(RandomNormal(0, 1)));
);
dt << addRows(nr);
dt << runFormulas;
// Start Here: Calculate MAD for each column . . .
dt = CurrentDataTable();
mat = dt << getAsMatrix;
// (1): Get the mean of each column in a row vector
mean = VMean(mat);
// (2): 'Explode' this to make a matrix congruant with 'mat'
meanMat = Repeat(mean, nr);
// (3): Get the Absolute deviations
AD = Abs(mat - meanMat);
// (4): Get the MAD
MAD = VMean(AD);
// Find the column numbers of the 'nc2' columns that have the biggest MAD values
nc2 = Round(nc/10, 0);
rankMAD = Rank(MAD);
topRandMAD = rankMAD[(nc-nc2)+1::nc];
// Make a second table
dt2 = NewTable("Top "||Char(nc2)||" Largest MAD Values from "||(dt << getName),
NewColumn("Column Number", Numeric, Nominal, Values(topRandMAD)),
NewColumn("MAD", Numeric, Continuous, Values(MAD[topRandMAD]))
);
另外@tx尼爾森方法中,我注意到分佈平台將給出中位數絕對偏差。 有了 80 萬個專欄,我可能會期望他的方法會更快。
回覆:中位數絕對偏差 --> 匯出到表格進一步 tSNE這是一個更完整的範例,您可以直接使用,只需更改對「dt」資料表的引用,以及輸出表中要刪除的列(即樣本 ID)
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
dt << select where(row()==1);
dtMAD = dt << Subset(
Selected Rows( 0 ),
Rows( [1] ),
Selected columns only( 0 )
);
dtMAD << delete columns({"Lot_id","wafer","Wafer id in lot ID","site"});
For( i = 1, i <= N Cols( dtMAD ), i++,
theMatrix = Column( dt, Column( dtMAD, i ) << get name ) << get as matrix;
Column( dtMAD, i )[1] = Quantile( .5, Abs( theMatrix - Quantile( .5, theMatrix ) ) );
);回覆:中位數絕對偏差 --> 匯出到表格進一步 tSNE這是產生 MAD 的簡單範例。我建議你把它變成一個函數,然後建立一個新的資料表,其中一行和> 800000列。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
theMatrix = Column( dt, "height" ) << get as matrix;
MAD = Quantile( .5, Abs( theMatrix - Quantile( .5, theMatrix ) ) );