def __init__(self, symbols, targetVariable, models=None):
        self.instrumentIds = symbols
        self.trainingDataSource = None
        self.validationDataSource = None
        self.testDataSource = None
        self.validationSplit = None
        self.targetVariable = None
        self.validationSplit = None
        self.targetVariable = None

        FeatureConfig.setupCustomFeatures(self.getCustomFeatures())
        self.__instrumentFeatureConfigs = {}
        instrumentFeatureConfigDicts = self.getInstrumentFeatureConfigDicts()
        for instrumentType in instrumentFeatureConfigDicts:
            if type(instrumentFeatureConfigDicts[instrumentType]) is list:
                self.__instrumentFeatureConfigs[instrumentType] = list(
                    map(lambda x: FeatureConfig(x),
                        instrumentFeatureConfigDicts[instrumentType]))
            elif type(instrumentFeatureConfigDicts[instrumentType]) is dict:
                self.__instrumentFeatureConfigs[instrumentType] = {
                    k: FeatureConfig(v)
                    for k, v in instrumentFeatureConfigDicts[instrumentType]
                }
            else:
                logError("Unknown type of instruments' feature config dicts")
示例#2
0
 def __init__(self):
     FeatureConfig.setupCustomFeatures(self.getCustomFeatures())
     self.__instrumentFeatureConfigs = {}
     instrumentFeatureConfigDicts = self.getInstrumentFeatureConfigDicts()
     for instrumentType in instrumentFeatureConfigDicts:
         self.__instrumentFeatureConfigs[instrumentType] = list(
             map(lambda x: FeatureConfig(x),
                 instrumentFeatureConfigDicts[instrumentType]))
     self.__marketFeatureConfigs = list(
         map(lambda x: FeatureConfig(x),
             self.getMarketFeatureConfigDicts()))