Skip to content

Commit 14850f6

Browse files
committed
Fixing issue in local ensembles caused by PHP null parameters deprecation
1 parent c73405c commit 14850f6

28 files changed

+36
-36
lines changed

bigml/anomaly.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/anomalytree.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/association.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2015-2021 BigML
3+
# Copyright 2015-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/associationrule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2016-2021 BigML
3+
# Copyright 2016-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/basemodel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/bigml.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/boostedensemble.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/boostedtree.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/centroid.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/cluster.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/deepnet.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
# Copyright 2017-2021 BigML
3+
# Copyright 2017-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/ensemble.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/fields.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/item.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2016-2021 BigML
3+
# Copyright 2016-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/laminar/math_ops.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
# Copyright 2017-2021 BigML
3+
# Copyright 2017-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/laminar/preprocess.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
# Copyright 2017-2021 BigML
3+
# Copyright 2017-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/logistic.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2016-2021 BigML
3+
# Copyright 2016-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/model.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/modelfields.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/multimodel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/multivote.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain
@@ -140,9 +140,9 @@ class MultiVote {
140140
const DEFAULT_METHOD = 0;
141141
const BINS_LIMIT = 32;
142142

143-
public $COMBINATION_WEIGHTS = array(MultiVote::PLURALITY => null, MultiVote::CONFIDENCE => 'confidence', MultiVote::PROBABILITY => 'probability', MultiVote::THRESHOLD => null);
143+
public $COMBINATION_WEIGHTS = array(MultiVote::PLURALITY => '', MultiVote::CONFIDENCE => 'confidence', MultiVote::PROBABILITY => 'probability', MultiVote::THRESHOLD => '');
144144
public $COMBINER_MAP = array(MultiVote::PLURALITY_CODE=>MultiVote::PLURALITY, MultiVote::CONFIDENCE_CODE => MultiVote::CONFIDENCE, MultiVote::PROBABILITY_CODE => MultiVote::PROBABILITY, MultiVote::THRESHOLD_CODE=>MultiVote::THRESHOLD);
145-
public $WEIGHT_KEYS = array(MultiVote::PLURALITY => null, MultiVote::CONFIDENCE=> array('confidence'), MultiVote::PROBABILITY=>array('distribution', 'count'), MultiVote::THRESHOLD=> null);
145+
public $WEIGHT_KEYS = array(MultiVote::PLURALITY => '', MultiVote::CONFIDENCE=> array('confidence'), MultiVote::PROBABILITY=>array('distribution', 'count'), MultiVote::THRESHOLD=> '');
146146

147147
public $predictions;
148148
public $probabilities;
@@ -588,7 +588,7 @@ public function combine($method=MultiVote::DEFAULT_METHOD, $with_confidence=fals
588588
}
589589

590590
return $predictions->combine_categorical( (array_key_exists($method, $this->COMBINATION_WEIGHTS)) ?
591-
$this->COMBINATION_WEIGHTS[$method] : null,
591+
$this->COMBINATION_WEIGHTS[$method] : '',
592592
$with_confidence, $add_confidence, $add_distribution, $add_count);
593593
}
594594
}
@@ -706,7 +706,7 @@ function probability_weight() {
706706

707707
}
708708

709-
function combine_categorical($weight_label=null, $with_confidence=false, $add_confidence=false,
709+
function combine_categorical($weight_label='', $with_confidence=false, $add_confidence=false,
710710
$add_distribution=false, $add_count=False) {
711711
/*
712712
Returns the prediction combining votes by using the given weight:
@@ -722,13 +722,13 @@ function combine_categorical($weight_label=null, $with_confidence=false, $add_co
722722
$mode = array();
723723

724724
$weight = 0;
725-
if ($weight_label == null) {
725+
if ($weight_label == '') {
726726
$weight = 1;
727727
}
728728
$instances = 0;
729729

730730
foreach($this->predictions as $prediction) {
731-
if ($weight_label != null) {
731+
if ($weight_label != '') {
732732

733733
if (!in_array($weight_label, array_values($this->COMBINATION_WEIGHTS))) {
734734
throw new \Exception("Wrong weight_label value.");
@@ -871,7 +871,7 @@ function weighted_confidence($combined_prediction, $weight_label) {
871871
}
872872
}
873873

874-
if ($weight_label != null && (!is_string($weight_label) || (!$check_confidence_and_weight_label)) ) {
874+
if ($weight_label != '' && (!is_string($weight_label) || (!$check_confidence_and_weight_label)) ) {
875875
throw new \Exception("Not enough data to use the selected prediction method. Lacks " . $weight_label . " information.");
876876
}
877877

@@ -880,7 +880,7 @@ function weighted_confidence($combined_prediction, $weight_label) {
880880
$weight = 1;
881881

882882
foreach($predictions as $prediction) {
883-
if ($weight_label != null) {
883+
if ($weight_label != '') {
884884
$weight = $prediction->$weight_label;
885885
}
886886

bigml/path.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/predicate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/predicates.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/prediction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/topicmodel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2017-2021 BigML
3+
# Copyright 2017-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

bigml/tree.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
#
3-
# Copyright 2012-2021 BigML
3+
# Copyright 2012-2023 BigML
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"); you may
66
# not use this file except in compliance with the License. You may obtain

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bigml/bigml-php",
33
"type": "library",
44
"description": "API bindings for BigML",
5-
"version": "v4.1.0",
5+
"version": "v4.2.0",
66
"license": "Apache-2.0",
77
"require": {
88
"php" : ">=8.0",

0 commit comments

Comments
 (0)