Hi Nupic,
I have been trying to use Temporal Anomaly Detection for my csv dataset. I have
been following the hot-gym tutorial and after swarming, I am able to generate
predictions. But when I tried to use same dataset for anomaly detection, the
anomalies are being printed as “None”.
These are the steps I followed:
- Changed result.inferences["multiStepBestPredictions"][1] to
result.inferences["anomalyScore”].
- Changed inferenceType in model params to ‘TemporalAnomaly’.
I am copying my model_params file as well.
MODEL_PARAMS = \
{ '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},
'clParams': { 'alpha': 0.050050000000000004,
'clVerbosity': 0,
'regionName': 'CLAClassifierRegion',
'steps': '1'},
'inferenceType': 'TemporalAnomaly',
'sensorParams': { 'encoders': { '_classifierInput': {
'classifierOnly': True,
'fieldname': 'class',
'n':
121,
'name': '_classifierInput',
'type': 'SDRCategoryEncoder',
'w':
21},
u'class': { 'fieldname':
'class',
'n': 121,
'name': 'class',
'type':
'SDRCategoryEncoder',
'w': 21},
u'dst_bytes': None,
u'duration': None,
u'flag': None,
u'protocol_type': None,
u'service': None,
u'src_bytes': None},
'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}
----------------------------------------------------------------------------------------------------------------------
I have total 150K records in the CSV file. I am also attaching a small subset
of the dataset, if it can help to resolve this.
duration,protocol_type,service,flag,src_bytes,dst_bytes,class
int,string,string,string,int,int,string
,,,,,,
0,tcp,ftp_data,SF,491,0,normal
0,udp,other,SF,146,0,normal
0,tcp,private,S0,0,0,neptune
0,tcp,http,SF,232,8153,normal
0,tcp,http,SF,199,420,normal
0,tcp,private,REJ,0,0,neptune
0,tcp,private,S0,0,0,neptune
0,tcp,private,S0,0,0,neptune
0,tcp,remote_job,S0,0,0,neptune
0,tcp,private,S0,0,0,neptune
It will be great if someone can help me on this.
Thanks,
Sanket