From dab706b3b549fc69b945bbeca7c207752a796b41 Mon Sep 17 00:00:00 2001 From: Andrew DalPino Date: Thu, 18 Jun 2020 15:38:57 -0500 Subject: [PATCH] Added composer installation instructions --- README.md | 27 ++++++++++++++++----------- composer.json | 12 +++++++++++- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5a0ce86..a31453a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ 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 @@ -11,17 +17,6 @@ An example project that demonstrates the problem of human activity recognition ( - [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 @@ -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. @@ -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 diff --git a/composer.json b/composer.json index 3883051..9d4ef1c 100644 --- a/composer.json +++ b/composer.json @@ -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", @@ -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 }