Hey everybody,

I want to make predictions with HTM on real world data.

I want to predict energy consumption. My dataset contains the datetime and temperature, as well as the consumption itself.

I am doing cross validation in order to compare the results with other models. So I have trainings and test sets. And I disable learning when I am doing the prediction on the test set.

But now I am facing some problems.

I ran a (large) swarm with the following result:

```
MODEL_PARAMS = \
{ 'aggregationInfo': { 'days': 0,
'fields': [],
'hours': 0,
'microseconds': 0,
'milliseconds': 0,
'minutes': 0,
'months': 0,
'seconds': 0,
'weeks': 0,
'years': 0},
'model': 'HTMPrediction',
'modelParams': { 'anomalyParams': { u'anomalyCacheRecords': None,
u'autoDetectThreshold': None,
u'autoDetectWaitRecords': None},
'clParams': { 'alpha': 0.01883125,
'regionName': 'SDRClassifierRegion',
'steps': '1',
'verbosity': 0},
'inferenceType': 'TemporalMultiStep',
'sensorParams': { 'encoders': { '_classifierInput': { 'classifierOnly': True,
'clipInput': True,
'fieldname': 'consumption',
'maxval': 617.76,
'minval': 0.0,
'n': 490,
'name': '_classifierInput',
'type': 'ScalarEncoder',
'w': 21},
u'consumption': None,
u'datetime_dayOfWeek': None,
u'datetime_timeOfDay': { 'fieldname': 'datetime',
'name': 'datetime',
'timeOfDay': ( 21,
1.21875),
'type': 'DateEncoder'},
u'datetime_weekend': None,
u'temperature': None},
'sensorAutoReset': None,
'verbosity': 0},
'spEnable': True,
'spParams': { 'boostStrength': 0.0,
'columnCount': 2048,
'globalInhibition': 1,
'inputWidth': 0,
'numActiveColumnsPerInhArea': 40,
'potentialPct': 0.8,
'seed': 1956,
'spVerbosity': 0,
'spatialImp': 'cpp',
'synPermActiveInc': 0.05,
'synPermConnected': 0.1,
'synPermInactiveDec': 0.043918750000000006},
'tmEnable': True,
'tmParams': { 'activationThreshold': 14,
'cellsPerColumn': 32,
'columnCount': 2048,
'globalDecay': 0.0,
'initialPerm': 0.21,
'inputWidth': 2048,
'maxAge': 0,
'maxSegmentsPerCell': 128,
'maxSynapsesPerSegment': 32,
'minThreshold': 10,
'newSynapseCount': 20,
'outputType': 'normal',
'pamLength': 3,
'permanenceDec': 0.1,
'permanenceInc': 0.1,
'seed': 1960,
'temporalImp': 'cpp',
'verbosity': 0},
'trainSPNetOnlyIfRequested': False},
'predictAheadTime': None,
'version': 1}
```

So now there are several things:

- When I just predict with this model Parameters i get the following result:

The HTM System is doing pretty much the naive prediction. But I thought it does not have the information of the consumption ( I mean they are not encoded). So how can the system know them?

- I want to add the temperature to the model, bc I know that there is a correlation of -0.9 between the consumption (which I want to predict) and the temperature. So in my understanding the temperature should be encoded, bc it has influence on the energy consumption.

So I ran another swarm to figure out the parameters for the temperature encoding.

My result was:

```
u'temperature': { 'clipInput': True,
'fieldname': 'temperature',
'maxval': 25.25,
'minval': -5.25,
'n': 387,
'name': 'temperature',
'type': 'ScalarEncoder',
'w': 21}},
```

And with a medium swarm I got the params for the consumption:

```
u'consumption': { 'clipInput': True,
'fieldname': 'consumption',
'maxval': 617.76,
'minval': 0.0,
'n': 521,
'name': 'consumption',
'type': 'ScalarEncoder',
'w': 21},
```

So what I have done, was just to add this to my model_params like this (just showing the sensor Params), while removing the timeOfDay:

```
'sensorParams': { 'encoders': { '_classifierInput': { 'classifierOnly': True,
'clipInput': True,
'fieldname': 'consumption',
'maxval': 617.76,
'minval': 0.0,
'n': 521,
'name': '_classifierInput',
'type': 'ScalarEncoder',
'w': 21},
u'consumption': { 'clipInput': True,
'fieldname': 'consumption',
'maxval': 617.76,
'minval': 0.0,
'n': 521,
'name': 'consumption',
'type': 'ScalarEncoder',
'w': 21},
u'datetime_dayOfWeek': None,
u'datetime_timeOfDay': None,
u'datetime_weekend': None,
u'temperature':{ 'clipInput': True,
'fieldname': 'temperature',
'maxval': 25.25,
'minval': -5.25,
'n': 387,
'name': 'temperature',
'type': 'ScalarEncoder',
'w': 21}},
'sensorAutoReset': None,
'verbosity': 0},
```

Ok so now to the second problem: I get super weird results:

This is in nearly every test set. So either I get the naive predition or just zeros all the time.

What can be reasons for such a behavior?

I really neeeed some help. +

Thank you all very much.

Helena