8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9435c9 commit a0fd37aCopy full SHA for a0fd37a
sklearn/tree/tests/test_tree.py
@@ -1619,10 +1619,12 @@ def test_criterion_copy():
1619
# Let's check whether copy of our criterion has the same type
1620
# and properties as original
1621
n_outputs = 3
1622
- n_classes = np.arange(3)
+ n_classes = np.arange(3, dtype=np.intp)
1623
n_samples = 100
1624
- pickle_copy = lambda obj: pickle.loads(pickle.dumps(obj))
1625
- for copy_func in [copy.copy, copy.deepcopy, pickle_copy]:
+
+ def _pickle_copy(obj):
1626
+ return pickle.loads(pickle.dumps(obj))
1627
+ for copy_func in [copy.copy, copy.deepcopy, _pickle_copy]:
1628
for _, typename in CRITERIA_CLF.items():
1629
criteria = typename(n_outputs, n_classes)
1630
result = copy_func(criteria).__reduce__()
0 commit comments