Skip to content

Commit b28b049

Browse files
author
h2o-ops
committed
Merge remote-tracking branch 'origin/rel-3.46.0'
2 parents 733c801 + 2050f4b commit b28b049

12 files changed

+276
-102
lines changed

h2o-docs/src/product/api-changes.rst

+40-36
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,93 @@
1-
API-Related Changes
2-
-------------------
1+
API-related changes
2+
===================
33

44
H2O-3 does its best to keep backwards compatibility between major versions, but sometimes breaking changes are needed in order to improve code quality and to address issues. This section provides a list of current breaking changes between specific releases.
55

66
From 3.32.0.1
7-
~~~~~~~~~~~~~
7+
-------------
88

99
Modules
10-
'''''''
10+
~~~~~~~
1111

1212
The deprecated ``h2o-scala`` module has been removed.
1313

1414
Target Encoding
15-
'''''''''''''''
15+
~~~~~~~~~~~~~~~
1616

17-
The Target Encoder API has been clarified and its consistency across clients has been improved:
17+
The Target Encoder API has been clarified and its consistency across clients has been improved. The following parameters are now deprecated in all clients and officially replaced by their new alternative:
1818

19-
The following parameters are now deprecated in all clients and officially replaced by their new alternative:
20-
- ``k`` -> ``inflection_point``
21-
- ``f`` -> ``smoothing``
22-
- ``noise_level`` -> ``noise``
23-
- ``use_blending`` (R only) -> ``blending``
19+
- ``k`` :math:`\to` ``inflection_point``
20+
- ``f`` :math:`\to` ``smoothing``
21+
- ``noise_level`` :math:`\to` ``noise``
22+
- ``use_blending`` (R only) :math:`\to` ``blending``
2423

25-
Legacy client code using the deprecated parameters should expect a deprecation warning when using them, they are strongly encouraged to update their code to use the new naming.
24+
Legacy client code using the deprecated parameters should expect a deprecation warning when using them. You are strongly encouraged to update your code to use the new naming.
25+
26+
``transform`` parameter updates
27+
'''''''''''''''''''''''''''''''
28+
29+
In an objective of performance optimization on the backend, and of simplification of the API, the ``transform`` method used to apply target encoding was modified as follows:
2630

27-
In an objective of performance optimization on the backend, and of simplification of the API, the ``transform`` method used to apply target encoding was modified as follow.
2831
- The R ``h2o.transform`` function (accepting a target encoder model as the first argument) and the Python ``H2OTargetEncoderEstimator.transform`` methods are now fully compatible: they accept the same parameters and work consistently.
29-
- The parameters ``data_leakage_handling``, ``seed`` are now ignored on those methods: ``transform`` will use by default the corresponding values defined when building the TargetEncoder model.
32+
- The parameters ``data_leakage_handling``, ``seed`` are now ignored on those methods: by default, ``transform`` will use the corresponding values defined when building the TargetEncoder model.
3033
- The other regularization parameters on these ``transform`` methods (e.g. ``noise``, ``blending``, ``inflection_point``, ``smoothing``), always default to the value defined on the TargetEncoder model.
3134
- A new ``as_training`` parameter has been introduced to simplify and enforce a correct usage of target encoding:
3235

33-
- When transforming a training dataset, user should use (R) ``h2o.transform(te_model, train_dataset, as_training=TRUE)`` or (Python) ``te_model.transform(train_dataset, as_training=True)``.
34-
- When transforming any other dataset (validation, test, ...), user can just use (R) ``h2o.transform(te_model, train_dataset)`` or (Python) ``te_model.transform(train_dataset)``.
36+
- When transforming a training dataset, you should use (R) ``h2o.transform(te_model, train_dataset, as_training=TRUE)`` or (Python) ``te_model.transform(train_dataset, as_training=True)``.
37+
- When transforming any other dataset (validation, test, ...), you can just use (R) ``h2o.transform(te_model, train_dataset)`` or (Python) ``te_model.transform(train_dataset)``.
3538
- Legacy code using for example ``h2o.transform(te_model, train_dataset, data_leakage_handling="KFold")`` will now be translated internally to ``h2o.transform(te_model, train_dataset, as_training=TRUE)``.
3639

3740

38-
Finally the following APIs, deprecated since 3.28, have been fully removed:
41+
Finally the following APIs (deprecated since 3.28) have been fully removed:
42+
3943
- Python: ``h2o.targetencoder`` module.
4044
- R: ``h2o.target_encode_fit`` and ``h2o.target_encode_transform`` functions.
4145

4246
Parameters
43-
''''''''''
44-
The ``max_hit_ratio_k`` param has been removed.
47+
~~~~~~~~~~
48+
49+
The ``max_hit_ratio_k`` parameter has been removed.
4550

