0
$\begingroup$

I'm not sure if it's the best place to ask this, as it's completely layman problem, but here we go. I've got a 2D data matrix, with var 1(lets call it rows) and var 2 (columns) and binary values only, where 1's count as valuable and 0's not really. From this data I need to extract the most valuable subset (mostly 1s left), in a way that favors the conservation of the rows. In other words I want to remove some (max 25%) rows and some (up to 75%) columns in a manner that leaves me with best-fitted combination. I was thinking about something like this:

  1. Calculate mean for every row and every column
  2. Calculate mean of means for rows and columns
  3. For every row and column subtract the mean from mean of means
  4. Plot the distribution
  5. Remove "the worst" rows and columns

However this seems very crude, and may lead to unnecessary loss of information. So I'd be grateful for any hints.

$\endgroup$
0
$\begingroup$

Calculating the mean of each row or column is unnecessary. Firstly, to get the means you are dividing every row by the same value (the number of columns) and every column would be divided by the same value (the number of rows). So the mean of a particular column will tell you whether that column has more or less 1's than other columns, however the column total (before dividing) gave you that same information. Secondly, by dividing we have lost the information that tells us the relationship between the number of rows versus the number of columns. If you were to remove the lowest column or row based simply on the mean value, then the actual number of 1's removed would be quite different for rows and columns if, in fact, the number of rows and columns are very different.

In other words... it would be better to merely leave the row and column totals alone (i.e., don't divide). If you remove a row or a column, you know exactly how many 1's are removed from the entire system (by looking at the sum of the removed row or column). So then you must decide on an appropriate trade-off between removing rows and columns (you indicated that you would rather remove a column than a row) and then proceed accordingly. Of course, as you remove rows and columns, the column/row totals will change which can affect your optimal removal strategy.

$\endgroup$
  • $\begingroup$ Thanks for the tip, the mean indeed seems less than necessary. $\endgroup$ – kopiks Feb 25 '17 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.