Skip to content

Commit cdf7a54

Browse files
committed
Added composer installation instructions
1 parent 760463e commit cdf7a54

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@
22
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.
33

44
- **Difficulty**: Easy
5-
- **Training time**: Seconds
6-
7-
## Requirements
8-
- [PHP](https://php.net) 7.2 or above
5+
- **Training time**: Less than a minute
96

107
## Installation
11-
Clone the repository locally using [Git](https://git-scm.com/):
8+
Clone the project locally using [Composer](https://getcomposer.org/):
129
```sh
13-
$ git clone https://github.com/RubixML/Iris
10+
$ composer create-project rubix/iris
1411
```
1512

16-
Install dependencies using [Composer](https://getcomposer.org/):
17-
```sh
18-
$ composer install
19-
```
13+
## Requirements
14+
- [PHP](https://php.net) 7.2 or above
2015

2116
## Tutorial
2217

@@ -80,13 +75,18 @@ $metric = new Accuracy();
8075

8176
$score = $metric->score($predictions, $testing->labels());
8277

83-
echo "Accuracy is $score" . PHP_EOL;
78+
echo 'Accuracy is ' . (string) ($score * 100.0) . '%' . PHP_EOL;
79+
```
80+
81+
Now you're ready to run the training script from the command line.
82+
```sh
83+
php train.php
8484
```
8585

8686
**Output**
8787

8888
```sh
89-
Accuracy is 0.9
89+
Accuracy is 90%
9090
```
9191

9292
### Next Steps

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@
2121
"php": ">=7.2",
2222
"rubix/ml": "^0.1.0-rc2"
2323
},
24+
"scripts": {
25+
"train": "@php train.php"
26+
},
2427
"config": {
2528
"preferred-install": "dist",
2629
"sort-packages": true
27-
}
30+
},
31+
"minimum-stability": "dev",
32+
"prefer-stable": true
2833
}

0 commit comments

Comments
 (0)