Machine learning on arduino

If I want to train a model on Arduino, do I need to buy a specific item and insert it into my nanoboard, or will the library be enough?
also, does any one have knowledge with training a model in the arduino? any sources?
i need to train the model to recognize the different brain signal using TGAM neurosky sensor

This remarkably complete tutorial is an excellent overview on machine learning, and will run on any Arduino.

It won't help with training a model to recognize a brain signal (you will need access to larger computers for that), but it will help understand the entire process.

I saw this article.
About my first question, do I need to buy an item? or the library will be enough.

For that tutorial you need an Arduino, but with a few minor modifications, like replacing Serial.print() with printf(), the code will run on any computer with a C compiler.