forked from jorgecasas/php-ml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jorgecasas#2 from jorgecasas/master
Master
- Loading branch information
Showing
425 changed files
with
26,959 additions
and
3,299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
max_line_length = 80 | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
* text=auto | ||
|
||
/docs export-ignore | ||
/tests export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.travis.yml export-ignore | ||
/ecs.yml export-ignore | ||
/CHANGELOG.md export-ignore | ||
/CONTRIBUTING.md export-ignore | ||
/mkdocs.yml export-ignore | ||
/phpbench.json export-ignore | ||
/phpstan.neon export-ignore | ||
/phpunit.xml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/vendor/ | ||
humbuglog.* | ||
/bin/phpunit | ||
/build | ||
/tests/Performance/Data/*.csv | ||
.php_cs.cache | ||
.phpunit.result.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,38 @@ | ||
language: php | ||
php: | ||
- '7.0' | ||
before_script: composer install | ||
script: bin/phpunit | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
include: | ||
- os: linux | ||
php: '7.2' | ||
env: PHPUNIT_FLAGS="--coverage-clover build/logs/clover.xml" DISABLE_XDEBUG="true" STATIC_ANALYSIS="true" | ||
|
||
- os: linux | ||
php: '7.3' | ||
|
||
- os: linux | ||
php: '7.4' | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
before_install: | ||
- if [[ $DISABLE_XDEBUG == "true" ]]; then phpenv config-rm xdebug.ini; fi | ||
|
||
install: | ||
- curl -s http://getcomposer.org/installer | php | ||
- php composer.phar install --no-interaction --ignore-platform-reqs | ||
|
||
script: | ||
- vendor/bin/phpunit $PHPUNIT_FLAGS | ||
- if [[ $STATIC_ANALYSIS != "" ]]; then composer check-cs; fi | ||
- if [[ $STATIC_ANALYSIS != "" ]]; then composer phpstan; fi | ||
|
||
after_success: | ||
- | | ||
if [[ $PHPUNIT_FLAGS != "" ]]; then | ||
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar | ||
php php-coveralls.phar --verbose; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [0.9.0] - Unreleased | ||
### Added | ||
- [Preprocessing] Implement LabelEncoder | ||
- [Preprocessing] Implement ColumnFilter | ||
- [Preprocessing] Implement LambdaTransformer | ||
- [Preprocessing] Implement NumberConverter | ||
- [Preprocessing] Implement OneHotEncoder | ||
- [Workflow] Implement FeatureUnion | ||
- [Metric] Add Regression metrics: meanSquaredError, meanSquaredLogarithmicError, meanAbsoluteError, medianAbsoluteError, r2Score, maxError | ||
- [Regression] Implement DecisionTreeRegressor | ||
|
||
## [0.8.0] - 2019-03-20 | ||
### Added | ||
- [Tokenization] Added NGramTokenizer (#350) | ||
- editorconfig file (#355) | ||
### Fixed | ||
- [Dataset] FilesDataset read samples without additional array (#363) | ||
- [Tokenization] fixed error with numeric token values (#363) | ||
### Changed | ||
- [Math] improved performance with pow and sqrt replacement (#350) | ||
- [Math] reduce duplicated code in distance metrics (#348) | ||
- update phpunit to 7.5.1 (#335) | ||
- code style fixes (#334) | ||
|
||
## [0.7.0] - 2018-11-07 | ||
### Added | ||
- [Clustering] added KMeans associative clustering (#262) | ||
- [Dataset] added removeColumns function to ArrayDataset (#249) | ||
- [Dataset] added a SvmDataset class for SVM-Light (or LibSVM) format files (#237) | ||
- [Dataset] added Mnist Dataset for MNIST file format (#326) | ||
- [Internal] Add performance test for LeastSquares (#263) | ||
|
||
### Changed | ||
- [Internal] implement Keep a Changelog format | ||
- [Classification] changed the default kernel type in SVC to Kernel::RBF (#267) | ||
- [Optimizer] removed $initialTheta property and renamed setInitialTheta method to setTheta (#252) | ||
- [Imputer] Throw exception when trying to transform without train data (#314) | ||
- [Math] Micro optimization for matrix multiplication (#255) | ||
- [Internal] Throw proper exception (#259, #251) | ||
- [MLPClassifier] return labels in output (#315) | ||
- [Internal] Update phpstan to 0.10.5 (#320) | ||
|
||
### Fixed | ||
- [SVM] ensure DataTransformer::testSet samples array is not empty (#204) | ||
- [Optimizer] optimizer initial theta randomization (#239) | ||
- [Internal] travis build on osx (#281) | ||
- [SVM] SVM locale (non-locale aware) (#288) | ||
- [Internal] typo, tests, code styles and documentation fixes (#265, #261, #254, #253, #251, #250, #248, #245, #243, #317, #328) | ||
- [Classification] Check if feature exist when predict target in NaiveBayes (#327) | ||
|
||
## [0.6.2] - 2018-02-22 | ||
### Fixed | ||
- Fix Apriori array keys (#238) | ||
|
||
## [0.6.1] - 2018-02-18 | ||
### Fixed | ||
- Fix KMeans and EigenvalueDecomposition (#235) | ||
|
||
## [0.6.0] - 2018-02-16 | ||
- feature [FeatureSelection] implement SelectKBest with scoring functions (#232) | ||
- feature [FeatureSelection] implement VarianceThreshold - simple baseline approach to feature selection. (#228) | ||
- feature [Classification] support probability estimation in SVC (#218) | ||
- feature [NeuralNetwork] configure an Activation Function per hidden layer (#208) | ||
- feature [NeuralNetwork] Ability to update learningRate in MLP (#160) | ||
- feature [Metric] Choose averaging method in classification report (#205) | ||
- enhancement Add phpstan strict rules (#233) | ||
- enhancement Flatten directory structure (#220) | ||
- enhancement Update phpunit/phpunit (#219) | ||
- enhancement Cache dependencies installed with composer on Travis (#215) | ||
- enhancement Add support for coveralls.io (#153) | ||
- enhancement Add phpstan and easy coding standards (#156, #168) | ||
- enhancement Throw exception when libsvm command fails to run (#200, #202) | ||
- enhancement Normalize composer.json and sort packages (#214, #210) | ||
- enhancement Rewrite DBSCAN (#185) | ||
- fix phpunit include tests path (#230) | ||
- fix support of a rule in Apriori (#229) | ||
- fix apriori generates an empty array as a part of the frequent item sets (#224) | ||
- fix backpropagation random error (#157) | ||
- fix logistic regression implementation (#169) | ||
- fix activation functions support (#163) | ||
- fix string representation of integer labels issue in NaiveBayes (#206) | ||
- fix the implementation of conjugate gradient method (#184) | ||
- typo, tests and documentation fixes (#234, #221, #181, #183, #155, #159, #165, #187, #154, #191, #203, #209, #213, #212, #211) | ||
|
||
## [0.5.0] - 2017-11-14 | ||
- general [php] Upgrade to PHP 7.1 (#150) | ||
- general [coding standard] fix imports order and drop unused docs typehints | ||
- feature [NeuralNetwork] Add PReLU activation function (#128) | ||
- feature [NeuralNetwork] Add ThresholdedReLU activation function (#129) | ||
- feature [Dataset] Support CSV with long lines (#119) | ||
- feature [NeuralNetwork] Neural networks partial training and persistency (#91) | ||
- feature Add french stopwords (#92) | ||
- feature New methods: setBinPath, setVarPath in SupportVectorMachine (#73) | ||
- feature Linear Discrimant Analysis (LDA) (#82) | ||
- feature Linear algebra operations, Dimensionality reduction and some other minor changes (#81) | ||
- feature Partial training base (#78) | ||
- feature Add delimiter option for CsvDataset (#66) | ||
- feature LogisticRegression classifier & Optimization methods (#63) | ||
- feature Additional training for SVR (#59) | ||
- optimization Comparison - replace eval (#130) | ||
- optimization Use C-style casts (#124) | ||
- optimization Speed up DataTransformer (#122) | ||
- bug DBSCAN fix for associative keys and array_merge performance optimization (#139) | ||
- bug Ensure user-provided SupportVectorMachine paths are valid (#126) | ||
- bug [DecisionTree] Fix string cast #120 (#121) | ||
- bug fix invalid typehint for subs method (#110) | ||
- bug Fix samples transformation in Pipeline training (#94) | ||
- bug Fix division by 0 error during normalization (#83) | ||
- bug Fix wrong docs references (#79) | ||
|
||
## [0.4.0] - 2017-02-23 | ||
- feature [Classification] - Ensemble Classifiers : Bagging and RandomForest by Mustafa Karabulut | ||
- feature [Classification] - RandomForest::getFeatureImportances() method by Mustafa Karabulut | ||
- feature [Classification] - Linear classifiers: Perceptron, Adaline, DecisionStump by Mustafa Karabulut | ||
- feature [Classification] - AdaBoost algorithm by Mustafa Karabulut | ||
- bug [Math] - Check if matrix is singular doing inverse by Povilas Susinskas | ||
- optimization - Euclidean optimization by Mustafa Karabulut | ||
|
||
## [0.3.0] - 2017-02-04 | ||
- feature [Persistency] - ModelManager - save and restore trained models by David Monllaó | ||
- feature [Classification] - DecisionTree implementation by Mustafa Karabulut | ||
- feature [Clustering] - Fuzzy C Means implementation by Mustafa Karabulut | ||
- other small fixes and code styles refactors | ||
|
||
## [0.2.1] - 2016-11-20 | ||
- feature [Association] - Apriori algorithm implementation | ||
- bug [Metric] - division by zero | ||
|
||
## [0.2.0] - 2016-08-14 | ||
- feature [NeuralNetwork] - MultilayerPerceptron and Backpropagation training | ||
|
||
## [0.1.2] - 2016-07-24 | ||
- feature [Dataset] - FilesDataset - load dataset from files (folder names as targets) | ||
- feature [Metric] - ClassificationReport - report about trained classifier | ||
- bug [Feature Extraction] - fix problem with token count vectorizer array order | ||
- tests [General] - add more tests for specific conditions | ||
|
||
## [0.1.1] - 2016-07-12 | ||
- feature [Cross Validation] Stratified Random Split - equal distribution for targets in split | ||
- feature [General] Documentation - add missing pages (Pipeline, ConfusionMatrix and TfIdfTransformer) and fix links | ||
|
||
## [0.1.0] - 2016-07-08 | ||
- first develop release | ||
- base tools for Machine Learning: Algorithms, Cross Validation, Preprocessing, Feature Extraction | ||
- bug [General] #7 - PHP-ML doesn't work on Mac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Contributing to PHP-ML | ||
|
||
PHP-ML is an open source project. If you'd like to contribute, please read the following text. Before I can merge your | ||
Pull-Request here are some guidelines that you need to follow. These guidelines exist not to annoy you, but to keep the | ||
code base clean, unified and future proof. | ||
|
||
## Branch | ||
|
||
You should only open pull requests against the `master` branch. | ||
|
||
## 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 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 | ||
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 | ||
composer phpstan | ||
``` | ||
|
||
|
||
## Documentation | ||
|
||
Please update the documentation pages if necessary. You can find them in docs/. | ||
|
||
--- | ||
|
||
Thank you very much again for your contribution! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.