chemicalchecker.util.aggregate.aggregate.Aggregate

class Aggregate(method, input_type)[source]

Bases: object

Aggregate class.

Aggregate samples.

Initialize a Aggregate instance.

Parameters:
  • method (str) – The aggregation method to be used. Must be one of: -first: The first occurrence of the signature is kept. -last: The last occurrence of the signature is kept. -average: The average of the signature is kept.

  • input_type (str) – One of ‘pairs’ or ‘matrix’.

Methods

transform

Do the aggregation.

transform(V, keys, keys_raw)[source]

Do the aggregation.

Parameters:
  • V (matrix) – The signatures matrix.

  • keys (array) – The keys.

  • keys_raw (array) – The raw keys (default=None).

Returns a (V, keys, keys_raw) tuple.