- 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 0 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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);
更多回答(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 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!