# Anomaly detection from multiple variable

**URL:** <https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670>\
**Category:** NuPIC\
**Tags:** question\
**Created:** [August 11, 2017, 2:15am UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670 "2017-08-11T02:15:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![z-wony](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/z-wony/32/1504_2.png) [@z-wony](https://discourse.numenta.org/u/z-wony)\
**Post date:** [August 11, 2017, 2:15am UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670/1 "2017-08-11T02:15:26Z")

</div>

Hi.

I’m checking feasibility of nupic to use my some solution.  
So, actually I’m not familar with HTM yet. (hope to familiar soon : ))  
I’d like to request to expert’s advices.

I wonder about anomaly detection from stream.  
Does ‘nupic’ can find anomaly from multiple column(= multi variable)?  
(Not ‘multiple variable to multiple anomaly score’.  
I means extract just 1 anomly score column from multiple column)

Is it possible?  
If it possible, which class should I refer?  
Or, which sample code should I refer?

Could you help me?  
Please~~

---

<div class="post-metadata">

**Author:** ![sheiser1](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/sheiser1/32/766_2.png) [@sheiser1](https://discourse.numenta.org/u/sheiser1)\
**Post date:** [August 11, 2017, 4:38am UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670/2 "2017-08-11T04:38:06Z")

</div>

Hi @z-wony,

Nupic will give you one anomaly score from a multi-field data stream yes. I think downloading nupic and looking at the one hot gym example is a good place to start. In that instance nupic is being fed 2 fields, one for energy consumption and one for time. There is a really good video on youtube that walks you through this example:

You can theoretically add as many fields as you want, simply by adding them to the model parameters file. It is recommended to try and limit the number of fields as much as possible though, certainly no more than 5 per model. If you have many fields you can make numerous nupic models with several fields each, or one model per field.

Finally there is a process within nupic called ‘swarming’, where nupic looks for which of the possible fields are most helpful to predicting the ‘predicted’ field that you specify. If you want to share what your data looks like (first few lines to get a sense) that can help to advise you. Best of luck

---

<div class="post-metadata">

**Author:** ![sheiser1](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/sheiser1/32/766_2.png) [@sheiser1](https://discourse.numenta.org/u/sheiser1)\
**Post date:** [August 11, 2017, 5:04am UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670/3 "2017-08-11T05:04:57Z")

</div>

This video actually precedes that one. It goes over getting nupic running from the ground up, so it may be a better place to start if you have a bit more time:

---

<div class="post-metadata">

**Author:** ![z-wony](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/z-wony/32/1504_2.png) [@z-wony](https://discourse.numenta.org/u/z-wony)\
**Post date:** [August 11, 2017, 8:30am UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670/4 "2017-08-11T08:30:29Z")

</div>

I’d like to thank you verrrrrrrrry much!  
I will study and try it as your recommend.  
Thank you again!

---

<div class="post-metadata">

**Author:** ![sheiser1](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/sheiser1/32/766_2.png) [@sheiser1](https://discourse.numenta.org/u/sheiser1)\
**Post date:** [August 11, 2017, 11:42am UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670/5 "2017-08-11T11:42:49Z")

</div>

You’re welcome certainly, I hope you get good results there

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [August 11, 2017, 3:11pm UTC](https://discourse.numenta.org/t/anomaly-detection-from-multiple-variable/2670/6 "2017-08-11T15:11:16Z")

</div>

> [@z-wony](#):
>
> I will study and try it as your recommend.

Remember that there have been some breaking changes in NuPIC since then, so the code I wrote in that video will not work if you’re using recent versions of NuPIC. See:

> [@WARNING: 0.7.0 breaking changes](https://discourse.numenta.org/t/warning-0-7-0-breaking-changes/2200):
>
> We will be making a number of breaking changes with 0.7, because we are prepping for a 1.0 release this year, and we have code that needs major refactoring, which will affect serialization, API usage, and parameter names. This is a necessary growing pain NuPIC needs to move forward. How to upgrade: Find / replace in your codebase: tpParams ==\> tmParams tpEnable ==\> tmEnable How to upgrade: Find / replace in your codebase: CLAModel ==\> HTMPredictionModel clamodel ==\> htmpredi…
