8000 MAINT Handle `Criterion.samples` using a memoryview by adam2392 · Pull Request #25005 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MAINT Handle Criterion.samples using a memoryview #25005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Dec 1, 2022
4 changes: 2 additions & 2 deletions sklearn/tree/_criterion.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cdef class Criterion:
cdef const DOUBLE_t[:, ::1] y # Values of y
cdef const DOUBLE_t[:] sample_weight # Sample weights

cdef SIZE_t* samples # Sample indices in X, y
cdef const SIZE_t[:] sample_indices # Sample indices in X, y
cdef SIZE_t start # samples[start:pos] are the samples in the left node
cdef SIZE_t pos # samples[pos:end] are the samples in the right node
cdef SIZE_t end
Expand All @@ -46,7 +46,7 @@ cdef class Criterion:
const DOUBLE_t[:, ::1] y,
const DOUBLE_t[:] sample_weight,
double weighted_n_samples,
SIZE_t* samples,
const SIZE_t[:] sample_indices,
SIZE_t start,
SIZE_t end
) nogil except -1
Expand Down
Loading
0