How to calcuate sum of each row for a dataset through MapReduce??
古いコメントを表示
I am working on a data clustering algorithm, I want row sum for each data set ID. I want the answer in the form of key, value.
3 件のコメント
Asif Iqbal
2017 年 6 月 7 日
data is your m*n matrix where i is your desired row number.
result= sum(data(i,:));
I hope this is what you wanted.
RJ
2017 年 6 月 9 日
回答 (2 件)
A. P. B.
2017 年 6 月 8 日
0 投票
If you have an N by M matrix; for P number of datasets
1) Read each data set
2)Calculate the sum and the val=sum(data(i,:));
But this gives only the value. Did not get what 'key' means in your query?
Usually 'min' or 'max' function which returns the minimum value or maximum value along a row returns the index value (column index) not the sum function.
Raikunta Aruna
2022 年 1 月 26 日
0 投票
How to find sum of row in a datset?
カテゴリ
ヘルプ センター および File Exchange で MapReduce についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!