Returns a new matrix that aggregates the rows grouped by the specified vector.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public Matrix<U> AggregateRowsBy<K, U>(
IList<K> groupingVector,
AggregatorGroup<U> aggregator
)
Public Function AggregateRowsBy(Of K, U) (
groupingVector As IList(Of K),
aggregator As AggregatorGroup(Of U)
) As Matrix(Of U)
public:
generic<typename K, typename U>
Matrix<U>^ AggregateRowsBy(
IList<K>^ groupingVector,
AggregatorGroup<U>^ aggregator
)
member AggregateRowsBy :
groupingVector : IList<'K> *
aggregator : AggregatorGroup<'U> -> Matrix<'U>
Parameters
- groupingVector
- Type: System.Collections.GenericIListK
The vector that contains the group memberships. - aggregator
- Type: Extreme.DataAnalysisAggregatorGroupU
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
Type:
MatrixUA 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.
Reference