Can someone explain to me how the classifier is trained and finally predicted? I have in mind the last two lines of code below. I can't understand how it is working.
I'm writing a thesis about ML and text classification and it is last one of my problems.
My answer on it is: In this point the classifier is training. It is first of steps to create a model of answers. We are taking the samples and assign labels for them.
It is true?
$split = new StratifiedRandomSplit($dataset, 0.2, 42);
$pipeline = new Pipeline([
new TokenCountVectorizer($tokenizer = new NGramTokenizer(1, 3), new Polish()),
new TfIdfTransformer()
], new SVC());
$pipeline->train($split->getTrainSamples(), $split->getTrainLabels());
$predicted = $pipeline->predict($split->getTestSamples());