- the value is equal to the maximum
- the value is 1 less than the maximum
Assign a set of weights to digits
1 回表示 (過去 30 日間)
古いコメントを表示
Good afternoon, everyone. Unfortunately, from time to time I block.
Here's the thing.
I have a set of digits where I have calculated how often each one appears.
Example,
Digit 1, appears 4x, digits 2 and 3 appear 1x, digit 4 appears 2x, and digits 5,6,7,8,9 appear 0 times. This in a matrix of values defined by 554 rows and 9 columns.
What I wanted was to assign a weight to each frequency for each row.
Example, the higher the frequency the lower the weight. In the example I gave, digit 1 would have a weight of 1, digits 2 and 3 would have a weight of 3, digit 4 would have a weight of 2, and the remaining digits would have a weight of 4. This for each row.
Can anyone help me? In the previous question I didn't answer earlier because I was sick.
1 2 3 4 5 6 7 8 9 - - - - - - -> this is the digits
4 1 1 2 0 0 0 0 0
3 1 1 2 0 0 1 0 0
1 5 1 0 0 1 0 0 0
5 3 0 0 0 0 0 0 0
3 2 1 0 0 0 0 1 1
3 2 1 1 0 0 0 1 0
3 2 0 1 0 0 1 1 0
4 2 0 0 0 1 0 1 0
2 3 1 0 2 0 0 0 0
2 1 2 1 1 0 0 1 0
2 2 1 0 1 1 0 0 1
2 4 0 0 1 0 0 1 0
3 2 1 1 0 0 1 0 0
4 1 1 0 0 0 1 1 0
4 2 1 0 0 1 0 0 0
5 0 2 0 0 0 1 0 0
2 2 2 0 1 0 1 0 0
3 4 0 0 0 0 1 0 0
2 4 0 0 0 0 0 2 0
5 0 2 0 0 0 1 0 0
5 2 1 0 0 0 0 0 0
4 1 1 1 0 0 1 0 0
3 2 1 0 0 1 0 0 1
5 0 2 0 0 0 1 0 0
2 3 2 0 0 0 0 1 0
4 2 0 0 0 0 1 1 0
2 0 4 1 0 0 0 1 0
3 3 0 0 0 0 1 1 0
5 0 2 0 0 0 1 0 0
4 1 2 0 0 0 0 0 1
5 2 0 0 0 0 1 0 0
5 0 2 0 0 0 1 0 0
5 2 1 0 0 0 0 0 0
4 2 1 0 0 0 1 0 0
5 0 2 0 0 0 1 0 0
3 3 1 1 0 0 0 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0 0
2 2 1 2 0 0 0 0 1
2 1 1 1 0 0 1 2 0
4 0 1 2 1 0 0 0 0
2 2 3 0 1 0 0 0 0
0 2 3 0 0 1 2 0 0
2 2 1 0 0 0 3 0 0
The above figures already reflect the frequency with which they occur..
2 件のコメント
the cyclist
2023 年 3 月 2 日
It seems strange to me that if your input row is
in = [4 3 3 3 3 3 3 4 4]
that your output row would be
out = [1 1 1 1 1 1 1 1 1];
The weight is equal to 1 in two different cases:
You really don't need to distinguish between those two cases?
Voss
2023 年 3 月 2 日
If I'm interpreting the original question correctly, the output for
in = [4 3 3 3 3 3 3 4 4]
would be
out = [1 2 2 2 2 2 2 1 1]
採用された回答
Voss
2023 年 3 月 2 日
load('counts.mat')
disp(counts);
[mm,nn] = size(counts);
weights = zeros(mm,nn);
for kk = 1:mm
[~,ii,jj] = unique(counts(kk,:));
weights(kk,:) = numel(ii)-jj+1;
end
disp(weights);
2 件のコメント
その他の回答 (1 件)
the cyclist
2023 年 3 月 2 日
編集済み: the cyclist
2023 年 3 月 2 日
% Abbreviated example input
M = [4 1 1 2 0 0 0 0 0
3 1 1 2 0 0 1 0 0
1 5 1 0 0 1 0 0 0];
% If you want the weight of each element to be the difference from the row
% maximum
W1 = max(M,[],2) - M
% If you want the weight of each element to be the difference from the row
% maximum, except you want 1 for actual max (which is what you described)
W2 = max(M,[],2) - M + (M==max(M,[],2))
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!