@@ -286,14 +286,15 @@ cdef inline int node_split_best(
286
286
Criterion criterion,
287
287
SplitRecord* split,
288
288
ParentInfo* parent_record,
289
- bint with_monotonic_cst,
290
- const int8_t[:] monotonic_cst,
291
289
) except - 1 nogil:
292
290
""" Find the best split on node samples[start:end]
293
291
294
292
Returns -1 in case of failure to allocate memory (and raise MemoryError)
295
293
or 0 otherwise.
296
294
"""
295
+ cdef const int8_t[:] monotonic_cst = splitter.monotonic_cst
296
+ cdef bint with_monotonic_cst = splitter.with_monotonic_cst
297
+
297
298
# Find the best split
298
299
cdef intp_t start = splitter.start
299
300
cdef intp_t end = splitter.end
@@ -667,14 +668,15 @@ cdef inline int node_split_random(
667
668
Criterion criterion,
668
669
SplitRecord* split,
669
670
ParentInfo* parent_record,
670
- bint with_monotonic_cst,
671
- const int8_t[:] monotonic_cst,
672
671
) except - 1 nogil:
673
672
""" Find the best random split on node samples[start:end]
674
673
675
674
Returns -1 in case of failure to allocate memory (and raise MemoryError)
676
675
or 0 otherwise.
677
676
"""
677
+ cdef const int8_t[:] monotonic_cst = splitter.monotonic_cst
678
+ cdef bint with_monotonic_cst = splitter.with_monotonic_cst
679
+
678
680
# Draw random splits and pick the best
679
681
cdef intp_t start = splitter.start
680
682
cdef intp_t end = splitter.end
@@ -1512,8 +1514,6 @@ cdef class BestSplitter(Splitter):
1512
1514
self .criterion,
1513
1515
split,
1514
1516
parent_record,
1515
- self .with_monotonic_cst,
1516
- self .monotonic_cst,
1517
1517
)
1518
1518
1519
1519
cdef class BestSparseSplitter(Splitter):
@@ -1542,8 +1542,6 @@ cdef class BestSparseSplitter(Splitter):
1542
1542
self .criterion,
1543
1543
split,
1544
1544
parent_record,
1545
- self .with_monotonic_cst,
1546
- self .monotonic_cst,
1547
1545
)
1548
1546
1549
1547
cdef class RandomSplitter(Splitter):
@@ -1572,8 +1570,6 @@ cdef class RandomSplitter(Splitter):
1572
1570
self .criterion,
1573
1571
split,
1574
1572
parent_record,
1575
- self .with_monotonic_cst,
1576
- self .monotonic_cst,
1577
1573
)
1578
1574
1579
1575
cdef class RandomSparseSplitter(Splitter):
@@ -1601,6 +1597,4 @@ cdef class RandomSparseSplitter(Splitter):
1601
1597
self .criterion,
1602
1598
split,
1603
1599
parent_record,
1604
- self .with_monotonic_cst,
1605
- self .monotonic_cst,
1606
1600
)
0 commit comments