Matrix<T>.Aggregate Rows By Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
Aggregate | Returns a new matrix that aggregates the rows according to the specified grouping. |
Aggregate | Returns a new matrix that aggregates the rows according to the specified grouping. |
Aggregate | Returns a new matrix that aggregates the rows grouped by the specified row. |
Aggregate | Returns a new matrix that aggregates the rows grouped by the specified row. |
Aggregate | Returns a new matrix that aggregates the rows grouped by the specified vector. |
Aggregate | Applies the specified aggregation function to the values in each row grouped by the specified grouping row. |
AggregateRowsBy<C, TResult>(C, AggregatorGroup<TResult>)
Returns a new matrix that aggregates the rows grouped by the specified row.
public Matrix<TResult> AggregateRowsBy<C, TResult>(
C groupingRowKey,
AggregatorGroup<TResult> aggregator
)
Parameters
- groupingRowKey C
- The key of the grouping row.
- aggregator AggregatorGroup<TResult>
- The aggregator to apply to each group.
Type Parameters
- C
- The type of the row keys.
- TResult
- The type of the result of the aggregator.
Return Value
Matrix<TResult>A new matrix, with columns indexed by the unique elements of the row with key groupingRowKey, and values the result of applying aggregator to each group of the remaining rows.
AggregateRowsBy<TResult>(IGrouping, Aggregator<T, TResult>)
Returns a new matrix that aggregates the rows according to the specified grouping.
public Matrix<TResult> AggregateRowsBy<TResult>(
IGrouping grouping,
Aggregator<T, TResult> aggregator
)
Parameters
- grouping IGrouping
- The grouping object.
- aggregator Aggregator<T, TResult>
- The aggregator to apply to each group.
Type Parameters
- TResult
- The type of the result of the aggregator.
Return Value
Matrix<TResult>A new matrix, with columns indexed by the index associated with grouping, and as values the result of applying aggregator to each group of each row.
AggregateRowsBy<TResult>(IGrouping, AggregatorGroup<TResult>)
Returns a new matrix that aggregates the rows according to the specified grouping.
public Matrix<TResult> AggregateRowsBy<TResult>(
IGrouping grouping,
AggregatorGroup<TResult> aggregator
)
Parameters
- grouping IGrouping
- The grouping object.
- aggregator AggregatorGroup<TResult>
- The aggregator to apply to each group.
Type Parameters
- TResult
- The type of the result of the aggregator.
Return Value
Matrix<TResult>A new matrix, with columns indexed by the index associated with grouping, and as values the result of applying aggregator to each group of each row.
AggregateRowsBy<K, U>(IList<K>, AggregatorGroup<U>)
Returns a new matrix that aggregates the rows grouped by the specified vector.
public Matrix<U> AggregateRowsBy<K, U>(
IList<K> groupingVector,
AggregatorGroup<U> aggregator
)
Parameters
- groupingVector IList<K>
- The vector that contains the group memberships.
- aggregator AggregatorGroup<U>
- The aggregator to apply to each group.
Type Parameters
- K
- The element type of the grouping vector.
- U
- The type of the result of the aggregator.
Return Value
Matrix<U>A new matrix, with columns indexed by the unique elements of groupingVector, and as values the result of applying aggregator to each group of each row.
AggregateRowsBy<C>(C, TypePreservingAggregatorGroup)
Returns a new matrix that aggregates the rows grouped by the specified row.
public Matrix<T> AggregateRowsBy<C>(
C groupingRowKey,
TypePreservingAggregatorGroup aggregator
)
Parameters
- groupingRowKey C
- The key of the grouping row.
- aggregator TypePreservingAggregatorGroup
- The aggregator to apply to each group.
Type Parameters
- C
- The type of the row keys.
Return Value
Matrix<T>A new matrix, with columns indexed by the unique elements of the row with key groupingRowKey, and values the result of applying aggregator to each group of the remaining rows.
AggregateRowsBy<R, TResult>(R, Func<Vector<T>, TResult>)
Applies the specified aggregation function to the values
in each row grouped by the specified grouping row.
public Matrix<TResult> AggregateRowsBy<R, TResult>(
R groupingRowKey,
Func<Vector<T>, TResult> aggregator
)
Parameters
- groupingRowKey R
- The key of the grouping row.
- aggregator Func<Vector<T>, TResult>
- A function that transforms a vector of type T to a value of type TResult.
Type Parameters
- R
- The element type of the row index of the matrix.
- TResult
- The type of the result of the aggregation.
Return Value
Matrix<TResult>A new matrix with columns indexed by the unique elements of row groupingRowKey and values the result of aggregator applied to each grouping.