MaTransformer

class zvt.factors.algorithm.MaTransformer(windows=None, cal_change_pct=False)

Bases: zvt.contract.factor.Transformer

__init__(windows=None, cal_change_pct=False) None
transform(input_df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame

input_df format:

                          col1    col2    col3    ...
entity_id    timestamp
                          1.2     0.5     0.3     ...
                          1.0     0.7     0.2     ...

the return result would change the columns and keep the format

Parameters

input_df

Returns

transform_one(entity_id, df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame

transform_one would not take effects if transform was implemented. Just show how to implement it here, most of time you should overwrite transform directly for performance.

Parameters
  • entity_id

  • df

Returns