Skip to content

Commit

Permalink
Added composer installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed Jun 18, 2020
1 parent 760463e commit cdf7a54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit cdf7a54

Please sign in to comment.