How to store trained data with MongoDB?

I’m discovering Machine Learning and I don’t know how to store my trained data so I don’t have to train them again.

I’m on php, with Symfony 3.4, using the php-ai/php-ml library.

I’ve already seen how to train my data and how to use MongoDB for “non-trained” data.

(Right now I’m using the Iris csv file given within the php-ml library.)

// (...) load dataset
// $labels is an array with each possible $label
//a classifier of type MultiLayer Perceptron (MLP)
$mlp = new MLPClassifier(4, [2], $labels);
$mlp->train(
    $samples = $dataset->getSamples(),
    $targets = $dataset->getTargets()
);

// $guess = testing data
$predict = $mlp->predict($guess);
//dump it so we can see the result
dump($predict);

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *