Skip to content

Commit

Permalink
Update to ML 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed May 8, 2021
1 parent 824db89 commit 582940e
Showing 4 changed files with 6 additions and 10 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/vendor
composer.lock
progress.csv
embedding.csv
report.json
predictions.json
probabilities.json
*.model
*.rbx
*.old
.vscode
.vs
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
}
],
"require": {
"php": ">=7.2",
"rubix/ml": "^0.3.0"
"php": ">=7.4",
"rubix/ml": "^1.0"
},
"scripts": {
"train": "@php train.php",
2 changes: 1 addition & 1 deletion train.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@

$dataset = Labeled::fromIterator(new CSV('train.csv', true));

$estimator = new PersistentModel(new NaiveBayes(2.0), new Filesystem('dota.model'));
$estimator = new PersistentModel(new NaiveBayes(), new Filesystem('dota.rbx'));

echo 'Training ...' . PHP_EOL;

4 changes: 2 additions & 2 deletions validate.php
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@

$dataset = Labeled::fromIterator(new CSV('test.csv', true));

$estimator = PersistentModel::load(new Filesystem('dota.model'));
$estimator = PersistentModel::load(new Filesystem('dota.rbx'));

echo 'Making predictions ...' . PHP_EOL;

@@ -31,6 +31,6 @@

echo $results;

$results->toJSON()->write('report.json');
$results->toJSON()->saveTo(new Filesystem('report.json'));

echo 'Report saved to report.json' . PHP_EOL;

0 comments on commit 582940e

Please sign in to comment.