How to Increase Predictive Performance

Hi,

I’ve compared LSTM to HTM (results are listed below, ignore the HTM MAPE column, lower is better across all statistics) and I got consistently better results using LSTM. How can I improve the performance across each increasing timesteps? Keep in mind that my LSTM code trained a separate network specifically for each step while HTM just used the built in multiStepBestPredictions feature.

My LSTM code is here: https://github.com/JonnoFTW/traffic-prediction/blob/master/main.py

My HTM evaluation code is here: https://github.com/JonnoFTW/htm-models-adelaide/blob/master/engine/evaluate.py

My Model Params are as follows:

{   'aggregationInfo': {   'days': 0,
                           'fields': [],
                           'hours': 0,
                           'microseconds': 0,
                           'milliseconds': 0,
                           'minutes': 0,
                           'months': 0,
                           'seconds': 0,
                           'weeks': 0,
                           'years': 0},
    'model': 'CLA',
    'modelParams': {   'anomalyParams': {   u'anomalyCacheRecords': None,
                                            u'autoDetectThreshold': None,
                                            u'autoDetectWaitRecords': None},
                       'clEnable': True,
                       'clParams': {   'alpha': 0.050050000000000004,
                                       'clVerbosity': 0,
                                       'regionName': 'CLAClassifierRegion',
                                       'steps': '1,3,6,9,12'},
                       'inferenceType': 'TemporalAnomaly',
                       'sensorParams': {   'encoders': {   'downstream': {   'fieldname': 'downstream',
                                                                             'name': 'downstream',
                                                                             'resolution': 0.8,
                                                                             'type': 'RandomDistributedScalarEncoder',
                                                                             'w': 21},
                                                           'timestamp_dayOfWeek': {   'fieldname': 'timestamp',
                                                                                      'name': 'timestamp_dayOfWeek',
                                                                                      'timeOfDay': (   51,
                                                                                                       9.49),
                                                                                      'type': 'DateEncoder'},
                                                           'timestamp_timeOfDay': {   'fieldname': 'timestamp',
                                                                                      'name': 'timestamp_timeOfDay',
                                                                                      'timeOfDay': (   51,
                                                                                                       9.49),
                                                                                      'type': 'DateEncoder'},
                                                           'timestamp_weekend': {   'fieldname': 'timestamp',
                                                                                    'name': 'timestamp_weekend',
                                                                                    'type': 'DateEncoder',
                                                                                    'weekend': (   51,
                                                                                                   9)}},
                                           'sensorAutoReset': None,
                                           'verbosity': 0},
                       'spEnable': True,
                       'spParams': {   'columnCount': 2048,
                                       'globalInhibition': 1,
                                       'inputWidth': 0,
                                       'maxBoost': 2.0,
                                       'numActiveColumnsPerInhArea': 40,
                                       'potentialPct': 0.8,
                                       'seed': 1956,
                                       'spVerbosity': 0,
                                       'spatialImp': 'cpp',
                                       'synPermActiveInc': 0.05,
                                       'synPermConnected': 0.1,
                                       'synPermInactiveDec': 0.05015},
                       'tpEnable': True,
                       'tpParams': {   'activationThreshold': 14,
                                       'cellsPerColumn': 32,
                                       'columnCount': 2048,
                                       'globalDecay': 0.0,
                                       'initialPerm': 0.21,
                                       'inputWidth': 2048,
                                       'maxAge': 0,
                                       'maxSegmentsPerCell': 128,
                                       'maxSynapsesPerSegment': 32,
                                       'minThreshold': 11,
                                       'newSynapseCount': 20,
                                       'outputType': 'normal',
                                       'pamLength': 3,
                                       'permanenceDec': 0.1,
                                       'permanenceInc': 0.1,
                                       'seed': 1960,
                                       'temporalImp': 'cpp',
                                       'verbosity': 0},
                       'trainSPNetOnlyIfRequested': False},
    'predictAheadTime': None,
    'version': 1}
1 Like

Make sure your RDSE resolution makes sense, there is a simple calculation to do in order to get the best value if you know the min/max of your data.

You need to know the number of buckets you want to have in the encoder (that is your variable to set). Calculate the resolution with (max - min) / numBuckets.