Skip to content
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

MAINT Update submodule commit and remove cnp imports where possible #249

Merged
merged 13 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sktree/_lib/sklearn_fork
Submodule sklearn_fork updated 153 files
3 changes: 1 addition & 2 deletions sktree/tree/_oblique_splitter.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@

import numpy as np

cimport numpy as cnp
from libcpp.vector cimport vector

from .._lib.sklearn.tree._criterion cimport Criterion
from .._lib.sklearn.tree._splitter cimport SplitRecord, Splitter
from .._lib.sklearn.tree._utils cimport UINT32_t
from .._lib.sklearn.utils._typedefs cimport float32_t, float64_t, intp_t
from .._lib.sklearn.utils._typedefs cimport float32_t, float64_t, int8_t, intp_t
from ._sklearn_splitter cimport sort


Expand Down
6 changes: 3 additions & 3 deletions sktree/tree/_oblique_splitter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ cdef class ObliqueSplitter(BaseObliqueSplitter):
intp_t min_samples_leaf,
float64_t min_weight_leaf,
object random_state,
const cnp.int8_t[:] monotonic_cst,
const int8_t[:] monotonic_cst,
float64_t feature_combinations,
*argv
):
Expand Down Expand Up @@ -667,7 +667,7 @@ cdef class MultiViewSplitter(BestObliqueSplitter):
intp_t min_samples_leaf,
float64_t min_weight_leaf,
object random_state,
const cnp.int8_t[:] monotonic_cst,
const int8_t[:] monotonic_cst,
float64_t feature_combinations,
const intp_t[:] feature_set_ends,
intp_t n_feature_sets,
Expand Down Expand Up @@ -839,7 +839,7 @@ cdef class MultiViewObliqueSplitter(BestObliqueSplitter):
intp_t min_samples_leaf,
float64_t min_weight_leaf,
object random_state,
const cnp.int8_t[:] monotonic_cst,
const int8_t[:] monotonic_cst,
float64_t feature_combinations,
const intp_t[:] feature_set_ends,
intp_t n_feature_sets,
Expand Down
5 changes: 2 additions & 3 deletions sktree/tree/manifold/_morf_splitter.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

import numpy as np

cimport numpy as cnp
from libcpp.vector cimport vector

from ..._lib.sklearn.tree._splitter cimport SplitRecord
from ..._lib.sklearn.tree._utils cimport UINT32_t
from ..._lib.sklearn.utils._typedefs cimport float32_t, float64_t, intp_t
from ..._lib.sklearn.utils._typedefs cimport float32_t, float64_t, int8_t, intp_t, uint8_t
from .._oblique_splitter cimport BestObliqueSplitter, ObliqueSplitRecord

# https://github.com/cython/cython/blob/master/Cython/Includes/libcpp/algorithm.pxd
Expand Down Expand Up @@ -53,7 +52,7 @@ cdef class PatchSplitter(BestObliqueSplitter):
cdef const intp_t[:] data_dims # The dimensions of the input data
cdef const intp_t[:] min_patch_dims # The minimum size of the patch to sample in each dimension
cdef const intp_t[:] max_patch_dims # The maximum size of the patch to sample in each dimension
cdef const cnp.uint8_t[:] dim_contiguous # A boolean array indicating whether each dimension is contiguous
cdef const uint8_t[:] dim_contiguous # A boolean array indicating whether each dimension is contiguous

# TODO: check if this works and is necessary for discontiguous data
# cdef intp_t[:] stride_offsets # The stride offsets for each dimension
Expand Down
8 changes: 2 additions & 6 deletions sktree/tree/manifold/_morf_splitter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

import numpy as np

cimport numpy as cnp

cnp.import_array()

from cython.operator cimport dereference as deref
from libcpp.vector cimport vector

Expand Down Expand Up @@ -124,11 +120,11 @@ cdef class BestPatchSplitter(BaseDensePatchSplitter):
intp_t min_samples_leaf,
float64_t min_weight_leaf,
object random_state,
const cnp.int8_t[:] monotonic_cst,
const int8_t[:] monotonic_cst,
float64_t feature_combinations,
const intp_t[:] min_patch_dims,
const intp_t[:] max_patch_dims,
const cnp.uint8_t[:] dim_contiguous,
const uint8_t[:] dim_contiguous,
const intp_t[:] data_dims,
bytes boundary,
const float32_t[:, :] feature_weight,
Expand Down
1 change: 0 additions & 1 deletion sktree/tree/unsupervised/_unsup_oblique_splitter.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np

cimport numpy as cnp
from libcpp.vector cimport vector

from ..._lib.sklearn.tree._splitter cimport SplitRecord
Expand Down
4 changes: 0 additions & 4 deletions sktree/tree/unsupervised/_unsup_oblique_splitter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

import numpy as np

cimport numpy as cnp

cnp.import_array()

from cython.operator cimport dereference as deref
from libcpp.vector cimport vector

Expand Down
4 changes: 0 additions & 4 deletions sktree/tree/unsupervised/_unsup_splitter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

import numpy as np

cimport numpy as cnp

cnp.import_array()

from libc.string cimport memcpy

from ..._lib.sklearn.tree._utils cimport RAND_R_MAX, rand_int
Expand Down
Loading