How to calcuate sum of each row for a dataset through MapReduce??

4 ビュー (過去 30 日間)
RJ
RJ 2017 年 6 月 7 日
回答済み: Raikunta Aruna 2022 年 1 月 26 日
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 件のコメント
Guillaume
Guillaume 2017 年 6 月 8 日
編集済み: Guillaume 2017 年 6 月 8 日
@Rahul,
Please provide an example of your dataset (with explanation of what each column is, particularly which one is the ID), and explain what you mean by row sum.
How big is your dataset that you need to use mapreduce?
RJ
RJ 2017 年 6 月 9 日
Dataset contains 10K rows and 5 columns, first one is ID. So I want column sum for five columns and rowsum for each row in 10K rows. Thank you for your earlier answer.

サインインしてコメントする。

回答 (2 件)

A. P. B.
A. P. B. 2017 年 6 月 8 日
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.
  1 件のコメント
RJ
RJ 2017 年 6 月 9 日
So how to perform sum of columns for a particular row and here Key is ID associated with each data series.

サインインしてコメントする。


Raikunta Aruna
Raikunta Aruna 2022 年 1 月 26 日
How to find sum of row in a datset?

カテゴリ

Help Center および File ExchangeMapReduce についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by