Skip to content

Commit

Permalink
Add performance test for LeastSquares (#263)
Browse files Browse the repository at this point in the history
* Install phpbench 🚀

* Add first benchmark for LeastSquares

* Update README and CONTRIBUTING guide

* Fix typo
  • Loading branch information
akondas authored Mar 10, 2018
1 parent af2d732 commit a36fe08
Show file tree
Hide file tree
Showing 10 changed files with 526 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
.php_cs.cache
/build
/tests/Performance/Data/*.csv
24 changes: 20 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,52 @@ code base clean, unified and future proof.

You should only open pull requests against the `master` branch.

## Unit-Tests
## Unit Tests

Please try to add a test for your pull-request. You can run the unit-tests by calling:

```bash
vendor/bin/phpunit
```

## Performance Tests

Before first run bootstrap script will download all necessary datasets from public repository `php-ai/php-ml-datasets`.

Time performance tests:

```bash
vendor/bin/phpbench run --report=time
```

Memory performance tests:

```bash
vendor/bin/phpbench run --report=memory
```

## Travis

GitHub automatically run your pull request through Travis CI.
If you break the tests, I cannot merge your code, so please make sure that your code is working before opening up a Pull-Request.

## Merge

Please allow me time to review your pull requests. I will give my best to review everything as fast as possible, but cannot always live up to my own expectations.
Please give me time to review your pull requests. I will give my best to review everything as fast as possible, but cannot always live up to my own expectations.

## Coding Standards & Static Analysis

When contributing code to PHP-ML, you must follow its coding standards. To do that, just run:

```bash
vendor/bin/ecs check src tests --fix
composer fix-cs
```
[More about EasyCodingStandard](https://github.com/Symplify/EasyCodingStandard)

Code has to also pass static analysis by [PHPStan](https://github.com/phpstan/phpstan):

```bash
vendor/bin/phpstan.phar analyse src tests --level max --configuration phpstan.neon
composer phpstan
```


Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
[![Coverage Status](https://coveralls.io/repos/github/php-ai/php-ml/badge.svg?branch=master)](https://coveralls.io/github/php-ai/php-ml?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/php-ai/php-ml/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/php-ai/php-ml/?branch=master)

<a href="http://www.yegor256.com/2016/10/23/award-2017.html">
<img src="http://www.yegor256.com/images/award/2017/winner-itcraftsmanpl.png"
style="width:203px;height:45px;"/></a>

![PHP-ML - Machine Learning library for PHP](docs/assets/php-ml-logo.png)
<p align="center">
<img src="https://github.com/php-ai/php-ml/blob/master/docs/assets/php-ml-logo.png" />
</p>

Fresh approach to Machine Learning in PHP. Algorithms, Cross Validation, Neural Network, Preprocessing, Feature Extraction and much more in one library.

Expand All @@ -35,6 +33,11 @@ echo $classifier->predict([3, 2]);
// return 'b'
```

## Awards

<a href="http://www.yegor256.com/2016/10/23/award-2017.html">
<img src="http://www.yegor256.com/images/award/2017/winner-itcraftsmanpl.png" width="400"/></a>

## Documentation

To find out how to use PHP-ML follow [Documentation](http://php-ml.readthedocs.org/).
Expand All @@ -51,6 +54,10 @@ composer require php-ai/php-ml

Example scripts are available in a separate repository [php-ai/php-ml-examples](https://github.com/php-ai/php-ml-examples).

## Datasets

Public datasets are available in a separate repository [php-ai/php-ml-datasets](https://github.com/php-ai/php-ml-datasets).

## Features

* Association rule learning
Expand Down Expand Up @@ -120,6 +127,7 @@ Example scripts are available in a separate repository [php-ai/php-ml-examples](

## Contribute

- [Guide: CONTRIBUTING.md](https://github.com/php-ai/php-ml/blob/master/CONTRIBUTING.md)
- [Issue Tracker: github.com/php-ai/php-ml](https://github.com/php-ai/php-ml/issues)
- [Source Code: github.com/php-ai/php-ml](https://github.com/php-ai/php-ml)

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"php": "^7.1"
},
"require-dev": {
"phpbench/phpbench": "^0.14.0",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpstan/phpstan-shim": "^0.9",
"phpstan/phpstan-strict-rules": "^0.9.0",
Expand Down
Loading

0 comments on commit a36fe08

Please sign in to comment.