From cdf7a54678623c85b38feadd89b00eaa87d096d4 Mon Sep 17 00:00:00 2001 From: Andrew DalPino Date: Thu, 18 Jun 2020 15:23:07 -0500 Subject: [PATCH] Added composer installation instructions --- README.md | 24 ++++++++++++------------ composer.json | 7 ++++++- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 69ab99e..44d2b5c 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,16 @@ A lightweight introduction to machine learning in Rubix ML using the famous [Iris dataset](https://en.wikipedia.org/wiki/Iris_flower_data_set) and the K Nearest Neighbors algorithm. By the end of this tutorial, you'll know how to structure a project, instantiate a learner, and train it to make predictions on some test data. - **Difficulty**: Easy -- **Training time**: Seconds - -## Requirements -- [PHP](https://php.net) 7.2 or above +- **Training time**: Less than a minute ## Installation -Clone the repository locally using [Git](https://git-scm.com/): +Clone the project locally using [Composer](https://getcomposer.org/): ```sh -$ git clone https://github.com/RubixML/Iris +$ composer create-project rubix/iris ``` -Install dependencies using [Composer](https://getcomposer.org/): -```sh -$ composer install -``` +## Requirements +- [PHP](https://php.net) 7.2 or above ## Tutorial @@ -80,13 +75,18 @@ $metric = new Accuracy(); $score = $metric->score($predictions, $testing->labels()); -echo "Accuracy is $score" . PHP_EOL; +echo 'Accuracy is ' . (string) ($score * 100.0) . '%' . PHP_EOL; +``` + +Now you're ready to run the training script from the command line. +```sh +php train.php ``` **Output** ```sh -Accuracy is 0.9 +Accuracy is 90% ``` ### Next Steps diff --git a/composer.json b/composer.json index 4a7ed1a..7812875 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,13 @@ "php": ">=7.2", "rubix/ml": "^0.1.0-rc2" }, + "scripts": { + "train": "@php train.php" + }, "config": { "preferred-install": "dist", "sort-packages": true - } + }, + "minimum-stability": "dev", + "prefer-stable": true }