8000 MAINT Handle `Criterion.samples` using a memoryview (#25005) · scikit-learn/scikit-learn@599e03c · GitHub
[go: up one dir, main page]

Skip to content

Commit 599e03c

Browse files
adam2392jshinm
andauthored
MAINT Handle Criterion.samples using a memoryview (#25005)
Co-authored-by: Jong Shin <jshin.m@gmail.com>
1 parent ba5f9e0 commit 599e03c

File tree

3 files changed

+80
-78
lines changed

3 files changed

+80
-78
lines changed

sklearn/tree/_criterion.pxd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cdef class Criterion:
2424
cdef const DOUBLE_t[:, ::1] y # Values of y
2525
cdef const DOUBLE_t[:] sample_weight # Sample weights
2626

27-
cdef SIZE_t* samples # Sample indices in X, y
27+
cdef const SIZE_t[:] sample_indices # Sample indices in X, y
2828
cdef SIZE_t start # samples[start:pos] are the samples in the left node
2929
cdef SIZE_t pos # samples[pos:end] are the samples in the right node
3030
cdef SIZE_t end
@@ -46,7 +46,7 @@ cdef class Criterion:
4646
const DOUBLE_t[:, ::1] y,
4747
const DOUBLE_t[:] sample_weight,
4848
double weighted_n_samples,
49-
SIZE_t* samples,
49+
const SIZE_t[:] sample_indices,
5050
SIZE_t start,
5151
SIZE_t end
5252
) nogil except -1

0 commit comments

Comments
 (0)
0