Skip to main content

BaseTransformer

Base class for transforming trading metrics.

Ancestors

  • abc.ABC

Descendants

  • systematica.portfolio.transformers.logistic.Logistic

Methods

transform

Transform metrics based on the selected transformation method. Parameters: Returns:

Reward

Computes a composite reward score. This class computes a reward score as a weighted sum of processed metrics. It uses a processor to transform the raw metrics and applies weights to each metric. The weight for ‘max_drawdown’ is inverted because a lower value is preferable. Method generated by attrs for class Reward.

Instance variables

  • transformer: systematica.portfolio.transformers.base.BaseTransformer: An instance of a transformer to process the metrics. If None, defaults to Logistic.
  • weights: Dict[str, float]: A dictionary mapping metric names to weights. Defaults to an empty dictionary.

Methods

run

Calculate the composite reward score. This method adjusts specific metrics (e.g., inverting ‘max_drawdown’), processes the metrics using the assigned processor, and computes a weighted sum of the processed metrics to derive a composite reward score. Parameters: Returns: