Let's demonstrate basic use of Shark with very few lines of code.
This is C++, so we start with includes.
using namespace shark;
Let's load some data for learning.
The next step is to create a predictive model. Here we use a simple linear classifier.
The core step of learning is to train the model on data using a trainer.
In Shark, the trainer is not glued to the model. Instead it is a separate object.
Here, good old Linear Discriminant Analysis (LDA) suits our needs.
Congrats! We have a readily trained classifier.
Let's try it out by applying it to new data.
double error = loss(testdata.labels(), classifier(testdata.inputs()));