Sanket, can you put your code online anywhere? How many rows of data
has the model seen when you try to get the anomaly score?

I notice that your input data does not include a timestamp, so NuPIC
is treating it like sequential input. That may be fine for you as long
as the time interval between each row is the same. But it may be
worthwhile to add timestamp if you think time-of-day or day-of-week is
relevant to the patterns in the data.


---------
Matt Taylor
OS Community Flag-Bearer
Numenta


On Fri, Nov 13, 2015 at 3:24 PM, Sanket Desai <[email protected]> wrote:
> 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
>
>
>
>

Reply via email to