Skip to content

Commit 30997eb

Browse files
committed
Added composer installation instructions
1 parent 7bfe4a3 commit 30997eb

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ The K Means algorithm is a popular unsupervised learner for clustering samples.
44
- **Difficulty**: Easy
55
- **Training time**: Less than a minute
66

7-
## Requirements
8-
- [PHP](https://php.net) 7.2 or above
9-
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/Colors
10+
$ composer create-project rubix/colors
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

@@ -34,15 +29,15 @@ use Rubix\ML\Datasets\Generators\Blob;
3429

3530
$generator = new Agglomerate([
3631
'red' => new Blob([255, 0, 0], 20.0),
37-
'orange' => new Blob([255, 128, 0], 20.0),
38-
'yellow' => new Blob([255, 255, 0], 20.0),
32+
'orange' => new Blob([255, 128, 0], 10.0),
33+
'yellow' => new Blob([255, 255, 0], 10.0),
3934
'green' => new Blob([0, 128, 0], 20.0),
4035
'blue' => new Blob([0, 0, 255], 20.0),
41-
'aqua' => new Blob([0, 255, 255], 20.0),
42-
'purple' => new Blob([128, 0, 255], 20.0),
43-
'pink' => new Blob([255, 0, 255], 20.0),
44-
'magenta' => new Blob([255, 0, 128], 20.0),
45-
'black' => new Blob([0, 0, 0], 20.0),
36+
'aqua' => new Blob([0, 255, 255], 10.0),
37+
'purple' => new Blob([128, 0, 255], 10.0),
38+
'pink' => new Blob([255, 0, 255], 10.0),
39+
'magenta' => new Blob([255, 0, 128], 10.0),
40+
'black' => new Blob([0, 0, 0], 10.0),
4641
]);
4742
```
4843

@@ -101,6 +96,11 @@ $report = new ContingencyTable();
10196
$results = $report->generate($predictions, $testing->labels());
10297
```
10398

99+
Now we're ready to run the training and validation script from the command line.
100+
```php
101+
$ php train.php
102+
```
103+
104104
Here is an excerpt of the Contingency Report. You'll notice a misclustered magenta point within the red cluster. Not bad, nice work!
105105

106106
```json

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
"league/csv": "^9.5",
2424
"rubix/ml": "^0.1.0-rc3"
2525
},
26+
"scripts": {
27+
"train": "@php train.php"
28+
},
2629
"config": {
2730
"preferred-install": "dist",
2831
"sort-packages": true
29-
}
32+
},
33+
"minimum-stability": "dev",
34+
"prefer-stable": true
3035
}

0 commit comments

Comments
 (0)