@@ -418,14 +418,17 @@ cdef inline intp_t node_split_best(
418
418
Criterion criterion,
419
419
SplitRecord* split,
420
420
ParentInfo* parent_record,
421
- bint with_monotonic_cst,
422
- const int8_t[:] monotonic_cst,
421
+ # bint with_monotonic_cst,
422
+ # const int8_t[:] monotonic_cst,
423
423
) except - 1 nogil:
424
424
""" Find the best split on node samples[start:end]
425
425
426
426
Returns -1 in case of failure to allocate memory (and raise MemoryError)
427
427
or 0 otherwise.
428
428
"""
429
+ cdef const int8_t[:] monotonic_cst = splitter.monotonic_cst
430
+ cdef bint with_monotonic_cst = splitter.with_monotonic_cst
431
+
429
432
# Find the best split
430
433
cdef intp_t start = splitter.start
431
434
cdef intp_t end = splitter.end
@@ -809,14 +812,15 @@ cdef inline int node_split_random(
809
812
Criterion criterion,
810
813
SplitRecord* split,
811
814
ParentInfo* parent_record,
812
- bint with_monotonic_cst,
813
- const int8_t[:] monotonic_cst,
814
815
) except - 1 nogil:
815
816
""" Find the best random split on node samples[start:end]
816
817
817
818
Returns -1 in case of failure to allocate memory (and raise MemoryError)
818
819
or 0 otherwise.
819
820
"""
821
+ cdef const int8_t[:] monotonic_cst = splitter.monotonic_cst
822
+ cdef bint with_monotonic_cst = splitter.with_monotonic_cst
823
+
820
824
# Draw random splits and pick the best
821
825
cdef intp_t start = splitter.start
822
826
cdef intp_t end = splitter.end
@@ -1662,8 +1666,6 @@ cdef class BestSplitter(Splitter):
1662
1666
self .criterion,
1663
1667
split,
1664
1668
parent_record,
1665
- self .with_monotonic_cst,
1666
- self .monotonic_cst,
1667
1669
)
1668
1670
1669
1671
cdef class BestSparseSplitter(Splitter):
@@ -1692,8 +1694,6 @@ cdef class BestSparseSplitter(Splitter):
1692
1694
self .criterion,
1693
1695
split,
1694
1696
parent_record,
1695
- self .with_monotonic_cst,
1696
- self .monotonic_cst,
1697
1697
)
1698
1698
1699
1699
cdef class RandomSplitter(Splitter):
@@ -1722,8 +1722,6 @@ cdef class RandomSplitter(Splitter):
1722
1722
self .criterion,
1723
1723
split,
1724
1724
parent_record,
1725
- self .with_monotonic_cst,
1726
- self .monotonic_cst,
1727
1725
)
1728
1726
1729
1727
cdef class RandomSparseSplitter(Splitter):
@@ -1751,6 +1749,4 @@ cdef class RandomSparseSplitter(Splitter):
1751
1749
self .criterion,
1752
1750
split,
1753
1751
parent_record,
1754
- self .with_monotonic_cst,
1755
- self .monotonic_cst,
1756
1752
)
0 commit comments