4651
From 3.30.1.2
47-
~~~~~~~~~~~~~
52+
-------------
4853

49-
The ``max_hit_ratio_k`` param is deprecated in version 3.30.1.2 and will be completely removed in the next major version, 3.32.0.1.
54+
The ``max_hit_ratio_k`` parameter is deprecated in version 3.30.1.2 and will be completely removed in the next major version, 3.32.0.1.
5055

5156
From 3.30.1.1
52-
~~~~~~~~~~~~~
57+
-------------
5358

5459
The deprecated ``h2o-scala`` module has been removed.
5560

5661

5762
From 3.30.0.5
58-
~~~~~~~~~~~~~
63+
-------------
5964

6065
The ``h2o-scala`` module is deprecated in version 3.30.0.5 and will be completely removed in the next major version, 3.30.1.1.
6166

6267

6368
From 3.30.0.4
64-
~~~~~~~~~~~~~
69+
-------------
6570

6671
The following options are no longer supported by native `XGBoost <https://xgboost.readthedocs.io/en/latest/parameter.html>`__ and have been removed.
6772

6873
- ``min_sum_hessian_in_leaf``
6974
- ``min_data_in_leaf``
7075

7176

72-
From 3.28 or Below to 3.30
73-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
77+
From 3.28 or below to 3.30
78+
--------------------------
7479

7580
Java API
76-
''''''''
81+
~~~~~~~~
7782

78-
``hex.grid.HyperSpaceWalker`` and ``hex.grid.HyperspaceWalker.HyperSpaceIterator`` interfaces have been simplified.
79-
Users implementing those interfaces directly, for example to create a custom grid search exploration algorithm, may want to look at the default implementations in **h2o-core/src/main/java/hex/grid/HyperSpaceWalker.java** if they are facing any issue when compiling against the new interfaces.
83+
The ``hex.grid.HyperSpaceWalker`` and ``hex.grid.HyperspaceWalker.HyperSpaceIterator`` interfaces have been simplified. Users implementing those interfaces directly, for example to create a custom grid search exploration algorithm, may want to look at the default implementations in ``h2o-core/src/main/java/hex/grid/HyperSpaceWalker.java`` if they are facing any issue when compiling against the new interfaces.
8084

8185

82-
From 3.26 or Below to 3.28
83-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
86+
From 3.26 or below to 3.28
87+
--------------------------
8488

8589
Java API
86-
''''''''
90+
~~~~~~~~
8791

8892
The following classes were moved:
8993

@@ -96,11 +100,11 @@ The following classes were moved:
96100
================================================= =========================================
97101

98102

99-
From 3.22 or Below to 3.24
100-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
103+
From 3.22 or below to 3.24
104+
--------------------------
101105

102106
Java API
103-
''''''''
107+
~~~~~~~~
104108

105109
The following classes were moved and/or renamed:
106110

@@ -112,4 +116,4 @@ The following classes were moved and/or renamed:
112116
``ai.h2o.automl.AutoML.algo`` ``ai.h2o.automl.Algo``
113117
================================================= ======================================
114118

115-
Some internal methods of ``StackedEnsemble`` and ``StackedEnsembleModel`` are no longer public, but this should not impact users.
119+
Some internal methods of ``StackedEnsemble`` and ``StackedEnsembleModel`` are no longer public, but this should not impact you.

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_equality_constraints_only_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_constraints_binomial():
6+
def test_equality_constraints_only_binomial():
77
'''
88
This test checks and make sure the equality constraints work with binomial family. Coefficients are initialized
99
with glm coefficients built without contraints, default coefficients and random coefficients.
@@ -129,6 +129,6 @@ def test_constraints_binomial():
129129

130130

131131
if __name__ == "__main__":
132-
pyunit_utils.standalone_test(test_constraints_binomial)
132+
pyunit_utils.standalone_test(test_equality_constraints_only_binomial)
133133
else:
134-
test_constraints_binomial()
134+
test_equality_constraints_only_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_equality_loose_lessthan_linear_constraints_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_constraints_binomial():
6+
def test_equality_linear_constraints_binomial():
77
'''
88
This test checks and make sure the equality constraints work with binomial family. Coefficients are initialized
99
with glm coefficients built without constraints, default coefficients and random coefficients. Note in this case,
@@ -168,6 +168,6 @@ def test_constraints_binomial():
168168

