You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the error Unrecognized options "0, 1, 2" under "datasource.ok" when trying to initiate a new DataArray with the result of getData() being passed to its constructor.
$dataArr = newDataArray();
$classifier = newComplementNaiveBayes($dataArr);
$items = [
"hi my name is alex, what about you?" => 'ok',
"are you hungy? what about some fries?" => 'ok',
"how are you?" => 'ok',
"buy viagra or dope" => 'spam',
"viagra spam drugs sex" => 'spam',
"buy drugs and have fun" => 'spam'
];
foreach ($itemsas$text => $classification) {
$dataArr->addDocument($classification, $text);
}
$classifier->setDataSource($dataArr);
var_dump($classifier->classify('hi guy, how are you?')); //okvar_dump($classifier->classify('buy viagra?')); //spamvar_dump($classifier->classify('bannana for scale')); //false$export = $dataArr->getData();
var_dump($export); // error will happen here
I believe I am using this in the way it is intended, so I think this behavior is a bug.
The text was updated successfully, but these errors were encountered:
I get the error
Unrecognized options "0, 1, 2" under "datasource.ok"
when trying to initiate a newDataArray
with the result ofgetData()
being passed to its constructor.I believe I am using this in the way it is intended, so I think this behavior is a bug.
The text was updated successfully, but these errors were encountered: