Skip to content

Commit 5cb9106

Browse files
committed
No more predict sample
1 parent 7a45981 commit 5cb9106

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

predict.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
use Rubix\ML\PersistentModel;
66
use Rubix\ML\Persisters\Filesystem;
7+
use Rubix\ML\Datasets\Unlabeled;
78

89
ini_set('memory_limit', '-1');
910

1011
$estimator = PersistentModel::load(new Filesystem('sentiment.rbx'));
1112

1213
while (empty($text)) $text = readline("Enter some text to analyze:\n");
1314

14-
$prediction = $estimator->predictSample([$text]);
15+
$dataset = new Unlabeled([
16+
[$text],
17+
]);
18+
19+
$prediction = current($estimator->predict($dataset));
1520

1621
echo "The sentiment is: $prediction" . PHP_EOL;

0 commit comments

Comments
 (0)