Toolbox Breakdown: getFeatureConfigDicts  


Member Admin
Joined: 4 years ago
Posts: 27
14/01/2020 4:20 pm  

When we are working with historical data we often want to manipulate the data to improve our model performance. One way of doing this is to create new features. To optimise how features are calculated and speed up the running time of your code, the Auquan toolbox gets you to predefine features using feature configuration dictionaries.

There are two steps to this process:

  1. First, you need to decide if you want to use the feature as a market feature, or an instrument feature. Instrument features are calculated per instrument (for example position, fees, moving average of instrument price). The toolbox auto-loops through all instruments to calculate features for you. Market features are calculated for the whole trading system (for example portfolio value).
    • Instrument features get declared in the function: getInstrumentFeatureConfigDicts()
    • Market features get declared in the function: getMarketFeatureConfigDicts()
  2. Then you need to create one config dictionary per feature. Feature config dictionaries are defined with the following keys:

    • featureId: A string representing the feature you want to use

    • featureKey {optional}: A string representing the key to access the value of this feature. If not present, use featureId

    • params {optional}: A dictionary with which contains other parameters, if needed by the feature

Example: Creating a moving sum

 def getInstrumentFeatureConfigDicts(self):
        msDict = {'featureKey': 'ms_5',
                'featureId': 'moving_sum',
                'params': {'period': 5,
                'featureName': 'basis'}}
        return [msDict]

In order to help you quickly create features, the Auquan toolbox contains several common features predefined, for use in these dictionaries. To see the list, click here.

If you are a more advanced practitioner, you can create your own features to use in the config dicts. To see how, click here

This topic was modified 2 years ago 2 times by David


Please Login or Register