169169

170170
if __name__ == "__main__":
171-
pyunit_utils.standalone_test(test_constraints_binomial)
171+
pyunit_utils.standalone_test(test_equality_linear_constraints_binomial)
172172
else:
173-
test_constraints_binomial()
173+
test_equality_linear_constraints_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_light_tight_beta_equality_lessthan_constraints_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_light_tight_linear_constraints_only_gaussian():
6+
def test_light_tight_linear_constraints_binomial():
77
'''
88
Test constrained GLM with beta, equality and less than and equal to constraints. The constraints are not very
99
tight. However, coefficients from GLM built without constraints won't be able to satisfied the constraints.
@@ -207,6 +207,6 @@ def test_light_tight_linear_constraints_only_gaussian():
207207
"not.".format(logloss, random_init_logloss)
208208

209209
if __name__ == "__main__":
210-
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_gaussian)
210+
pyunit_utils.standalone_test(test_light_tight_linear_constraints_binomial)
211211
else:
212-
test_light_tight_linear_constraints_only_gaussian()
212+
test_light_tight_linear_constraints_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_light_tight_equality_lessthan_constraints_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_light_tight_linear_constraints_only_gaussian():
6+
def test_light_tight_linear_constraints_only_binomial():
77
'''
88
Test constrained GLM with equality and less than and equal to constraints. The constraints are not very
99
tight. However, coefficients from GLM built without constraints won't be able to satisfied the constraints.
@@ -185,6 +185,6 @@ def test_light_tight_linear_constraints_only_gaussian():
185185
"not.".format(logloss, random_init_logloss)
186186

187187
if __name__ == "__main__":
188-
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_gaussian)
188+
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_binomial)
189189
else:
190-
test_light_tight_linear_constraints_only_gaussian()
190+
test_light_tight_linear_constraints_only_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_light_tight_linear_constraints_only_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_light_tight_linear_constraints_only_gaussian():
6+
def test_light_tight_linear_constraints_only_binomial():
77
'''
88
Test constrained GLM with less than and equal to constraints. The constraints are not very
99
tight. However, coefficients from GLM built without constraints won't be able to satisfied the constraints.
@@ -201,6 +201,6 @@ def test_light_tight_linear_constraints_only_gaussian():
201201
"not.".format(logloss, random_init_logloss)
202202

203203
if __name__ == "__main__":
204-
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_gaussian)
204+
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_binomial)
205205
else:
206-
test_light_tight_linear_constraints_only_gaussian()
206+
test_light_tight_linear_constraints_only_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_loose_beta_linear_constraints_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_constraints_binomial():
6+
def test_loose_beta_linear_constraints_binomial():
77
'''
88
check and make sure coefficients close to GLM built without constraints are generated with loose constraints
99
that are satisfied with coefficients from GLM without constraints. Only beta and less than and equal to
@@ -157,6 +157,6 @@ def test_constraints_binomial():
157157

158158

