Commit Graph

424 Commits

Author SHA1 Message Date
Yuji Uchiyama
add00c6108 Fix apriori keys (#238)
* Add test to check keys of rules

* Reindex after array_filter/array_unique in Apriori
2018-02-22 17:02:55 +01:00
Arkadiusz Kondas
8aed3b9286
Prepare CHANGELOG for next fix release 2018-02-18 00:11:54 +01:00
Arkadiusz Kondas
0a15561352
Fix KMeans and EigenvalueDecomposition (#235)
* Fix kmeans cluster and eigenvalue decomposition

* Fix kmeans space

* Fix code style
2018-02-18 00:09:24 +01:00
Arkadiusz Kondas
797952e1bc
Prepare CHANGELOG.md for next release 2018-02-16 20:41:37 +01:00
Arkadiusz Kondas
16dc16b0d9
Add phpstan strict rules (#233)
* Add phpstan strict rules

* Fix travis coveralls

* Add phpstan-phpunit strict rules

* Fix eigen decomposition test name and phpstan ingored error
2018-02-16 07:25:24 +01:00
Marcin Michalski
6ac61a860c Fix 'toSmall' typo (#234) 2018-02-15 18:14:06 +01:00
Arkadiusz Kondas
451f84c2e6 Add SelectKBest docs 2018-02-14 20:34:53 +01:00
Arkadiusz Kondas
83b1d7c9ac Update coveralls phar 2018-02-14 20:34:53 +01:00
Arkadiusz Kondas
b4b190de7f Fix pipeline transformers 2018-02-14 20:34:53 +01:00
Arkadiusz Kondas
998879b6fc Switch SelectKBest constructor parameters 2018-02-14 20:34:53 +01:00
Arkadiusz Kondas
9e5b3a0c69 Implement first regression scoring function UnivariateLinearRegression 2018-02-14 20:34:53 +01:00
Arkadiusz Kondas
fbf84ca95f Implement SelectKBest algo for feature selection 2018-02-14 20:34:53 +01:00
Arkadiusz Kondas
52c9ba8291
Fix: phpunit include tests path (#230)
* Fix phpunit include path

* Add tests for Covariance
2018-02-11 18:17:50 +01:00
Yuji Uchiyama
53f8a89556 Fix support of a rule in Apriori (#229)
* Clean up test code

* Add test to check support and confidence (failed due to a bug)

* Fix support value of rules
2018-02-11 12:42:46 +01:00
Arkadiusz Kondas
3ba35918a3
Implement VarianceThreshold - simple baseline approach to feature selection. (#228)
* Add sum of squares deviations

* Calculate population variance

* Add VarianceThreshold - feature selection transformer

* Add docs about VarianceThreshold

* Add missing code for pipeline usage
2018-02-10 18:07:09 +01:00
Andreas Möller
4b5d57fd6f Enhancement: Flatten directory structure (#220) 2018-02-10 12:08:58 +01:00
Yuji Uchiyama
71cc633c8e Fix apriori generates an empty array as a part of the frequent item sets (#224) 2018-02-07 10:02:38 +01:00
Yuji Uchiyama
ec091b5ea3 Support probability estimation in SVC (#218)
* Add test for svm model with probability estimation

* Extract buildPredictCommand method

* Fix test to use PHP_EOL

* Add predictProbability method (not completed)

* Add test for DataTransformer::predictions

* Fix SVM to use PHP_EOL

* Support probability estimation in SVM

* Add documentation

* Add InvalidOperationException class

* Throw InvalidOperationException before executing libsvm if probability estimation is not supported
2018-02-06 20:39:25 +01:00
Yuji Uchiyama
ed775fb232 Fix documentation of apriori (#221)
* Fix the return value of the single sample prediction

* Fix typo
2018-02-05 18:50:45 +01:00
Andreas Möller
84a49dbffe Enhancement: Update phpunit/phpunit (#219) 2018-02-03 14:11:48 +01:00
Jonathan Baldie
c32bf3fe2b Configure an Activation Function per hidden layer (#208)
* ability to specify per-layer activation function

* some tests for new addition to layer

* appease style CI whitespace issue

* more flexible addition of layers, and developer can pass Layer object in manually

* new test for layer object in mlp constructor

* documentation for added MLP functionality
2018-02-01 23:15:36 +01:00
Andreas Möller
8daed2484d Enhancement: Cache dependencies installed with composer on Travis (#215) 2018-01-31 21:50:26 +01:00
Jonathan Baldie
e318921076 Fix string representation of integer labels issue in NaiveBayes (#206)
* Update NaiveBayes.php

This fixes an issue using string labels that are string representations of integers, e.g. "1998" getting cast to (int)1998.

* Update NaiveBayes.php

fixes superfluous whitespace error

* added tests for naive bayes with numeric labels

* added array_unique

* nested array_flips for speed

* nested the array flips inside the array map

* to appear style CI test
2018-01-31 21:44:44 +01:00
Arkadiusz Kondas
10070d97fd
Normalize composer.json with localheinz/json-normalizer (#214) 2018-01-31 20:06:51 +01:00
Andreas Möller
695a62d75f Fix: Option --dev has been deprecated (#213) 2018-01-31 19:33:57 +01:00
Andreas Möller
e17016de71 Fix: Use enforceTimeLimit instead of beStrictAboutTestSize (#212) 2018-01-31 19:32:18 +01:00
Andreas Möller
498937cf64 Enhancement: Reference phpunit schema (#211) 2018-01-31 19:29:19 +01:00
Andreas Möller
4954f4d40e Enhancement: Keep packages sorted in composer.json (#210) 2018-01-31 19:25:22 +01:00
Yuji Uchiyama
9f0723f7d0 Fix documentation of ClassificationReport (#209)
* Fix values in example code

* Remove inconsistent empty lines
2018-01-31 19:20:50 +01:00
Marcin Michalski
4ab73eec5b Force all errors when running tests (#203) 2018-01-30 22:05:47 +01:00
Yuji Uchiyama
554c86af68 Choose averaging method in classification report (#205)
* Fix testcases of ClassificationReport

* Fix averaging method in ClassificationReport

* Fix divided by zero if labels are empty

* Fix calculation of f1score

* Add averaging methods (not completed)

* Implement weighted average method

* Extract counts to properties

* Fix default to macro average

* Implement micro average method

* Fix style

* Update docs

* Fix styles
2018-01-29 18:06:21 +01:00
Marcin Michalski
ba7114a3f7 Add libsvm exception tests (#202) 2018-01-26 22:07:22 +01:00
Jeroen van den Enden
89268ecb1a Throw exception when libsvm command fails to run (#200)
* Throw exception when libsvm command fails to run

* Update CS
2018-01-25 16:12:13 +01:00
Arkadiusz Kondas
7435bece34
Add test for Pipeline save and restore with ModelManager (#191) 2018-01-12 10:54:20 +01:00
Yuji Uchiyama
d953ef6bfc Fix the implementation of conjugate gradient method (#184)
* Add unit tests for optimizers

* Fix ConjugateGradient

* Fix coding style

* Fix namespace
2018-01-12 10:53:43 +01:00
David Monllaó
e83f7b95d5 Fix activation functions support (#163)
- Backpropagation using the neuron activation functions derivative
- instead of hardcoded sigmoid derivative
- Added missing activation functions derivatives
- Sigmoid forced for the output layer
- Updated ThresholdedReLU default threshold to 0 (acts as a ReLU)
- Unit tests for derivatives
- Unit tests for classifiers using different activation functions
- Added missing docs
2018-01-09 11:09:59 +01:00
Yuji Uchiyama
9938cf2911 Rewrite DBSCAN (#185)
* Add testcases to DBSCAN

* Fix DBSCAN implementation

* Refactoring DBSCAN implementation

* Fix coding style
2018-01-09 10:53:02 +01:00
Miguel Piedrafita
5a691635d7 Update license year (#183)
* Update license year

* Update LICENSE
2018-01-07 10:57:14 +01:00
Tomáš Votruba
6660645ecd Update dev dependencies (#187)
* composer: update dev dependencies

* phpstan fixes

* phpstan fixes

* phpstan fixes

* phpstan fixes

* drop probably forgotten humbug configs

* apply cs

* fix cs bug

* compsoer: add coding standard and phsptan dev friendly scripts

* ecs: add skipped errors

* cs: fix PHP 7.1

* fix cs

* ecs: exclude strict fixer that break code

* ecs: cleanup commented sets

* travis: use composer scripts for testing to prevent duplicated setup
2018-01-06 21:25:47 +01:00
Tomáš Votruba
a348111e97 Add PHPStan and level to max (#168)
* tests: update to PHPUnit 6.0 with rector

* fix namespaces on tests

* composer + tests: use standard test namespace naming

* update travis

* resolve conflict

* phpstan lvl 2

* phpstan lvl 3

* phpstan lvl 4

* phpstan lvl 5

* phpstan lvl 6

* phpstan lvl 7

* level max

* resolve conflict

* [cs] clean empty docs

* composer: bump to PHPUnit 6.4

* cleanup

* composer + travis: add phpstan

* phpstan lvl 1

* composer: update dev deps

* phpstan fixes

* update Contributing with new tools

* docs: link fixes, PHP version update

* composer: drop php-cs-fixer, cs already handled by ecs

* ecs: add old set rules

* [cs] apply rest of rules
2018-01-06 13:09:33 +01:00
Anatoly Pashin
fbbe5c5761 Update README.md (#181) 2018-01-06 11:12:42 +01:00
David Monllaó
c4ad117d28 Ability to update learningRate in MLP (#160)
* Allow people to update the learning rate

* Test for learning rate setter
2017-12-05 21:09:06 +01:00
Yuji Uchiyama
c4f58f7f6f Fix logistic regression implementation (#169)
* Fix target value of LogisticRegression

* Fix probability calculation in LogisticRegression

* Change the default cost function to log-likelihood

* Remove redundant round function

* Fix for coding standard
2017-12-05 12:03:55 +01:00
Tomáš Votruba
946fbbc521 Tests: use PHPUnit (6.4) exception methods (#165)
* tests: update to PHPUnit 6.0 with rector

* [cs] clean empty docs

* composer: bump to PHPUnit 6.4

* tests: use class references over strings

* cleanup
2017-11-28 08:00:13 +01:00
Tomáš Votruba
726cf4cddf Added EasyCodingStandard + lots of code fixes (#156)
* travis: move coveralls here, decouple from package

* composer: use PSR4

* phpunit: simpler config

* travis: add ecs run

* composer: add ecs dev

* use standard vendor/bin directory for dependency bins, confuses with local bins and require gitignore handling

* ecs: add PSR2

* [cs] PSR2 spacing fixes

* [cs] PSR2 class name fix

* [cs] PHP7 fixes - return semicolon spaces, old rand functions, typehints

* [cs] fix less strict typehints

* fix typehints to make tests pass

* ecs: ignore typehint-less elements

* [cs] standardize arrays

* [cs] standardize docblock, remove unused comments

* [cs] use self where possible

* [cs] sort class elements, from public to private

* [cs] do not use yoda (found less yoda-cases, than non-yoda)

* space

* [cs] do not assign in condition

* [cs] use namespace imports if possible

* [cs] use ::class over strings

* [cs] fix defaults for arrays properties, properties and constants single spacing

* cleanup ecs comments

* [cs] use item per line in multi-items array

* missing line

* misc

* rebase
2017-11-22 22:16:10 +01:00
David Monllaó
b1d40bfa30 Change from theta to learning rate var name in NN (#159) 2017-11-20 23:39:50 +01:00
David Monllaó
333598b472 Fix backpropagation random error (#157) 2017-11-20 23:11:21 +01:00
Qingshan Luo
ff80af2044 code style Update Phpml\Math\Distance\Manhattan::distance() method. (#154)
I think this will be better.
2017-11-16 21:45:35 +01:00
David Monllaó
f7537c049a documentation add tokenizer->fit required to build the dictionary (#155) 2017-11-16 21:40:11 +01:00
Arkadiusz Kondas
a11e3f69c3
Add support for coveralls.io (#153)
* Add support for coveralls.io

* Generate coverage report only on php 7.2 build

* Fix osx travis build and move tools to bin dir

* Update php version badge

* Fix travis conditional statement

* Fix travis conditional statement

* 🤦 fix bin path
2017-11-15 11:08:51 +01:00