diff --git a/.gitignore b/.gitignore index da6cd45..66856ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ /vendor composer.lock -progress.csv -embedding.csv report.json -predictions.json -probabilities.json -*.model +*.rbx *.old .vscode .vs \ No newline at end of file diff --git a/composer.json b/composer.json index 46821ed..eaac350 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/train.php b/train.php index ed231d2..407684f 100644 --- a/train.php +++ b/train.php @@ -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; diff --git a/validate.php b/validate.php index b9ee95c..95bbdea 100644 --- a/validate.php +++ b/validate.php @@ -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;