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 3d98c69 commit dab706b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@ An example project that demonstrates the problem of human activity recognition (
- **Difficulty**: Medium
- **Training time**: Minutes

## Installation
Clone the project locally using [Composer](https://getcomposer.org/):
```sh
$ composer create-project rubix/har
```

## Requirements
- [PHP](https://php.net) 7.2 or above

#### Recommended
- [Tensor extension](https://github.com/RubixML/Tensor) for faster training and inference
- 1G of system memory or more

## Installation
Clone the repository locally using [Git](https://git-scm.com/):
```sh
$ git clone https://github.com/RubixML/HAR
```

Install dependencies using [Composer](https://getcomposer.org/):
```sh
$ composer install
```

## Tutorial

### Introduction
Expand Down Expand Up @@ -107,6 +102,11 @@ Since we wrapped the estimator in a Persistent Model wrapper, we can save the mo
$estimator->save();
```

To run the training script, call it from the command line like this.
```sh
$ php train.php
```

### Cross Validation
The authors of the dataset provide an additional 2,947 labeled testing samples that we'll use to test the model. We've held these samples out until now because we wanted to be able to test the model on samples it has never seen before. Start by extracting the testing samples and ground-truth labels from the `test.ndjson` file.

Expand Down Expand Up @@ -156,6 +156,11 @@ Now, generate the report using the predictions and labels from the testing set.
$results = $report->generate($predictions, $dataset->labels());
```

To execute the validation script, enter the following command at the command prompt.
```php
$ php validate.php
```

The output of the report should look something like the output below. Nice work! As you can see, our estimator is about 97% accurate and has very good specificity and negative predictive value.

```json
Expand Down
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Recognize one of six human activities such as standing, sitting, and walking using a Softmax Classifier trained on mobile phone sensor data.",
"homepage": "https://github.com/RubixML/HAR",
"license": "Apache-2.0",
"readme": "README.md",
"keywords": [
"classification", "classifier", "cross validation", "dataset", "data science",
"dimensionality reduction", "example project", "har", "human activity recognition",
Expand All @@ -23,8 +24,17 @@
"league/csv": "^9.5",
"rubix/ml": "^0.1.0-rc2"
},
"suggest": {
"ext-tensor": "For faster training and inference"
},
"scripts": {
"train": "@php train.php",
"test": "@php validate.php"
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}

0 comments on commit dab706b

Please sign in to comment.