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 d4c918a commit 1387429
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/vendor
composer.lock
report.json
*.model
.vscode
.vs
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
Use the [K Nearest Neighbors](https://docs.rubixml.com/en/latest/classifiers/k-nearest-neighbors.html) algorithm to predict who of your friends will stay married or get a divorce based on their answers to a 54 question survey about their partner. Included in this project is a 171 sample human-annotated dataset that we'll use to train the learner.

- **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/Divorce
$ composer create-project rubix/divorce
```

Install dependencies using [Composer](https://getcomposer.org/):
```sh
$ composer install
```
## Requirements
- [PHP](https://php.net) 7.2 or above

## Tutorial

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
}
6 changes: 5 additions & 1 deletion train.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

echo 'Making predictions ...' . PHP_EOL;

$predictions = $estimator->predict($testing);
$predictions = $estimator->predict($testing->randomize());

echo 'Example predictions:' . PHP_EOL;

print_r(array_slice($predictions, 0, 3));

$metric = new Accuracy();

Expand Down

0 comments on commit 1387429

Please sign in to comment.