Skip to content

Commit bb6ef64

Browse files
committed
Merge branch '2.5' into 3.0
2 parents c014c91 + 685b53d commit bb6ef64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+942
-74
lines changed

.php-cs-fixer.dist.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'array_syntax' => ['syntax' => 'short'],
1515
'backtick_to_shell_exec' => true,
1616
'binary_operator_spaces' => true,
17+
'blank_lines_before_namespace' => true,
1718
'blank_line_after_namespace' => true,
1819
'blank_line_after_opening_tag' => true,
1920
'blank_line_before_statement' => [
@@ -22,19 +23,13 @@
2223
'if', 'foreach', 'return', 'switch', 'try', 'while',
2324
],
2425
],
25-
'braces' => [
26-
'allow_single_line_closure' => false,
27-
'position_after_control_structures' => 'same',
28-
'position_after_functions_and_oop_constructs' => 'next',
29-
],
3026
'cast_spaces' => ['space' => 'single'],
3127
'class_attributes_separation' => true,
3228
'combine_consecutive_issets' => true,
3329
'combine_consecutive_unsets' => true,
3430
'compact_nullable_typehint' => true,
3531
'concat_space' => ['spacing' => 'one'],
3632
'fully_qualified_strict_types' => true,
37-
'function_typehint_space' => true,
3833
'increment_style' => ['style' => 'pre'],
3934
'linebreak_after_opening_tag' => true,
4035
'list_syntax' => ['syntax' => 'short'],
@@ -111,11 +106,11 @@
111106
'semicolon_after_instruction' => true,
112107
'short_scalar_cast' => true,
113108
'simplified_null_return' => true,
114-
'single_blank_line_before_namespace' => true,
115109
'single_quote' => true,
116110
'single_line_comment_style' => true,
117111
'ternary_operator_spaces' => true,
118112
'ternary_to_null_coalescing' => true,
113+
'type_declaration_spaces' => true,
119114
'trim_array_spaces' => true,
120115
'unary_operator_spaces' => true,
121116
'whitespace_after_comma_in_array' => true,

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
- Remove Network interface
1010
- RBX Serializer only tracks major library version number
1111

12+
- 2.5.0
13+
- Added Vantage Point Spatial tree
14+
- Blob Generator can now `simulate()` a Dataset object
15+
1216
- 2.4.1
1317
- Sentence Tokenizer fix Arabic and Farsi language support
18+
- Optimize online variance updating
1419

1520
- 2.4.0
1621
- Add GELU activation function

benchmarks/AnomalyDetectors/GaussianMLEBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class GaussianMLEBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/AnomalyDetectors/IsolationForestBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class IsolationForestBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/AnomalyDetectors/LocalOutlierFactorBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class LocalOutlierFactorBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/AnomalyDetectors/LodaBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class LodaBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/AnomalyDetectors/OneClassSVMBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class OneClassSVMBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/AnomalyDetectors/RobustZScoreBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class RobustZScoreBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/AdaBoostBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class AdaBoostBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
protected const TESTING_SIZE = 10000;
1919