159159
if __name__ == "__main__":
160-
pyunit_utils.standalone_test(test_constraints_binomial)
160+
pyunit_utils.standalone_test(test_loose_beta_linear_constraints_binomial)
161161
else:
162-
test_constraints_binomial()
162+
test_loose_beta_linear_constraints_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_loose_only_linear_constraints_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_constraints_binomial():
6+
def test_loose_linear_constraints_binomial():
77
'''
88
check and make sure coefficients close to GLM built without constraints are generated with loose constraints
99
that are satisfied with coefficients from GLM without constraints. Only less than and equal to
@@ -135,6 +135,6 @@ def test_constraints_binomial():
135135
" but is not.".format(logloss, default_init_logloss)
136136

137137
if __name__ == "__main__":
138-
pyunit_utils.standalone_test(test_constraints_binomial)
138+
pyunit_utils.standalone_test(test_loose_linear_constraints_binomial)
139139
else:
140-
test_constraints_binomial()
140+
test_loose_linear_constraints_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_tight_beta_equality_linear_constraints_binomial.py

+3-39
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_light_tight_linear_constraints_only_gaussian():
6+
def test_tight_beta_linear_constraints_binomial():
77
'''
88
Test constrained GLM with beta, equality and less than and equal to constraints. The constraints are very
99
tight and coefficients from GLM built without constraints won't be able to satisfied the constraints.
@@ -174,42 +174,6 @@ def test_light_tight_linear_constraints_only_gaussian():
174174
types = "Equal"
175175
contraint_numbers = 5
176176
tight_constraints.append([name, values, types, contraint_numbers])
177-
178-
name = "C19"
179-
values = 0.5
180-
types = "Equal"
181-
contraint_numbers = 4
182-
tight_constraints.append([name, values, types, contraint_numbers])
183-
184-
name = "C10.1"
185-
values = -0.3
186-
types = "Equal"
187-
contraint_numbers = 4
188-
tight_constraints.append([name, values, types, contraint_numbers])
189-
190-
name = "constant"
191-
values = -0.5
192-
types = "Equal"
193-
contraint_numbers = 4
194-
tight_constraints.append([name, values, types, contraint_numbers])
195-
196-
name = "C18"
197-
values = 0.75
198-
types = "Equal"
199-
contraint_numbers = 5
200-
tight_constraints.append([name, values, types, contraint_numbers])
201-
202-
name = "C20"
203-
values = -0.13
204-
types = "Equal"
205-
contraint_numbers = 5
206-
tight_constraints.append([name, values, types, contraint_numbers])
207-
208-
name = "constant"
209-
values = -3
210-
types = "Equal"
211-
contraint_numbers = 5
212-
tight_constraints.append([name, values, types, contraint_numbers])
213177

214178
linear_constraints2 = h2o.H2OFrame(tight_constraints)
215179
linear_constraints2.set_names(["names", "values", "types", "constraint_numbers"])
@@ -317,6 +281,6 @@ def test_light_tight_linear_constraints_only_gaussian():
317281
"not.".format(logloss, random_init_logloss)
318282

319283
if __name__ == "__main__":
320-
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_gaussian)
284+
pyunit_utils.standalone_test(test_tight_beta_linear_constraints_binomial)
321285
else:
322-
test_light_tight_linear_constraints_only_gaussian()
286+
test_tight_beta_linear_constraints_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_tight_equality_linear_constraints_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_light_tight_linear_constraints_only_gaussian():
6+
def test_tight_equality_linear_constraints_binomial():
77
'''
88
Test constrained GLM with equality and less than and equal to constraints. The constraints are very
99
tight and coefficients from GLM built without constraints won't be able to satisfied the constraints.
@@ -237,6 +237,6 @@ def test_light_tight_linear_constraints_only_gaussian():
237237
"not.".format(logloss, random_init_logloss)
238238

239239
if __name__ == "__main__":
240-
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_gaussian)
240+
pyunit_utils.standalone_test(test_tight_equality_linear_constraints_binomial)
241241
else:
242-
test_light_tight_linear_constraints_only_gaussian()
242+
test_tight_equality_linear_constraints_binomial()

h2o-py/tests/testdir_algos/glm/pyunit_GH_6722_tight_linear_constraints_only_binomial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from tests import pyunit_utils
44
from tests.pyunit_utils import utils_for_glm_tests
55

6-
def test_light_tight_linear_constraints_only_gaussian():
6+
def test_tight_linear_constraints_binomial():
77
'''
88
Test constrained GLM with less than and equal to constraints. The constraints are very
99
tight and coefficients from GLM built without constraints won't be able to satisfied the constraints.
@@ -201,6 +201,6 @@ def test_light_tight_linear_constraints_only_gaussian():
201201
"not.".format(logloss, random_init_logloss)
202202

203203
if __name__ == "__main__":
204-
pyunit_utils.standalone_test(test_light_tight_linear_constraints_only_gaussian)
204+
pyunit_utils.standalone_test(test_tight_linear_constraints_binomial)
205205
else:
206-
test_light_tight_linear_constraints_only_gaussian()
206+
test_tight_linear_constraints_binomial()

0 commit comments

Comments
 (0)