benchmarks/Classifiers/ClassificationTreeBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class ClassificationTreeBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/ExtraTreeClassifierBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class ExtraTreeClassifierBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/GaussianNBBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class GaussianNBBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/KDNeighborsBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class KDNeighborsBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/KNearestNeighborsBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class KNearestNeighborsBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/LogisticRegressionBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class LogisticRegressionBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/LogitBoostBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class LogitBoostBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/MultilayerPerceptronBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class MultilayerPerceptronBench
1717
{
18-
protected const TRAINING_SIZE = 2500;
18+
protected const TRAINING_SIZE = 10000;
1919

2020
protected const TESTING_SIZE = 10000;
2121

benchmarks/Classifiers/NaiveBayesBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class NaiveBayesBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
protected const TESTING_SIZE = 10000;
1919

benchmarks/Classifiers/OneVsRestBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class OneVsRestBench
1616
{
17-
protected const TRAINING_SIZE = 2500;
17+
protected const TRAINING_SIZE = 10000;
1818

1919
protected const TESTING_SIZE = 10000;
2020

benchmarks/Classifiers/RadiusNeighborsBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class RadiusNeighborsBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Classifiers/RandomForestBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class RandomForestBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
protected const TESTING_SIZE = 10000;
1919

benchmarks/Classifiers/SVCBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class SVCBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
protected const TESTING_SIZE = 10000;
1919

benchmarks/Classifiers/SoftmaxClassifierBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class SoftmaxClassifierBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Clusterers/FuzzyCMeansBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class FuzzyCMeansBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Clusterers/GaussianMixtureBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class GaussianMixtureBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Clusterers/KMeansBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class KMeansBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

benchmarks/Clusterers/MeanShiftBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class MeanShiftBench
1414
{
15-
protected const TRAINING_SIZE = 2500;
15+
protected const TRAINING_SIZE = 10000;
1616

1717
protected const TESTING_SIZE = 10000;
1818

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
namespace Rubix\ML\Benchmarks\Graph\Trees;
4+
5+
use Rubix\ML\Graph\Trees\VantageTree;
6+
use Rubix\ML\Datasets\Generators\Blob;
7+
use Rubix\ML\Datasets\Generators\Agglomerate;
8+
9+
/**
10+
* @Groups({"Trees"})
11+
* @BeforeMethods({"setUp"})
12+
*/
13+
class VantageTreeBench
14+
{
15+
protected const DATASET_SIZE = 10000;
16+
17+
/**
18+
* @var \Rubix\ML\Datasets\Labeled;
19+
*/
20+
protected $dataset;
21+
22+
/**
23+
* @var \Rubix\ML\Graph\Trees\VantageTree
24+
*/
25+
protected $tree;
26+
27+
public function setUp() : void
28+
{
29+
$generator = new Agglomerate([
30+
'Iris-setosa' => new Blob([5.0, 3.42, 1.46, 0.24], [0.35, 0.38, 0.17, 0.1]),
31+
'Iris-versicolor' => new Blob([5.94, 2.77, 4.26, 1.33], [0.51, 0.31, 0.47, 0.2]),
32+
'Iris-virginica' => new Blob([6.59, 2.97, 5.55, 2.03], [0.63, 0.32, 0.55, 0.27]),
33+
]);
34+
35+
$this->dataset = $generator->generate(self::DATASET_SIZE);
36+
37+
$this->tree = new VantageTree(30);
38+
}
39+
40+
/**
41+
* @Subject
42+
* @Iterations(3)
43+
* @OutputTimeUnit("seconds", precision=3)
44+
*/
45+
public function grow() : void
46+
{
47+
$this->tree->grow($this->dataset);
48+
}
49+
}

benchmarks/Persisters/Serializers/GzipNativeBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class GzipNativeBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
/**
1919
* @var \Rubix\ML\Serializers\GzipNative

benchmarks/Persisters/Serializers/NativeBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class NativeBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
/**
1919
* @var \Rubix\ML\Serializers\Native

benchmarks/Persisters/Serializers/RBXBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class RBXBench
1515
{
16-
protected const TRAINING_SIZE = 2500;
16+
protected const TRAINING_SIZE = 10000;
1717

1818
/**
1919
* @var \Rubix\ML\Serializers\RBX

benchmarks/Regressors/AdalineBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class AdalineBench
1313
{
14-
protected const TRAINING_SIZE = 2500;
14+
protected const TRAINING_SIZE = 10000;
1515

1616
protected const TESTING_SIZE = 10000;
1717

benchmarks/Regressors/ExtraTreeRegressorBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class ExtraTreeRegressorBench
1313
{
14-
protected const TRAINING_SIZE = 2500;
14+
protected const TRAINING_SIZE = 10000;
1515

1616
protected const TESTING_SIZE = 10000;
1717

benchmarks/Regressors/GradientBoostBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class GradientBoostBench
1313
{
14-
protected const TRAINING_SIZE = 2500;
14+
protected const TRAINING_SIZE = 10000;
1515

1616
protected const TESTING_SIZE = 10000;
1717

benchmarks/Regressors/KDNeighborsRegressorBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class KDNeighborsRegressorBench
1313
{
14-
protected const TRAINING_SIZE = 2500;
14+
protected const TRAINING_SIZE = 10000;
1515

1616
protected const TESTING_SIZE = 10000;
1717

0 commit comments

Comments
 (0)