From bda486db469a0ea3c00c303fc89c73eb69d64a3c Mon Sep 17 00:00:00 2001 From: Jacob Schreiber Date: Thu, 16 Jul 2015 09:53:03 +0200 Subject: [PATCH 1/3] Generated C file --- sklearn/tree/_tree.c | 356 +++++++++++++++++++++---------------------- 1 file changed, 178 insertions(+), 178 deletions(-) diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index 27ca4c4b631e9..6d6906ae6893e 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -512,7 +512,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -521,7 +521,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -530,7 +530,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -539,7 +539,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":729 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -548,7 +548,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -557,7 +557,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -566,7 +566,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -575,7 +575,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":736 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -584,7 +584,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -593,7 +593,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":741 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -602,7 +602,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -611,7 +611,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -620,7 +620,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -629,7 +629,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -638,7 +638,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -647,7 +647,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -656,7 +656,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -665,7 +665,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -674,7 +674,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -683,7 +683,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -692,7 +692,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -798,7 +798,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSparseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -807,7 +807,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -816,7 +816,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -825,7 +825,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -2470,8 +2470,8 @@ static char __pyx_k_could_not_allocate_d_bytes[] = "could not allocate %d bytes" static char __pyx_k_compute_feature_importances[] = "compute_feature_importances"; static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_could_not_allocate_d_d_bytes[] = "could not allocate (%d * %d) bytes"; -static char __pyx_k_Users_ajoly_Dropbox_git_scikit[] = "/Users/ajoly/Dropbox/git/scikit-learn/sklearn/tree/_tree.pyx"; static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_volatile_jmschrei_Bureau_scikit[] = "/volatile/jmschrei/Bureau/scikit-learn/sklearn/tree/_tree.pyx"; static char __pyx_k_Did_not_recognise_loaded_array_l[] = "Did not recognise loaded array layout"; static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_No_support_for_np_int64_index_ba[] = "No support for np.int64 index based sparse matrices"; @@ -2495,7 +2495,6 @@ static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_TREE_LEAF; static PyObject *__pyx_n_s_TREE_UNDEFINED; -static PyObject *__pyx_kp_s_Users_ajoly_Dropbox_git_scikit; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_X; static PyObject *__pyx_kp_s_X_dtype_should_be_np_float32_got; @@ -2587,6 +2586,7 @@ static PyObject *__pyx_n_s_tocsc; static PyObject *__pyx_n_s_tree; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_values; +static PyObject *__pyx_kp_s_volatile_jmschrei_Bureau_scikit; static PyObject *__pyx_n_s_weighted_n_node_samples; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_zeros; @@ -27968,7 +27968,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -28018,7 +28018,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -28031,7 +28031,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -28040,7 +28040,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -28049,7 +28049,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -28058,7 +28058,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -28068,7 +28068,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -28080,7 +28080,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -28091,7 +28091,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -28105,7 +28105,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -28117,7 +28117,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L6_bool_binop_done:; if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -28131,7 +28131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -28145,7 +28145,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -28157,7 +28157,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L9_bool_binop_done:; if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -28171,7 +28171,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -28180,7 +28180,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -28189,7 +28189,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -28199,7 +28199,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< @@ -28208,7 +28208,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -28217,7 +28217,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -28228,7 +28228,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -28237,7 +28237,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -28250,7 +28250,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -28259,7 +28259,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -28270,7 +28270,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -28279,7 +28279,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -28288,7 +28288,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -28297,7 +28297,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -28306,7 +28306,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -28318,7 +28318,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -28327,7 +28327,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -28345,7 +28345,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -28361,7 +28361,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -28376,7 +28376,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -28386,7 +28386,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -28396,7 +28396,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -28416,7 +28416,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -28434,7 +28434,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L19_bool_binop_done:; if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -28448,7 +28448,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -28457,7 +28457,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -28468,7 +28468,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -28479,7 +28479,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -28490,7 +28490,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -28501,7 +28501,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -28512,7 +28512,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -28523,7 +28523,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -28534,7 +28534,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -28545,7 +28545,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -28556,7 +28556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -28567,7 +28567,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -28578,7 +28578,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -28589,7 +28589,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -28600,7 +28600,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -28611,7 +28611,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -28622,7 +28622,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -28633,7 +28633,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -28645,7 +28645,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -28671,7 +28671,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -28680,7 +28680,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -28692,7 +28692,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -28701,7 +28701,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -28710,7 +28710,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -28719,7 +28719,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -28729,7 +28729,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -28739,7 +28739,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -28771,7 +28771,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -28795,7 +28795,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -28805,7 +28805,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -28817,7 +28817,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -28827,7 +28827,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -28839,7 +28839,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -28851,7 +28851,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -28868,7 +28868,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -28882,7 +28882,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -28901,7 +28901,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -28918,7 +28918,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -28932,7 +28932,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -28951,7 +28951,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -28968,7 +28968,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -28982,7 +28982,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -29001,7 +29001,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -29018,7 +29018,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -29032,7 +29032,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -29051,7 +29051,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -29068,7 +29068,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -29082,7 +29082,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -29101,7 +29101,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":786 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -29133,7 +29133,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":793 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -29142,7 +29142,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -29151,7 +29151,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":797 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -29174,7 +29174,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); __pyx_t_3 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -29191,7 +29191,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -29230,7 +29230,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -29247,7 +29247,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -29261,7 +29261,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":804 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -29281,7 +29281,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -29299,7 +29299,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_L7_bool_binop_done:; if (__pyx_t_6) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -29313,7 +29313,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[2]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -29329,7 +29329,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) break; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":817 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -29338,7 +29338,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -29347,7 +29347,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":819 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -29358,7 +29358,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -29368,7 +29368,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -29378,7 +29378,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_6) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -29390,7 +29390,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); __pyx_t_4 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -29400,7 +29400,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -29414,7 +29414,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[2]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -29432,7 +29432,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< @@ -29450,7 +29450,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -29468,7 +29468,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -29486,7 +29486,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -29504,7 +29504,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -29522,7 +29522,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -29540,7 +29540,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -29558,7 +29558,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -29576,7 +29576,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -29594,7 +29594,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -29612,7 +29612,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -29630,7 +29630,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -29648,7 +29648,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< @@ -29668,7 +29668,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< @@ -29688,7 +29688,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< @@ -29708,7 +29708,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< @@ -29727,7 +29727,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -29750,7 +29750,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -29762,7 +29762,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -29774,7 +29774,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":797 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -29784,7 +29784,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -29794,7 +29794,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":786 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -29819,7 +29819,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -29834,7 +29834,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -29845,7 +29845,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -29857,7 +29857,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -29866,7 +29866,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":975 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -29877,7 +29877,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -29886,7 +29886,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -29895,7 +29895,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -29907,7 +29907,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":979 +/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -29921,7 +29921,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -29931,7 +29931,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":981 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -29945,7 +29945,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -29956,7 +29956,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -31806,7 +31806,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_TREE_LEAF, __pyx_k_TREE_LEAF, sizeof(__pyx_k_TREE_LEAF), 0, 0, 1, 1}, {&__pyx_n_s_TREE_UNDEFINED, __pyx_k_TREE_UNDEFINED, sizeof(__pyx_k_TREE_UNDEFINED), 0, 0, 1, 1}, - {&__pyx_kp_s_Users_ajoly_Dropbox_git_scikit, __pyx_k_Users_ajoly_Dropbox_git_scikit, sizeof(__pyx_k_Users_ajoly_Dropbox_git_scikit), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1}, {&__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_k_X_dtype_should_be_np_float32_got, sizeof(__pyx_k_X_dtype_should_be_np_float32_got), 0, 0, 1, 0}, @@ -31898,6 +31897,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, + {&__pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_k_volatile_jmschrei_Bureau_scikit, sizeof(__pyx_k_volatile_jmschrei_Bureau_scikit), 0, 0, 1, 0}, {&__pyx_n_s_weighted_n_node_samples, __pyx_k_weighted_n_node_samples, sizeof(__pyx_k_weighted_n_node_samples), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, @@ -31961,7 +31961,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< @@ -31972,7 +31972,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< @@ -31983,7 +31983,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -31994,7 +31994,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -32005,7 +32005,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -32016,7 +32016,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -32037,7 +32037,7 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ajoly_Dropbox_git_scikit, __pyx_n_s_realloc_test, 3449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_n_s_realloc_test, 3449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -32878,7 +32878,7 @@ PyMODINIT_FUNC PyInit__tree(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< From 13ba1b1a2709b232d02d8dfd8de14a4a1938495e Mon Sep 17 00:00:00 2001 From: Jacob Schreiber Date: Wed, 8 Jul 2015 10:56:00 +0200 Subject: [PATCH 2/3] Introduce FriedmanMSESplitter as SpeedSplitter, a faster way to do Gradient Boosting. --- sklearn/ensemble/gradient_boosting.py | 18 +- sklearn/tree/_tree.c | 8844 ++++++++++++++++--------- sklearn/tree/_tree.pyx | 901 ++- 3 files changed, 6431 insertions(+), 3332 deletions(-) diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py index 4d741299b2cfe..05e3c21361a4c 100644 --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -45,7 +45,7 @@ from ..tree.tree import DecisionTreeRegressor from ..tree._tree import DTYPE, TREE_LEAF -from ..tree._tree import PresortBestSplitter +from ..tree._tree import PresortBestSplitter, SpeedSplitter from ..tree._tree import FriedmanMSE from ._gradient_boosting import predict_stages @@ -1011,11 +1011,17 @@ def _fit_stages(self, X, y, y_pred, sample_weight, random_state, # init criterion and splitter criterion = FriedmanMSE(1) - splitter = PresortBestSplitter(criterion, - self.max_features_, - self.min_samples_leaf, - min_weight_leaf, - random_state) + #splitter = PresortBestSplitter(criterion, + # self.max_features_, + # self.min_samples_leaf, + # min_weight_leaf, + # random_state) + + splitter = SpeedSplitter(criterion, + self.max_features_, + self.min_samples_leaf, + min_weight_leaf, + random_state) if self.verbose: verbose_reporter = VerboseReporter(self.verbose) diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index 6d6906ae6893e..2bc2aef9d4f9c 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -792,6 +792,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter; +struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_RandomSparseSplitter; @@ -949,7 +950,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":69 +/* "sklearn/tree/_tree.pyx":70 * cdef int IS_NOT_LEFT = 0 * * cdef enum: # <<<<<<<<<<<<<< @@ -960,7 +961,7 @@ enum { __pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX = 0x7FFFFFFF }; -/* "sklearn/tree/_tree.pyx":2617 +/* "sklearn/tree/_tree.pyx":3326 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -972,7 +973,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":2774 +/* "sklearn/tree/_tree.pyx":3484 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1114,12 +1115,12 @@ struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder { }; -/* "sklearn/tree/_tree.pyx":150 +/* "sklearn/tree/_tree.pyx":220 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< - * """Abstract criterion for classification.""" - * cdef SIZE_t* n_classes + * """ + * This is a criterion with methods specifically used for classification. */ struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion { struct __pyx_obj_7sklearn_4tree_5_tree_Criterion __pyx_base; @@ -1131,36 +1132,36 @@ struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion { }; -/* "sklearn/tree/_tree.pyx":368 +/* "sklearn/tree/_tree.pyx":521 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Cross Entropy impurity criteria. - * + * """ + * A class representing the Cross Entropy impurity criteria. This handles */ struct __pyx_obj_7sklearn_4tree_5_tree_Entropy { struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; }; -/* "sklearn/tree/_tree.pyx":459 +/* "sklearn/tree/_tree.pyx":643 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Gini Index impurity criteria. - * + * """ + * A class representing the Gini Index impurity criteria. This handles */ struct __pyx_obj_7sklearn_4tree_5_tree_Gini { struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; }; -/* "sklearn/tree/_tree.pyx":553 +/* "sklearn/tree/_tree.pyx":770 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< - * """Abstract criterion for regression. - * + * """ + * A class representing a regression criteria. This handles cases where the */ struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion { struct __pyx_obj_7sklearn_4tree_5_tree_Criterion __pyx_base; @@ -1178,7 +1179,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion { }; -/* "sklearn/tree/_tree.pyx":836 +/* "sklearn/tree/_tree.pyx":1070 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1190,7 +1191,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_MSE { }; -/* "sklearn/tree/_tree.pyx":877 +/* "sklearn/tree/_tree.pyx":1111 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1202,7 +1203,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE { }; -/* "sklearn/tree/_tree.pyx":1031 +/* "sklearn/tree/_tree.pyx":1372 * * * cdef class BaseDenseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1217,7 +1218,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter { }; -/* "sklearn/tree/_tree.pyx":1062 +/* "sklearn/tree/_tree.pyx":1405 * * * cdef class BestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1229,7 +1230,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter { }; -/* "sklearn/tree/_tree.pyx":1361 +/* "sklearn/tree/_tree.pyx":1704 * * * cdef class RandomSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1241,7 +1242,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter { }; -/* "sklearn/tree/_tree.pyx":1563 +/* "sklearn/tree/_tree.pyx":1906 * * * cdef class PresortBestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1259,8 +1260,27 @@ struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter { }; -/* "sklearn/tree/_tree.pyx":1811 +/* "sklearn/tree/_tree.pyx":2153 + * n_constant_features[0] = n_total_constants * + * cdef class SpeedSplitter( BaseDenseSplitter ): # <<<<<<<<<<<<<< + * """ + * This object is a splitter which performs more caching in order to try to + */ +struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter { + struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter __pyx_base; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *X_old; + PyArrayObject *X_idx_sorted; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t X_idx_sorted_stride; + __pyx_t_7sklearn_4tree_5_tree_INT32_t *X_idx_sorted_ptr; + unsigned char *sample_mask; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t X_feature_stride; + double impurity; +}; + + +/* "sklearn/tree/_tree.pyx":2520 + * return self.impurity * * cdef class BaseSparseSplitter(Splitter): # <<<<<<<<<<<<<< * # The sparse splitter works only with csc sparse matrix format @@ -1277,7 +1297,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2130 +/* "sklearn/tree/_tree.pyx":2839 * * * cdef class BestSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1289,7 +1309,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2348 +/* "sklearn/tree/_tree.pyx":3057 * * * cdef class RandomSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1301,7 +1321,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2605 +/* "sklearn/tree/_tree.pyx":3314 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1313,7 +1333,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { }; -/* "sklearn/tree/_tree.pyx":2754 +/* "sklearn/tree/_tree.pyx":3464 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1359,12 +1379,12 @@ struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap { static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap; -/* "sklearn/tree/_tree.pyx":97 +/* "sklearn/tree/_tree.pyx":98 * # ============================================================================= * * cdef class Criterion: # <<<<<<<<<<<<<< - * """Interface for impurity criteria.""" - * + * """ + * Interface for impurity criteria. This object stores methods on how to */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion { @@ -1379,12 +1399,12 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; -/* "sklearn/tree/_tree.pyx":922 +/* "sklearn/tree/_tree.pyx":1156 * * * cdef class Splitter: # <<<<<<<<<<<<<< - * def __cinit__(self, Criterion criterion, SIZE_t max_features, - * SIZE_t min_samples_leaf, double min_weight_leaf, + * """ + * Interface for the splitter class. This is an object which handles efficient */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter { @@ -1397,7 +1417,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; -/* "sklearn/tree/_tree.pyx":2958 +/* "sklearn/tree/_tree.pyx":3668 * # ============================================================================= * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1422,7 +1442,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *); -/* "sklearn/tree/_tree.pyx":2566 +/* "sklearn/tree/_tree.pyx":3275 * # Tree builders * # ============================================================================= * cdef class TreeBuilder: # <<<<<<<<<<<<<< @@ -1438,12 +1458,12 @@ static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtabptr_ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, PyObject *, PyArrayObject *, PyArrayObject *); -/* "sklearn/tree/_tree.pyx":150 +/* "sklearn/tree/_tree.pyx":220 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< - * """Abstract criterion for classification.""" - * cdef SIZE_t* n_classes + * """ + * This is a criterion with methods specifically used for classification. */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion { @@ -1452,12 +1472,12 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion; -/* "sklearn/tree/_tree.pyx":368 +/* "sklearn/tree/_tree.pyx":521 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Cross Entropy impurity criteria. - * + * """ + * A class representing the Cross Entropy impurity criteria. This handles */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy { @@ -1466,12 +1486,12 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy *__pyx_vtabptr_7sklearn_4tree_5_tree_Entropy; -/* "sklearn/tree/_tree.pyx":459 +/* "sklearn/tree/_tree.pyx":643 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Gini Index impurity criteria. - * + * """ + * A class representing the Gini Index impurity criteria. This handles */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini { @@ -1480,12 +1500,12 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini *__pyx_vtabptr_7sklearn_4tree_5_tree_Gini; -/* "sklearn/tree/_tree.pyx":553 +/* "sklearn/tree/_tree.pyx":770 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< - * """Abstract criterion for regression. - * + * """ + * A class representing a regression criteria. This handles cases where the */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion { @@ -1494,7 +1514,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion; -/* "sklearn/tree/_tree.pyx":836 +/* "sklearn/tree/_tree.pyx":1070 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1508,7 +1528,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE *__pyx_vtabptr_7sklearn_4tree_5_tree_MSE; -/* "sklearn/tree/_tree.pyx":877 +/* "sklearn/tree/_tree.pyx":1111 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1522,7 +1542,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE; -/* "sklearn/tree/_tree.pyx":1031 +/* "sklearn/tree/_tree.pyx":1372 * * * cdef class BaseDenseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1536,7 +1556,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BaseDenseSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BaseDenseSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter; -/* "sklearn/tree/_tree.pyx":1062 +/* "sklearn/tree/_tree.pyx":1405 * * * cdef class BestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1550,7 +1570,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter; -/* "sklearn/tree/_tree.pyx":1361 +/* "sklearn/tree/_tree.pyx":1704 * * * cdef class RandomSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1564,7 +1584,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter; -/* "sklearn/tree/_tree.pyx":1563 +/* "sklearn/tree/_tree.pyx":1906 * * * cdef class PresortBestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1578,8 +1598,22 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter; -/* "sklearn/tree/_tree.pyx":1811 +/* "sklearn/tree/_tree.pyx":2153 + * n_constant_features[0] = n_total_constants * + * cdef class SpeedSplitter( BaseDenseSplitter ): # <<<<<<<<<<<<<< + * """ + * This object is a splitter which performs more caching in order to try to + */ + +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_SpeedSplitter { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BaseDenseSplitter __pyx_base; +}; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter; + + +/* "sklearn/tree/_tree.pyx":2520 + * return self.impurity * * cdef class BaseSparseSplitter(Splitter): # <<<<<<<<<<<<<< * # The sparse splitter works only with csc sparse matrix format @@ -1596,7 +1630,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, int *); -/* "sklearn/tree/_tree.pyx":2130 +/* "sklearn/tree/_tree.pyx":2839 * * * cdef class BestSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1610,7 +1644,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSparseSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSparseSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter; -/* "sklearn/tree/_tree.pyx":2348 +/* "sklearn/tree/_tree.pyx":3057 * * * cdef class RandomSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1624,7 +1658,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSparseSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSparseSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter; -/* "sklearn/tree/_tree.pyx":2605 +/* "sklearn/tree/_tree.pyx":3314 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1638,7 +1672,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; -/* "sklearn/tree/_tree.pyx":2754 +/* "sklearn/tree/_tree.pyx":3464 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -2081,6 +2115,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter *__pyx_v_self, double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self, double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ +static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ +static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ +static double __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, double __pyx_v_threshold, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end_negative, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start_positive, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_zero_pos); /* proto*/ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_feature, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_end_negative, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_start_positive, int *__pyx_v_is_samples_sorted); /* proto*/ @@ -2218,6 +2255,7 @@ static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter = 0; @@ -2297,6 +2335,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce__(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ +static void __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self); /* proto */ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter *__pyx_v_self); /* proto */ @@ -2352,6 +2393,7 @@ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BaseDenseSplitter(PyTypeObje static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_SpeedSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BaseSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -2459,6 +2501,7 @@ static char __pyx_k_asfortranarray[] = "asfortranarray"; static char __pyx_k_max_leaf_nodes[] = "max_leaf_nodes"; static char __pyx_k_n_node_samples[] = "n_node_samples"; static char __pyx_k_min_weight_leaf[] = "min_weight_leaf"; +static char __pyx_k_mn_samples_leaf[] = "mn_samples_leaf"; static char __pyx_k_min_samples_leaf[] = "min_samples_leaf"; static char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; static char __pyx_k_min_samples_split[] = "min_samples_split"; @@ -2545,6 +2588,7 @@ static PyObject *__pyx_n_s_max_leaf_nodes; static PyObject *__pyx_n_s_min_samples_leaf; static PyObject *__pyx_n_s_min_samples_split; static PyObject *__pyx_n_s_min_weight_leaf; +static PyObject *__pyx_n_s_mn_samples_leaf; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_n_classes; static PyObject *__pyx_n_s_n_features; @@ -2608,8 +2652,8 @@ static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_codeobj__13; -/* "sklearn/tree/_tree.pyx":100 - * """Interface for impurity criteria.""" +/* "sklearn/tree/_tree.pyx":104 + * """ * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< * double weighted_n_samples, SIZE_t* samples, SIZE_t start, @@ -2621,12 +2665,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_init(CYTHON_UNUSED struct _ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":107 +/* "sklearn/tree/_tree.pyx":133 * pass * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< - * """Reset the criterion at pos=start.""" - * pass + * """ + * This is a placeholder for a method which will reset the criterion at */ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_reset(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self) { @@ -2634,12 +2678,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_reset(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":111 +/* "sklearn/tree/_tree.pyx":141 * pass * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< - * """Update the collected statistics by moving samples[pos:new_pos] from - * the right child to the left child.""" + * """ + * This is a placeholder for a method which will update the collected */ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_update(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_new_pos) { @@ -2647,12 +2691,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_update(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":116 +/* "sklearn/tree/_tree.pyx":155 * pass * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + * """ + * This is a placeholder for a method which will evaluate the impurity of */ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self) { @@ -2663,12 +2707,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity(CYTHON_UNUS return __pyx_r; } -/* "sklearn/tree/_tree.pyx":121 +/* "sklearn/tree/_tree.pyx":164 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: - * """Evaluate the impurity in children nodes, i.e. the impurity of + * """ */ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, CYTHON_UNUSED double *__pyx_v_impurity_left, CYTHON_UNUSED double *__pyx_v_impurity_right) { @@ -2676,12 +2720,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity(CYTHON_UN /* function exit code */ } -/* "sklearn/tree/_tree.pyx":127 +/* "sklearn/tree/_tree.pyx":183 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< - * """Compute the node value of samples[start:end] into dest.""" - * pass + * """ + * This is a placeholder for a method which will compute the node value */ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, CYTHON_UNUSED double *__pyx_v_dest) { @@ -2689,12 +2733,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value(CYTHON_UNUSED st /* function exit code */ } -/* "sklearn/tree/_tree.pyx":131 +/* "sklearn/tree/_tree.pyx":196 * pass * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< - * """Weighted impurity improvement, i.e. - * + * """ + * This is a placeholder for a method which will compute the improvement */ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, double __pyx_v_impurity) { @@ -2702,7 +2746,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru double __pyx_v_impurity_right; double __pyx_r; - /* "sklearn/tree/_tree.pyx":143 + /* "sklearn/tree/_tree.pyx":213 * cdef double impurity_right * * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< @@ -2711,7 +2755,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_vtab)->children_impurity(__pyx_v_self, (&__pyx_v_impurity_left), (&__pyx_v_impurity_right)); - /* "sklearn/tree/_tree.pyx":145 + /* "sklearn/tree/_tree.pyx":215 * self.children_impurity(&impurity_left, &impurity_right) * * return ((self.weighted_n_node_samples / self.weighted_n_samples) * # <<<<<<<<<<<<<< @@ -2721,12 +2765,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru __pyx_r = ((__pyx_v_self->weighted_n_node_samples / __pyx_v_self->weighted_n_samples) * ((__pyx_v_impurity - ((__pyx_v_self->weighted_n_right / __pyx_v_self->weighted_n_node_samples) * __pyx_v_impurity_right)) - ((__pyx_v_self->weighted_n_left / __pyx_v_self->weighted_n_node_samples) * __pyx_v_impurity_left))); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":131 + /* "sklearn/tree/_tree.pyx":196 * pass * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< - * """Weighted impurity improvement, i.e. - * + * """ + * This is a placeholder for a method which will compute the improvement */ /* function exit code */ @@ -2734,12 +2778,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":158 +/* "sklearn/tree/_tree.pyx":231 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< * np.ndarray[SIZE_t, ndim=1] n_classes): - * # Default values + * """ */ /* Python wrapper */ @@ -2773,11 +2817,11 @@ static int __pyx_pw_7sklearn_4tree_5_tree_23ClassificationCriterion_1__cinit__(P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_classes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2785,18 +2829,18 @@ static int __pyx_pw_7sklearn_4tree_5_tree_23ClassificationCriterion_1__cinit__(P values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } - __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_n_classes = ((PyArrayObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.ClassificationCriterion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *)__pyx_v_self), __pyx_v_n_outputs, __pyx_v_n_classes); /* function exit code */ @@ -2833,21 +2877,21 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_pybuffernd_n_classes.rcbuffer = &__pyx_pybuffer_n_classes; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_n_classes.diminfo[0].strides = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n_classes.diminfo[0].shape = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.shape[0]; - /* "sklearn/tree/_tree.pyx":161 - * np.ndarray[SIZE_t, ndim=1] n_classes): - * # Default values + /* "sklearn/tree/_tree.pyx":245 + * """ + * * self.y = NULL # <<<<<<<<<<<<<< * self.y_stride = 0 * self.sample_weight = NULL */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":162 - * # Default values + /* "sklearn/tree/_tree.pyx":246 + * * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< * self.sample_weight = NULL @@ -2855,7 +2899,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":163 + /* "sklearn/tree/_tree.pyx":247 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -2864,7 +2908,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":165 + /* "sklearn/tree/_tree.pyx":249 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -2873,7 +2917,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":166 + /* "sklearn/tree/_tree.pyx":250 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -2882,7 +2926,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":167 + /* "sklearn/tree/_tree.pyx":251 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -2891,7 +2935,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":168 + /* "sklearn/tree/_tree.pyx":252 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -2900,7 +2944,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":170 + /* "sklearn/tree/_tree.pyx":254 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -2909,7 +2953,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.n_outputs = __pyx_v_n_outputs; - /* "sklearn/tree/_tree.pyx":171 + /* "sklearn/tree/_tree.pyx":255 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -2918,7 +2962,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.n_node_samples = 0; - /* "sklearn/tree/_tree.pyx":172 + /* "sklearn/tree/_tree.pyx":256 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -2927,7 +2971,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.weighted_n_node_samples = 0.0; - /* "sklearn/tree/_tree.pyx":173 + /* "sklearn/tree/_tree.pyx":257 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -2936,7 +2980,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":174 + /* "sklearn/tree/_tree.pyx":258 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -2945,7 +2989,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_tree.pyx":176 + /* "sklearn/tree/_tree.pyx":260 * self.weighted_n_right = 0.0 * * self.label_count_left = NULL # <<<<<<<<<<<<<< @@ -2954,7 +2998,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_left = NULL; - /* "sklearn/tree/_tree.pyx":177 + /* "sklearn/tree/_tree.pyx":261 * * self.label_count_left = NULL * self.label_count_right = NULL # <<<<<<<<<<<<<< @@ -2963,34 +3007,34 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_right = NULL; - /* "sklearn/tree/_tree.pyx":178 + /* "sklearn/tree/_tree.pyx":262 * self.label_count_left = NULL * self.label_count_right = NULL * self.label_count_total = NULL # <<<<<<<<<<<<<< * - * # Count labels for each output + * # Initialize variables for each response based on the number of unique */ __pyx_v_self->label_count_total = NULL; - /* "sklearn/tree/_tree.pyx":181 - * - * # Count labels for each output + /* "sklearn/tree/_tree.pyx":266 + * # Initialize variables for each response based on the number of unique + * # classes in that response * self.n_classes = NULL # <<<<<<<<<<<<<< - * safe_realloc(&self.n_classes, n_outputs) * + * # Allocate memory space for each response */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_tree.pyx":182 - * # Count labels for each output - * self.n_classes = NULL + /* "sklearn/tree/_tree.pyx":269 + * + * # Allocate memory space for each response * safe_realloc(&self.n_classes, n_outputs) # <<<<<<<<<<<<<< * * cdef SIZE_t k = 0 */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":184 + /* "sklearn/tree/_tree.pyx":271 * safe_realloc(&self.n_classes, n_outputs) * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -2999,18 +3043,18 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":185 + /* "sklearn/tree/_tree.pyx":272 * * cdef SIZE_t k = 0 * cdef SIZE_t label_count_stride = 0 # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * # For each response, set the number of unique classes in that response, */ __pyx_v_label_count_stride = 0; - /* "sklearn/tree/_tree.pyx":187 - * cdef SIZE_t label_count_stride = 0 - * + /* "sklearn/tree/_tree.pyx":276 + * # For each response, set the number of unique classes in that response, + * # and also set the stride for that response * for k in range(n_outputs): # <<<<<<<<<<<<<< * self.n_classes[k] = n_classes[k] * @@ -3019,8 +3063,8 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_k = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":188 - * + /* "sklearn/tree/_tree.pyx":277 + * # and also set the stride for that response * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< * @@ -3029,7 +3073,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_3 = __pyx_v_k; (__pyx_v_self->n_classes[__pyx_v_k]) = (*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_n_classes.diminfo[0].strides)); - /* "sklearn/tree/_tree.pyx":190 + /* "sklearn/tree/_tree.pyx":279 * self.n_classes[k] = n_classes[k] * * if n_classes[k] > label_count_stride: # <<<<<<<<<<<<<< @@ -3040,7 +3084,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_5 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_n_classes.diminfo[0].strides)) > __pyx_v_label_count_stride) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":191 + /* "sklearn/tree/_tree.pyx":280 * * if n_classes[k] > label_count_stride: * label_count_stride = n_classes[k] # <<<<<<<<<<<<<< @@ -3054,7 +3098,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":193 + /* "sklearn/tree/_tree.pyx":282 * label_count_stride = n_classes[k] * * self.label_count_stride = label_count_stride # <<<<<<<<<<<<<< @@ -3063,7 +3107,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_stride = __pyx_v_label_count_stride; - /* "sklearn/tree/_tree.pyx":196 + /* "sklearn/tree/_tree.pyx":285 * * # Allocate counters * cdef SIZE_t n_elements = n_outputs * label_count_stride # <<<<<<<<<<<<<< @@ -3072,7 +3116,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_n_elements = (__pyx_v_n_outputs * __pyx_v_label_count_stride); - /* "sklearn/tree/_tree.pyx":197 + /* "sklearn/tree/_tree.pyx":286 * # Allocate counters * cdef SIZE_t n_elements = n_outputs * label_count_stride * self.label_count_left = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< @@ -3081,7 +3125,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_left = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":198 + /* "sklearn/tree/_tree.pyx":287 * cdef SIZE_t n_elements = n_outputs * label_count_stride * self.label_count_left = calloc(n_elements, sizeof(double)) * self.label_count_right = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< @@ -3090,7 +3134,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_right = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":199 + /* "sklearn/tree/_tree.pyx":288 * self.label_count_left = calloc(n_elements, sizeof(double)) * self.label_count_right = calloc(n_elements, sizeof(double)) * self.label_count_total = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< @@ -3099,7 +3143,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_total = ((double *)calloc(__pyx_v_n_elements, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":202 + /* "sklearn/tree/_tree.pyx":291 * * # Check for allocation errors * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< @@ -3113,7 +3157,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":203 + /* "sklearn/tree/_tree.pyx":292 * # Check for allocation errors * if (self.label_count_left == NULL or * self.label_count_right == NULL or # <<<<<<<<<<<<<< @@ -3127,7 +3171,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":204 + /* "sklearn/tree/_tree.pyx":293 * if (self.label_count_left == NULL or * self.label_count_right == NULL or * self.label_count_total == NULL): # <<<<<<<<<<<<<< @@ -3139,22 +3183,22 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":205 + /* "sklearn/tree/_tree.pyx":294 * self.label_count_right == NULL or * self.label_count_total == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":158 + /* "sklearn/tree/_tree.pyx":231 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< * np.ndarray[SIZE_t, ndim=1] n_classes): - * # Default values + * """ */ /* function exit code */ @@ -3175,12 +3219,12 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":207 +/* "sklearn/tree/_tree.pyx":296 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor.""" - * free(self.n_classes) + * """ + * Destructor for this class. We have allocated memory to the following */ /* Python wrapper */ @@ -3198,17 +3242,17 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":209 - * def __dealloc__(self): - * """Destructor.""" + /* "sklearn/tree/_tree.pyx":302 + * """ + * * free(self.n_classes) # <<<<<<<<<<<<<< * free(self.label_count_left) * free(self.label_count_right) */ free(__pyx_v_self->n_classes); - /* "sklearn/tree/_tree.pyx":210 - * """Destructor.""" + /* "sklearn/tree/_tree.pyx":303 + * * free(self.n_classes) * free(self.label_count_left) # <<<<<<<<<<<<<< * free(self.label_count_right) @@ -3216,7 +3260,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_left); - /* "sklearn/tree/_tree.pyx":211 + /* "sklearn/tree/_tree.pyx":304 * free(self.n_classes) * free(self.label_count_left) * free(self.label_count_right) # <<<<<<<<<<<<<< @@ -3225,7 +3269,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_right); - /* "sklearn/tree/_tree.pyx":212 + /* "sklearn/tree/_tree.pyx":305 * free(self.label_count_left) * free(self.label_count_right) * free(self.label_count_total) # <<<<<<<<<<<<<< @@ -3234,19 +3278,19 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_total); - /* "sklearn/tree/_tree.pyx":207 + /* "sklearn/tree/_tree.pyx":296 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor.""" - * free(self.n_classes) + * """ + * Destructor for this class. We have allocated memory to the following */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":214 +/* "sklearn/tree/_tree.pyx":307 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3279,7 +3323,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":215 + /* "sklearn/tree/_tree.pyx":308 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< @@ -3288,34 +3332,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":216 + /* "sklearn/tree/_tree.pyx":309 * def __reduce__(self): * return (ClassificationCriterion, * (self.n_outputs, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), * self.__getstate__()) */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":217 + /* "sklearn/tree/_tree.pyx":310 * return (ClassificationCriterion, * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), # <<<<<<<<<<<<<< * self.__getstate__()) * */ - __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->__pyx_base.n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->__pyx_base.n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":216 + /* "sklearn/tree/_tree.pyx":309 * def __reduce__(self): * return (ClassificationCriterion, * (self.n_outputs, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), * self.__getstate__()) */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -3324,14 +3368,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":218 + /* "sklearn/tree/_tree.pyx":311 * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), * self.__getstate__()) # <<<<<<<<<<<<<< * * def __getstate__(self): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { @@ -3344,22 +3388,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red } } if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":215 + /* "sklearn/tree/_tree.pyx":308 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion))); @@ -3374,7 +3418,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":214 + /* "sklearn/tree/_tree.pyx":307 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3396,7 +3440,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red return __pyx_r; } -/* "sklearn/tree/_tree.pyx":220 +/* "sklearn/tree/_tree.pyx":313 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3426,7 +3470,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":221 + /* "sklearn/tree/_tree.pyx":314 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -3434,13 +3478,13 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":220 + /* "sklearn/tree/_tree.pyx":313 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3459,7 +3503,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get return __pyx_r; } -/* "sklearn/tree/_tree.pyx":223 +/* "sklearn/tree/_tree.pyx":316 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -3492,7 +3536,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_8__set return __pyx_r; } -/* "sklearn/tree/_tree.pyx":226 +/* "sklearn/tree/_tree.pyx":319 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< @@ -3521,8 +3565,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; int __pyx_t_8; - /* "sklearn/tree/_tree.pyx":232 - * children samples[start:start] and samples[start:end].""" + /* "sklearn/tree/_tree.pyx":346 + * * # Initialize fields * self.y = y # <<<<<<<<<<<<<< * self.y_stride = y_stride @@ -3530,7 +3574,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.y = __pyx_v_y; - /* "sklearn/tree/_tree.pyx":233 + /* "sklearn/tree/_tree.pyx":347 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -3539,7 +3583,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.y_stride = __pyx_v_y_stride; - /* "sklearn/tree/_tree.pyx":234 + /* "sklearn/tree/_tree.pyx":348 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -3548,7 +3592,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.sample_weight = __pyx_v_sample_weight; - /* "sklearn/tree/_tree.pyx":235 + /* "sklearn/tree/_tree.pyx":349 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -3557,7 +3601,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.samples = __pyx_v_samples; - /* "sklearn/tree/_tree.pyx":236 + /* "sklearn/tree/_tree.pyx":350 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -3566,7 +3610,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":237 + /* "sklearn/tree/_tree.pyx":351 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -3575,7 +3619,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":238 + /* "sklearn/tree/_tree.pyx":352 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< @@ -3584,7 +3628,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":239 + /* "sklearn/tree/_tree.pyx":353 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -3593,7 +3637,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.weighted_n_samples = __pyx_v_weighted_n_samples; - /* "sklearn/tree/_tree.pyx":240 + /* "sklearn/tree/_tree.pyx":354 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -3602,7 +3646,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_weighted_n_node_samples = 0.0; - /* "sklearn/tree/_tree.pyx":243 + /* "sklearn/tree/_tree.pyx":357 * * # Initialize label_count_total and weighted_n_node_samples * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3612,7 +3656,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":244 + /* "sklearn/tree/_tree.pyx":358 * # Initialize label_count_total and weighted_n_node_samples * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3622,7 +3666,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_t_2 = __pyx_v_self->n_classes; __pyx_v_n_classes = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":245 + /* "sklearn/tree/_tree.pyx":359 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -3632,7 +3676,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_t_1 = __pyx_v_self->label_count_stride; __pyx_v_label_count_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":246 + /* "sklearn/tree/_tree.pyx":360 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -3642,7 +3686,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_t_3 = __pyx_v_self->label_count_total; __pyx_v_label_count_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":248 + /* "sklearn/tree/_tree.pyx":362 * cdef double* label_count_total = self.label_count_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -3651,7 +3695,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":249 + /* "sklearn/tree/_tree.pyx":363 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -3660,7 +3704,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":250 + /* "sklearn/tree/_tree.pyx":364 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3669,7 +3713,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":251 + /* "sklearn/tree/_tree.pyx":365 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 # <<<<<<<<<<<<<< @@ -3678,7 +3722,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_c = 0; - /* "sklearn/tree/_tree.pyx":252 + /* "sklearn/tree/_tree.pyx":366 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -3687,18 +3731,18 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":253 + /* "sklearn/tree/_tree.pyx":367 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 * cdef SIZE_t offset = 0 # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * # Allocate memory for each response to store the weighted number of */ __pyx_v_offset = 0; - /* "sklearn/tree/_tree.pyx":255 - * cdef SIZE_t offset = 0 - * + /* "sklearn/tree/_tree.pyx":371 + * # Allocate memory for each response to store the weighted number of + * # samples in each class * for k in range(n_outputs): # <<<<<<<<<<<<<< * memset(label_count_total + offset, 0, * n_classes[k] * sizeof(double)) @@ -3707,8 +3751,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":256 - * + /* "sklearn/tree/_tree.pyx":372 + * # samples in each class * for k in range(n_outputs): * memset(label_count_total + offset, 0, # <<<<<<<<<<<<<< * n_classes[k] * sizeof(double)) @@ -3716,39 +3760,39 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ memset((__pyx_v_label_count_total + __pyx_v_offset), 0, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":258 + /* "sklearn/tree/_tree.pyx":374 * memset(label_count_total + offset, 0, * n_classes[k] * sizeof(double)) * offset += label_count_stride # <<<<<<<<<<<<<< * - * for p in range(start, end): + * # Now go through and record the number of samples for each class for */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":260 - * offset += label_count_stride - * + /* "sklearn/tree/_tree.pyx":378 + * # Now go through and record the number of samples for each class for + * # each response * for p in range(start, end): # <<<<<<<<<<<<<< + * # Identify the next sample in the mask * i = samples[p] - * */ __pyx_t_1 = __pyx_v_end; for (__pyx_t_4 = __pyx_v_start; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_p = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":261 - * + /* "sklearn/tree/_tree.pyx":380 * for p in range(start, end): + * # Identify the next sample in the mask * i = samples[p] # <<<<<<<<<<<<<< * - * if sample_weight != NULL: + * # w is originally set to be 1.0, meaning that if no sample weights */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":263 - * i = samples[p] - * + /* "sklearn/tree/_tree.pyx":384 + * # w is originally set to be 1.0, meaning that if no sample weights + * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: # <<<<<<<<<<<<<< * w = sample_weight[i] * @@ -3756,21 +3800,21 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_t_5 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":264 - * + /* "sklearn/tree/_tree.pyx":385 + * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * # Go through each response and add this sample's class in to the */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); goto __pyx_L7; } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":266 - * w = sample_weight[i] - * + /* "sklearn/tree/_tree.pyx":389 + * # Go through each response and add this sample's class in to the + * # appropriate bin * for k in range(n_outputs): # <<<<<<<<<<<<<< * c = y[i * y_stride + k] * label_count_total[k * label_count_stride + c] += w @@ -3779,8 +3823,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_k = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":267 - * + /* "sklearn/tree/_tree.pyx":390 + * # appropriate bin * for k in range(n_outputs): * c = y[i * y_stride + k] # <<<<<<<<<<<<<< * label_count_total[k * label_count_stride + c] += w @@ -3788,37 +3832,37 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_c = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)])); - /* "sklearn/tree/_tree.pyx":268 + /* "sklearn/tree/_tree.pyx":391 * for k in range(n_outputs): * c = y[i * y_stride + k] * label_count_total[k * label_count_stride + c] += w # <<<<<<<<<<<<<< * - * weighted_n_node_samples += w + * # Add the weight to the sum of weights so far */ __pyx_t_8 = ((__pyx_v_k * __pyx_v_label_count_stride) + __pyx_v_c); (__pyx_v_label_count_total[__pyx_t_8]) = ((__pyx_v_label_count_total[__pyx_t_8]) + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":270 - * label_count_total[k * label_count_stride + c] += w + /* "sklearn/tree/_tree.pyx":394 * + * # Add the weight to the sum of weights so far * weighted_n_node_samples += w # <<<<<<<<<<<<<< * - * self.weighted_n_node_samples = weighted_n_node_samples + * # Save the sum of weights so far */ __pyx_v_weighted_n_node_samples = (__pyx_v_weighted_n_node_samples + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":272 - * weighted_n_node_samples += w + /* "sklearn/tree/_tree.pyx":397 * + * # Save the sum of weights so far * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< * * # Reset to pos=start */ __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":275 + /* "sklearn/tree/_tree.pyx":400 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -3827,7 +3871,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset(((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":226 + /* "sklearn/tree/_tree.pyx":319 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< @@ -3838,12 +3882,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":277 +/* "sklearn/tree/_tree.pyx":402 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< - * """Reset the criterion at pos=start.""" - * self.pos = self.start + * """ + * Reset the criterion at pos=start. */ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self) { @@ -3860,9 +3904,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct double *__pyx_t_4; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_5; - /* "sklearn/tree/_tree.pyx":279 - * cdef void reset(self) nogil: - * """Reset the criterion at pos=start.""" + /* "sklearn/tree/_tree.pyx":407 + * """ + * * self.pos = self.start # <<<<<<<<<<<<<< * * self.weighted_n_left = 0.0 @@ -3870,7 +3914,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_1 = __pyx_v_self->__pyx_base.start; __pyx_v_self->__pyx_base.pos = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":281 + /* "sklearn/tree/_tree.pyx":409 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -3879,7 +3923,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":282 + /* "sklearn/tree/_tree.pyx":410 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3889,7 +3933,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":284 + /* "sklearn/tree/_tree.pyx":412 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3899,7 +3943,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":285 + /* "sklearn/tree/_tree.pyx":413 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3909,7 +3953,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_3 = __pyx_v_self->n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":286 + /* "sklearn/tree/_tree.pyx":414 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -3919,7 +3963,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_1 = __pyx_v_self->label_count_stride; __pyx_v_label_count_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":287 + /* "sklearn/tree/_tree.pyx":415 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -3929,7 +3973,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_4 = __pyx_v_self->label_count_total; __pyx_v_label_count_total = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":288 + /* "sklearn/tree/_tree.pyx":416 * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< @@ -3939,7 +3983,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_4 = __pyx_v_self->label_count_left; __pyx_v_label_count_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":289 + /* "sklearn/tree/_tree.pyx":417 * cdef double* label_count_total = self.label_count_total * cdef double* label_count_left = self.label_count_left * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< @@ -3949,7 +3993,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_t_4 = __pyx_v_self->label_count_right; __pyx_v_label_count_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":291 + /* "sklearn/tree/_tree.pyx":419 * cdef double* label_count_right = self.label_count_right * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3958,7 +4002,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":293 + /* "sklearn/tree/_tree.pyx":421 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3969,7 +4013,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_1; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":294 + /* "sklearn/tree/_tree.pyx":422 * * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -3978,7 +4022,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ memset(__pyx_v_label_count_left, 0, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":295 + /* "sklearn/tree/_tree.pyx":423 * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) * memcpy(label_count_right, label_count_total, # <<<<<<<<<<<<<< @@ -3987,7 +4031,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ memcpy(__pyx_v_label_count_right, __pyx_v_label_count_total, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":298 + /* "sklearn/tree/_tree.pyx":426 * n_classes[k] * sizeof(double)) * * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -3996,7 +4040,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); - /* "sklearn/tree/_tree.pyx":299 + /* "sklearn/tree/_tree.pyx":427 * * label_count_total += label_count_stride * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -4005,7 +4049,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); - /* "sklearn/tree/_tree.pyx":300 + /* "sklearn/tree/_tree.pyx":428 * label_count_total += label_count_stride * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -4015,23 +4059,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":277 + /* "sklearn/tree/_tree.pyx":402 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< - * """Reset the criterion at pos=start.""" - * self.pos = self.start + * """ + * Reset the criterion at pos=start. */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":302 +/* "sklearn/tree/_tree.pyx":430 * label_count_right += label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< - * """Update the collected statistics by moving samples[pos:new_pos] from - * the right child to the left child.""" + * """ + * Update the collected statistics by moving samples[pos:new_pos] from */ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_new_pos) { @@ -4062,9 +4106,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_9; - /* "sklearn/tree/_tree.pyx":305 - * """Update the collected statistics by moving samples[pos:new_pos] from - * the right child to the left child.""" + /* "sklearn/tree/_tree.pyx":442 + * """ + * * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight @@ -4072,8 +4116,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_1 = __pyx_v_self->__pyx_base.y; __pyx_v_y = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":306 - * the right child to the left child.""" + /* "sklearn/tree/_tree.pyx":443 + * * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< * cdef DOUBLE_t* sample_weight = self.sample_weight @@ -4082,7 +4126,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_2 = __pyx_v_self->__pyx_base.y_stride; __pyx_v_y_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":307 + /* "sklearn/tree/_tree.pyx":444 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -4092,7 +4136,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_1 = __pyx_v_self->__pyx_base.sample_weight; __pyx_v_sample_weight = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":309 + /* "sklearn/tree/_tree.pyx":446 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -4102,7 +4146,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_3 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":310 + /* "sklearn/tree/_tree.pyx":447 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -4112,7 +4156,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_2 = __pyx_v_self->__pyx_base.pos; __pyx_v_pos = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":312 + /* "sklearn/tree/_tree.pyx":449 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4122,7 +4166,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":313 + /* "sklearn/tree/_tree.pyx":450 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4132,7 +4176,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_3 = __pyx_v_self->n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":314 + /* "sklearn/tree/_tree.pyx":451 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -4142,7 +4186,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_2 = __pyx_v_self->label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":315 + /* "sklearn/tree/_tree.pyx":452 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -4152,7 +4196,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_4 = __pyx_v_self->label_count_total; __pyx_v_label_count_total = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":316 + /* "sklearn/tree/_tree.pyx":453 * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< @@ -4162,7 +4206,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_4 = __pyx_v_self->label_count_left; __pyx_v_label_count_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":317 + /* "sklearn/tree/_tree.pyx":454 * cdef double* label_count_total = self.label_count_total * cdef double* label_count_left = self.label_count_left * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< @@ -4172,7 +4216,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_4 = __pyx_v_self->label_count_right; __pyx_v_label_count_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":323 + /* "sklearn/tree/_tree.pyx":460 * cdef SIZE_t k * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -4181,7 +4225,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":324 + /* "sklearn/tree/_tree.pyx":461 * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -4190,29 +4234,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":328 + /* "sklearn/tree/_tree.pyx":465 * # Note: We assume start <= pos < new_pos <= end - * + * # Go through each sample in the new indexing * for p in range(pos, new_pos): # <<<<<<<<<<<<<< + * # Unpack the sample from the mask * i = samples[p] - * */ __pyx_t_2 = __pyx_v_new_pos; for (__pyx_t_5 = __pyx_v_pos; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_v_p = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":329 - * + /* "sklearn/tree/_tree.pyx":467 * for p in range(pos, new_pos): + * # Unpack the sample from the mask * i = samples[p] # <<<<<<<<<<<<<< * - * if sample_weight != NULL: + * # w is originally set to be 1.0, meaning that if no sample weights */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":331 - * i = samples[p] - * + /* "sklearn/tree/_tree.pyx":471 + * # w is originally set to be 1.0, meaning that if no sample weights + * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: # <<<<<<<<<<<<<< * w = sample_weight[i] * @@ -4220,21 +4264,21 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_6 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":332 - * + /* "sklearn/tree/_tree.pyx":472 + * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< * - * for k in range(n_outputs): + * # If the child has changed nodes, then we need to change the weight */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); goto __pyx_L5; } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":334 - * w = sample_weight[i] - * + /* "sklearn/tree/_tree.pyx":476 + * # If the child has changed nodes, then we need to change the weight + * # in the nodes. * for k in range(n_outputs): # <<<<<<<<<<<<<< * label_index = (k * label_count_stride + * y[i * y_stride + k]) @@ -4243,8 +4287,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_k = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":335 - * + /* "sklearn/tree/_tree.pyx":477 + * # in the nodes. * for k in range(n_outputs): * label_index = (k * label_count_stride + # <<<<<<<<<<<<<< * y[i * y_stride + k]) @@ -4252,7 +4296,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_label_index = ((__pyx_v_k * __pyx_v_label_count_stride) + ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]))); - /* "sklearn/tree/_tree.pyx":337 + /* "sklearn/tree/_tree.pyx":479 * label_index = (k * label_count_stride + * y[i * y_stride + k]) * label_count_left[label_index] += w # <<<<<<<<<<<<<< @@ -4262,66 +4306,66 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_9 = __pyx_v_label_index; (__pyx_v_label_count_left[__pyx_t_9]) = ((__pyx_v_label_count_left[__pyx_t_9]) + __pyx_v_w); - /* "sklearn/tree/_tree.pyx":338 + /* "sklearn/tree/_tree.pyx":480 * y[i * y_stride + k]) * label_count_left[label_index] += w * label_count_right[label_index] -= w # <<<<<<<<<<<<<< * - * diff_w += w + * # Change the difference in weights */ __pyx_t_9 = __pyx_v_label_index; (__pyx_v_label_count_right[__pyx_t_9]) = ((__pyx_v_label_count_right[__pyx_t_9]) - __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":340 - * label_count_right[label_index] -= w + /* "sklearn/tree/_tree.pyx":483 * + * # Change the difference in weights * diff_w += w # <<<<<<<<<<<<<< * - * self.weighted_n_left += diff_w + * # Adjust the left and right node weights by the difference determined before */ __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":342 - * diff_w += w + /* "sklearn/tree/_tree.pyx":486 * + * # Adjust the left and right node weights by the difference determined before * self.weighted_n_left += diff_w # <<<<<<<<<<<<<< * self.weighted_n_right -= diff_w * */ __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":343 - * + /* "sklearn/tree/_tree.pyx":487 + * # Adjust the left and right node weights by the difference determined before * self.weighted_n_left += diff_w * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< * - * self.pos = new_pos + * # Change the position to the new position */ __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":345 - * self.weighted_n_right -= diff_w + /* "sklearn/tree/_tree.pyx":490 * + * # Change the position to the new position * self.pos = new_pos # <<<<<<<<<<<<<< * * cdef double node_impurity(self) nogil: */ __pyx_v_self->__pyx_base.pos = __pyx_v_new_pos; - /* "sklearn/tree/_tree.pyx":302 + /* "sklearn/tree/_tree.pyx":430 * label_count_right += label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< - * """Update the collected statistics by moving samples[pos:new_pos] from - * the right child to the left child.""" + * """ + * Update the collected statistics by moving samples[pos:new_pos] from */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":347 +/* "sklearn/tree/_tree.pyx":492 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4337,7 +4381,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_impur return __pyx_r; } -/* "sklearn/tree/_tree.pyx":350 +/* "sklearn/tree/_tree.pyx":495 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4350,12 +4394,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_children_imp /* function exit code */ } -/* "sklearn/tree/_tree.pyx":354 +/* "sklearn/tree/_tree.pyx":499 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< - * """Compute the node value of samples[start:end] into dest.""" - * cdef SIZE_t n_outputs = self.n_outputs + * """ + * Compute the node value of samples[start:end] and save it into dest. */ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, double *__pyx_v_dest) { @@ -4369,9 +4413,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s double *__pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":356 - * cdef void node_value(self, double* dest) nogil: - * """Compute the node value of samples[start:end] into dest.""" + /* "sklearn/tree/_tree.pyx":509 + * """ + * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride @@ -4379,8 +4423,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":357 - * """Compute the node value of samples[start:end] into dest.""" + /* "sklearn/tree/_tree.pyx":510 + * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< * cdef SIZE_t label_count_stride = self.label_count_stride @@ -4389,7 +4433,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s __pyx_t_2 = __pyx_v_self->n_classes; __pyx_v_n_classes = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":358 + /* "sklearn/tree/_tree.pyx":511 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -4399,7 +4443,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s __pyx_t_1 = __pyx_v_self->label_count_stride; __pyx_v_label_count_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":359 + /* "sklearn/tree/_tree.pyx":512 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -4409,7 +4453,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s __pyx_t_3 = __pyx_v_self->label_count_total; __pyx_v_label_count_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":362 + /* "sklearn/tree/_tree.pyx":515 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4420,7 +4464,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":363 + /* "sklearn/tree/_tree.pyx":516 * * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -4429,7 +4473,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s */ memcpy(__pyx_v_dest, __pyx_v_label_count_total, ((__pyx_v_n_classes[__pyx_v_k]) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":364 + /* "sklearn/tree/_tree.pyx":517 * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride # <<<<<<<<<<<<<< @@ -4438,7 +4482,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s */ __pyx_v_dest = (__pyx_v_dest + __pyx_v_label_count_stride); - /* "sklearn/tree/_tree.pyx":365 + /* "sklearn/tree/_tree.pyx":518 * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4448,23 +4492,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":354 + /* "sklearn/tree/_tree.pyx":499 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< - * """Compute the node value of samples[start:end] into dest.""" - * cdef SIZE_t n_outputs = self.n_outputs + * """ + * Compute the node value of samples[start:end] and save it into dest. */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":382 - * cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) +/* "sklearn/tree/_tree.pyx":536 * """ + * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + * """ + * Evaluate the impurity of the current node, i.e. the impurity of */ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_Entropy *__pyx_v_self) { @@ -4475,7 +4519,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ double *__pyx_v_label_count_total; double __pyx_v_entropy; double __pyx_v_total; - double __pyx_v_tmp; + double __pyx_v_pmk; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_c; double __pyx_r; @@ -4488,9 +4532,9 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; int __pyx_t_8; - /* "sklearn/tree/_tree.pyx":385 - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + /* "sklearn/tree/_tree.pyx":542 + * """ + * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< * * cdef SIZE_t n_outputs = self.n_outputs @@ -4498,7 +4542,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":387 + /* "sklearn/tree/_tree.pyx":544 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4508,7 +4552,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":388 + /* "sklearn/tree/_tree.pyx":545 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4518,7 +4562,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":389 + /* "sklearn/tree/_tree.pyx":546 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -4528,7 +4572,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":390 + /* "sklearn/tree/_tree.pyx":547 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -4538,118 +4582,118 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_total; __pyx_v_label_count_total = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":392 + /* "sklearn/tree/_tree.pyx":549 * cdef double* label_count_total = self.label_count_total * * cdef double entropy = 0.0 # <<<<<<<<<<<<<< * cdef double total = 0.0 - * cdef double tmp + * cdef double pmk */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":393 + /* "sklearn/tree/_tree.pyx":550 * * cdef double entropy = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< - * cdef double tmp + * cdef double pmk * cdef SIZE_t k */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":398 - * cdef SIZE_t c + /* "sklearn/tree/_tree.pyx":556 * + * # Go through each response and calculate the entropy * for k in range(n_outputs): # <<<<<<<<<<<<<< + * # Initialize the entropy to 0.0 for this response * entropy = 0.0 - * */ __pyx_t_2 = __pyx_v_n_outputs; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":399 - * + /* "sklearn/tree/_tree.pyx":558 * for k in range(n_outputs): + * # Initialize the entropy to 0.0 for this response * entropy = 0.0 # <<<<<<<<<<<<<< * - * for c in range(n_classes[k]): + * # For each class in this response */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":401 - * entropy = 0.0 + /* "sklearn/tree/_tree.pyx":561 * + * # For each class in this response * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * tmp = label_count_total[c] - * if tmp > 0.0: + * # Look up the weighted number of points in this class + * pmk = label_count_total[c] */ __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_c = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":402 - * + /* "sklearn/tree/_tree.pyx":563 * for c in range(n_classes[k]): - * tmp = label_count_total[c] # <<<<<<<<<<<<<< - * if tmp > 0.0: - * tmp /= weighted_n_node_samples + * # Look up the weighted number of points in this class + * pmk = label_count_total[c] # <<<<<<<<<<<<<< + * + * # If more than 0 weight, then calculate entropy */ - __pyx_v_tmp = (__pyx_v_label_count_total[__pyx_v_c]); + __pyx_v_pmk = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":403 - * for c in range(n_classes[k]): - * tmp = label_count_total[c] - * if tmp > 0.0: # <<<<<<<<<<<<<< - * tmp /= weighted_n_node_samples - * entropy -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":566 + * + * # If more than 0 weight, then calculate entropy + * if pmk > 0.0: # <<<<<<<<<<<<<< + * pmk /= weighted_n_node_samples + * entropy -= pmk * log(pmk) */ - __pyx_t_8 = ((__pyx_v_tmp > 0.0) != 0); + __pyx_t_8 = ((__pyx_v_pmk > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":404 - * tmp = label_count_total[c] - * if tmp > 0.0: - * tmp /= weighted_n_node_samples # <<<<<<<<<<<<<< - * entropy -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":567 + * # If more than 0 weight, then calculate entropy + * if pmk > 0.0: + * pmk /= weighted_n_node_samples # <<<<<<<<<<<<<< + * entropy -= pmk * log(pmk) * */ - __pyx_v_tmp = (__pyx_v_tmp / __pyx_v_weighted_n_node_samples); + __pyx_v_pmk = (__pyx_v_pmk / __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":405 - * if tmp > 0.0: - * tmp /= weighted_n_node_samples - * entropy -= tmp * log(tmp) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":568 + * if pmk > 0.0: + * pmk /= weighted_n_node_samples + * entropy -= pmk * log(pmk) # <<<<<<<<<<<<<< * - * total += entropy + * # Otherwise the addition is 0. */ - __pyx_v_entropy = (__pyx_v_entropy - (__pyx_v_tmp * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_tmp))); + __pyx_v_entropy = (__pyx_v_entropy - (__pyx_v_pmk * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_pmk))); goto __pyx_L7; } __pyx_L7:; } - /* "sklearn/tree/_tree.pyx":407 - * entropy -= tmp * log(tmp) - * + /* "sklearn/tree/_tree.pyx":572 + * # Otherwise the addition is 0. + * # Add that class entropy to the total entropy * total += entropy # <<<<<<<<<<<<<< * label_count_total += label_count_stride * */ __pyx_v_total = (__pyx_v_total + __pyx_v_entropy); - /* "sklearn/tree/_tree.pyx":408 - * + /* "sklearn/tree/_tree.pyx":573 + * # Add that class entropy to the total entropy * total += entropy * label_count_total += label_count_stride # <<<<<<<<<<<<<< * - * return total / n_outputs + * # Return the total entropy over all responses divided by the number of */ __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":410 - * label_count_total += label_count_stride - * + /* "sklearn/tree/_tree.pyx":577 + * # Return the total entropy over all responses divided by the number of + * # responses. * return total / n_outputs # <<<<<<<<<<<<<< * * cdef void children_impurity(self, double* impurity_left, @@ -4657,12 +4701,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":382 - * cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) + /* "sklearn/tree/_tree.pyx":536 * """ + * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + * """ + * Evaluate the impurity of the current node, i.e. the impurity of */ /* function exit code */ @@ -4670,12 +4714,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":412 +/* "sklearn/tree/_tree.pyx":579 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: - * """Evaluate the impurity in children nodes, i.e. the impurity of the + * """ */ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_Entropy *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { @@ -4691,7 +4735,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py double __pyx_v_entropy_right; double __pyx_v_total_left; double __pyx_v_total_right; - double __pyx_v_tmp; + double __pyx_v_pmk; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_c; double __pyx_t_1; @@ -4703,9 +4747,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; int __pyx_t_8; - /* "sklearn/tree/_tree.pyx":417 - * left child (samples[start:pos]) and the impurity the right child - * (samples[pos:end]).""" + /* "sklearn/tree/_tree.pyx":594 + * """ + * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right @@ -4713,8 +4757,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":418 - * (samples[pos:end]).""" + /* "sklearn/tree/_tree.pyx":595 + * * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< * cdef double weighted_n_right = self.weighted_n_right @@ -4723,7 +4767,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; __pyx_v_weighted_n_left = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":419 + /* "sklearn/tree/_tree.pyx":596 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< @@ -4733,7 +4777,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; __pyx_v_weighted_n_right = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":421 + /* "sklearn/tree/_tree.pyx":598 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4743,7 +4787,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":422 + /* "sklearn/tree/_tree.pyx":599 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4753,7 +4797,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":423 + /* "sklearn/tree/_tree.pyx":600 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -4763,7 +4807,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":424 + /* "sklearn/tree/_tree.pyx":601 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< @@ -4773,7 +4817,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_left; __pyx_v_label_count_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":425 + /* "sklearn/tree/_tree.pyx":602 * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_left = self.label_count_left * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< @@ -4783,7 +4827,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_right; __pyx_v_label_count_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":427 + /* "sklearn/tree/_tree.pyx":604 * cdef double* label_count_right = self.label_count_right * * cdef double entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4792,7 +4836,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":428 + /* "sklearn/tree/_tree.pyx":605 * * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4801,156 +4845,156 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":429 + /* "sklearn/tree/_tree.pyx":606 * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< * cdef double total_right = 0.0 - * cdef double tmp + * cdef double pmk */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":430 + /* "sklearn/tree/_tree.pyx":607 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< - * cdef double tmp + * cdef double pmk * cdef SIZE_t k */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":435 - * cdef SIZE_t c + /* "sklearn/tree/_tree.pyx":613 * + * # For each response * for k in range(n_outputs): # <<<<<<<<<<<<<< + * # Initialize the left and right entropies to be 0 * entropy_left = 0.0 - * entropy_right = 0.0 */ __pyx_t_2 = __pyx_v_n_outputs; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":436 - * + /* "sklearn/tree/_tree.pyx":615 * for k in range(n_outputs): + * # Initialize the left and right entropies to be 0 * entropy_left = 0.0 # <<<<<<<<<<<<<< * entropy_right = 0.0 * */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":437 - * for k in range(n_outputs): + /* "sklearn/tree/_tree.pyx":616 + * # Initialize the left and right entropies to be 0 * entropy_left = 0.0 * entropy_right = 0.0 # <<<<<<<<<<<<<< * - * for c in range(n_classes[k]): + * # For each unique class in this response */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":439 - * entropy_right = 0.0 + /* "sklearn/tree/_tree.pyx":619 * + * # For each unique class in this response * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * tmp = label_count_left[c] - * if tmp > 0.0: + * # Calculate this classes entropy on the left node + * pmk = label_count_left[c] */ __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_c = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":440 - * + /* "sklearn/tree/_tree.pyx":621 * for c in range(n_classes[k]): - * tmp = label_count_left[c] # <<<<<<<<<<<<<< - * if tmp > 0.0: - * tmp /= weighted_n_left + * # Calculate this classes entropy on the left node + * pmk = label_count_left[c] # <<<<<<<<<<<<<< + * if pmk > 0.0: + * pmk /= weighted_n_left */ - __pyx_v_tmp = (__pyx_v_label_count_left[__pyx_v_c]); + __pyx_v_pmk = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":441 - * for c in range(n_classes[k]): - * tmp = label_count_left[c] - * if tmp > 0.0: # <<<<<<<<<<<<<< - * tmp /= weighted_n_left - * entropy_left -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":622 + * # Calculate this classes entropy on the left node + * pmk = label_count_left[c] + * if pmk > 0.0: # <<<<<<<<<<<<<< + * pmk /= weighted_n_left + * entropy_left -= pmk * log(pmk) */ - __pyx_t_8 = ((__pyx_v_tmp > 0.0) != 0); + __pyx_t_8 = ((__pyx_v_pmk > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":442 - * tmp = label_count_left[c] - * if tmp > 0.0: - * tmp /= weighted_n_left # <<<<<<<<<<<<<< - * entropy_left -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":623 + * pmk = label_count_left[c] + * if pmk > 0.0: + * pmk /= weighted_n_left # <<<<<<<<<<<<<< + * entropy_left -= pmk * log(pmk) * */ - __pyx_v_tmp = (__pyx_v_tmp / __pyx_v_weighted_n_left); + __pyx_v_pmk = (__pyx_v_pmk / __pyx_v_weighted_n_left); - /* "sklearn/tree/_tree.pyx":443 - * if tmp > 0.0: - * tmp /= weighted_n_left - * entropy_left -= tmp * log(tmp) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":624 + * if pmk > 0.0: + * pmk /= weighted_n_left + * entropy_left -= pmk * log(pmk) # <<<<<<<<<<<<<< * - * tmp = label_count_right[c] + * # Calculate this classes entropy on the right node */ - __pyx_v_entropy_left = (__pyx_v_entropy_left - (__pyx_v_tmp * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_tmp))); + __pyx_v_entropy_left = (__pyx_v_entropy_left - (__pyx_v_pmk * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_pmk))); goto __pyx_L7; } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":445 - * entropy_left -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":627 * - * tmp = label_count_right[c] # <<<<<<<<<<<<<< - * if tmp > 0.0: - * tmp /= weighted_n_right + * # Calculate this classes entropy on the right node + * pmk = label_count_right[c] # <<<<<<<<<<<<<< + * if pmk > 0.0: + * pmk /= weighted_n_right */ - __pyx_v_tmp = (__pyx_v_label_count_right[__pyx_v_c]); + __pyx_v_pmk = (__pyx_v_label_count_right[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":446 - * - * tmp = label_count_right[c] - * if tmp > 0.0: # <<<<<<<<<<<<<< - * tmp /= weighted_n_right - * entropy_right -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":628 + * # Calculate this classes entropy on the right node + * pmk = label_count_right[c] + * if pmk > 0.0: # <<<<<<<<<<<<<< + * pmk /= weighted_n_right + * entropy_right -= pmk * log(pmk) */ - __pyx_t_8 = ((__pyx_v_tmp > 0.0) != 0); + __pyx_t_8 = ((__pyx_v_pmk > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":447 - * tmp = label_count_right[c] - * if tmp > 0.0: - * tmp /= weighted_n_right # <<<<<<<<<<<<<< - * entropy_right -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":629 + * pmk = label_count_right[c] + * if pmk > 0.0: + * pmk /= weighted_n_right # <<<<<<<<<<<<<< + * entropy_right -= pmk * log(pmk) * */ - __pyx_v_tmp = (__pyx_v_tmp / __pyx_v_weighted_n_right); + __pyx_v_pmk = (__pyx_v_pmk / __pyx_v_weighted_n_right); - /* "sklearn/tree/_tree.pyx":448 - * if tmp > 0.0: - * tmp /= weighted_n_right - * entropy_right -= tmp * log(tmp) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":630 + * if pmk > 0.0: + * pmk /= weighted_n_right + * entropy_right -= pmk * log(pmk) # <<<<<<<<<<<<<< * - * total_left += entropy_left + * # Add local entropy to the total entropy on the appropriate side */ - __pyx_v_entropy_right = (__pyx_v_entropy_right - (__pyx_v_tmp * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_tmp))); + __pyx_v_entropy_right = (__pyx_v_entropy_right - (__pyx_v_pmk * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_pmk))); goto __pyx_L8; } __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":450 - * entropy_right -= tmp * log(tmp) + /* "sklearn/tree/_tree.pyx":633 * + * # Add local entropy to the total entropy on the appropriate side * total_left += entropy_left # <<<<<<<<<<<<<< * total_right += entropy_right * label_count_left += label_count_stride */ __pyx_v_total_left = (__pyx_v_total_left + __pyx_v_entropy_left); - /* "sklearn/tree/_tree.pyx":451 - * + /* "sklearn/tree/_tree.pyx":634 + * # Add local entropy to the total entropy on the appropriate side * total_left += entropy_left * total_right += entropy_right # <<<<<<<<<<<<<< * label_count_left += label_count_stride @@ -4958,7 +5002,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_right = (__pyx_v_total_right + __pyx_v_entropy_right); - /* "sklearn/tree/_tree.pyx":452 + /* "sklearn/tree/_tree.pyx":635 * total_left += entropy_left * total_right += entropy_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -4967,27 +5011,27 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); - /* "sklearn/tree/_tree.pyx":453 + /* "sklearn/tree/_tree.pyx":636 * total_right += entropy_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< * - * impurity_left[0] = total_left / n_outputs + * # Save the average entropy over all responses */ __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":455 - * label_count_right += label_count_stride + /* "sklearn/tree/_tree.pyx":639 * + * # Save the average entropy over all responses * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< * impurity_right[0] = total_right / n_outputs * */ (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":456 - * + /* "sklearn/tree/_tree.pyx":640 + * # Save the average entropy over all responses * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< * @@ -4995,23 +5039,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":412 + /* "sklearn/tree/_tree.pyx":579 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: - * """Evaluate the impurity in children nodes, i.e. the impurity of the + * """ */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":474 - * = 1 - \sum_{k=0}^{K-1} pmk ** 2 +/* "sklearn/tree/_tree.pyx":659 * """ + * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + * """ + * Evaluate the impurity of the current node, i.e. the impurity of */ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_Gini *__pyx_v_self) { @@ -5022,7 +5066,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj double *__pyx_v_label_count_total; double __pyx_v_gini; double __pyx_v_total; - double __pyx_v_tmp; + double __pyx_v_pmk; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_c; double __pyx_r; @@ -5034,9 +5078,9 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_6; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; - /* "sklearn/tree/_tree.pyx":477 - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + /* "sklearn/tree/_tree.pyx":665 + * """ + * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< * * cdef SIZE_t n_outputs = self.n_outputs @@ -5044,7 +5088,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":479 + /* "sklearn/tree/_tree.pyx":667 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -5054,7 +5098,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":480 + /* "sklearn/tree/_tree.pyx":668 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -5064,7 +5108,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":481 + /* "sklearn/tree/_tree.pyx":669 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -5074,7 +5118,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":482 + /* "sklearn/tree/_tree.pyx":670 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -5084,84 +5128,84 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_total; __pyx_v_label_count_total = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":484 + /* "sklearn/tree/_tree.pyx":672 * cdef double* label_count_total = self.label_count_total * * cdef double gini = 0.0 # <<<<<<<<<<<<<< * cdef double total = 0.0 - * cdef double tmp + * cdef double pmk */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":485 + /* "sklearn/tree/_tree.pyx":673 * * cdef double gini = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< - * cdef double tmp + * cdef double pmk * cdef SIZE_t k */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":490 - * cdef SIZE_t c + /* "sklearn/tree/_tree.pyx":679 * + * # For each response * for k in range(n_outputs): # <<<<<<<<<<<<<< + * # Set the initial Gini index to 0 * gini = 0.0 - * */ __pyx_t_2 = __pyx_v_n_outputs; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":491 - * + /* "sklearn/tree/_tree.pyx":681 * for k in range(n_outputs): + * # Set the initial Gini index to 0 * gini = 0.0 # <<<<<<<<<<<<<< * - * for c in range(n_classes[k]): + * # For each class in this response */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":493 - * gini = 0.0 + /* "sklearn/tree/_tree.pyx":684 * + * # For each class in this response * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * tmp = label_count_total[c] - * gini += tmp * tmp + * # Unpack the weighted count of this class + * pmk = label_count_total[c] */ __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_c = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":494 - * + /* "sklearn/tree/_tree.pyx":686 * for c in range(n_classes[k]): - * tmp = label_count_total[c] # <<<<<<<<<<<<<< - * gini += tmp * tmp + * # Unpack the weighted count of this class + * pmk = label_count_total[c] # <<<<<<<<<<<<<< * + * # Add the squared count to the Gini index */ - __pyx_v_tmp = (__pyx_v_label_count_total[__pyx_v_c]); + __pyx_v_pmk = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":495 - * for c in range(n_classes[k]): - * tmp = label_count_total[c] - * gini += tmp * tmp # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":689 * - * gini = 1.0 - gini / (weighted_n_node_samples * + * # Add the squared count to the Gini index + * gini += pmk * pmk # <<<<<<<<<<<<<< + * + * # Calculate the Gini index by normalizing against the squared */ - __pyx_v_gini = (__pyx_v_gini + (__pyx_v_tmp * __pyx_v_tmp)); + __pyx_v_gini = (__pyx_v_gini + (__pyx_v_pmk * __pyx_v_pmk)); } - /* "sklearn/tree/_tree.pyx":497 - * gini += tmp * tmp - * + /* "sklearn/tree/_tree.pyx":693 + * # Calculate the Gini index by normalizing against the squared + * # total weight of all samples * gini = 1.0 - gini / (weighted_n_node_samples * # <<<<<<<<<<<<<< * weighted_n_node_samples) * */ __pyx_v_gini = (1.0 - (__pyx_v_gini / (__pyx_v_weighted_n_node_samples * __pyx_v_weighted_n_node_samples))); - /* "sklearn/tree/_tree.pyx":500 + /* "sklearn/tree/_tree.pyx":696 * weighted_n_node_samples) * * total += gini # <<<<<<<<<<<<<< @@ -5170,19 +5214,19 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_total = (__pyx_v_total + __pyx_v_gini); - /* "sklearn/tree/_tree.pyx":501 + /* "sklearn/tree/_tree.pyx":697 * * total += gini * label_count_total += label_count_stride # <<<<<<<<<<<<<< * - * return total / n_outputs + * # Return the average Gini index over all responses */ __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":503 - * label_count_total += label_count_stride + /* "sklearn/tree/_tree.pyx":700 * + * # Return the average Gini index over all responses * return total / n_outputs # <<<<<<<<<<<<<< * * cdef void children_impurity(self, double* impurity_left, @@ -5190,12 +5234,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":474 - * = 1 - \sum_{k=0}^{K-1} pmk ** 2 + /* "sklearn/tree/_tree.pyx":659 * """ + * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Evaluate the impurity of the current node, i.e. the impurity of - * samples[start:end].""" + * """ + * Evaluate the impurity of the current node, i.e. the impurity of */ /* function exit code */ @@ -5203,12 +5247,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":505 +/* "sklearn/tree/_tree.pyx":702 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: - * """Evaluate the impurity in children nodes, i.e. the impurity of the + * """ */ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_Gini *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { @@ -5225,7 +5269,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o CYTHON_UNUSED double __pyx_v_total; double __pyx_v_total_left; double __pyx_v_total_right; - double __pyx_v_tmp; + double __pyx_v_pmk; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_c; double __pyx_t_1; @@ -5236,9 +5280,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_6; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; - /* "sklearn/tree/_tree.pyx":510 - * left child (samples[start:pos]) and the impurity the right child - * (samples[pos:end]).""" + /* "sklearn/tree/_tree.pyx":717 + * """ + * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right @@ -5246,8 +5290,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":511 - * (samples[pos:end]).""" + /* "sklearn/tree/_tree.pyx":718 + * * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< * cdef double weighted_n_right = self.weighted_n_right @@ -5256,7 +5300,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; __pyx_v_weighted_n_left = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":512 + /* "sklearn/tree/_tree.pyx":719 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< @@ -5266,7 +5310,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; __pyx_v_weighted_n_right = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":514 + /* "sklearn/tree/_tree.pyx":721 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -5276,7 +5320,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":515 + /* "sklearn/tree/_tree.pyx":722 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -5286,7 +5330,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_3 = __pyx_v_self->__pyx_base.n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":516 + /* "sklearn/tree/_tree.pyx":723 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -5296,7 +5340,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_2 = __pyx_v_self->__pyx_base.label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":517 + /* "sklearn/tree/_tree.pyx":724 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_left = self.label_count_left # <<<<<<<<<<<<<< @@ -5306,7 +5350,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_left; __pyx_v_label_count_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":518 + /* "sklearn/tree/_tree.pyx":725 * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_left = self.label_count_left * cdef double* label_count_right = self.label_count_right # <<<<<<<<<<<<<< @@ -5316,7 +5360,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_t_4 = __pyx_v_self->__pyx_base.label_count_right; __pyx_v_label_count_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":520 + /* "sklearn/tree/_tree.pyx":727 * cdef double* label_count_right = self.label_count_right * * cdef double gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5325,7 +5369,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_left = 0.0; - /* "sklearn/tree/_tree.pyx":521 + /* "sklearn/tree/_tree.pyx":728 * * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5334,7 +5378,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_right = 0.0; - /* "sklearn/tree/_tree.pyx":522 + /* "sklearn/tree/_tree.pyx":729 * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -5343,120 +5387,120 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":523 + /* "sklearn/tree/_tree.pyx":730 * cdef double gini_right = 0.0 * cdef double total = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< * cdef double total_right = 0.0 - * cdef double tmp + * cdef double pmk */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":524 + /* "sklearn/tree/_tree.pyx":731 * cdef double total = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< - * cdef double tmp + * cdef double pmk * cdef SIZE_t k */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":529 - * cdef SIZE_t c + /* "sklearn/tree/_tree.pyx":737 * + * # For each response * for k in range(n_outputs): # <<<<<<<<<<<<<< + * # Initialize both children to be 0 * gini_left = 0.0 - * gini_right = 0.0 */ __pyx_t_2 = __pyx_v_n_outputs; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":530 - * + /* "sklearn/tree/_tree.pyx":739 * for k in range(n_outputs): + * # Initialize both children to be 0 * gini_left = 0.0 # <<<<<<<<<<<<<< * gini_right = 0.0 * */ __pyx_v_gini_left = 0.0; - /* "sklearn/tree/_tree.pyx":531 - * for k in range(n_outputs): + /* "sklearn/tree/_tree.pyx":740 + * # Initialize both children to be 0 * gini_left = 0.0 * gini_right = 0.0 # <<<<<<<<<<<<<< * - * for c in range(n_classes[k]): + * # Go through each unique class */ __pyx_v_gini_right = 0.0; - /* "sklearn/tree/_tree.pyx":533 - * gini_right = 0.0 + /* "sklearn/tree/_tree.pyx":743 * + * # Go through each unique class * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * tmp = label_count_left[c] - * gini_left += tmp * tmp + * # Add to the Gini index of the left node + * pmk = label_count_left[c] */ __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_c = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":534 - * + /* "sklearn/tree/_tree.pyx":745 * for c in range(n_classes[k]): - * tmp = label_count_left[c] # <<<<<<<<<<<<<< - * gini_left += tmp * tmp - * tmp = label_count_right[c] + * # Add to the Gini index of the left node + * pmk = label_count_left[c] # <<<<<<<<<<<<<< + * gini_left += pmk * pmk + * */ - __pyx_v_tmp = (__pyx_v_label_count_left[__pyx_v_c]); + __pyx_v_pmk = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":535 - * for c in range(n_classes[k]): - * tmp = label_count_left[c] - * gini_left += tmp * tmp # <<<<<<<<<<<<<< - * tmp = label_count_right[c] - * gini_right += tmp * tmp + /* "sklearn/tree/_tree.pyx":746 + * # Add to the Gini index of the left node + * pmk = label_count_left[c] + * gini_left += pmk * pmk # <<<<<<<<<<<<<< + * + * # Add to the Gini index of the right node */ - __pyx_v_gini_left = (__pyx_v_gini_left + (__pyx_v_tmp * __pyx_v_tmp)); + __pyx_v_gini_left = (__pyx_v_gini_left + (__pyx_v_pmk * __pyx_v_pmk)); - /* "sklearn/tree/_tree.pyx":536 - * tmp = label_count_left[c] - * gini_left += tmp * tmp - * tmp = label_count_right[c] # <<<<<<<<<<<<<< - * gini_right += tmp * tmp + /* "sklearn/tree/_tree.pyx":749 + * + * # Add to the Gini index of the right node + * pmk = label_count_right[c] # <<<<<<<<<<<<<< + * gini_right += pmk * pmk * */ - __pyx_v_tmp = (__pyx_v_label_count_right[__pyx_v_c]); + __pyx_v_pmk = (__pyx_v_label_count_right[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":537 - * gini_left += tmp * tmp - * tmp = label_count_right[c] - * gini_right += tmp * tmp # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":750 + * # Add to the Gini index of the right node + * pmk = label_count_right[c] + * gini_right += pmk * pmk # <<<<<<<<<<<<<< * - * gini_left = 1.0 - gini_left / (weighted_n_left * + * # Normalize the Gini index of the left node */ - __pyx_v_gini_right = (__pyx_v_gini_right + (__pyx_v_tmp * __pyx_v_tmp)); + __pyx_v_gini_right = (__pyx_v_gini_right + (__pyx_v_pmk * __pyx_v_pmk)); } - /* "sklearn/tree/_tree.pyx":539 - * gini_right += tmp * tmp + /* "sklearn/tree/_tree.pyx":753 * + * # Normalize the Gini index of the left node * gini_left = 1.0 - gini_left / (weighted_n_left * # <<<<<<<<<<<<<< * weighted_n_left) - * gini_right = 1.0 - gini_right / (weighted_n_right * + * */ __pyx_v_gini_left = (1.0 - (__pyx_v_gini_left / (__pyx_v_weighted_n_left * __pyx_v_weighted_n_left))); - /* "sklearn/tree/_tree.pyx":541 - * gini_left = 1.0 - gini_left / (weighted_n_left * - * weighted_n_left) + /* "sklearn/tree/_tree.pyx":757 + * + * # Normalize the Gini index of the right node * gini_right = 1.0 - gini_right / (weighted_n_right * # <<<<<<<<<<<<<< * weighted_n_right) * */ __pyx_v_gini_right = (1.0 - (__pyx_v_gini_right / (__pyx_v_weighted_n_right * __pyx_v_weighted_n_right))); - /* "sklearn/tree/_tree.pyx":544 + /* "sklearn/tree/_tree.pyx":760 * weighted_n_right) * * total_left += gini_left # <<<<<<<<<<<<<< @@ -5465,7 +5509,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total_left = (__pyx_v_total_left + __pyx_v_gini_left); - /* "sklearn/tree/_tree.pyx":545 + /* "sklearn/tree/_tree.pyx":761 * * total_left += gini_left * total_right += gini_right # <<<<<<<<<<<<<< @@ -5474,7 +5518,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total_right = (__pyx_v_total_right + __pyx_v_gini_right); - /* "sklearn/tree/_tree.pyx":546 + /* "sklearn/tree/_tree.pyx":762 * total_left += gini_left * total_right += gini_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -5483,27 +5527,27 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_label_count_left = (__pyx_v_label_count_left + __pyx_v_label_count_stride); - /* "sklearn/tree/_tree.pyx":547 + /* "sklearn/tree/_tree.pyx":763 * total_right += gini_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< * - * impurity_left[0] = total_left / n_outputs + * # Save the average Gini index over all responses */ __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":549 - * label_count_right += label_count_stride + /* "sklearn/tree/_tree.pyx":766 * + * # Save the average Gini index over all responses * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< * impurity_right[0] = total_right / n_outputs * */ (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":550 - * + /* "sklearn/tree/_tree.pyx":767 + * # Save the average Gini index over all responses * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< * @@ -5511,23 +5555,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":505 + /* "sklearn/tree/_tree.pyx":702 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: - * """Evaluate the impurity in children nodes, i.e. the impurity of the + * """ */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":574 +/* "sklearn/tree/_tree.pyx":793 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< - * # Default values - * self.y = NULL + * """ + * Initialize parameters for this criterion. The only input are the number */ /* Python wrapper */ @@ -5558,18 +5602,18 @@ static int __pyx_pw_7sklearn_4tree_5_tree_19RegressionCriterion_1__cinit__(PyObj else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } - __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_outputs = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_n_outputs == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.RegressionCriterion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5592,8 +5636,8 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":576 - * def __cinit__(self, SIZE_t n_outputs): + /* "sklearn/tree/_tree.pyx":805 + * * # Default values * self.y = NULL # <<<<<<<<<<<<<< * self.y_stride = 0 @@ -5601,7 +5645,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":577 + /* "sklearn/tree/_tree.pyx":806 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -5610,7 +5654,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":578 + /* "sklearn/tree/_tree.pyx":807 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -5619,7 +5663,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":580 + /* "sklearn/tree/_tree.pyx":809 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -5628,7 +5672,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":581 + /* "sklearn/tree/_tree.pyx":810 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -5637,7 +5681,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":582 + /* "sklearn/tree/_tree.pyx":811 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -5646,7 +5690,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":583 + /* "sklearn/tree/_tree.pyx":812 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -5655,7 +5699,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":585 + /* "sklearn/tree/_tree.pyx":814 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -5664,7 +5708,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.n_outputs = __pyx_v_n_outputs; - /* "sklearn/tree/_tree.pyx":586 + /* "sklearn/tree/_tree.pyx":815 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -5673,7 +5717,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.n_node_samples = 0; - /* "sklearn/tree/_tree.pyx":587 + /* "sklearn/tree/_tree.pyx":816 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -5682,7 +5726,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.weighted_n_node_samples = 0.0; - /* "sklearn/tree/_tree.pyx":588 + /* "sklearn/tree/_tree.pyx":817 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -5691,7 +5735,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":589 + /* "sklearn/tree/_tree.pyx":818 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -5700,7 +5744,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_tree.pyx":593 + /* "sklearn/tree/_tree.pyx":822 * # Allocate accumulators. Make sure they are NULL, not uninitialized, * # before an exception can be raised (which triggers __dealloc__). * self.mean_left = NULL # <<<<<<<<<<<<<< @@ -5709,7 +5753,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_left = NULL; - /* "sklearn/tree/_tree.pyx":594 + /* "sklearn/tree/_tree.pyx":823 * # before an exception can be raised (which triggers __dealloc__). * self.mean_left = NULL * self.mean_right = NULL # <<<<<<<<<<<<<< @@ -5718,7 +5762,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_right = NULL; - /* "sklearn/tree/_tree.pyx":595 + /* "sklearn/tree/_tree.pyx":824 * self.mean_left = NULL * self.mean_right = NULL * self.mean_total = NULL # <<<<<<<<<<<<<< @@ -5727,7 +5771,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_total = NULL; - /* "sklearn/tree/_tree.pyx":596 + /* "sklearn/tree/_tree.pyx":825 * self.mean_right = NULL * self.mean_total = NULL * self.sq_sum_left = NULL # <<<<<<<<<<<<<< @@ -5736,7 +5780,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_left = NULL; - /* "sklearn/tree/_tree.pyx":597 + /* "sklearn/tree/_tree.pyx":826 * self.mean_total = NULL * self.sq_sum_left = NULL * self.sq_sum_right = NULL # <<<<<<<<<<<<<< @@ -5745,7 +5789,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_right = NULL; - /* "sklearn/tree/_tree.pyx":598 + /* "sklearn/tree/_tree.pyx":827 * self.sq_sum_left = NULL * self.sq_sum_right = NULL * self.sq_sum_total = NULL # <<<<<<<<<<<<<< @@ -5754,7 +5798,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_total = NULL; - /* "sklearn/tree/_tree.pyx":599 + /* "sklearn/tree/_tree.pyx":828 * self.sq_sum_right = NULL * self.sq_sum_total = NULL * self.var_left = NULL # <<<<<<<<<<<<<< @@ -5763,7 +5807,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_left = NULL; - /* "sklearn/tree/_tree.pyx":600 + /* "sklearn/tree/_tree.pyx":829 * self.sq_sum_total = NULL * self.var_left = NULL * self.var_right = NULL # <<<<<<<<<<<<<< @@ -5772,7 +5816,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_right = NULL; - /* "sklearn/tree/_tree.pyx":601 + /* "sklearn/tree/_tree.pyx":830 * self.var_left = NULL * self.var_right = NULL * self.sum_left = NULL # <<<<<<<<<<<<<< @@ -5781,7 +5825,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_left = NULL; - /* "sklearn/tree/_tree.pyx":602 + /* "sklearn/tree/_tree.pyx":831 * self.var_right = NULL * self.sum_left = NULL * self.sum_right = NULL # <<<<<<<<<<<<<< @@ -5790,26 +5834,26 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_right = NULL; - /* "sklearn/tree/_tree.pyx":603 + /* "sklearn/tree/_tree.pyx":832 * self.sum_left = NULL * self.sum_right = NULL * self.sum_total = NULL # <<<<<<<<<<<<<< * - * self.mean_left = calloc(n_outputs, sizeof(double)) + * # Allocate memory for the accumulators */ __pyx_v_self->sum_total = NULL; - /* "sklearn/tree/_tree.pyx":605 - * self.sum_total = NULL + /* "sklearn/tree/_tree.pyx":835 * + * # Allocate memory for the accumulators * self.mean_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * self.mean_right = calloc(n_outputs, sizeof(double)) * self.mean_total = calloc(n_outputs, sizeof(double)) */ __pyx_v_self->mean_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":606 - * + /* "sklearn/tree/_tree.pyx":836 + * # Allocate memory for the accumulators * self.mean_left = calloc(n_outputs, sizeof(double)) * self.mean_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * self.mean_total = calloc(n_outputs, sizeof(double)) @@ -5817,7 +5861,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":607 + /* "sklearn/tree/_tree.pyx":837 * self.mean_left = calloc(n_outputs, sizeof(double)) * self.mean_right = calloc(n_outputs, sizeof(double)) * self.mean_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5826,7 +5870,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":608 + /* "sklearn/tree/_tree.pyx":838 * self.mean_right = calloc(n_outputs, sizeof(double)) * self.mean_total = calloc(n_outputs, sizeof(double)) * self.sq_sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5835,7 +5879,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":609 + /* "sklearn/tree/_tree.pyx":839 * self.mean_total = calloc(n_outputs, sizeof(double)) * self.sq_sum_left = calloc(n_outputs, sizeof(double)) * self.sq_sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5844,7 +5888,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":610 + /* "sklearn/tree/_tree.pyx":840 * self.sq_sum_left = calloc(n_outputs, sizeof(double)) * self.sq_sum_right = calloc(n_outputs, sizeof(double)) * self.sq_sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5853,7 +5897,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":611 + /* "sklearn/tree/_tree.pyx":841 * self.sq_sum_right = calloc(n_outputs, sizeof(double)) * self.sq_sum_total = calloc(n_outputs, sizeof(double)) * self.var_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5862,7 +5906,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":612 + /* "sklearn/tree/_tree.pyx":842 * self.sq_sum_total = calloc(n_outputs, sizeof(double)) * self.var_left = calloc(n_outputs, sizeof(double)) * self.var_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5871,7 +5915,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":613 + /* "sklearn/tree/_tree.pyx":843 * self.var_left = calloc(n_outputs, sizeof(double)) * self.var_right = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5880,7 +5924,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":614 + /* "sklearn/tree/_tree.pyx":844 * self.var_right = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5889,7 +5933,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":615 + /* "sklearn/tree/_tree.pyx":845 * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) * self.sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5898,7 +5942,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":617 + /* "sklearn/tree/_tree.pyx":847 * self.sum_total = calloc(n_outputs, sizeof(double)) * * if (self.mean_left == NULL or # <<<<<<<<<<<<<< @@ -5912,7 +5956,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":618 + /* "sklearn/tree/_tree.pyx":848 * * if (self.mean_left == NULL or * self.mean_right == NULL or # <<<<<<<<<<<<<< @@ -5926,7 +5970,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":619 + /* "sklearn/tree/_tree.pyx":849 * if (self.mean_left == NULL or * self.mean_right == NULL or * self.mean_total == NULL or # <<<<<<<<<<<<<< @@ -5940,7 +5984,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":620 + /* "sklearn/tree/_tree.pyx":850 * self.mean_right == NULL or * self.mean_total == NULL or * self.sq_sum_left == NULL or # <<<<<<<<<<<<<< @@ -5954,7 +5998,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":621 + /* "sklearn/tree/_tree.pyx":851 * self.mean_total == NULL or * self.sq_sum_left == NULL or * self.sq_sum_right == NULL or # <<<<<<<<<<<<<< @@ -5968,7 +6012,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":622 + /* "sklearn/tree/_tree.pyx":852 * self.sq_sum_left == NULL or * self.sq_sum_right == NULL or * self.sq_sum_total == NULL or # <<<<<<<<<<<<<< @@ -5982,7 +6026,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":623 + /* "sklearn/tree/_tree.pyx":853 * self.sq_sum_right == NULL or * self.sq_sum_total == NULL or * self.var_left == NULL or # <<<<<<<<<<<<<< @@ -5996,7 +6040,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":624 + /* "sklearn/tree/_tree.pyx":854 * self.sq_sum_total == NULL or * self.var_left == NULL or * self.var_right == NULL or # <<<<<<<<<<<<<< @@ -6010,7 +6054,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":625 + /* "sklearn/tree/_tree.pyx":855 * self.var_left == NULL or * self.var_right == NULL or * self.sum_left == NULL or # <<<<<<<<<<<<<< @@ -6024,7 +6068,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":626 + /* "sklearn/tree/_tree.pyx":856 * self.var_right == NULL or * self.sum_left == NULL or * self.sum_right == NULL or # <<<<<<<<<<<<<< @@ -6038,7 +6082,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":627 + /* "sklearn/tree/_tree.pyx":857 * self.sum_left == NULL or * self.sum_right == NULL or * self.sum_total == NULL): # <<<<<<<<<<<<<< @@ -6050,22 +6094,22 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":628 + /* "sklearn/tree/_tree.pyx":858 * self.sum_right == NULL or * self.sum_total == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":574 + /* "sklearn/tree/_tree.pyx":793 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< - * # Default values - * self.y = NULL + * """ + * Initialize parameters for this criterion. The only input are the number */ /* function exit code */ @@ -6079,12 +6123,12 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":630 +/* "sklearn/tree/_tree.pyx":860 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor.""" - * free(self.mean_left) + * """ + * The destructor method for this class. Since we've allocated memory to */ /* Python wrapper */ @@ -6102,17 +6146,17 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":632 - * def __dealloc__(self): - * """Destructor.""" + /* "sklearn/tree/_tree.pyx":866 + * """ + * * free(self.mean_left) # <<<<<<<<<<<<<< * free(self.mean_right) * free(self.mean_total) */ free(__pyx_v_self->mean_left); - /* "sklearn/tree/_tree.pyx":633 - * """Destructor.""" + /* "sklearn/tree/_tree.pyx":867 + * * free(self.mean_left) * free(self.mean_right) # <<<<<<<<<<<<<< * free(self.mean_total) @@ -6120,7 +6164,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_right); - /* "sklearn/tree/_tree.pyx":634 + /* "sklearn/tree/_tree.pyx":868 * free(self.mean_left) * free(self.mean_right) * free(self.mean_total) # <<<<<<<<<<<<<< @@ -6129,7 +6173,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_total); - /* "sklearn/tree/_tree.pyx":635 + /* "sklearn/tree/_tree.pyx":869 * free(self.mean_right) * free(self.mean_total) * free(self.sq_sum_left) # <<<<<<<<<<<<<< @@ -6138,7 +6182,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_left); - /* "sklearn/tree/_tree.pyx":636 + /* "sklearn/tree/_tree.pyx":870 * free(self.mean_total) * free(self.sq_sum_left) * free(self.sq_sum_right) # <<<<<<<<<<<<<< @@ -6147,7 +6191,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_right); - /* "sklearn/tree/_tree.pyx":637 + /* "sklearn/tree/_tree.pyx":871 * free(self.sq_sum_left) * free(self.sq_sum_right) * free(self.sq_sum_total) # <<<<<<<<<<<<<< @@ -6156,7 +6200,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_total); - /* "sklearn/tree/_tree.pyx":638 + /* "sklearn/tree/_tree.pyx":872 * free(self.sq_sum_right) * free(self.sq_sum_total) * free(self.var_left) # <<<<<<<<<<<<<< @@ -6165,7 +6209,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->var_left); - /* "sklearn/tree/_tree.pyx":639 + /* "sklearn/tree/_tree.pyx":873 * free(self.sq_sum_total) * free(self.var_left) * free(self.var_right) # <<<<<<<<<<<<<< @@ -6174,7 +6218,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->var_right); - /* "sklearn/tree/_tree.pyx":640 + /* "sklearn/tree/_tree.pyx":874 * free(self.var_left) * free(self.var_right) * free(self.sum_left) # <<<<<<<<<<<<<< @@ -6183,7 +6227,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_left); - /* "sklearn/tree/_tree.pyx":641 + /* "sklearn/tree/_tree.pyx":875 * free(self.var_right) * free(self.sum_left) * free(self.sum_right) # <<<<<<<<<<<<<< @@ -6192,7 +6236,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_right); - /* "sklearn/tree/_tree.pyx":642 + /* "sklearn/tree/_tree.pyx":876 * free(self.sum_left) * free(self.sum_right) * free(self.sum_total) # <<<<<<<<<<<<<< @@ -6201,19 +6245,19 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_total); - /* "sklearn/tree/_tree.pyx":630 + /* "sklearn/tree/_tree.pyx":860 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor.""" - * free(self.mean_left) + * """ + * The destructor method for this class. Since we've allocated memory to */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":644 +/* "sklearn/tree/_tree.pyx":878 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6246,7 +6290,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":645 + /* "sklearn/tree/_tree.pyx":879 * * def __reduce__(self): * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) # <<<<<<<<<<<<<< @@ -6254,14 +6298,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ * def __getstate__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { @@ -6274,14 +6318,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ } } if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion))); @@ -6296,7 +6340,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":644 + /* "sklearn/tree/_tree.pyx":878 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6318,7 +6362,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":647 +/* "sklearn/tree/_tree.pyx":881 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6348,7 +6392,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":648 + /* "sklearn/tree/_tree.pyx":882 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -6356,13 +6400,13 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":647 + /* "sklearn/tree/_tree.pyx":881 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6381,7 +6425,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":650 +/* "sklearn/tree/_tree.pyx":884 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -6414,7 +6458,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_8__setstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":653 +/* "sklearn/tree/_tree.pyx":887 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -6451,7 +6495,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_6; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; - /* "sklearn/tree/_tree.pyx":659 + /* "sklearn/tree/_tree.pyx":893 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -6460,7 +6504,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.y = __pyx_v_y; - /* "sklearn/tree/_tree.pyx":660 + /* "sklearn/tree/_tree.pyx":894 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -6469,7 +6513,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.y_stride = __pyx_v_y_stride; - /* "sklearn/tree/_tree.pyx":661 + /* "sklearn/tree/_tree.pyx":895 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -6478,7 +6522,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.sample_weight = __pyx_v_sample_weight; - /* "sklearn/tree/_tree.pyx":662 + /* "sklearn/tree/_tree.pyx":896 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -6487,7 +6531,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.samples = __pyx_v_samples; - /* "sklearn/tree/_tree.pyx":663 + /* "sklearn/tree/_tree.pyx":897 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -6496,7 +6540,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":664 + /* "sklearn/tree/_tree.pyx":898 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -6505,7 +6549,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":665 + /* "sklearn/tree/_tree.pyx":899 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< @@ -6514,7 +6558,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":666 + /* "sklearn/tree/_tree.pyx":900 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -6523,7 +6567,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.weighted_n_samples = __pyx_v_weighted_n_samples; - /* "sklearn/tree/_tree.pyx":667 + /* "sklearn/tree/_tree.pyx":901 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0. # <<<<<<<<<<<<<< @@ -6532,7 +6576,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_weighted_n_node_samples = 0.; - /* "sklearn/tree/_tree.pyx":670 + /* "sklearn/tree/_tree.pyx":904 * * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -6542,7 +6586,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":671 + /* "sklearn/tree/_tree.pyx":905 * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -6552,7 +6596,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->mean_left; __pyx_v_mean_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":672 + /* "sklearn/tree/_tree.pyx":906 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -6562,7 +6606,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->mean_right; __pyx_v_mean_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":673 + /* "sklearn/tree/_tree.pyx":907 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -6572,7 +6616,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->mean_total; __pyx_v_mean_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":674 + /* "sklearn/tree/_tree.pyx":908 * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -6582,7 +6626,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sq_sum_left; __pyx_v_sq_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":675 + /* "sklearn/tree/_tree.pyx":909 * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left * cdef double* sq_sum_right = self.sq_sum_right # <<<<<<<<<<<<<< @@ -6592,7 +6636,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sq_sum_right; __pyx_v_sq_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":676 + /* "sklearn/tree/_tree.pyx":910 * cdef double* sq_sum_left = self.sq_sum_left * cdef double* sq_sum_right = self.sq_sum_right * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< @@ -6602,7 +6646,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":677 + /* "sklearn/tree/_tree.pyx":911 * cdef double* sq_sum_right = self.sq_sum_right * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< @@ -6612,7 +6656,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->var_left; __pyx_v_var_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":678 + /* "sklearn/tree/_tree.pyx":912 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -6622,7 +6666,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->var_right; __pyx_v_var_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":679 + /* "sklearn/tree/_tree.pyx":913 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -6632,7 +6676,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sum_left; __pyx_v_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":680 + /* "sklearn/tree/_tree.pyx":914 * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -6642,7 +6686,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sum_right; __pyx_v_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":681 + /* "sklearn/tree/_tree.pyx":915 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< @@ -6652,7 +6696,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sum_total; __pyx_v_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":683 + /* "sklearn/tree/_tree.pyx":917 * cdef double* sum_total = self.sum_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -6661,7 +6705,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":684 + /* "sklearn/tree/_tree.pyx":918 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -6670,7 +6714,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":685 + /* "sklearn/tree/_tree.pyx":919 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -6679,7 +6723,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":686 + /* "sklearn/tree/_tree.pyx":920 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6688,7 +6732,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":687 + /* "sklearn/tree/_tree.pyx":921 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6697,7 +6741,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":688 + /* "sklearn/tree/_tree.pyx":922 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -6706,7 +6750,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":690 + /* "sklearn/tree/_tree.pyx":924 * cdef DOUBLE_t w = 1.0 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< @@ -6715,7 +6759,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_n_bytes = (__pyx_v_n_outputs * (sizeof(double))); - /* "sklearn/tree/_tree.pyx":691 + /* "sklearn/tree/_tree.pyx":925 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) * memset(mean_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6724,7 +6768,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_mean_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":692 + /* "sklearn/tree/_tree.pyx":926 * cdef SIZE_t n_bytes = n_outputs * sizeof(double) * memset(mean_left, 0, n_bytes) * memset(mean_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6733,7 +6777,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_mean_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":693 + /* "sklearn/tree/_tree.pyx":927 * memset(mean_left, 0, n_bytes) * memset(mean_right, 0, n_bytes) * memset(mean_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6742,7 +6786,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_mean_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":694 + /* "sklearn/tree/_tree.pyx":928 * memset(mean_right, 0, n_bytes) * memset(mean_total, 0, n_bytes) * memset(sq_sum_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6751,7 +6795,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sq_sum_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":695 + /* "sklearn/tree/_tree.pyx":929 * memset(mean_total, 0, n_bytes) * memset(sq_sum_left, 0, n_bytes) * memset(sq_sum_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6760,7 +6804,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sq_sum_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":696 + /* "sklearn/tree/_tree.pyx":930 * memset(sq_sum_left, 0, n_bytes) * memset(sq_sum_right, 0, n_bytes) * memset(sq_sum_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6769,7 +6813,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sq_sum_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":697 + /* "sklearn/tree/_tree.pyx":931 * memset(sq_sum_right, 0, n_bytes) * memset(sq_sum_total, 0, n_bytes) * memset(var_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6778,7 +6822,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_var_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":698 + /* "sklearn/tree/_tree.pyx":932 * memset(sq_sum_total, 0, n_bytes) * memset(var_left, 0, n_bytes) * memset(var_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6787,7 +6831,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_var_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":699 + /* "sklearn/tree/_tree.pyx":933 * memset(var_left, 0, n_bytes) * memset(var_right, 0, n_bytes) * memset(sum_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6796,7 +6840,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sum_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":700 + /* "sklearn/tree/_tree.pyx":934 * memset(var_right, 0, n_bytes) * memset(sum_left, 0, n_bytes) * memset(sum_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6805,7 +6849,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sum_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":701 + /* "sklearn/tree/_tree.pyx":935 * memset(sum_left, 0, n_bytes) * memset(sum_right, 0, n_bytes) * memset(sum_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6814,7 +6858,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sum_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":703 + /* "sklearn/tree/_tree.pyx":937 * memset(sum_total, 0, n_bytes) * * for p in range(start, end): # <<<<<<<<<<<<<< @@ -6825,7 +6869,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py for (__pyx_t_3 = __pyx_v_start; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_p = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":704 + /* "sklearn/tree/_tree.pyx":938 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -6834,7 +6878,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":706 + /* "sklearn/tree/_tree.pyx":940 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -6844,7 +6888,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_4 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":707 + /* "sklearn/tree/_tree.pyx":941 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -6856,7 +6900,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":709 + /* "sklearn/tree/_tree.pyx":943 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6867,7 +6911,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":710 + /* "sklearn/tree/_tree.pyx":944 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -6876,7 +6920,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_tree.pyx":711 + /* "sklearn/tree/_tree.pyx":945 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -6885,7 +6929,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w_y_ik = (__pyx_v_w * __pyx_v_y_ik); - /* "sklearn/tree/_tree.pyx":712 + /* "sklearn/tree/_tree.pyx":946 * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik * sum_total[k] += w_y_ik # <<<<<<<<<<<<<< @@ -6895,7 +6939,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_7 = __pyx_v_k; (__pyx_v_sum_total[__pyx_t_7]) = ((__pyx_v_sum_total[__pyx_t_7]) + __pyx_v_w_y_ik); - /* "sklearn/tree/_tree.pyx":713 + /* "sklearn/tree/_tree.pyx":947 * w_y_ik = w * y_ik * sum_total[k] += w_y_ik * sq_sum_total[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -6906,7 +6950,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py (__pyx_v_sq_sum_total[__pyx_t_7]) = ((__pyx_v_sq_sum_total[__pyx_t_7]) + (__pyx_v_w_y_ik * __pyx_v_y_ik)); } - /* "sklearn/tree/_tree.pyx":715 + /* "sklearn/tree/_tree.pyx":949 * sq_sum_total[k] += w_y_ik * y_ik * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -6916,7 +6960,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_v_weighted_n_node_samples = (__pyx_v_weighted_n_node_samples + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":717 + /* "sklearn/tree/_tree.pyx":951 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6925,7 +6969,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":719 + /* "sklearn/tree/_tree.pyx":953 * self.weighted_n_node_samples = weighted_n_node_samples * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6936,7 +6980,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":720 + /* "sklearn/tree/_tree.pyx":954 * * for k in range(n_outputs): * mean_total[k] = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6946,7 +6990,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py (__pyx_v_mean_total[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); } - /* "sklearn/tree/_tree.pyx":723 + /* "sklearn/tree/_tree.pyx":957 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -6955,7 +6999,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset(((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":653 + /* "sklearn/tree/_tree.pyx":887 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -6966,7 +7010,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":725 +/* "sklearn/tree/_tree.pyx":959 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -6994,7 +7038,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p double *__pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":727 + /* "sklearn/tree/_tree.pyx":961 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" * self.pos = self.start # <<<<<<<<<<<<<< @@ -7004,7 +7048,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.start; __pyx_v_self->__pyx_base.pos = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":729 + /* "sklearn/tree/_tree.pyx":963 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -7013,7 +7057,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":730 + /* "sklearn/tree/_tree.pyx":964 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -7023,7 +7067,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":732 + /* "sklearn/tree/_tree.pyx":966 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7033,7 +7077,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":733 + /* "sklearn/tree/_tree.pyx":967 * * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -7043,7 +7087,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->mean_left; __pyx_v_mean_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":734 + /* "sklearn/tree/_tree.pyx":968 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -7053,7 +7097,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->mean_right; __pyx_v_mean_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":735 + /* "sklearn/tree/_tree.pyx":969 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -7063,7 +7107,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->mean_total; __pyx_v_mean_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":736 + /* "sklearn/tree/_tree.pyx":970 * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -7073,7 +7117,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sq_sum_left; __pyx_v_sq_sum_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":737 + /* "sklearn/tree/_tree.pyx":971 * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left * cdef double* sq_sum_right = self.sq_sum_right # <<<<<<<<<<<<<< @@ -7083,7 +7127,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sq_sum_right; __pyx_v_sq_sum_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":738 + /* "sklearn/tree/_tree.pyx":972 * cdef double* sq_sum_left = self.sq_sum_left * cdef double* sq_sum_right = self.sq_sum_right * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< @@ -7093,7 +7137,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":739 + /* "sklearn/tree/_tree.pyx":973 * cdef double* sq_sum_right = self.sq_sum_right * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< @@ -7103,7 +7147,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->var_left; __pyx_v_var_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":740 + /* "sklearn/tree/_tree.pyx":974 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7113,7 +7157,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->var_right; __pyx_v_var_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":741 + /* "sklearn/tree/_tree.pyx":975 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -7123,7 +7167,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":742 + /* "sklearn/tree/_tree.pyx":976 * cdef double* var_right = self.var_right * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -7133,7 +7177,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sum_left; __pyx_v_sum_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":743 + /* "sklearn/tree/_tree.pyx":977 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -7143,7 +7187,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sum_right; __pyx_v_sum_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":744 + /* "sklearn/tree/_tree.pyx":978 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< @@ -7153,7 +7197,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sum_total; __pyx_v_sum_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":746 + /* "sklearn/tree/_tree.pyx":980 * cdef double* sum_total = self.sum_total * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -7162,7 +7206,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":748 + /* "sklearn/tree/_tree.pyx":982 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7173,7 +7217,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":749 + /* "sklearn/tree/_tree.pyx":983 * * for k in range(n_outputs): * mean_right[k] = mean_total[k] # <<<<<<<<<<<<<< @@ -7182,7 +7226,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_mean_right[__pyx_v_k]) = (__pyx_v_mean_total[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":750 + /* "sklearn/tree/_tree.pyx":984 * for k in range(n_outputs): * mean_right[k] = mean_total[k] * mean_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -7191,7 +7235,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_mean_left[__pyx_v_k]) = 0.0; - /* "sklearn/tree/_tree.pyx":751 + /* "sklearn/tree/_tree.pyx":985 * mean_right[k] = mean_total[k] * mean_left[k] = 0.0 * sq_sum_right[k] = sq_sum_total[k] # <<<<<<<<<<<<<< @@ -7200,7 +7244,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_sq_sum_right[__pyx_v_k]) = (__pyx_v_sq_sum_total[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":752 + /* "sklearn/tree/_tree.pyx":986 * mean_left[k] = 0.0 * sq_sum_right[k] = sq_sum_total[k] * sq_sum_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -7209,7 +7253,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_sq_sum_left[__pyx_v_k]) = 0.0; - /* "sklearn/tree/_tree.pyx":753 + /* "sklearn/tree/_tree.pyx":987 * sq_sum_right[k] = sq_sum_total[k] * sq_sum_left[k] = 0.0 * var_right[k] = (sq_sum_right[k] / weighted_n_node_samples - # <<<<<<<<<<<<<< @@ -7218,7 +7262,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_var_right[__pyx_v_k]) = (((__pyx_v_sq_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_node_samples) - ((__pyx_v_mean_right[__pyx_v_k]) * (__pyx_v_mean_right[__pyx_v_k]))); - /* "sklearn/tree/_tree.pyx":755 + /* "sklearn/tree/_tree.pyx":989 * var_right[k] = (sq_sum_right[k] / weighted_n_node_samples - * mean_right[k] * mean_right[k]) * var_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -7227,7 +7271,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_var_left[__pyx_v_k]) = 0.0; - /* "sklearn/tree/_tree.pyx":756 + /* "sklearn/tree/_tree.pyx":990 * mean_right[k] * mean_right[k]) * var_left[k] = 0.0 * sum_right[k] = sum_total[k] # <<<<<<<<<<<<<< @@ -7236,7 +7280,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_sum_right[__pyx_v_k]) = (__pyx_v_sum_total[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":757 + /* "sklearn/tree/_tree.pyx":991 * var_left[k] = 0.0 * sum_right[k] = sum_total[k] * sum_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -7246,7 +7290,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p (__pyx_v_sum_left[__pyx_v_k]) = 0.0; } - /* "sklearn/tree/_tree.pyx":725 + /* "sklearn/tree/_tree.pyx":959 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -7257,7 +7301,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":759 +/* "sklearn/tree/_tree.pyx":993 * sum_left[k] = 0.0 * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -7300,7 +7344,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_9; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_10; - /* "sklearn/tree/_tree.pyx":762 + /* "sklearn/tree/_tree.pyx":996 * """Update the collected statistics by moving samples[pos:new_pos] from * the right child to the left child.""" * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< @@ -7310,7 +7354,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_1 = __pyx_v_self->__pyx_base.y; __pyx_v_y = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":763 + /* "sklearn/tree/_tree.pyx":997 * the right child to the left child.""" * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< @@ -7320,7 +7364,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_2 = __pyx_v_self->__pyx_base.y_stride; __pyx_v_y_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":764 + /* "sklearn/tree/_tree.pyx":998 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -7330,7 +7374,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_1 = __pyx_v_self->__pyx_base.sample_weight; __pyx_v_sample_weight = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":766 + /* "sklearn/tree/_tree.pyx":1000 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -7340,7 +7384,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_3 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":767 + /* "sklearn/tree/_tree.pyx":1001 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -7350,7 +7394,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_2 = __pyx_v_self->__pyx_base.pos; __pyx_v_pos = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":769 + /* "sklearn/tree/_tree.pyx":1003 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7360,7 +7404,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":770 + /* "sklearn/tree/_tree.pyx":1004 * * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -7370,7 +7414,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->mean_left; __pyx_v_mean_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":771 + /* "sklearn/tree/_tree.pyx":1005 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -7380,7 +7424,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->mean_right; __pyx_v_mean_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":772 + /* "sklearn/tree/_tree.pyx":1006 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -7390,7 +7434,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sq_sum_left; __pyx_v_sq_sum_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":773 + /* "sklearn/tree/_tree.pyx":1007 * cdef double* mean_right = self.mean_right * cdef double* sq_sum_left = self.sq_sum_left * cdef double* sq_sum_right = self.sq_sum_right # <<<<<<<<<<<<<< @@ -7400,7 +7444,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sq_sum_right; __pyx_v_sq_sum_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":774 + /* "sklearn/tree/_tree.pyx":1008 * cdef double* sq_sum_left = self.sq_sum_left * cdef double* sq_sum_right = self.sq_sum_right * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< @@ -7410,7 +7454,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->var_left; __pyx_v_var_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":775 + /* "sklearn/tree/_tree.pyx":1009 * cdef double* sq_sum_right = self.sq_sum_right * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7420,7 +7464,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->var_right; __pyx_v_var_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":776 + /* "sklearn/tree/_tree.pyx":1010 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -7430,7 +7474,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sum_left; __pyx_v_sum_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":777 + /* "sklearn/tree/_tree.pyx":1011 * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -7440,7 +7484,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sum_right; __pyx_v_sum_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":779 + /* "sklearn/tree/_tree.pyx":1013 * cdef double* sum_right = self.sum_right * * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -7450,7 +7494,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_5 = __pyx_v_self->__pyx_base.weighted_n_left; __pyx_v_weighted_n_left = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":780 + /* "sklearn/tree/_tree.pyx":1014 * * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< @@ -7460,7 +7504,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_5 = __pyx_v_self->__pyx_base.weighted_n_right; __pyx_v_weighted_n_right = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":785 + /* "sklearn/tree/_tree.pyx":1019 * cdef SIZE_t p * cdef SIZE_t k * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -7469,7 +7513,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":786 + /* "sklearn/tree/_tree.pyx":1020 * cdef SIZE_t k * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -7478,7 +7522,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":790 + /* "sklearn/tree/_tree.pyx":1024 * * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -7489,7 +7533,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ for (__pyx_t_6 = __pyx_v_pos; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_p = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":791 + /* "sklearn/tree/_tree.pyx":1025 * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -7498,7 +7542,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":793 + /* "sklearn/tree/_tree.pyx":1027 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -7508,7 +7552,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_7 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":794 + /* "sklearn/tree/_tree.pyx":1028 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -7520,7 +7564,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":796 + /* "sklearn/tree/_tree.pyx":1030 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7531,7 +7575,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_k = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":797 + /* "sklearn/tree/_tree.pyx":1031 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -7540,7 +7584,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_tree.pyx":798 + /* "sklearn/tree/_tree.pyx":1032 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -7549,7 +7593,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_w_y_ik = (__pyx_v_w * __pyx_v_y_ik); - /* "sklearn/tree/_tree.pyx":800 + /* "sklearn/tree/_tree.pyx":1034 * w_y_ik = w * y_ik * * sum_left[k] += w_y_ik # <<<<<<<<<<<<<< @@ -7559,7 +7603,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_10 = __pyx_v_k; (__pyx_v_sum_left[__pyx_t_10]) = ((__pyx_v_sum_left[__pyx_t_10]) + __pyx_v_w_y_ik); - /* "sklearn/tree/_tree.pyx":801 + /* "sklearn/tree/_tree.pyx":1035 * * sum_left[k] += w_y_ik * sum_right[k] -= w_y_ik # <<<<<<<<<<<<<< @@ -7569,7 +7613,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_10 = __pyx_v_k; (__pyx_v_sum_right[__pyx_t_10]) = ((__pyx_v_sum_right[__pyx_t_10]) - __pyx_v_w_y_ik); - /* "sklearn/tree/_tree.pyx":803 + /* "sklearn/tree/_tree.pyx":1037 * sum_right[k] -= w_y_ik * * sq_sum_left[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -7579,7 +7623,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_10 = __pyx_v_k; (__pyx_v_sq_sum_left[__pyx_t_10]) = ((__pyx_v_sq_sum_left[__pyx_t_10]) + (__pyx_v_w_y_ik * __pyx_v_y_ik)); - /* "sklearn/tree/_tree.pyx":804 + /* "sklearn/tree/_tree.pyx":1038 * * sq_sum_left[k] += w_y_ik * y_ik * sq_sum_right[k] -= w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -7590,7 +7634,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ (__pyx_v_sq_sum_right[__pyx_t_10]) = ((__pyx_v_sq_sum_right[__pyx_t_10]) - (__pyx_v_w_y_ik * __pyx_v_y_ik)); } - /* "sklearn/tree/_tree.pyx":806 + /* "sklearn/tree/_tree.pyx":1040 * sq_sum_right[k] -= w_y_ik * y_ik * * diff_w += w # <<<<<<<<<<<<<< @@ -7600,7 +7644,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":808 + /* "sklearn/tree/_tree.pyx":1042 * diff_w += w * * weighted_n_left += diff_w # <<<<<<<<<<<<<< @@ -7609,7 +7653,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_weighted_n_left = (__pyx_v_weighted_n_left + __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":809 + /* "sklearn/tree/_tree.pyx":1043 * * weighted_n_left += diff_w * weighted_n_right -= diff_w # <<<<<<<<<<<<<< @@ -7618,7 +7662,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_weighted_n_right = (__pyx_v_weighted_n_right - __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":811 + /* "sklearn/tree/_tree.pyx":1045 * weighted_n_right -= diff_w * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7629,7 +7673,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":812 + /* "sklearn/tree/_tree.pyx":1046 * * for k in range(n_outputs): * mean_left[k] = sum_left[k] / weighted_n_left # <<<<<<<<<<<<<< @@ -7638,7 +7682,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ (__pyx_v_mean_left[__pyx_v_k]) = ((__pyx_v_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left); - /* "sklearn/tree/_tree.pyx":813 + /* "sklearn/tree/_tree.pyx":1047 * for k in range(n_outputs): * mean_left[k] = sum_left[k] / weighted_n_left * mean_right[k] = sum_right[k] / weighted_n_right # <<<<<<<<<<<<<< @@ -7647,7 +7691,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ (__pyx_v_mean_right[__pyx_v_k]) = ((__pyx_v_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right); - /* "sklearn/tree/_tree.pyx":814 + /* "sklearn/tree/_tree.pyx":1048 * mean_left[k] = sum_left[k] / weighted_n_left * mean_right[k] = sum_right[k] / weighted_n_right * var_left[k] = (sq_sum_left[k] / weighted_n_left - # <<<<<<<<<<<<<< @@ -7656,7 +7700,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ (__pyx_v_var_left[__pyx_v_k]) = (((__pyx_v_sq_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left) - ((__pyx_v_mean_left[__pyx_v_k]) * (__pyx_v_mean_left[__pyx_v_k]))); - /* "sklearn/tree/_tree.pyx":816 + /* "sklearn/tree/_tree.pyx":1050 * var_left[k] = (sq_sum_left[k] / weighted_n_left - * mean_left[k] * mean_left[k]) * var_right[k] = (sq_sum_right[k] / weighted_n_right - # <<<<<<<<<<<<<< @@ -7666,7 +7710,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ (__pyx_v_var_right[__pyx_v_k]) = (((__pyx_v_sq_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right) - ((__pyx_v_mean_right[__pyx_v_k]) * (__pyx_v_mean_right[__pyx_v_k]))); } - /* "sklearn/tree/_tree.pyx":819 + /* "sklearn/tree/_tree.pyx":1053 * mean_right[k] * mean_right[k]) * * self.weighted_n_left = weighted_n_left # <<<<<<<<<<<<<< @@ -7675,7 +7719,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_self->__pyx_base.weighted_n_left = __pyx_v_weighted_n_left; - /* "sklearn/tree/_tree.pyx":820 + /* "sklearn/tree/_tree.pyx":1054 * * self.weighted_n_left = weighted_n_left * self.weighted_n_right = weighted_n_right # <<<<<<<<<<<<<< @@ -7684,7 +7728,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_self->__pyx_base.weighted_n_right = __pyx_v_weighted_n_right; - /* "sklearn/tree/_tree.pyx":822 + /* "sklearn/tree/_tree.pyx":1056 * self.weighted_n_right = weighted_n_right * * self.pos = new_pos # <<<<<<<<<<<<<< @@ -7693,7 +7737,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_self->__pyx_base.pos = __pyx_v_new_pos; - /* "sklearn/tree/_tree.pyx":759 + /* "sklearn/tree/_tree.pyx":993 * sum_left[k] = 0.0 * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -7704,7 +7748,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":824 +/* "sklearn/tree/_tree.pyx":1058 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7720,7 +7764,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_impurity( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":827 +/* "sklearn/tree/_tree.pyx":1061 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7733,7 +7777,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurit /* function exit code */ } -/* "sklearn/tree/_tree.pyx":831 +/* "sklearn/tree/_tree.pyx":1065 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -7743,7 +7787,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurit static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, double *__pyx_v_dest) { - /* "sklearn/tree/_tree.pyx":833 + /* "sklearn/tree/_tree.pyx":1067 * cdef void node_value(self, double* dest) nogil: * """Compute the node value of samples[start:end] into dest.""" * memcpy(dest, self.mean_total, self.n_outputs * sizeof(double)) # <<<<<<<<<<<<<< @@ -7752,7 +7796,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struc */ memcpy(__pyx_v_dest, __pyx_v_self->mean_total, (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":831 + /* "sklearn/tree/_tree.pyx":1065 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -7763,7 +7807,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":841 +/* "sklearn/tree/_tree.pyx":1075 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7784,7 +7828,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ double __pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":844 + /* "sklearn/tree/_tree.pyx":1078 * """Evaluate the impurity of the current node, i.e. the impurity of * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7794,7 +7838,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":845 + /* "sklearn/tree/_tree.pyx":1079 * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< @@ -7804,7 +7848,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_2 = __pyx_v_self->__pyx_base.sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":846 + /* "sklearn/tree/_tree.pyx":1080 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -7814,7 +7858,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_2 = __pyx_v_self->__pyx_base.mean_total; __pyx_v_mean_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":847 + /* "sklearn/tree/_tree.pyx":1081 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* mean_total = self.mean_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -7824,7 +7868,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":848 + /* "sklearn/tree/_tree.pyx":1082 * cdef double* mean_total = self.mean_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -7833,7 +7877,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":851 + /* "sklearn/tree/_tree.pyx":1085 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7844,7 +7888,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":852 + /* "sklearn/tree/_tree.pyx":1086 * * for k in range(n_outputs): * total += (sq_sum_total[k] / weighted_n_node_samples - # <<<<<<<<<<<<<< @@ -7854,7 +7898,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_v_total = (__pyx_v_total + (((__pyx_v_sq_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples) - ((__pyx_v_mean_total[__pyx_v_k]) * (__pyx_v_mean_total[__pyx_v_k])))); } - /* "sklearn/tree/_tree.pyx":855 + /* "sklearn/tree/_tree.pyx":1089 * mean_total[k] * mean_total[k]) * * return total / n_outputs # <<<<<<<<<<<<<< @@ -7864,7 +7908,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":841 + /* "sklearn/tree/_tree.pyx":1075 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7877,7 +7921,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":857 +/* "sklearn/tree/_tree.pyx":1091 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7896,7 +7940,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob double *__pyx_t_2; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_3; - /* "sklearn/tree/_tree.pyx":862 + /* "sklearn/tree/_tree.pyx":1096 * left child (samples[start:pos]) and the impurity the right child * (samples[pos:end]).""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7906,7 +7950,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":863 + /* "sklearn/tree/_tree.pyx":1097 * (samples[pos:end]).""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< @@ -7916,7 +7960,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_t_2 = __pyx_v_self->__pyx_base.var_left; __pyx_v_var_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":864 + /* "sklearn/tree/_tree.pyx":1098 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7926,7 +7970,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_t_2 = __pyx_v_self->__pyx_base.var_right; __pyx_v_var_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":865 + /* "sklearn/tree/_tree.pyx":1099 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -7935,7 +7979,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":866 + /* "sklearn/tree/_tree.pyx":1100 * cdef double* var_right = self.var_right * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -7944,7 +7988,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":869 + /* "sklearn/tree/_tree.pyx":1103 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7955,7 +7999,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":870 + /* "sklearn/tree/_tree.pyx":1104 * * for k in range(n_outputs): * total_left += var_left[k] # <<<<<<<<<<<<<< @@ -7964,7 +8008,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ __pyx_v_total_left = (__pyx_v_total_left + (__pyx_v_var_left[__pyx_v_k])); - /* "sklearn/tree/_tree.pyx":871 + /* "sklearn/tree/_tree.pyx":1105 * for k in range(n_outputs): * total_left += var_left[k] * total_right += var_right[k] # <<<<<<<<<<<<<< @@ -7974,7 +8018,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_v_total_right = (__pyx_v_total_right + (__pyx_v_var_right[__pyx_v_k])); } - /* "sklearn/tree/_tree.pyx":873 + /* "sklearn/tree/_tree.pyx":1107 * total_right += var_right[k] * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -7983,7 +8027,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":874 + /* "sklearn/tree/_tree.pyx":1108 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -7992,7 +8036,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":857 + /* "sklearn/tree/_tree.pyx":1091 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -8003,7 +8047,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob /* function exit code */ } -/* "sklearn/tree/_tree.pyx":886 +/* "sklearn/tree/_tree.pyx":1120 * """ * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -8025,8 +8069,9 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; double *__pyx_t_2; double __pyx_t_3; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":887 + /* "sklearn/tree/_tree.pyx":1121 * * cdef double impurity_improvement(self, double impurity) nogil: * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -8036,7 +8081,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":889 + /* "sklearn/tree/_tree.pyx":1123 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t k * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -8046,7 +8091,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_left; __pyx_v_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":890 + /* "sklearn/tree/_tree.pyx":1124 * cdef SIZE_t k * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -8056,7 +8101,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_right; __pyx_v_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":891 + /* "sklearn/tree/_tree.pyx":1125 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< @@ -8065,7 +8110,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = 0.0; - /* "sklearn/tree/_tree.pyx":892 + /* "sklearn/tree/_tree.pyx":1126 * cdef double* sum_right = self.sum_right * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 # <<<<<<<<<<<<<< @@ -8074,7 +8119,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_right = 0.0; - /* "sklearn/tree/_tree.pyx":893 + /* "sklearn/tree/_tree.pyx":1127 * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -8084,7 +8129,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left; __pyx_v_weighted_n_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":894 + /* "sklearn/tree/_tree.pyx":1128 * cdef double total_sum_right = 0.0 * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< @@ -8094,36 +8139,37 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right; __pyx_v_weighted_n_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":895 + /* "sklearn/tree/_tree.pyx":1129 * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right * cdef double diff = 0.0 # <<<<<<<<<<<<<< * - * for k from 0 <= k < n_outputs: + * for k in range(n_outputs): */ __pyx_v_diff = 0.0; - /* "sklearn/tree/_tree.pyx":897 + /* "sklearn/tree/_tree.pyx":1131 * cdef double diff = 0.0 * - * for k from 0 <= k < n_outputs: # <<<<<<<<<<<<<< + * for k in range(n_outputs): # <<<<<<<<<<<<<< * total_sum_left += sum_left[k] * total_sum_right += sum_right[k] */ __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_1; __pyx_v_k++) { + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":898 + /* "sklearn/tree/_tree.pyx":1132 * - * for k from 0 <= k < n_outputs: + * for k in range(n_outputs): * total_sum_left += sum_left[k] # <<<<<<<<<<<<<< * total_sum_right += sum_right[k] * */ __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_sum_left[__pyx_v_k])); - /* "sklearn/tree/_tree.pyx":899 - * for k from 0 <= k < n_outputs: + /* "sklearn/tree/_tree.pyx":1133 + * for k in range(n_outputs): * total_sum_left += sum_left[k] * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< * @@ -8132,7 +8178,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_sum_right[__pyx_v_k])); } - /* "sklearn/tree/_tree.pyx":901 + /* "sklearn/tree/_tree.pyx":1135 * total_sum_right += sum_right[k] * * total_sum_left = total_sum_left / n_outputs # <<<<<<<<<<<<<< @@ -8141,7 +8187,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = (__pyx_v_total_sum_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":902 + /* "sklearn/tree/_tree.pyx":1136 * * total_sum_left = total_sum_left / n_outputs * total_sum_right = total_sum_right / n_outputs # <<<<<<<<<<<<<< @@ -8150,7 +8196,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_right = (__pyx_v_total_sum_right / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":903 + /* "sklearn/tree/_tree.pyx":1137 * total_sum_left = total_sum_left / n_outputs * total_sum_right = total_sum_right / n_outputs * diff = ((total_sum_left / weighted_n_left) - # <<<<<<<<<<<<<< @@ -8159,7 +8205,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_diff = ((__pyx_v_total_sum_left / __pyx_v_weighted_n_left) - (__pyx_v_total_sum_right / __pyx_v_weighted_n_right)); - /* "sklearn/tree/_tree.pyx":906 + /* "sklearn/tree/_tree.pyx":1140 * (total_sum_right / weighted_n_right)) * * return (weighted_n_left * weighted_n_right * diff * diff / # <<<<<<<<<<<<<< @@ -8169,7 +8215,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_r = ((((__pyx_v_weighted_n_left * __pyx_v_weighted_n_right) * __pyx_v_diff) * __pyx_v_diff) / (__pyx_v_weighted_n_left + __pyx_v_weighted_n_right)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":886 + /* "sklearn/tree/_tree.pyx":1120 * """ * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -8182,7 +8228,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":913 +/* "sklearn/tree/_tree.pyx":1147 * # ============================================================================= * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: # <<<<<<<<<<<<<< @@ -8192,7 +8238,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start_pos) { - /* "sklearn/tree/_tree.pyx":914 + /* "sklearn/tree/_tree.pyx":1148 * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: * self.impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -8201,7 +8247,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->impurity_left = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":915 + /* "sklearn/tree/_tree.pyx":1149 * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: * self.impurity_left = INFINITY * self.impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -8210,7 +8256,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->impurity_right = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":916 + /* "sklearn/tree/_tree.pyx":1150 * self.impurity_left = INFINITY * self.impurity_right = INFINITY * self.pos = start_pos # <<<<<<<<<<<<<< @@ -8219,7 +8265,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->pos = __pyx_v_start_pos; - /* "sklearn/tree/_tree.pyx":917 + /* "sklearn/tree/_tree.pyx":1151 * self.impurity_right = INFINITY * self.pos = start_pos * self.feature = 0 # <<<<<<<<<<<<<< @@ -8228,7 +8274,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->feature = 0; - /* "sklearn/tree/_tree.pyx":918 + /* "sklearn/tree/_tree.pyx":1152 * self.pos = start_pos * self.feature = 0 * self.threshold = 0. # <<<<<<<<<<<<<< @@ -8237,7 +8283,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->threshold = 0.; - /* "sklearn/tree/_tree.pyx":919 + /* "sklearn/tree/_tree.pyx":1153 * self.feature = 0 * self.threshold = 0. * self.improvement = -INFINITY # <<<<<<<<<<<<<< @@ -8246,7 +8292,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); - /* "sklearn/tree/_tree.pyx":913 + /* "sklearn/tree/_tree.pyx":1147 * # ============================================================================= * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: # <<<<<<<<<<<<<< @@ -8257,9 +8303,9 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":923 +/* "sklearn/tree/_tree.pyx":1163 + * """ * - * cdef class Splitter: * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< * SIZE_t min_samples_leaf, double min_weight_leaf, * object random_state): @@ -8302,26 +8348,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_8Splitter_1__cinit__(PyObject *__pyx_v case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -8333,20 +8379,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_8Splitter_1__cinit__(PyObject *__pyx_v values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); - __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.Splitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); /* function exit code */ @@ -8363,9 +8409,9 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":926 - * SIZE_t min_samples_leaf, double min_weight_leaf, - * object random_state): + /* "sklearn/tree/_tree.pyx":1191 + * """ + * * self.criterion = criterion # <<<<<<<<<<<<<< * * self.samples = NULL @@ -8376,7 +8422,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 __Pyx_DECREF(((PyObject *)__pyx_v_self->criterion)); __pyx_v_self->criterion = __pyx_v_criterion; - /* "sklearn/tree/_tree.pyx":928 + /* "sklearn/tree/_tree.pyx":1193 * self.criterion = criterion * * self.samples = NULL # <<<<<<<<<<<<<< @@ -8385,7 +8431,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->samples = NULL; - /* "sklearn/tree/_tree.pyx":929 + /* "sklearn/tree/_tree.pyx":1194 * * self.samples = NULL * self.n_samples = 0 # <<<<<<<<<<<<<< @@ -8394,7 +8440,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->n_samples = 0; - /* "sklearn/tree/_tree.pyx":930 + /* "sklearn/tree/_tree.pyx":1195 * self.samples = NULL * self.n_samples = 0 * self.features = NULL # <<<<<<<<<<<<<< @@ -8403,7 +8449,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->features = NULL; - /* "sklearn/tree/_tree.pyx":931 + /* "sklearn/tree/_tree.pyx":1196 * self.n_samples = 0 * self.features = NULL * self.n_features = 0 # <<<<<<<<<<<<<< @@ -8412,7 +8458,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->n_features = 0; - /* "sklearn/tree/_tree.pyx":932 + /* "sklearn/tree/_tree.pyx":1197 * self.features = NULL * self.n_features = 0 * self.feature_values = NULL # <<<<<<<<<<<<<< @@ -8421,7 +8467,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->feature_values = NULL; - /* "sklearn/tree/_tree.pyx":934 + /* "sklearn/tree/_tree.pyx":1199 * self.feature_values = NULL * * self.y = NULL # <<<<<<<<<<<<<< @@ -8430,7 +8476,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->y = NULL; - /* "sklearn/tree/_tree.pyx":935 + /* "sklearn/tree/_tree.pyx":1200 * * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -8439,7 +8485,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->y_stride = 0; - /* "sklearn/tree/_tree.pyx":936 + /* "sklearn/tree/_tree.pyx":1201 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -8448,7 +8494,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":938 + /* "sklearn/tree/_tree.pyx":1203 * self.sample_weight = NULL * * self.max_features = max_features # <<<<<<<<<<<<<< @@ -8457,7 +8503,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->max_features = __pyx_v_max_features; - /* "sklearn/tree/_tree.pyx":939 + /* "sklearn/tree/_tree.pyx":1204 * * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -8466,7 +8512,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->min_samples_leaf = __pyx_v_min_samples_leaf; - /* "sklearn/tree/_tree.pyx":940 + /* "sklearn/tree/_tree.pyx":1205 * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -8475,7 +8521,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->min_weight_leaf = __pyx_v_min_weight_leaf; - /* "sklearn/tree/_tree.pyx":941 + /* "sklearn/tree/_tree.pyx":1206 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.random_state = random_state # <<<<<<<<<<<<<< @@ -8488,9 +8534,9 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 __Pyx_DECREF(__pyx_v_self->random_state); __pyx_v_self->random_state = __pyx_v_random_state; - /* "sklearn/tree/_tree.pyx":923 + /* "sklearn/tree/_tree.pyx":1163 + * """ * - * cdef class Splitter: * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< * SIZE_t min_samples_leaf, double min_weight_leaf, * object random_state): @@ -8502,12 +8548,12 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":943 +/* "sklearn/tree/_tree.pyx":1208 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor.""" - * free(self.samples) + * """ + * The destructor method for the Splitter class. Memory had to be */ /* Python wrapper */ @@ -8525,17 +8571,17 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":945 - * def __dealloc__(self): - * """Destructor.""" + /* "sklearn/tree/_tree.pyx":1214 + * """ + * * free(self.samples) # <<<<<<<<<<<<<< * free(self.features) * free(self.constant_features) */ free(__pyx_v_self->samples); - /* "sklearn/tree/_tree.pyx":946 - * """Destructor.""" + /* "sklearn/tree/_tree.pyx":1215 + * * free(self.samples) * free(self.features) # <<<<<<<<<<<<<< * free(self.constant_features) @@ -8543,7 +8589,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->features); - /* "sklearn/tree/_tree.pyx":947 + /* "sklearn/tree/_tree.pyx":1216 * free(self.samples) * free(self.features) * free(self.constant_features) # <<<<<<<<<<<<<< @@ -8552,7 +8598,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->constant_features); - /* "sklearn/tree/_tree.pyx":948 + /* "sklearn/tree/_tree.pyx":1217 * free(self.features) * free(self.constant_features) * free(self.feature_values) # <<<<<<<<<<<<<< @@ -8561,19 +8607,19 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->feature_values); - /* "sklearn/tree/_tree.pyx":943 + /* "sklearn/tree/_tree.pyx":1208 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Destructor.""" - * free(self.samples) + * """ + * The destructor method for the Splitter class. Memory had to be */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":950 +/* "sklearn/tree/_tree.pyx":1219 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8603,7 +8649,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_4__getstate__(CYTHON_U int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":951 + /* "sklearn/tree/_tree.pyx":1220 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -8611,13 +8657,13 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_4__getstate__(CYTHON_U * def __setstate__(self, d): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":950 + /* "sklearn/tree/_tree.pyx":1219 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8636,7 +8682,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_4__getstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":953 +/* "sklearn/tree/_tree.pyx":1222 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -8669,7 +8715,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_6__setstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":956 +/* "sklearn/tree/_tree.pyx":1225 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -8710,20 +8756,20 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; - /* "sklearn/tree/_tree.pyx":962 - * """Initialize the splitter.""" + /* "sklearn/tree/_tree.pyx":1250 + * * # Reset random state * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) # <<<<<<<<<<<<<< - * # Initialize samples and features structures - * cdef SIZE_t n_samples = X.shape[0] + * + * # Unpack the number of samples */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->random_state, __pyx_n_s_randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->random_state, __pyx_n_s_randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -8737,7 +8783,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -8748,41 +8794,41 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_7 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->rand_r_state = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":964 - * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) - * # Initialize samples and features structures + /* "sklearn/tree/_tree.pyx":1253 + * + * # Unpack the number of samples * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< - * cdef SIZE_t* samples = safe_realloc(&self.samples, n_samples) * + * # Create a new array which will be used to store nonzero */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_n_samples = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":965 - * # Initialize samples and features structures - * cdef SIZE_t n_samples = X.shape[0] + /* "sklearn/tree/_tree.pyx":1257 + * # Create a new array which will be used to store nonzero + * # samples from the feature of interest * cdef SIZE_t* samples = safe_realloc(&self.samples, n_samples) # <<<<<<<<<<<<<< * * cdef SIZE_t i, j */ - __pyx_t_9 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->samples), __pyx_v_n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->samples), __pyx_v_n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_samples = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":968 + /* "sklearn/tree/_tree.pyx":1260 * * cdef SIZE_t i, j * cdef double weighted_n_samples = 0.0 # <<<<<<<<<<<<<< @@ -8791,29 +8837,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_weighted_n_samples = 0.0; - /* "sklearn/tree/_tree.pyx":969 + /* "sklearn/tree/_tree.pyx":1261 * cdef SIZE_t i, j * cdef double weighted_n_samples = 0.0 * j = 0 # <<<<<<<<<<<<<< * - * for i in range(n_samples): + * # In order to only use positively weighted samples, we must go through */ __pyx_v_j = 0; - /* "sklearn/tree/_tree.pyx":971 - * j = 0 - * + /* "sklearn/tree/_tree.pyx":1266 + * # each sample and check its associated weight, if given. If no weights + * # are given, we assume the weight on each point is equal to 1. * for i in range(n_samples): # <<<<<<<<<<<<<< - * # Only work with positively weighted samples - * if sample_weight == NULL or sample_weight[i] != 0.0: + * # If no sample weights are passed in, or the associated sample + * # weight is greater than 0, add that sample to the growing array, */ __pyx_t_8 = __pyx_v_n_samples; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":973 - * for i in range(n_samples): - * # Only work with positively weighted samples + /* "sklearn/tree/_tree.pyx":1270 + * # weight is greater than 0, add that sample to the growing array, + * # and increment the count * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< * samples[j] = i * j += 1 @@ -8829,8 +8875,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_L6_bool_binop_done:; if (__pyx_t_11) { - /* "sklearn/tree/_tree.pyx":974 - * # Only work with positively weighted samples + /* "sklearn/tree/_tree.pyx":1271 + * # and increment the count * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i # <<<<<<<<<<<<<< * j += 1 @@ -8838,21 +8884,21 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ (__pyx_v_samples[__pyx_v_j]) = __pyx_v_i; - /* "sklearn/tree/_tree.pyx":975 + /* "sklearn/tree/_tree.pyx":1272 * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i * j += 1 # <<<<<<<<<<<<<< * - * if sample_weight != NULL: + * # Add the sample weight, or 1.0 if no sample weights are given. */ __pyx_v_j = (__pyx_v_j + 1); goto __pyx_L5; } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":977 - * j += 1 - * + /* "sklearn/tree/_tree.pyx":1277 + * # If the sample weight is 0.0, then it does not matter if added + * # to the weight sum * if sample_weight != NULL: # <<<<<<<<<<<<<< * weighted_n_samples += sample_weight[i] * else: @@ -8860,8 +8906,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_11 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_11) { - /* "sklearn/tree/_tree.pyx":978 - * + /* "sklearn/tree/_tree.pyx":1278 + * # to the weight sum * if sample_weight != NULL: * weighted_n_samples += sample_weight[i] # <<<<<<<<<<<<<< * else: @@ -8872,63 +8918,63 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":980 + /* "sklearn/tree/_tree.pyx":1280 * weighted_n_samples += sample_weight[i] * else: * weighted_n_samples += 1.0 # <<<<<<<<<<<<<< * - * self.n_samples = j + * # Reset the number of samples to be the number of non-zero-weight */ __pyx_v_weighted_n_samples = (__pyx_v_weighted_n_samples + 1.0); } __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":982 - * weighted_n_samples += 1.0 - * + /* "sklearn/tree/_tree.pyx":1284 + * # Reset the number of samples to be the number of non-zero-weight + * # samples found from the original data * self.n_samples = j # <<<<<<<<<<<<<< - * self.weighted_n_samples = weighted_n_samples * + * # Reset the weighted number of samples to be the sum of the weights of the */ __pyx_v_self->n_samples = __pyx_v_j; - /* "sklearn/tree/_tree.pyx":983 - * - * self.n_samples = j + /* "sklearn/tree/_tree.pyx":1288 + * # Reset the weighted number of samples to be the sum of the weights of the + * # sample_weight vector * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< * - * cdef SIZE_t n_features = X.shape[1] + * # Get the number of features from the original dataset, and allocate a new */ __pyx_v_self->weighted_n_samples = __pyx_v_weighted_n_samples; - /* "sklearn/tree/_tree.pyx":985 - * self.weighted_n_samples = weighted_n_samples - * + /* "sklearn/tree/_tree.pyx":1292 + * # Get the number of features from the original dataset, and allocate a new + * # array of features IDs which will help us index data in the future * cdef SIZE_t n_features = X.shape[1] # <<<<<<<<<<<<<< * cdef SIZE_t* features = safe_realloc(&self.features, n_features) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n_features = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":986 - * + /* "sklearn/tree/_tree.pyx":1293 + * # array of features IDs which will help us index data in the future * cdef SIZE_t n_features = X.shape[1] * cdef SIZE_t* features = safe_realloc(&self.features, n_features) # <<<<<<<<<<<<<< * * for i in range(n_features): */ - __pyx_t_9 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->features), __pyx_v_n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->features), __pyx_v_n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_features = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":988 + /* "sklearn/tree/_tree.pyx":1295 * cdef SIZE_t* features = safe_realloc(&self.features, n_features) * * for i in range(n_features): # <<<<<<<<<<<<<< @@ -8939,7 +8985,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":989 + /* "sklearn/tree/_tree.pyx":1296 * * for i in range(n_features): * features[i] = i # <<<<<<<<<<<<<< @@ -8949,65 +8995,65 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea (__pyx_v_features[__pyx_v_i]) = __pyx_v_i; } - /* "sklearn/tree/_tree.pyx":991 + /* "sklearn/tree/_tree.pyx":1298 * features[i] = i * * self.n_features = n_features # <<<<<<<<<<<<<< * - * safe_realloc(&self.feature_values, n_samples) + * # Allocate a new array for the values a feature takes; which is */ __pyx_v_self->n_features = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":993 - * self.n_features = n_features - * + /* "sklearn/tree/_tree.pyx":1302 + * # Allocate a new array for the values a feature takes; which is + * # maximally the number of non-zero-weight entries. * safe_realloc(&self.feature_values, n_samples) # <<<<<<<<<<<<<< * safe_realloc(&self.constant_features, n_features) * */ - __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->feature_values), __pyx_v_n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->feature_values), __pyx_v_n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":994 - * + /* "sklearn/tree/_tree.pyx":1303 + * # maximally the number of non-zero-weight entries. * safe_realloc(&self.feature_values, n_samples) * safe_realloc(&self.constant_features, n_features) # <<<<<<<<<<<<<< * - * # Initialize y, sample_weight + * # Store y as a buffer for memory efficient storage */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->constant_features), __pyx_v_n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->constant_features), __pyx_v_n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":997 + /* "sklearn/tree/_tree.pyx":1306 * - * # Initialize y, sample_weight + * # Store y as a buffer for memory efficient storage * self.y = y.data # <<<<<<<<<<<<<< - * self.y_stride = y.strides[0] / y.itemsize - * self.sample_weight = sample_weight + * + * # Save the stride of y in order to access elements in the buffer easily */ __pyx_v_self->y = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_y->data); - /* "sklearn/tree/_tree.pyx":998 - * # Initialize y, sample_weight - * self.y = y.data + /* "sklearn/tree/_tree.pyx":1310 + * # Save the stride of y in order to access elements in the buffer easily + * # in the future * self.y_stride = y.strides[0] / y.itemsize # <<<<<<<<<<<<<< - * self.sample_weight = sample_weight * + * # Finally, store the weight of each sample in the dataset */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->y_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_y->strides[0])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_8)); - /* "sklearn/tree/_tree.pyx":999 - * self.y = y.data - * self.y_stride = y.strides[0] / y.itemsize + /* "sklearn/tree/_tree.pyx":1313 + * + * # Finally, store the weight of each sample in the dataset * self.sample_weight = sample_weight # <<<<<<<<<<<<<< * * cdef void node_reset(self, SIZE_t start, SIZE_t end, */ __pyx_v_self->sample_weight = __pyx_v_sample_weight; - /* "sklearn/tree/_tree.pyx":956 + /* "sklearn/tree/_tree.pyx":1225 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -9035,28 +9081,28 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1001 +/* "sklearn/tree/_tree.pyx":1315 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< * double* weighted_n_node_samples) nogil: - * """Reset splitter on node samples[start:end].""" + * """ */ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end, double *__pyx_v_weighted_n_node_samples) { double __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1004 - * double* weighted_n_node_samples) nogil: - * """Reset splitter on node samples[start:end].""" + /* "sklearn/tree/_tree.pyx":1332 + * """ + * * self.start = start # <<<<<<<<<<<<<< * self.end = end * */ __pyx_v_self->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1005 - * """Reset splitter on node samples[start:end].""" + /* "sklearn/tree/_tree.pyx":1333 + * * self.start = start * self.end = end # <<<<<<<<<<<<<< * @@ -9064,7 +9110,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ */ __pyx_v_self->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1007 + /* "sklearn/tree/_tree.pyx":1335 * self.end = end * * self.criterion.init(self.y, # <<<<<<<<<<<<<< @@ -9073,7 +9119,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->criterion->__pyx_vtab)->init(__pyx_v_self->criterion, __pyx_v_self->y, __pyx_v_self->y_stride, __pyx_v_self->sample_weight, __pyx_v_self->weighted_n_samples, __pyx_v_self->samples, __pyx_v_start, __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1015 + /* "sklearn/tree/_tree.pyx":1343 * end) * * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -9083,23 +9129,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ __pyx_t_1 = __pyx_v_self->criterion->weighted_n_node_samples; (__pyx_v_weighted_n_node_samples[0]) = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1001 + /* "sklearn/tree/_tree.pyx":1315 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< * double* weighted_n_node_samples) nogil: - * """Reset splitter on node samples[start:end].""" + * """ */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1017 +/* "sklearn/tree/_tree.pyx":1345 * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< * SIZE_t* n_constant_features) nogil: - * """Find a split on node samples[start:end].""" + * """ */ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, CYTHON_UNUSED struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features) { @@ -9107,50 +9153,50 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split(CYTHON_UNUSED str /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1022 +/* "sklearn/tree/_tree.pyx":1355 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< - * """Copy the value of node samples[start:end] into dest.""" - * self.criterion.node_value(dest) + * """ + * Copy the value of node samples[start:end] into dest. */ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *__pyx_v_self, double *__pyx_v_dest) { - /* "sklearn/tree/_tree.pyx":1024 - * cdef void node_value(self, double* dest) nogil: - * """Copy the value of node samples[start:end] into dest.""" + /* "sklearn/tree/_tree.pyx":1360 + * """ + * * self.criterion.node_value(dest) # <<<<<<<<<<<<<< * * cdef double node_impurity(self) nogil: */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->criterion->__pyx_vtab)->node_value(__pyx_v_self->criterion, __pyx_v_dest); - /* "sklearn/tree/_tree.pyx":1022 + /* "sklearn/tree/_tree.pyx":1355 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< - * """Copy the value of node samples[start:end] into dest.""" - * self.criterion.node_value(dest) + * """ + * Copy the value of node samples[start:end] into dest. */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1026 +/* "sklearn/tree/_tree.pyx":1362 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Copy the impurity of node samples[start:end.""" - * return self.criterion.node_impurity() + * """ + * Return the impurity of the node where the last batch of samples */ static double __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *__pyx_v_self) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":1028 - * cdef double node_impurity(self) nogil: - * """Copy the impurity of node samples[start:end.""" + /* "sklearn/tree/_tree.pyx":1369 + * """ + * * return self.criterion.node_impurity() # <<<<<<<<<<<<<< * * @@ -9158,12 +9204,12 @@ static double __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_impurity(struct __pyx __pyx_r = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->criterion->__pyx_vtab)->node_impurity(__pyx_v_self->criterion); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1026 + /* "sklearn/tree/_tree.pyx":1362 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< - * """Copy the impurity of node samples[start:end.""" - * return self.criterion.node_impurity() + * """ + * Return the impurity of the node where the last batch of samples */ /* function exit code */ @@ -9525,7 +9571,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_15min_weight_leaf_2__set__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1036 +/* "sklearn/tree/_tree.pyx":1377 * cdef SIZE_t X_fx_stride * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -9570,26 +9616,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_17BaseDenseSplitter_1__cinit__(PyObjec case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -9601,20 +9647,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_17BaseDenseSplitter_1__cinit__(PyObjec values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); - __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BaseDenseSplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); /* function exit code */ @@ -9631,8 +9677,8 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1041 - * # Parent __cinit__ is automatically called + /* "sklearn/tree/_tree.pyx":1384 + * """ * * self.X = NULL # <<<<<<<<<<<<<< * self.X_sample_stride = 0 @@ -9640,7 +9686,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ */ __pyx_v_self->X = NULL; - /* "sklearn/tree/_tree.pyx":1042 + /* "sklearn/tree/_tree.pyx":1385 * * self.X = NULL * self.X_sample_stride = 0 # <<<<<<<<<<<<<< @@ -9649,7 +9695,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ */ __pyx_v_self->X_sample_stride = 0; - /* "sklearn/tree/_tree.pyx":1043 + /* "sklearn/tree/_tree.pyx":1386 * self.X = NULL * self.X_sample_stride = 0 * self.X_fx_stride = 0 # <<<<<<<<<<<<<< @@ -9658,7 +9704,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ */ __pyx_v_self->X_fx_stride = 0; - /* "sklearn/tree/_tree.pyx":1036 + /* "sklearn/tree/_tree.pyx":1377 * cdef SIZE_t X_fx_stride * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -9672,7 +9718,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1045 +/* "sklearn/tree/_tree.pyx":1388 * self.X_fx_stride = 0 * * cdef void init(self, # <<<<<<<<<<<<<< @@ -9699,33 +9745,33 @@ static void __pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init(struct __pyx_ __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; - /* "sklearn/tree/_tree.pyx":1052 + /* "sklearn/tree/_tree.pyx":1395 * * # Call parent init * Splitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< * * # Initialize X */ - __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1055 + /* "sklearn/tree/_tree.pyx":1398 * * # Initialize X * cdef np.ndarray X_ndarray = X # <<<<<<<<<<<<<< * * self.X = X_ndarray.data */ - if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_X; __Pyx_INCREF(__pyx_t_1); __pyx_v_X_ndarray = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":1057 + /* "sklearn/tree/_tree.pyx":1400 * cdef np.ndarray X_ndarray = X * * self.X = X_ndarray.data # <<<<<<<<<<<<<< @@ -9734,47 +9780,47 @@ static void __pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init(struct __pyx_ */ __pyx_v_self->X = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_ndarray->data); - /* "sklearn/tree/_tree.pyx":1058 + /* "sklearn/tree/_tree.pyx":1401 * * self.X = X_ndarray.data * self.X_sample_stride = X.strides[0] / X.itemsize # <<<<<<<<<<<<<< * self.X_fx_stride = X.strides[1] / X.itemsize * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->X_sample_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_4)); - /* "sklearn/tree/_tree.pyx":1059 + /* "sklearn/tree/_tree.pyx":1402 * self.X = X_ndarray.data * self.X_sample_stride = X.strides[0] / X.itemsize * self.X_fx_stride = X.strides[1] / X.itemsize # <<<<<<<<<<<<<< * * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->X_fx_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_4) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); - /* "sklearn/tree/_tree.pyx":1045 + /* "sklearn/tree/_tree.pyx":1388 * self.X_fx_stride = 0 * * cdef void init(self, # <<<<<<<<<<<<<< @@ -9800,7 +9846,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init(struct __pyx_ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1064 +/* "sklearn/tree/_tree.pyx":1407 * cdef class BestSplitter(BaseDenseSplitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9833,7 +9879,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1065 + /* "sklearn/tree/_tree.pyx":1408 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -9842,44 +9888,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1066 + /* "sklearn/tree/_tree.pyx":1409 * def __reduce__(self): * return (BestSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1067 + /* "sklearn/tree/_tree.pyx":1410 * return (BestSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1068 + /* "sklearn/tree/_tree.pyx":1411 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1065 + /* "sklearn/tree/_tree.pyx":1408 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -9897,14 +9943,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1069 + /* "sklearn/tree/_tree.pyx":1412 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -9917,22 +9963,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1065 + /* "sklearn/tree/_tree.pyx":1408 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter))); @@ -9947,7 +9993,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1064 + /* "sklearn/tree/_tree.pyx":1407 * cdef class BestSplitter(BaseDenseSplitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9969,7 +10015,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1071 +/* "sklearn/tree/_tree.pyx":1414 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -10012,7 +10058,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx int __pyx_t_6; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1075 + /* "sklearn/tree/_tree.pyx":1418 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -10022,7 +10068,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1076 + /* "sklearn/tree/_tree.pyx":1419 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -10032,7 +10078,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1077 + /* "sklearn/tree/_tree.pyx":1420 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -10042,7 +10088,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1079 + /* "sklearn/tree/_tree.pyx":1422 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -10052,7 +10098,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1080 + /* "sklearn/tree/_tree.pyx":1423 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -10062,7 +10108,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1081 + /* "sklearn/tree/_tree.pyx":1424 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -10072,7 +10118,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1083 + /* "sklearn/tree/_tree.pyx":1426 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -10082,7 +10128,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_3 = __pyx_v_self->__pyx_base.X; __pyx_v_X = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1084 + /* "sklearn/tree/_tree.pyx":1427 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -10092,7 +10138,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1085 + /* "sklearn/tree/_tree.pyx":1428 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -10102,7 +10148,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.X_sample_stride; __pyx_v_X_sample_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1086 + /* "sklearn/tree/_tree.pyx":1429 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_fx_stride = self.X_fx_stride # <<<<<<<<<<<<<< @@ -10112,7 +10158,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.X_fx_stride; __pyx_v_X_fx_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1087 + /* "sklearn/tree/_tree.pyx":1430 * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_fx_stride = self.X_fx_stride * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -10122,7 +10168,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1088 + /* "sklearn/tree/_tree.pyx":1431 * cdef SIZE_t X_fx_stride = self.X_fx_stride * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -10132,7 +10178,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1089 + /* "sklearn/tree/_tree.pyx":1432 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -10142,7 +10188,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1090 + /* "sklearn/tree/_tree.pyx":1433 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -10151,7 +10197,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":1094 + /* "sklearn/tree/_tree.pyx":1437 * cdef SplitRecord best, current * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -10160,7 +10206,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":1096 + /* "sklearn/tree/_tree.pyx":1439 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -10169,7 +10215,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1098 + /* "sklearn/tree/_tree.pyx":1441 * cdef SIZE_t n_visited_features = 0 * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -10178,7 +10224,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1100 + /* "sklearn/tree/_tree.pyx":1443 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -10187,7 +10233,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1101 + /* "sklearn/tree/_tree.pyx":1444 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -10196,7 +10242,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":1103 + /* "sklearn/tree/_tree.pyx":1446 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -10205,7 +10251,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":1107 + /* "sklearn/tree/_tree.pyx":1450 * cdef SIZE_t partition_end * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -10214,7 +10260,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1118 + /* "sklearn/tree/_tree.pyx":1461 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -10229,7 +10275,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1120 + /* "sklearn/tree/_tree.pyx":1463 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -10243,7 +10289,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1122 + /* "sklearn/tree/_tree.pyx":1465 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -10255,7 +10301,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L5_bool_binop_done:; if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1124 + /* "sklearn/tree/_tree.pyx":1467 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -10264,7 +10310,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":1138 + /* "sklearn/tree/_tree.pyx":1481 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -10273,7 +10319,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":1141 + /* "sklearn/tree/_tree.pyx":1484 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -10283,7 +10329,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1143 + /* "sklearn/tree/_tree.pyx":1486 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -10292,7 +10338,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":1144 + /* "sklearn/tree/_tree.pyx":1487 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -10301,7 +10347,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":1145 + /* "sklearn/tree/_tree.pyx":1488 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -10310,7 +10356,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":1147 + /* "sklearn/tree/_tree.pyx":1490 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -10322,7 +10368,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1151 + /* "sklearn/tree/_tree.pyx":1494 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -10331,7 +10377,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":1154 + /* "sklearn/tree/_tree.pyx":1497 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -10340,7 +10386,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":1160 + /* "sklearn/tree/_tree.pyx":1503 * # Xf[i] == X[samples[i], j], so the sort uses the cache more * # effectively. * for p in range(start, end): # <<<<<<<<<<<<<< @@ -10351,7 +10397,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx for (__pyx_t_7 = __pyx_v_start; __pyx_t_7 < __pyx_t_2; __pyx_t_7+=1) { __pyx_v_p = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1161 + /* "sklearn/tree/_tree.pyx":1504 * # effectively. * for p in range(start, end): * Xf[p] = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -10361,7 +10407,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx (__pyx_v_Xf[__pyx_v_p]) = (__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_current.feature))]); } - /* "sklearn/tree/_tree.pyx":1164 + /* "sklearn/tree/_tree.pyx":1507 * X_fx_stride * current.feature] * * sort(Xf + start, samples + start, end - start) # <<<<<<<<<<<<<< @@ -10370,7 +10416,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_f_7sklearn_4tree_5_tree_sort((__pyx_v_Xf + __pyx_v_start), (__pyx_v_samples + __pyx_v_start), (__pyx_v_end - __pyx_v_start)); - /* "sklearn/tree/_tree.pyx":1166 + /* "sklearn/tree/_tree.pyx":1509 * sort(Xf + start, samples + start, end - start) * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -10380,7 +10426,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = (((__pyx_v_Xf[(__pyx_v_end - 1)]) <= ((__pyx_v_Xf[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1167 + /* "sklearn/tree/_tree.pyx":1510 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -10389,7 +10435,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":1168 + /* "sklearn/tree/_tree.pyx":1511 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -10399,7 +10445,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1170 + /* "sklearn/tree/_tree.pyx":1513 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -10408,7 +10454,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":1171 + /* "sklearn/tree/_tree.pyx":1514 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -10420,7 +10466,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1174 + /* "sklearn/tree/_tree.pyx":1517 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -10429,7 +10475,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":1175 + /* "sklearn/tree/_tree.pyx":1518 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -10441,7 +10487,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1178 + /* "sklearn/tree/_tree.pyx":1521 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -10450,7 +10496,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1179 + /* "sklearn/tree/_tree.pyx":1522 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -10459,7 +10505,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1181 + /* "sklearn/tree/_tree.pyx":1524 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -10470,7 +10516,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1182 + /* "sklearn/tree/_tree.pyx":1525 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -10485,7 +10531,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L16_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1183 + /* "sklearn/tree/_tree.pyx":1526 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -10497,7 +10543,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L16_bool_binop_done:; if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1184 + /* "sklearn/tree/_tree.pyx":1527 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -10507,16 +10553,16 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":1188 + /* "sklearn/tree/_tree.pyx":1531 * # (p + 1 >= end) or (X[samples[p + 1], current.feature] > * # X[samples[p], current.feature]) * p += 1 # <<<<<<<<<<<<<< - * # (p >= end) or (X[samples[p], current.feature] > + * # (p >= end) or (X[samples[p], current.fe + 1 ature] > * # X[samples[p - 1], current.feature]) */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":1192 + /* "sklearn/tree/_tree.pyx":1535 * # X[samples[p - 1], current.feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -10526,7 +10572,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1193 + /* "sklearn/tree/_tree.pyx":1536 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -10535,7 +10581,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":1196 + /* "sklearn/tree/_tree.pyx":1539 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -10549,7 +10595,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L20_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1197 + /* "sklearn/tree/_tree.pyx":1540 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -10561,7 +10607,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L20_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1198 + /* "sklearn/tree/_tree.pyx":1541 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -10571,7 +10617,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1200 + /* "sklearn/tree/_tree.pyx":1543 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -10580,7 +10626,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":1203 + /* "sklearn/tree/_tree.pyx":1546 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -10594,7 +10640,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1204 + /* "sklearn/tree/_tree.pyx":1547 * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< @@ -10606,7 +10652,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L23_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1205 + /* "sklearn/tree/_tree.pyx":1548 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -10616,7 +10662,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1207 + /* "sklearn/tree/_tree.pyx":1550 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -10625,7 +10671,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":1209 + /* "sklearn/tree/_tree.pyx":1552 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -10635,7 +10681,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1210 + /* "sklearn/tree/_tree.pyx":1553 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -10644,7 +10690,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":1212 + /* "sklearn/tree/_tree.pyx":1555 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< @@ -10653,7 +10699,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_current.threshold = (((__pyx_v_Xf[(__pyx_v_p - 1)]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); - /* "sklearn/tree/_tree.pyx":1214 + /* "sklearn/tree/_tree.pyx":1557 * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -10663,7 +10709,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1215 + /* "sklearn/tree/_tree.pyx":1558 * * if current.threshold == Xf[p]: * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -10675,7 +10721,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } __pyx_L26:; - /* "sklearn/tree/_tree.pyx":1217 + /* "sklearn/tree/_tree.pyx":1560 * current.threshold = Xf[p - 1] * * best = current # copy # <<<<<<<<<<<<<< @@ -10697,7 +10743,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1220 + /* "sklearn/tree/_tree.pyx":1563 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -10707,7 +10753,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1221 + /* "sklearn/tree/_tree.pyx":1564 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -10716,7 +10762,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1222 + /* "sklearn/tree/_tree.pyx":1565 * if best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -10725,7 +10771,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1224 + /* "sklearn/tree/_tree.pyx":1567 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -10736,7 +10782,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1226 + /* "sklearn/tree/_tree.pyx":1569 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -10746,7 +10792,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1227 + /* "sklearn/tree/_tree.pyx":1570 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -10758,7 +10804,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1230 + /* "sklearn/tree/_tree.pyx":1573 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -10767,7 +10813,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":1232 + /* "sklearn/tree/_tree.pyx":1575 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -10776,7 +10822,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1233 + /* "sklearn/tree/_tree.pyx":1576 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -10785,7 +10831,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1234 + /* "sklearn/tree/_tree.pyx":1577 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -10800,7 +10846,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } __pyx_L27:; - /* "sklearn/tree/_tree.pyx":1239 + /* "sklearn/tree/_tree.pyx":1582 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -10809,7 +10855,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":1242 + /* "sklearn/tree/_tree.pyx":1585 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -10818,7 +10864,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":1247 + /* "sklearn/tree/_tree.pyx":1590 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -10827,7 +10873,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":1248 + /* "sklearn/tree/_tree.pyx":1591 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -10836,7 +10882,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":1071 + /* "sklearn/tree/_tree.pyx":1414 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -10847,7 +10893,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1253 +/* "sklearn/tree/_tree.pyx":1596 * # Sort n-element arrays pointed to by Xf and samples, simultaneously, * # by the values in Xf. Algorithm: Introsort (Musser, SP&E, 1997). * cdef inline void sort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10858,7 +10904,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_v_Xf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n) { int __pyx_v_maxd; - /* "sklearn/tree/_tree.pyx":1254 + /* "sklearn/tree/_tree.pyx":1597 * # by the values in Xf. Algorithm: Introsort (Musser, SP&E, 1997). * cdef inline void sort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: * cdef int maxd = 2 * log(n) # <<<<<<<<<<<<<< @@ -10867,7 +10913,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4t */ __pyx_v_maxd = (2 * ((int)__pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_n))); - /* "sklearn/tree/_tree.pyx":1255 + /* "sklearn/tree/_tree.pyx":1598 * cdef inline void sort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: * cdef int maxd = 2 * log(n) * introsort(Xf, samples, n, maxd) # <<<<<<<<<<<<<< @@ -10876,7 +10922,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4t */ __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_v_Xf, __pyx_v_samples, __pyx_v_n, __pyx_v_maxd); - /* "sklearn/tree/_tree.pyx":1253 + /* "sklearn/tree/_tree.pyx":1596 * # Sort n-element arrays pointed to by Xf and samples, simultaneously, * # by the values in Xf. Algorithm: Introsort (Musser, SP&E, 1997). * cdef inline void sort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10887,7 +10933,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1258 +/* "sklearn/tree/_tree.pyx":1601 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10901,7 +10947,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1260 + /* "sklearn/tree/_tree.pyx":1603 * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: * # Helper for sort * Xf[i], Xf[j] = Xf[j], Xf[i] # <<<<<<<<<<<<<< @@ -10913,7 +10959,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t (__pyx_v_Xf[__pyx_v_i]) = __pyx_t_1; (__pyx_v_Xf[__pyx_v_j]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1261 + /* "sklearn/tree/_tree.pyx":1604 * # Helper for sort * Xf[i], Xf[j] = Xf[j], Xf[i] * samples[i], samples[j] = samples[j], samples[i] # <<<<<<<<<<<<<< @@ -10925,7 +10971,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t (__pyx_v_samples[__pyx_v_i]) = __pyx_t_3; (__pyx_v_samples[__pyx_v_j]) = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1258 + /* "sklearn/tree/_tree.pyx":1601 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10936,7 +10982,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1264 +/* "sklearn/tree/_tree.pyx":1607 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10951,7 +10997,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_r; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1267 + /* "sklearn/tree/_tree.pyx":1610 * # Median of three pivot selection, after Bentley and McIlroy (1993). * # Engineering a sort function. SP&E. Requires 8/3 comparisons on average. * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] # <<<<<<<<<<<<<< @@ -10962,7 +11008,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_v_b = (__pyx_v_Xf[(__pyx_v_n / 2)]); __pyx_v_c = (__pyx_v_Xf[(__pyx_v_n - 1)]); - /* "sklearn/tree/_tree.pyx":1268 + /* "sklearn/tree/_tree.pyx":1611 * # Engineering a sort function. SP&E. Requires 8/3 comparisons on average. * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] * if a < b: # <<<<<<<<<<<<<< @@ -10972,7 +11018,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_t_1 = ((__pyx_v_a < __pyx_v_b) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1269 + /* "sklearn/tree/_tree.pyx":1612 * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] * if a < b: * if b < c: # <<<<<<<<<<<<<< @@ -10982,7 +11028,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_t_1 = ((__pyx_v_b < __pyx_v_c) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1270 + /* "sklearn/tree/_tree.pyx":1613 * if a < b: * if b < c: * return b # <<<<<<<<<<<<<< @@ -10993,7 +11039,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1271 + /* "sklearn/tree/_tree.pyx":1614 * if b < c: * return b * elif a < c: # <<<<<<<<<<<<<< @@ -11003,7 +11049,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_t_1 = ((__pyx_v_a < __pyx_v_c) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1272 + /* "sklearn/tree/_tree.pyx":1615 * return b * elif a < c: * return c # <<<<<<<<<<<<<< @@ -11015,7 +11061,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1274 + /* "sklearn/tree/_tree.pyx":1617 * return c * else: * return a # <<<<<<<<<<<<<< @@ -11027,7 +11073,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } } - /* "sklearn/tree/_tree.pyx":1275 + /* "sklearn/tree/_tree.pyx":1618 * else: * return a * elif b < c: # <<<<<<<<<<<<<< @@ -11037,7 +11083,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_t_1 = ((__pyx_v_b < __pyx_v_c) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1276 + /* "sklearn/tree/_tree.pyx":1619 * return a * elif b < c: * if a < c: # <<<<<<<<<<<<<< @@ -11047,7 +11093,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre __pyx_t_1 = ((__pyx_v_a < __pyx_v_c) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1277 + /* "sklearn/tree/_tree.pyx":1620 * elif b < c: * if a < c: * return a # <<<<<<<<<<<<<< @@ -11059,7 +11105,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1279 + /* "sklearn/tree/_tree.pyx":1622 * return a * else: * return c # <<<<<<<<<<<<<< @@ -11072,7 +11118,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1281 + /* "sklearn/tree/_tree.pyx":1624 * return c * else: * return b # <<<<<<<<<<<<<< @@ -11083,7 +11129,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1264 + /* "sklearn/tree/_tree.pyx":1607 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11096,7 +11142,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1286 +/* "sklearn/tree/_tree.pyx":1629 * # Introsort with median of 3 pivot selection and 3-way partition function * # (robust to repeated elements, e.g. lots of zero features). * cdef void introsort(DTYPE_t* Xf, SIZE_t *samples, SIZE_t n, int maxd) nogil: # <<<<<<<<<<<<<< @@ -11111,7 +11157,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_r; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1290 + /* "sklearn/tree/_tree.pyx":1633 * cdef SIZE_t i, l, r * * while n > 1: # <<<<<<<<<<<<<< @@ -11122,7 +11168,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_t_1 = ((__pyx_v_n > 1) != 0); if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":1291 + /* "sklearn/tree/_tree.pyx":1634 * * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") # <<<<<<<<<<<<<< @@ -11132,7 +11178,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_t_1 = ((__pyx_v_maxd <= 0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1292 + /* "sklearn/tree/_tree.pyx":1635 * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) # <<<<<<<<<<<<<< @@ -11141,7 +11187,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_v_Xf, __pyx_v_samples, __pyx_v_n); - /* "sklearn/tree/_tree.pyx":1293 + /* "sklearn/tree/_tree.pyx":1636 * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) * return # <<<<<<<<<<<<<< @@ -11151,7 +11197,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1294 + /* "sklearn/tree/_tree.pyx":1637 * heapsort(Xf, samples, n) * return * maxd -= 1 # <<<<<<<<<<<<<< @@ -11160,7 +11206,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_maxd = (__pyx_v_maxd - 1); - /* "sklearn/tree/_tree.pyx":1296 + /* "sklearn/tree/_tree.pyx":1639 * maxd -= 1 * * pivot = median3(Xf, n) # <<<<<<<<<<<<<< @@ -11169,7 +11215,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_pivot = __pyx_f_7sklearn_4tree_5_tree_median3(__pyx_v_Xf, __pyx_v_n); - /* "sklearn/tree/_tree.pyx":1299 + /* "sklearn/tree/_tree.pyx":1642 * * # Three-way partition. * i = l = 0 # <<<<<<<<<<<<<< @@ -11179,7 +11225,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_v_i = 0; __pyx_v_l = 0; - /* "sklearn/tree/_tree.pyx":1300 + /* "sklearn/tree/_tree.pyx":1643 * # Three-way partition. * i = l = 0 * r = n # <<<<<<<<<<<<<< @@ -11188,7 +11234,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_r = __pyx_v_n; - /* "sklearn/tree/_tree.pyx":1301 + /* "sklearn/tree/_tree.pyx":1644 * i = l = 0 * r = n * while i < r: # <<<<<<<<<<<<<< @@ -11199,7 +11245,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_t_1 = ((__pyx_v_i < __pyx_v_r) != 0); if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":1302 + /* "sklearn/tree/_tree.pyx":1645 * r = n * while i < r: * if Xf[i] < pivot: # <<<<<<<<<<<<<< @@ -11209,7 +11255,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_t_1 = (((__pyx_v_Xf[__pyx_v_i]) < __pyx_v_pivot) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1303 + /* "sklearn/tree/_tree.pyx":1646 * while i < r: * if Xf[i] < pivot: * swap(Xf, samples, i, l) # <<<<<<<<<<<<<< @@ -11218,7 +11264,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_v_Xf, __pyx_v_samples, __pyx_v_i, __pyx_v_l); - /* "sklearn/tree/_tree.pyx":1304 + /* "sklearn/tree/_tree.pyx":1647 * if Xf[i] < pivot: * swap(Xf, samples, i, l) * i += 1 # <<<<<<<<<<<<<< @@ -11227,7 +11273,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_i = (__pyx_v_i + 1); - /* "sklearn/tree/_tree.pyx":1305 + /* "sklearn/tree/_tree.pyx":1648 * swap(Xf, samples, i, l) * i += 1 * l += 1 # <<<<<<<<<<<<<< @@ -11238,7 +11284,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L8; } - /* "sklearn/tree/_tree.pyx":1306 + /* "sklearn/tree/_tree.pyx":1649 * i += 1 * l += 1 * elif Xf[i] > pivot: # <<<<<<<<<<<<<< @@ -11248,7 +11294,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_t_1 = (((__pyx_v_Xf[__pyx_v_i]) > __pyx_v_pivot) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1307 + /* "sklearn/tree/_tree.pyx":1650 * l += 1 * elif Xf[i] > pivot: * r -= 1 # <<<<<<<<<<<<<< @@ -11257,7 +11303,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_r = (__pyx_v_r - 1); - /* "sklearn/tree/_tree.pyx":1308 + /* "sklearn/tree/_tree.pyx":1651 * elif Xf[i] > pivot: * r -= 1 * swap(Xf, samples, i, r) # <<<<<<<<<<<<<< @@ -11269,7 +11315,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1310 + /* "sklearn/tree/_tree.pyx":1653 * swap(Xf, samples, i, r) * else: * i += 1 # <<<<<<<<<<<<<< @@ -11281,7 +11327,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1312 + /* "sklearn/tree/_tree.pyx":1655 * i += 1 * * introsort(Xf, samples, l, maxd) # <<<<<<<<<<<<<< @@ -11290,7 +11336,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_v_Xf, __pyx_v_samples, __pyx_v_l, __pyx_v_maxd); - /* "sklearn/tree/_tree.pyx":1313 + /* "sklearn/tree/_tree.pyx":1656 * * introsort(Xf, samples, l, maxd) * Xf += r # <<<<<<<<<<<<<< @@ -11299,7 +11345,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_Xf = (__pyx_v_Xf + __pyx_v_r); - /* "sklearn/tree/_tree.pyx":1314 + /* "sklearn/tree/_tree.pyx":1657 * introsort(Xf, samples, l, maxd) * Xf += r * samples += r # <<<<<<<<<<<<<< @@ -11308,7 +11354,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre */ __pyx_v_samples = (__pyx_v_samples + __pyx_v_r); - /* "sklearn/tree/_tree.pyx":1315 + /* "sklearn/tree/_tree.pyx":1658 * Xf += r * samples += r * n -= r # <<<<<<<<<<<<<< @@ -11318,7 +11364,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_v_n = (__pyx_v_n - __pyx_v_r); } - /* "sklearn/tree/_tree.pyx":1286 + /* "sklearn/tree/_tree.pyx":1629 * # Introsort with median of 3 pivot selection and 3-way partition function * # (robust to repeated elements, e.g. lots of zero features). * cdef void introsort(DTYPE_t* Xf, SIZE_t *samples, SIZE_t n, int maxd) nogil: # <<<<<<<<<<<<<< @@ -11330,7 +11376,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L0:; } -/* "sklearn/tree/_tree.pyx":1318 +/* "sklearn/tree/_tree.pyx":1661 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -11345,7 +11391,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea int __pyx_t_1; int __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1323 + /* "sklearn/tree/_tree.pyx":1666 * cdef SIZE_t child, maxind, root * * root = start # <<<<<<<<<<<<<< @@ -11354,7 +11400,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ __pyx_v_root = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1324 + /* "sklearn/tree/_tree.pyx":1667 * * root = start * while True: # <<<<<<<<<<<<<< @@ -11363,7 +11409,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ while (1) { - /* "sklearn/tree/_tree.pyx":1325 + /* "sklearn/tree/_tree.pyx":1668 * root = start * while True: * child = root * 2 + 1 # <<<<<<<<<<<<<< @@ -11372,7 +11418,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ __pyx_v_child = ((__pyx_v_root * 2) + 1); - /* "sklearn/tree/_tree.pyx":1328 + /* "sklearn/tree/_tree.pyx":1671 * * # find max of root, left child, right child * maxind = root # <<<<<<<<<<<<<< @@ -11381,7 +11427,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ __pyx_v_maxind = __pyx_v_root; - /* "sklearn/tree/_tree.pyx":1329 + /* "sklearn/tree/_tree.pyx":1672 * # find max of root, left child, right child * maxind = root * if child < end and Xf[maxind] < Xf[child]: # <<<<<<<<<<<<<< @@ -11399,7 +11445,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea __pyx_L6_bool_binop_done:; if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1330 + /* "sklearn/tree/_tree.pyx":1673 * maxind = root * if child < end and Xf[maxind] < Xf[child]: * maxind = child # <<<<<<<<<<<<<< @@ -11411,7 +11457,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1331 + /* "sklearn/tree/_tree.pyx":1674 * if child < end and Xf[maxind] < Xf[child]: * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: # <<<<<<<<<<<<<< @@ -11429,7 +11475,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea __pyx_L9_bool_binop_done:; if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1332 + /* "sklearn/tree/_tree.pyx":1675 * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: * maxind = child + 1 # <<<<<<<<<<<<<< @@ -11441,7 +11487,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":1334 + /* "sklearn/tree/_tree.pyx":1677 * maxind = child + 1 * * if maxind == root: # <<<<<<<<<<<<<< @@ -11451,7 +11497,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea __pyx_t_1 = ((__pyx_v_maxind == __pyx_v_root) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1335 + /* "sklearn/tree/_tree.pyx":1678 * * if maxind == root: * break # <<<<<<<<<<<<<< @@ -11462,7 +11508,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":1337 + /* "sklearn/tree/_tree.pyx":1680 * break * else: * swap(Xf, samples, root, maxind) # <<<<<<<<<<<<<< @@ -11471,7 +11517,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_v_Xf, __pyx_v_samples, __pyx_v_root, __pyx_v_maxind); - /* "sklearn/tree/_tree.pyx":1338 + /* "sklearn/tree/_tree.pyx":1681 * else: * swap(Xf, samples, root, maxind) * root = maxind # <<<<<<<<<<<<<< @@ -11483,7 +11529,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1318 + /* "sklearn/tree/_tree.pyx":1661 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -11494,7 +11540,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1341 +/* "sklearn/tree/_tree.pyx":1684 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11507,7 +11553,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1345 + /* "sklearn/tree/_tree.pyx":1688 * * # heapify * start = (n - 2) / 2 # <<<<<<<<<<<<<< @@ -11516,7 +11562,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ __pyx_v_start = ((__pyx_v_n - 2) / 2); - /* "sklearn/tree/_tree.pyx":1346 + /* "sklearn/tree/_tree.pyx":1689 * # heapify * start = (n - 2) / 2 * end = n # <<<<<<<<<<<<<< @@ -11525,7 +11571,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ __pyx_v_end = __pyx_v_n; - /* "sklearn/tree/_tree.pyx":1347 + /* "sklearn/tree/_tree.pyx":1690 * start = (n - 2) / 2 * end = n * while True: # <<<<<<<<<<<<<< @@ -11534,7 +11580,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ while (1) { - /* "sklearn/tree/_tree.pyx":1348 + /* "sklearn/tree/_tree.pyx":1691 * end = n * while True: * sift_down(Xf, samples, start, end) # <<<<<<<<<<<<<< @@ -11543,7 +11589,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_v_Xf, __pyx_v_samples, __pyx_v_start, __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1349 + /* "sklearn/tree/_tree.pyx":1692 * while True: * sift_down(Xf, samples, start, end) * if start == 0: # <<<<<<<<<<<<<< @@ -11553,7 +11599,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree __pyx_t_1 = ((__pyx_v_start == 0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1350 + /* "sklearn/tree/_tree.pyx":1693 * sift_down(Xf, samples, start, end) * if start == 0: * break # <<<<<<<<<<<<<< @@ -11563,7 +11609,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":1351 + /* "sklearn/tree/_tree.pyx":1694 * if start == 0: * break * start -= 1 # <<<<<<<<<<<<<< @@ -11574,7 +11620,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1354 + /* "sklearn/tree/_tree.pyx":1697 * * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 # <<<<<<<<<<<<<< @@ -11583,7 +11629,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ __pyx_v_end = (__pyx_v_n - 1); - /* "sklearn/tree/_tree.pyx":1355 + /* "sklearn/tree/_tree.pyx":1698 * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 * while end > 0: # <<<<<<<<<<<<<< @@ -11594,7 +11640,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree __pyx_t_1 = ((__pyx_v_end > 0) != 0); if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":1356 + /* "sklearn/tree/_tree.pyx":1699 * end = n - 1 * while end > 0: * swap(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11603,7 +11649,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_v_Xf, __pyx_v_samples, 0, __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1357 + /* "sklearn/tree/_tree.pyx":1700 * while end > 0: * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11612,7 +11658,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_v_Xf, __pyx_v_samples, 0, __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1358 + /* "sklearn/tree/_tree.pyx":1701 * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) * end = end - 1 # <<<<<<<<<<<<<< @@ -11622,7 +11668,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree __pyx_v_end = (__pyx_v_end - 1); } - /* "sklearn/tree/_tree.pyx":1341 + /* "sklearn/tree/_tree.pyx":1684 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11633,7 +11679,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1363 +/* "sklearn/tree/_tree.pyx":1706 * cdef class RandomSplitter(BaseDenseSplitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11666,7 +11712,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1364 + /* "sklearn/tree/_tree.pyx":1707 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -11675,44 +11721,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1365 + /* "sklearn/tree/_tree.pyx":1708 * def __reduce__(self): * return (RandomSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1366 + /* "sklearn/tree/_tree.pyx":1709 * return (RandomSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1367 + /* "sklearn/tree/_tree.pyx":1710 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1364 + /* "sklearn/tree/_tree.pyx":1707 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -11730,14 +11776,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1368 + /* "sklearn/tree/_tree.pyx":1711 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -11750,22 +11796,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1364 + /* "sklearn/tree/_tree.pyx":1707 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter))); @@ -11780,7 +11826,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1363 + /* "sklearn/tree/_tree.pyx":1706 * cdef class RandomSplitter(BaseDenseSplitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11802,7 +11848,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1370 +/* "sklearn/tree/_tree.pyx":1713 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -11848,7 +11894,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p int __pyx_t_6; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1374 + /* "sklearn/tree/_tree.pyx":1717 * """Find the best random split on node samples[start:end].""" * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -11858,7 +11904,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1375 + /* "sklearn/tree/_tree.pyx":1718 * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -11868,7 +11914,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1376 + /* "sklearn/tree/_tree.pyx":1719 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -11878,7 +11924,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1378 + /* "sklearn/tree/_tree.pyx":1721 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -11888,7 +11934,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1379 + /* "sklearn/tree/_tree.pyx":1722 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -11898,7 +11944,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1380 + /* "sklearn/tree/_tree.pyx":1723 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -11908,7 +11954,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1382 + /* "sklearn/tree/_tree.pyx":1725 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -11918,7 +11964,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_3 = __pyx_v_self->__pyx_base.X; __pyx_v_X = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1383 + /* "sklearn/tree/_tree.pyx":1726 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -11928,7 +11974,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1384 + /* "sklearn/tree/_tree.pyx":1727 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -11938,7 +11984,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.X_sample_stride; __pyx_v_X_sample_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1385 + /* "sklearn/tree/_tree.pyx":1728 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_fx_stride = self.X_fx_stride # <<<<<<<<<<<<<< @@ -11948,7 +11994,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.X_fx_stride; __pyx_v_X_fx_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1386 + /* "sklearn/tree/_tree.pyx":1729 * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_fx_stride = self.X_fx_stride * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -11958,7 +12004,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1387 + /* "sklearn/tree/_tree.pyx":1730 * cdef SIZE_t X_fx_stride = self.X_fx_stride * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -11968,7 +12014,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1388 + /* "sklearn/tree/_tree.pyx":1731 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -11978,7 +12024,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1389 + /* "sklearn/tree/_tree.pyx":1732 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -11987,7 +12033,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":1393 + /* "sklearn/tree/_tree.pyx":1736 * cdef SplitRecord best, current * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -11996,7 +12042,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":1396 + /* "sklearn/tree/_tree.pyx":1739 * cdef SIZE_t f_j, p, tmp * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -12005,7 +12051,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1398 + /* "sklearn/tree/_tree.pyx":1741 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -12014,7 +12060,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1399 + /* "sklearn/tree/_tree.pyx":1742 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -12023,7 +12069,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":1401 + /* "sklearn/tree/_tree.pyx":1744 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -12032,7 +12078,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":1402 + /* "sklearn/tree/_tree.pyx":1745 * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -12041,7 +12087,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1408 + /* "sklearn/tree/_tree.pyx":1751 * cdef SIZE_t partition_end * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -12050,7 +12096,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1419 + /* "sklearn/tree/_tree.pyx":1762 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -12065,7 +12111,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1421 + /* "sklearn/tree/_tree.pyx":1764 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -12079,7 +12125,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1423 + /* "sklearn/tree/_tree.pyx":1766 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -12091,7 +12137,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L5_bool_binop_done:; if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1424 + /* "sklearn/tree/_tree.pyx":1767 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -12100,7 +12146,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":1438 + /* "sklearn/tree/_tree.pyx":1781 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -12109,7 +12155,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":1441 + /* "sklearn/tree/_tree.pyx":1784 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -12119,7 +12165,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1443 + /* "sklearn/tree/_tree.pyx":1786 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -12128,7 +12174,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":1444 + /* "sklearn/tree/_tree.pyx":1787 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -12137,7 +12183,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":1445 + /* "sklearn/tree/_tree.pyx":1788 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -12146,7 +12192,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":1447 + /* "sklearn/tree/_tree.pyx":1790 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -12158,7 +12204,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1451 + /* "sklearn/tree/_tree.pyx":1794 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -12167,7 +12213,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":1454 + /* "sklearn/tree/_tree.pyx":1797 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -12176,7 +12222,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":1457 + /* "sklearn/tree/_tree.pyx":1800 * * # Find min, max * min_feature_value = X[X_sample_stride * samples[start] + # <<<<<<<<<<<<<< @@ -12185,7 +12231,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_min_feature_value = (__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_start])) + (__pyx_v_X_fx_stride * __pyx_v_current.feature))]); - /* "sklearn/tree/_tree.pyx":1459 + /* "sklearn/tree/_tree.pyx":1802 * min_feature_value = X[X_sample_stride * samples[start] + * X_fx_stride * current.feature] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -12194,7 +12240,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_max_feature_value = __pyx_v_min_feature_value; - /* "sklearn/tree/_tree.pyx":1460 + /* "sklearn/tree/_tree.pyx":1803 * X_fx_stride * current.feature] * max_feature_value = min_feature_value * Xf[start] = min_feature_value # <<<<<<<<<<<<<< @@ -12203,7 +12249,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_Xf[__pyx_v_start]) = __pyx_v_min_feature_value; - /* "sklearn/tree/_tree.pyx":1462 + /* "sklearn/tree/_tree.pyx":1805 * Xf[start] = min_feature_value * * for p in range(start + 1, end): # <<<<<<<<<<<<<< @@ -12214,7 +12260,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p for (__pyx_t_7 = (__pyx_v_start + 1); __pyx_t_7 < __pyx_t_2; __pyx_t_7+=1) { __pyx_v_p = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1463 + /* "sklearn/tree/_tree.pyx":1806 * * for p in range(start + 1, end): * current_feature_value = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -12223,7 +12269,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current_feature_value = (__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_current.feature))]); - /* "sklearn/tree/_tree.pyx":1465 + /* "sklearn/tree/_tree.pyx":1808 * current_feature_value = X[X_sample_stride * samples[p] + * X_fx_stride * current.feature] * Xf[p] = current_feature_value # <<<<<<<<<<<<<< @@ -12232,7 +12278,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_Xf[__pyx_v_p]) = __pyx_v_current_feature_value; - /* "sklearn/tree/_tree.pyx":1467 + /* "sklearn/tree/_tree.pyx":1810 * Xf[p] = current_feature_value * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -12242,7 +12288,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1468 + /* "sklearn/tree/_tree.pyx":1811 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -12253,7 +12299,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L11; } - /* "sklearn/tree/_tree.pyx":1469 + /* "sklearn/tree/_tree.pyx":1812 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -12263,7 +12309,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1470 + /* "sklearn/tree/_tree.pyx":1813 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -12276,7 +12322,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L11:; } - /* "sklearn/tree/_tree.pyx":1472 + /* "sklearn/tree/_tree.pyx":1815 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -12286,7 +12332,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_max_feature_value <= (__pyx_v_min_feature_value + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1473 + /* "sklearn/tree/_tree.pyx":1816 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -12295,7 +12341,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":1474 + /* "sklearn/tree/_tree.pyx":1817 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -12305,7 +12351,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1476 + /* "sklearn/tree/_tree.pyx":1819 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -12314,7 +12360,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":1477 + /* "sklearn/tree/_tree.pyx":1820 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -12326,7 +12372,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1480 + /* "sklearn/tree/_tree.pyx":1823 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -12335,7 +12381,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":1481 + /* "sklearn/tree/_tree.pyx":1824 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -12347,7 +12393,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1484 + /* "sklearn/tree/_tree.pyx":1827 * * # Draw a random threshold * current.threshold = rand_uniform(min_feature_value, # <<<<<<<<<<<<<< @@ -12356,7 +12402,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current.threshold = __pyx_f_7sklearn_4tree_5_tree_rand_uniform(__pyx_v_min_feature_value, __pyx_v_max_feature_value, __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":1488 + /* "sklearn/tree/_tree.pyx":1831 * random_state) * * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -12366,7 +12412,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current.threshold == __pyx_v_max_feature_value) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1489 + /* "sklearn/tree/_tree.pyx":1832 * * if current.threshold == max_feature_value: * current.threshold = min_feature_value # <<<<<<<<<<<<<< @@ -12378,7 +12424,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":1492 + /* "sklearn/tree/_tree.pyx":1835 * * # Partition * partition_end = end # <<<<<<<<<<<<<< @@ -12387,7 +12433,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1493 + /* "sklearn/tree/_tree.pyx":1836 * # Partition * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -12396,7 +12442,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1494 + /* "sklearn/tree/_tree.pyx":1837 * partition_end = end * p = start * while p < partition_end: # <<<<<<<<<<<<<< @@ -12407,7 +12453,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1495 + /* "sklearn/tree/_tree.pyx":1838 * p = start * while p < partition_end: * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -12416,7 +12462,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current_feature_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1496 + /* "sklearn/tree/_tree.pyx":1839 * while p < partition_end: * current_feature_value = Xf[p] * if current_feature_value <= current.threshold: # <<<<<<<<<<<<<< @@ -12426,7 +12472,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_feature_value <= __pyx_v_current.threshold) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1497 + /* "sklearn/tree/_tree.pyx":1840 * current_feature_value = Xf[p] * if current_feature_value <= current.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -12438,7 +12484,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1499 + /* "sklearn/tree/_tree.pyx":1842 * p += 1 * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -12447,7 +12493,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":1501 + /* "sklearn/tree/_tree.pyx":1844 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -12456,7 +12502,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_Xf[__pyx_v_p]) = (__pyx_v_Xf[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1502 + /* "sklearn/tree/_tree.pyx":1845 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = current_feature_value # <<<<<<<<<<<<<< @@ -12465,7 +12511,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_Xf[__pyx_v_partition_end]) = __pyx_v_current_feature_value; - /* "sklearn/tree/_tree.pyx":1504 + /* "sklearn/tree/_tree.pyx":1847 * Xf[partition_end] = current_feature_value * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -12474,7 +12520,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1505 + /* "sklearn/tree/_tree.pyx":1848 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -12483,7 +12529,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1506 + /* "sklearn/tree/_tree.pyx":1849 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -12495,7 +12541,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L16:; } - /* "sklearn/tree/_tree.pyx":1508 + /* "sklearn/tree/_tree.pyx":1851 * samples[p] = tmp * * current.pos = partition_end # <<<<<<<<<<<<<< @@ -12504,7 +12550,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current.pos = __pyx_v_partition_end; - /* "sklearn/tree/_tree.pyx":1511 + /* "sklearn/tree/_tree.pyx":1854 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -12518,7 +12564,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L18_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1512 + /* "sklearn/tree/_tree.pyx":1855 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -12530,7 +12576,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L18_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1513 + /* "sklearn/tree/_tree.pyx":1856 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -12540,7 +12586,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1516 + /* "sklearn/tree/_tree.pyx":1859 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -12549,7 +12595,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1517 + /* "sklearn/tree/_tree.pyx":1860 * # Evaluate split * self.criterion.reset() * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -12558,7 +12604,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":1520 + /* "sklearn/tree/_tree.pyx":1863 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -12572,7 +12618,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L21_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1521 + /* "sklearn/tree/_tree.pyx":1864 * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< @@ -12584,7 +12630,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L21_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1522 + /* "sklearn/tree/_tree.pyx":1865 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -12594,7 +12640,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1524 + /* "sklearn/tree/_tree.pyx":1867 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -12603,7 +12649,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":1526 + /* "sklearn/tree/_tree.pyx":1869 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -12613,7 +12659,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1527 + /* "sklearn/tree/_tree.pyx":1870 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -12622,7 +12668,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":1529 + /* "sklearn/tree/_tree.pyx":1872 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) * best = current # copy # <<<<<<<<<<<<<< @@ -12640,7 +12686,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":1532 + /* "sklearn/tree/_tree.pyx":1875 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: # <<<<<<<<<<<<<< @@ -12658,7 +12704,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L25_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1533 + /* "sklearn/tree/_tree.pyx":1876 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: * partition_end = end # <<<<<<<<<<<<<< @@ -12667,7 +12713,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1534 + /* "sklearn/tree/_tree.pyx":1877 * if best.pos < end and current.feature != best.feature: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -12676,7 +12722,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1536 + /* "sklearn/tree/_tree.pyx":1879 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -12687,7 +12733,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1538 + /* "sklearn/tree/_tree.pyx":1881 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -12697,7 +12743,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1539 + /* "sklearn/tree/_tree.pyx":1882 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -12709,7 +12755,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1542 + /* "sklearn/tree/_tree.pyx":1885 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -12718,7 +12764,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":1544 + /* "sklearn/tree/_tree.pyx":1887 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -12727,7 +12773,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1545 + /* "sklearn/tree/_tree.pyx":1888 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -12736,7 +12782,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1546 + /* "sklearn/tree/_tree.pyx":1889 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -12751,7 +12797,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":1551 + /* "sklearn/tree/_tree.pyx":1894 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -12760,7 +12806,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":1554 + /* "sklearn/tree/_tree.pyx":1897 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -12769,7 +12815,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":1559 + /* "sklearn/tree/_tree.pyx":1902 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -12778,7 +12824,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":1560 + /* "sklearn/tree/_tree.pyx":1903 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -12787,7 +12833,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":1370 + /* "sklearn/tree/_tree.pyx":1713 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -12798,7 +12844,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1573 +/* "sklearn/tree/_tree.pyx":1916 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12843,26 +12889,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_1__cinit__(PyObj case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -12874,20 +12920,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_1__cinit__(PyObj values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); - __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.PresortBestSplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); /* function exit code */ @@ -12904,7 +12950,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1578 + /* "sklearn/tree/_tree.pyx":1921 * object random_state): * # Initialize pointers * self.X_old = NULL # <<<<<<<<<<<<<< @@ -12913,7 +12959,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_old = NULL; - /* "sklearn/tree/_tree.pyx":1579 + /* "sklearn/tree/_tree.pyx":1922 * # Initialize pointers * self.X_old = NULL * self.X_argsorted_ptr = NULL # <<<<<<<<<<<<<< @@ -12922,7 +12968,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1580 + /* "sklearn/tree/_tree.pyx":1923 * self.X_old = NULL * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 # <<<<<<<<<<<<<< @@ -12931,7 +12977,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_stride = 0; - /* "sklearn/tree/_tree.pyx":1581 + /* "sklearn/tree/_tree.pyx":1924 * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 * self.sample_mask = NULL # <<<<<<<<<<<<<< @@ -12940,7 +12986,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1573 + /* "sklearn/tree/_tree.pyx":1916 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12954,7 +13000,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1583 +/* "sklearn/tree/_tree.pyx":1926 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12977,7 +13023,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":1585 + /* "sklearn/tree/_tree.pyx":1928 * def __dealloc__(self): * """Destructor.""" * free(self.sample_mask) # <<<<<<<<<<<<<< @@ -12986,7 +13032,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st */ free(__pyx_v_self->sample_mask); - /* "sklearn/tree/_tree.pyx":1583 + /* "sklearn/tree/_tree.pyx":1926 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12998,7 +13044,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1587 +/* "sklearn/tree/_tree.pyx":1930 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -13031,7 +13077,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1588 + /* "sklearn/tree/_tree.pyx":1931 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -13040,44 +13086,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1589 + /* "sklearn/tree/_tree.pyx":1932 * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1590 + /* "sklearn/tree/_tree.pyx":1933 * return (PresortBestSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1591 + /* "sklearn/tree/_tree.pyx":1934 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1588 + /* "sklearn/tree/_tree.pyx":1931 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -13095,14 +13141,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1592 + /* "sklearn/tree/_tree.pyx":1935 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void init(self, object X, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -13115,22 +13161,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1588 + /* "sklearn/tree/_tree.pyx":1931 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter))); @@ -13145,7 +13191,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1587 + /* "sklearn/tree/_tree.pyx":1930 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -13167,7 +13213,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1594 +/* "sklearn/tree/_tree.pyx":1937 * self.random_state), self.__getstate__()) * * cdef void init(self, object X, # <<<<<<<<<<<<<< @@ -13200,11 +13246,11 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; - /* "sklearn/tree/_tree.pyx":1598 + /* "sklearn/tree/_tree.pyx":1941 * DOUBLE_t* sample_weight) except *: * * cdef void* sample_mask = NULL # <<<<<<<<<<<<<< @@ -13213,29 +13259,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1601 + /* "sklearn/tree/_tree.pyx":1944 * * # Call parent initializer * BaseDenseSplitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< * * cdef np.ndarray X_ndarray = X */ - __pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1603 + /* "sklearn/tree/_tree.pyx":1946 * BaseDenseSplitter.init(self, X, y, sample_weight) * * cdef np.ndarray X_ndarray = X # <<<<<<<<<<<<<< * * # Pre-sort X */ - if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_X; __Pyx_INCREF(__pyx_t_1); __pyx_v_X_ndarray = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":1606 + /* "sklearn/tree/_tree.pyx":1949 * * # Pre-sort X * if self.X_old != self.X: # <<<<<<<<<<<<<< @@ -13245,7 +13291,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __pyx_t_2 = ((__pyx_v_self->X_old != __pyx_v_self->__pyx_base.X) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":1607 + /* "sklearn/tree/_tree.pyx":1950 * # Pre-sort X * if self.X_old != self.X: * self.X_old = self.X # <<<<<<<<<<<<<< @@ -13255,79 +13301,79 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __pyx_t_3 = __pyx_v_self->__pyx_base.X; __pyx_v_self->X_old = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1608 + /* "sklearn/tree/_tree.pyx":1951 * if self.X_old != self.X: * self.X_old = self.X * self.X_argsorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), # <<<<<<<<<<<<<< * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_X_ndarray)); __Pyx_GIVEREF(((PyObject *)__pyx_v_X_ndarray)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_X_ndarray)); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "sklearn/tree/_tree.pyx":1609 + /* "sklearn/tree/_tree.pyx":1952 * self.X_old = self.X * self.X_argsorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), * dtype=np.int32) # <<<<<<<<<<<<<< * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1608 + /* "sklearn/tree/_tree.pyx":1951 * if self.X_old != self.X: * self.X_old = self.X * self.X_argsorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), # <<<<<<<<<<<<<< * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->X_argsorted); __Pyx_DECREF(((PyObject *)__pyx_v_self->X_argsorted)); __pyx_v_self->X_argsorted = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1610 + /* "sklearn/tree/_tree.pyx":1953 * self.X_argsorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data # <<<<<<<<<<<<<< @@ -13336,19 +13382,19 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_self->X_argsorted_ptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_self->X_argsorted->data); - /* "sklearn/tree/_tree.pyx":1612 + /* "sklearn/tree/_tree.pyx":1955 * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / * self.X_argsorted.itemsize) # <<<<<<<<<<<<<< * * self.n_total_samples = X.shape[0] */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->X_argsorted), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->X_argsorted), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1611 + /* "sklearn/tree/_tree.pyx":1954 * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / # <<<<<<<<<<<<<< @@ -13357,33 +13403,33 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_self->X_argsorted_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_self->X_argsorted->strides[1])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_8)); - /* "sklearn/tree/_tree.pyx":1614 + /* "sklearn/tree/_tree.pyx":1957 * self.X_argsorted.itemsize) * * self.n_total_samples = X.shape[0] # <<<<<<<<<<<<<< * sample_mask = safe_realloc(&self.sample_mask, self.n_total_samples) * memset(sample_mask, 0, self.n_total_samples) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_7); if (unlikely((__pyx_t_8 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_self->n_total_samples = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1615 + /* "sklearn/tree/_tree.pyx":1958 * * self.n_total_samples = X.shape[0] * sample_mask = safe_realloc(&self.sample_mask, self.n_total_samples) # <<<<<<<<<<<<<< * memset(sample_mask, 0, self.n_total_samples) * */ - __pyx_t_9 = __pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sample_mask), __pyx_v_self->n_total_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sample_mask), __pyx_v_self->n_total_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sample_mask = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1616 + /* "sklearn/tree/_tree.pyx":1959 * self.n_total_samples = X.shape[0] * sample_mask = safe_realloc(&self.sample_mask, self.n_total_samples) * memset(sample_mask, 0, self.n_total_samples) # <<<<<<<<<<<<<< @@ -13395,7 +13441,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1594 + /* "sklearn/tree/_tree.pyx":1937 * self.random_state), self.__getstate__()) * * cdef void init(self, object X, # <<<<<<<<<<<<<< @@ -13424,7 +13470,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1618 +/* "sklearn/tree/_tree.pyx":1961 * memset(sample_mask, 0, self.n_total_samples) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -13475,7 +13521,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc int __pyx_t_8; int __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1622 + /* "sklearn/tree/_tree.pyx":1965 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -13485,7 +13531,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1623 + /* "sklearn/tree/_tree.pyx":1966 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -13495,7 +13541,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1624 + /* "sklearn/tree/_tree.pyx":1967 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -13505,7 +13551,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1626 + /* "sklearn/tree/_tree.pyx":1969 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -13515,7 +13561,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1627 + /* "sklearn/tree/_tree.pyx":1970 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -13525,7 +13571,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1628 + /* "sklearn/tree/_tree.pyx":1971 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -13535,7 +13581,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1630 + /* "sklearn/tree/_tree.pyx":1973 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -13545,7 +13591,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_3 = __pyx_v_self->__pyx_base.X; __pyx_v_X = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1631 + /* "sklearn/tree/_tree.pyx":1974 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -13555,7 +13601,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1632 + /* "sklearn/tree/_tree.pyx":1975 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -13565,7 +13611,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.X_sample_stride; __pyx_v_X_sample_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1633 + /* "sklearn/tree/_tree.pyx":1976 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_fx_stride = self.X_fx_stride # <<<<<<<<<<<<<< @@ -13575,7 +13621,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.X_fx_stride; __pyx_v_X_fx_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1634 + /* "sklearn/tree/_tree.pyx":1977 * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_fx_stride = self.X_fx_stride * cdef INT32_t* X_argsorted = self.X_argsorted_ptr # <<<<<<<<<<<<<< @@ -13585,7 +13631,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_4 = __pyx_v_self->X_argsorted_ptr; __pyx_v_X_argsorted = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1635 + /* "sklearn/tree/_tree.pyx":1978 * cdef SIZE_t X_fx_stride = self.X_fx_stride * cdef INT32_t* X_argsorted = self.X_argsorted_ptr * cdef SIZE_t X_argsorted_stride = self.X_argsorted_stride # <<<<<<<<<<<<<< @@ -13595,7 +13641,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->X_argsorted_stride; __pyx_v_X_argsorted_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1636 + /* "sklearn/tree/_tree.pyx":1979 * cdef INT32_t* X_argsorted = self.X_argsorted_ptr * cdef SIZE_t X_argsorted_stride = self.X_argsorted_stride * cdef SIZE_t n_total_samples = self.n_total_samples # <<<<<<<<<<<<<< @@ -13605,7 +13651,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->n_total_samples; __pyx_v_n_total_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1637 + /* "sklearn/tree/_tree.pyx":1980 * cdef SIZE_t X_argsorted_stride = self.X_argsorted_stride * cdef SIZE_t n_total_samples = self.n_total_samples * cdef unsigned char* sample_mask = self.sample_mask # <<<<<<<<<<<<<< @@ -13615,7 +13661,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_5 = __pyx_v_self->sample_mask; __pyx_v_sample_mask = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":1639 + /* "sklearn/tree/_tree.pyx":1982 * cdef unsigned char* sample_mask = self.sample_mask * * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -13625,7 +13671,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1640 + /* "sklearn/tree/_tree.pyx":1983 * * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -13635,7 +13681,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1641 + /* "sklearn/tree/_tree.pyx":1984 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -13645,7 +13691,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_6 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1642 + /* "sklearn/tree/_tree.pyx":1985 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -13654,7 +13700,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":1646 + /* "sklearn/tree/_tree.pyx":1989 * cdef SplitRecord best, current * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -13663,7 +13709,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":1649 + /* "sklearn/tree/_tree.pyx":1992 * cdef SIZE_t f_j, p * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -13672,7 +13718,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1651 + /* "sklearn/tree/_tree.pyx":1994 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -13681,7 +13727,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1652 + /* "sklearn/tree/_tree.pyx":1995 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -13690,7 +13736,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":1654 + /* "sklearn/tree/_tree.pyx":1997 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -13699,7 +13745,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":1655 + /* "sklearn/tree/_tree.pyx":1998 * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -13708,7 +13754,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1659 + /* "sklearn/tree/_tree.pyx":2002 * cdef SIZE_t i, j * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -13717,7 +13763,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1662 + /* "sklearn/tree/_tree.pyx":2005 * * # Set sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -13728,7 +13774,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc for (__pyx_t_7 = __pyx_v_start; __pyx_t_7 < __pyx_t_2; __pyx_t_7+=1) { __pyx_v_p = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1663 + /* "sklearn/tree/_tree.pyx":2006 * # Set sample mask * for p in range(start, end): * sample_mask[samples[p]] = 1 # <<<<<<<<<<<<<< @@ -13738,7 +13784,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc (__pyx_v_sample_mask[(__pyx_v_samples[__pyx_v_p])]) = 1; } - /* "sklearn/tree/_tree.pyx":1674 + /* "sklearn/tree/_tree.pyx":2017 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -13753,7 +13799,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1676 + /* "sklearn/tree/_tree.pyx":2019 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -13767,7 +13813,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1678 + /* "sklearn/tree/_tree.pyx":2021 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -13779,7 +13825,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L7_bool_binop_done:; if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1679 + /* "sklearn/tree/_tree.pyx":2022 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -13788,7 +13834,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":1693 + /* "sklearn/tree/_tree.pyx":2036 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -13797,7 +13843,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":1696 + /* "sklearn/tree/_tree.pyx":2039 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -13807,7 +13853,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1698 + /* "sklearn/tree/_tree.pyx":2041 * if f_j < n_known_constants: * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -13816,7 +13862,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":1699 + /* "sklearn/tree/_tree.pyx":2042 * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -13825,7 +13871,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":1700 + /* "sklearn/tree/_tree.pyx":2043 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -13834,7 +13880,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":1702 + /* "sklearn/tree/_tree.pyx":2045 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -13846,7 +13892,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1706 + /* "sklearn/tree/_tree.pyx":2049 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -13855,7 +13901,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":1709 + /* "sklearn/tree/_tree.pyx":2052 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -13864,7 +13910,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":1712 + /* "sklearn/tree/_tree.pyx":2055 * * # Extract ordering from X_argsorted * p = start # <<<<<<<<<<<<<< @@ -13873,7 +13919,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1714 + /* "sklearn/tree/_tree.pyx":2057 * p = start * * for i in range(n_total_samples): # <<<<<<<<<<<<<< @@ -13884,7 +13930,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_2; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1715 + /* "sklearn/tree/_tree.pyx":2058 * * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current.feature + i] # <<<<<<<<<<<<<< @@ -13893,7 +13939,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_j = (__pyx_v_X_argsorted[((__pyx_v_X_argsorted_stride * __pyx_v_current.feature) + __pyx_v_i)]); - /* "sklearn/tree/_tree.pyx":1716 + /* "sklearn/tree/_tree.pyx":2059 * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current.feature + i] * if sample_mask[j] == 1: # <<<<<<<<<<<<<< @@ -13903,7 +13949,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = (((__pyx_v_sample_mask[__pyx_v_j]) == 1) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1717 + /* "sklearn/tree/_tree.pyx":2060 * j = X_argsorted[X_argsorted_stride * current.feature + i] * if sample_mask[j] == 1: * samples[p] = j # <<<<<<<<<<<<<< @@ -13912,7 +13958,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_samples[__pyx_v_p]) = __pyx_v_j; - /* "sklearn/tree/_tree.pyx":1718 + /* "sklearn/tree/_tree.pyx":2061 * if sample_mask[j] == 1: * samples[p] = j * Xf[p] = X[X_sample_stride * j + # <<<<<<<<<<<<<< @@ -13921,7 +13967,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_Xf[__pyx_v_p]) = (__pyx_v_X[((__pyx_v_X_sample_stride * __pyx_v_j) + (__pyx_v_X_fx_stride * __pyx_v_current.feature))]); - /* "sklearn/tree/_tree.pyx":1720 + /* "sklearn/tree/_tree.pyx":2063 * Xf[p] = X[X_sample_stride * j + * X_fx_stride * current.feature] * p += 1 # <<<<<<<<<<<<<< @@ -13934,7 +13980,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":1723 + /* "sklearn/tree/_tree.pyx":2066 * * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -13944,7 +13990,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = (((__pyx_v_Xf[(__pyx_v_end - 1)]) <= ((__pyx_v_Xf[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1724 + /* "sklearn/tree/_tree.pyx":2067 * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -13953,7 +13999,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":1725 + /* "sklearn/tree/_tree.pyx":2068 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -13963,7 +14009,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1727 + /* "sklearn/tree/_tree.pyx":2070 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -13972,7 +14018,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":1728 + /* "sklearn/tree/_tree.pyx":2071 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -13984,7 +14030,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1731 + /* "sklearn/tree/_tree.pyx":2074 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -13993,7 +14039,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":1732 + /* "sklearn/tree/_tree.pyx":2075 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -14005,7 +14051,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":1734 + /* "sklearn/tree/_tree.pyx":2077 * features[f_i], features[f_j] = features[f_j], features[f_i] * * self.criterion.reset() # <<<<<<<<<<<<<< @@ -14014,7 +14060,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1735 + /* "sklearn/tree/_tree.pyx":2078 * * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -14023,7 +14069,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1737 + /* "sklearn/tree/_tree.pyx":2080 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -14034,7 +14080,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1738 + /* "sklearn/tree/_tree.pyx":2081 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -14049,7 +14095,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L19_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1739 + /* "sklearn/tree/_tree.pyx":2082 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -14061,7 +14107,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L19_bool_binop_done:; if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1740 + /* "sklearn/tree/_tree.pyx":2083 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -14071,7 +14117,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":1744 + /* "sklearn/tree/_tree.pyx":2087 * # (p + 1 >= end) or (X[samples[p + 1], current.feature] > * # X[samples[p], current.feature]) * p += 1 # <<<<<<<<<<<<<< @@ -14080,7 +14126,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":1748 + /* "sklearn/tree/_tree.pyx":2091 * # X[samples[p - 1], current.feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -14090,7 +14136,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1749 + /* "sklearn/tree/_tree.pyx":2092 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -14099,7 +14145,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":1752 + /* "sklearn/tree/_tree.pyx":2095 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -14113,7 +14159,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1753 + /* "sklearn/tree/_tree.pyx":2096 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -14125,7 +14171,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L23_bool_binop_done:; if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1754 + /* "sklearn/tree/_tree.pyx":2097 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -14135,125 +14181,2271 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L15_continue; } - /* "sklearn/tree/_tree.pyx":1756 + /* "sklearn/tree/_tree.pyx":2099 + * continue + * + * self.criterion.update(current.pos) # <<<<<<<<<<<<<< + * + * # Reject if min_weight_leaf is not satisfied + */ + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); + + /* "sklearn/tree/_tree.pyx":2102 + * + * # Reject if min_weight_leaf is not satisfied + * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< + * (self.criterion.weighted_n_right < min_weight_leaf)): + * continue + */ + __pyx_t_9 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_left < __pyx_v_min_weight_leaf) != 0); + if (!__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L26_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":2103 + * # Reject if min_weight_leaf is not satisfied + * if ((self.criterion.weighted_n_left < min_weight_leaf) or + * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_9 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); + __pyx_t_8 = __pyx_t_9; + __pyx_L26_bool_binop_done:; + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":2104 + * if ((self.criterion.weighted_n_left < min_weight_leaf) or + * (self.criterion.weighted_n_right < min_weight_leaf)): + * continue # <<<<<<<<<<<<<< + * + * current.improvement = self.criterion.impurity_improvement(impurity) + */ + goto __pyx_L15_continue; + } + + /* "sklearn/tree/_tree.pyx":2106 * continue * - * self.criterion.update(current.pos) # <<<<<<<<<<<<<< + * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * + * if current.improvement > best.improvement: + */ + __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); + + /* "sklearn/tree/_tree.pyx":2108 + * current.improvement = self.criterion.impurity_improvement(impurity) + * + * if current.improvement > best.improvement: # <<<<<<<<<<<<<< + * self.criterion.children_impurity(¤t.impurity_left, + * ¤t.impurity_right) + */ + __pyx_t_8 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":2109 + * + * if current.improvement > best.improvement: + * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< + * ¤t.impurity_right) + * + */ + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); + + /* "sklearn/tree/_tree.pyx":2112 + * ¤t.impurity_right) + * + * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< + * if current.threshold == Xf[p]: + * current.threshold = Xf[p - 1] + */ + __pyx_v_current.threshold = (((__pyx_v_Xf[(__pyx_v_p - 1)]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); + + /* "sklearn/tree/_tree.pyx":2113 + * + * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 + * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< + * current.threshold = Xf[p - 1] + * + */ + __pyx_t_8 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":2114 + * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 + * if current.threshold == Xf[p]: + * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< + * + * best = current # copy + */ + __pyx_v_current.threshold = (__pyx_v_Xf[(__pyx_v_p - 1)]); + goto __pyx_L29; + } + __pyx_L29:; + + /* "sklearn/tree/_tree.pyx":2116 + * current.threshold = Xf[p - 1] + * + * best = current # copy # <<<<<<<<<<<<<< + * + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + */ + __pyx_v_best = __pyx_v_current; + goto __pyx_L28; + } + __pyx_L28:; + goto __pyx_L21; + } + __pyx_L21:; + __pyx_L15_continue:; + } + } + __pyx_L14:; + } + __pyx_L10:; + } + + /* "sklearn/tree/_tree.pyx":2119 + * + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + * if best.pos < end: # <<<<<<<<<<<<<< + * partition_end = end + * p = start + */ + __pyx_t_8 = ((__pyx_v_best.pos < __pyx_v_end) != 0); + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":2120 + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + * if best.pos < end: + * partition_end = end # <<<<<<<<<<<<<< + * p = start + * + */ + __pyx_v_partition_end = __pyx_v_end; + + /* "sklearn/tree/_tree.pyx":2121 + * if best.pos < end: + * partition_end = end + * p = start # <<<<<<<<<<<<<< + * + * while p < partition_end: + */ + __pyx_v_p = __pyx_v_start; + + /* "sklearn/tree/_tree.pyx":2123 + * p = start + * + * while p < partition_end: # <<<<<<<<<<<<<< + * if X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature] <= best.threshold: + */ + while (1) { + __pyx_t_8 = ((__pyx_v_p < __pyx_v_partition_end) != 0); + if (!__pyx_t_8) break; + + /* "sklearn/tree/_tree.pyx":2125 + * while p < partition_end: + * if X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< + * p += 1 + * + */ + __pyx_t_8 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":2126 + * if X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature] <= best.threshold: + * p += 1 # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_p = (__pyx_v_p + 1); + goto __pyx_L33; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":2129 + * + * else: + * partition_end -= 1 # <<<<<<<<<<<<<< + * + * tmp = samples[partition_end] + */ + __pyx_v_partition_end = (__pyx_v_partition_end - 1); + + /* "sklearn/tree/_tree.pyx":2131 + * partition_end -= 1 + * + * tmp = samples[partition_end] # <<<<<<<<<<<<<< + * samples[partition_end] = samples[p] + * samples[p] = tmp + */ + __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); + + /* "sklearn/tree/_tree.pyx":2132 + * + * tmp = samples[partition_end] + * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< + * samples[p] = tmp + * + */ + (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); + + /* "sklearn/tree/_tree.pyx":2133 + * tmp = samples[partition_end] + * samples[partition_end] = samples[p] + * samples[p] = tmp # <<<<<<<<<<<<<< + * + * # Reset sample mask + */ + (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; + } + __pyx_L33:; + } + goto __pyx_L30; + } + __pyx_L30:; + + /* "sklearn/tree/_tree.pyx":2136 + * + * # Reset sample mask + * for p in range(start, end): # <<<<<<<<<<<<<< + * sample_mask[samples[p]] = 0 + * + */ + __pyx_t_7 = __pyx_v_end; + for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_7; __pyx_t_2+=1) { + __pyx_v_p = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":2137 + * # Reset sample mask + * for p in range(start, end): + * sample_mask[samples[p]] = 0 # <<<<<<<<<<<<<< + * + * # Respect invariant for constant features: the original order of + */ + (__pyx_v_sample_mask[(__pyx_v_samples[__pyx_v_p])]) = 0; + } + + /* "sklearn/tree/_tree.pyx":2142 + * # element in features[:n_known_constants] must be preserved for sibling + * # and child nodes + * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< + * + * # Copy newly found constant features + */ + memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); + + /* "sklearn/tree/_tree.pyx":2145 + * + * # Copy newly found constant features + * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< + * features + n_known_constants, + * sizeof(SIZE_t) * n_found_constants) + */ + memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); + + /* "sklearn/tree/_tree.pyx":2150 + * + * # Return values + * split[0] = best # <<<<<<<<<<<<<< + * n_constant_features[0] = n_total_constants + * + */ + (__pyx_v_split[0]) = __pyx_v_best; + + /* "sklearn/tree/_tree.pyx":2151 + * # Return values + * split[0] = best + * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< + * + * cdef class SpeedSplitter( BaseDenseSplitter ): + */ + (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; + + /* "sklearn/tree/_tree.pyx":1961 + * memset(sample_mask, 0, self.n_total_samples) + * + * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< + * SIZE_t* n_constant_features) nogil: + * """Find the best split on node samples[start:end].""" + */ + + /* function exit code */ +} + +/* "sklearn/tree/_tree.pyx":2168 + * cdef double impurity + * + * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< + * SIZE_t mn_samples_leaf, + * double min_weight_leaf, + */ + +/* Python wrapper */ +static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion = 0; + CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features; + CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf; + CYTHON_UNUSED double __pyx_v_min_weight_leaf; + CYTHON_UNUSED PyObject *__pyx_v_random_state = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_criterion,&__pyx_n_s_max_features,&__pyx_n_s_mn_samples_leaf,&__pyx_n_s_min_weight_leaf,&__pyx_n_s_random_state,0}; + PyObject* values[5] = {0,0,0,0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_criterion)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 2: + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mn_samples_leaf)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 3: + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + case 4: + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + } + __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_mn_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_mn_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_random_state = values[4]; + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("sklearn.tree._tree.SpeedSplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_mn_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "sklearn/tree/_tree.pyx":2174 + * + * # Initialize the points to point at appropriate objects + * self.X_old = NULL # <<<<<<<<<<<<<< + * self.X_idx_sorted_stride = 0 + * self.X_idx_sorted_ptr = NULL + */ + __pyx_v_self->X_old = NULL; + + /* "sklearn/tree/_tree.pyx":2175 + * # Initialize the points to point at appropriate objects + * self.X_old = NULL + * self.X_idx_sorted_stride = 0 # <<<<<<<<<<<<<< + * self.X_idx_sorted_ptr = NULL + * self.sample_mask = NULL + */ + __pyx_v_self->X_idx_sorted_stride = 0; + + /* "sklearn/tree/_tree.pyx":2176 + * self.X_old = NULL + * self.X_idx_sorted_stride = 0 + * self.X_idx_sorted_ptr = NULL # <<<<<<<<<<<<<< + * self.sample_mask = NULL + * self.X_feature_stride = 0 + */ + __pyx_v_self->X_idx_sorted_ptr = NULL; + + /* "sklearn/tree/_tree.pyx":2177 + * self.X_idx_sorted_stride = 0 + * self.X_idx_sorted_ptr = NULL + * self.sample_mask = NULL # <<<<<<<<<<<<<< + * self.X_feature_stride = 0 + * self.impurity = 0. + */ + __pyx_v_self->sample_mask = NULL; + + /* "sklearn/tree/_tree.pyx":2178 + * self.X_idx_sorted_ptr = NULL + * self.sample_mask = NULL + * self.X_feature_stride = 0 # <<<<<<<<<<<<<< + * self.impurity = 0. + * + */ + __pyx_v_self->X_feature_stride = 0; + + /* "sklearn/tree/_tree.pyx":2179 + * self.sample_mask = NULL + * self.X_feature_stride = 0 + * self.impurity = 0. # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_v_self->impurity = 0.; + + /* "sklearn/tree/_tree.pyx":2168 + * cdef double impurity + * + * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< + * SIZE_t mn_samples_leaf, + * double min_weight_leaf, + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "sklearn/tree/_tree.pyx":2181 + * self.impurity = 0. + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * """ + * Free the memory associated with this object. + */ + +/* Python wrapper */ +static void __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_3__dealloc__(PyObject *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_2__dealloc__(((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__", 0); + + /* "sklearn/tree/_tree.pyx":2186 + * """ + * + * free(self.sample_mask) # <<<<<<<<<<<<<< + * + * def __reduce(self): + */ + free(__pyx_v_self->sample_mask); + + /* "sklearn/tree/_tree.pyx":2181 + * self.impurity = 0. + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * """ + * Free the memory associated with this object. + */ + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +/* "sklearn/tree/_tree.pyx":2188 + * free(self.sample_mask) + * + * def __reduce(self): # <<<<<<<<<<<<<< + * return (SpeedSplitter, (self.criterion, + * self.max_features, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_5__reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_5__reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce (wrapper)", 0); + __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce", 0); + + /* "sklearn/tree/_tree.pyx":2189 + * + * def __reduce(self): + * return (SpeedSplitter, (self.criterion, # <<<<<<<<<<<<<< + * self.max_features, + * self.min_samples_leaf, + */ + __Pyx_XDECREF(__pyx_r); + + /* "sklearn/tree/_tree.pyx":2190 + * def __reduce(self): + * return (SpeedSplitter, (self.criterion, + * self.max_features, # <<<<<<<<<<<<<< + * self.min_samples_leaf, + * self.min_weight_leaf, + */ + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + + /* "sklearn/tree/_tree.pyx":2191 + * return (SpeedSplitter, (self.criterion, + * self.max_features, + * self.min_samples_leaf, # <<<<<<<<<<<<<< + * self.min_weight_leaf, + * self.random_state), self.__getstate__() ) + */ + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + + /* "sklearn/tree/_tree.pyx":2192 + * self.max_features, + * self.min_samples_leaf, + * self.min_weight_leaf, # <<<<<<<<<<<<<< + * self.random_state), self.__getstate__() ) + * + */ + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + + /* "sklearn/tree/_tree.pyx":2189 + * + * def __reduce(self): + * return (SpeedSplitter, (self.criterion, # <<<<<<<<<<<<<< + * self.max_features, + * self.min_samples_leaf, + */ + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.random_state); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.random_state); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->__pyx_base.__pyx_base.random_state); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + + /* "sklearn/tree/_tree.pyx":2193 + * self.min_samples_leaf, + * self.min_weight_leaf, + * self.random_state), self.__getstate__() ) # <<<<<<<<<<<<<< + * + * cdef void init(self, object X, + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = NULL; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + if (__pyx_t_1) { + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "sklearn/tree/_tree.pyx":2189 + * + * def __reduce(self): + * return (SpeedSplitter, (self.criterion, # <<<<<<<<<<<<<< + * self.max_features, + * self.min_samples_leaf, + */ + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter))); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "sklearn/tree/_tree.pyx":2188 + * free(self.sample_mask) + * + * def __reduce(self): # <<<<<<<<<<<<<< + * return (SpeedSplitter, (self.criterion, + * self.max_features, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("sklearn.tree._tree.SpeedSplitter.__reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "sklearn/tree/_tree.pyx":2195 + * self.random_state), self.__getstate__() ) + * + * cdef void init(self, object X, # <<<<<<<<<<<<<< + * np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, + * DOUBLE_t* sample_weight) except *: + */ + +static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight) { + PyArrayObject *__pyx_v_X_ndarray = 0; + void *__pyx_v_sample_mask; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_j; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_features; + __Pyx_LocalBuf_ND __pyx_pybuffernd_y; + __Pyx_Buffer __pyx_pybuffer_y; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_3; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + Py_ssize_t __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_t_9; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_t_10; + int __pyx_t_11; + int __pyx_t_12; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_t_13; + unsigned char *__pyx_t_14; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("init", 0); + __pyx_pybuffer_y.pybuffer.buf = NULL; + __pyx_pybuffer_y.refcount = 0; + __pyx_pybuffernd_y.data = NULL; + __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; + { + __Pyx_BufFmt_StackElem __pyx_stack[1]; + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; + + /* "sklearn/tree/_tree.pyx":2203 + * + * # Unpack X and expose its memory buffer + * self.n_samples = X.shape[0] # <<<<<<<<<<<<<< + * self.n_features = X.shape[1] + * cdef np.ndarray X_ndarray = X + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->__pyx_base.__pyx_base.n_samples = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":2204 + * # Unpack X and expose its memory buffer + * self.n_samples = X.shape[0] + * self.n_features = X.shape[1] # <<<<<<<<<<<<<< + * cdef np.ndarray X_ndarray = X + * self.X = X_ndarray.data + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->__pyx_base.__pyx_base.n_features = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":2205 + * self.n_samples = X.shape[0] + * self.n_features = X.shape[1] + * cdef np.ndarray X_ndarray = X # <<<<<<<<<<<<<< + * self.X = X_ndarray.data + * self.X_sample_stride = X.strides[0] / X.itemsize + */ + if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_v_X; + __Pyx_INCREF(__pyx_t_1); + __pyx_v_X_ndarray = ((PyArrayObject *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "sklearn/tree/_tree.pyx":2206 + * self.n_features = X.shape[1] + * cdef np.ndarray X_ndarray = X + * self.X = X_ndarray.data # <<<<<<<<<<<<<< + * self.X_sample_stride = X.strides[0] / X.itemsize + * self.X_feature_stride = X.strides[1] / X.itemsize + */ + __pyx_v_self->__pyx_base.X = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_ndarray->data); + + /* "sklearn/tree/_tree.pyx":2207 + * cdef np.ndarray X_ndarray = X + * self.X = X_ndarray.data + * self.X_sample_stride = X.strides[0] / X.itemsize # <<<<<<<<<<<<<< + * self.X_feature_stride = X.strides[1] / X.itemsize + * self.impurity = 1.e2 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self->__pyx_base.X_sample_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_4)); + + /* "sklearn/tree/_tree.pyx":2208 + * self.X = X_ndarray.data + * self.X_sample_stride = X.strides[0] / X.itemsize + * self.X_feature_stride = X.strides[1] / X.itemsize # <<<<<<<<<<<<<< + * self.impurity = 1.e2 + * + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->X_feature_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_4) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); + + /* "sklearn/tree/_tree.pyx":2209 + * self.X_sample_stride = X.strides[0] / X.itemsize + * self.X_feature_stride = X.strides[1] / X.itemsize + * self.impurity = 1.e2 # <<<<<<<<<<<<<< + * + * cdef void* sample_mask = NULL + */ + __pyx_v_self->impurity = 1.e2; + + /* "sklearn/tree/_tree.pyx":2211 + * self.impurity = 1.e2 + * + * cdef void* sample_mask = NULL # <<<<<<<<<<<<<< + * + * # Get the random state + */ + __pyx_v_sample_mask = NULL; + + /* "sklearn/tree/_tree.pyx":2214 + * + * # Get the random state + * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) # <<<<<<<<<<<<<< + * + * cdef SIZE_t i, j = 0 + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.random_state, __pyx_n_s_randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; + } + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_int_0); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_9 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->__pyx_base.__pyx_base.rand_r_state = __pyx_t_9; + + /* "sklearn/tree/_tree.pyx":2216 + * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) + * + * cdef SIZE_t i, j = 0 # <<<<<<<<<<<<<< + * self.weighted_n_samples = 0.0 + * + */ + __pyx_v_j = 0; + + /* "sklearn/tree/_tree.pyx":2217 + * + * cdef SIZE_t i, j = 0 + * self.weighted_n_samples = 0.0 # <<<<<<<<<<<<<< + * + * cdef SIZE_t* samples = safe_realloc(&self.samples, self.n_samples) + */ + __pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples = 0.0; + + /* "sklearn/tree/_tree.pyx":2219 + * self.weighted_n_samples = 0.0 + * + * cdef SIZE_t* samples = safe_realloc(&self.samples, self.n_samples) # <<<<<<<<<<<<<< + * + * # In order to only use positively weighted samples, we must go through + */ + __pyx_t_10 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.samples), __pyx_v_self->__pyx_base.__pyx_base.n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_samples = __pyx_t_10; + + /* "sklearn/tree/_tree.pyx":2224 + * # each sample and check its associated weight, if given. If no weights + * # are given, we assume the weight on each point is equal to 1. + * for i in range(self.n_samples): # <<<<<<<<<<<<<< + * # If no sample weights are passed in, or the associated sample + * # weight is greater than 0, add that sample to the growing array, + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_samples; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":2228 + * # weight is greater than 0, add that sample to the growing array, + * # and increment the count + * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< + * samples[j] = i + * j += 1 + */ + __pyx_t_12 = ((__pyx_v_sample_weight == NULL) != 0); + if (!__pyx_t_12) { + } else { + __pyx_t_11 = __pyx_t_12; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_12 = (((__pyx_v_sample_weight[__pyx_v_i]) != 0.0) != 0); + __pyx_t_11 = __pyx_t_12; + __pyx_L6_bool_binop_done:; + if (__pyx_t_11) { + + /* "sklearn/tree/_tree.pyx":2229 + * # and increment the count + * if sample_weight == NULL or sample_weight[i] != 0.0: + * samples[j] = i # <<<<<<<<<<<<<< + * j += 1 + * + */ + (__pyx_v_samples[__pyx_v_j]) = __pyx_v_i; + + /* "sklearn/tree/_tree.pyx":2230 + * if sample_weight == NULL or sample_weight[i] != 0.0: + * samples[j] = i + * j += 1 # <<<<<<<<<<<<<< + * + * # Add the sample weight, or 1.0 if no sample weights are given. + */ + __pyx_v_j = (__pyx_v_j + 1); + goto __pyx_L5; + } + __pyx_L5:; + + /* "sklearn/tree/_tree.pyx":2235 + * # If the sample weight is 0.0, then it does not matter if added + * # to the weight sum + * if sample_weight != NULL: # <<<<<<<<<<<<<< + * self.weighted_n_samples += sample_weight[i] + * else: + */ + __pyx_t_11 = ((__pyx_v_sample_weight != NULL) != 0); + if (__pyx_t_11) { + + /* "sklearn/tree/_tree.pyx":2236 + * # to the weight sum + * if sample_weight != NULL: + * self.weighted_n_samples += sample_weight[i] # <<<<<<<<<<<<<< + * else: + * self.weighted_n_samples += 1 + */ + __pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples = (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples + (__pyx_v_sample_weight[__pyx_v_i])); + goto __pyx_L8; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":2238 + * self.weighted_n_samples += sample_weight[i] + * else: + * self.weighted_n_samples += 1 # <<<<<<<<<<<<<< + * + * self.n_samples = j + */ + __pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples = (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples + 1.0); + } + __pyx_L8:; + } + + /* "sklearn/tree/_tree.pyx":2240 + * self.weighted_n_samples += 1 + * + * self.n_samples = j # <<<<<<<<<<<<<< + * + * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) + */ + __pyx_v_self->__pyx_base.__pyx_base.n_samples = __pyx_v_j; + + /* "sklearn/tree/_tree.pyx":2242 + * self.n_samples = j + * + * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) # <<<<<<<<<<<<<< + * for i in range(self.n_features): + * features[i] = i + */ + __pyx_t_10 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.features), __pyx_v_self->__pyx_base.__pyx_base.n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_features = __pyx_t_10; + + /* "sklearn/tree/_tree.pyx":2243 + * + * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) + * for i in range(self.n_features): # <<<<<<<<<<<<<< + * features[i] = i + * + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_features; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":2244 + * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) + * for i in range(self.n_features): + * features[i] = i # <<<<<<<<<<<<<< + * + * safe_realloc(&self.feature_values, self.n_samples) + */ + (__pyx_v_features[__pyx_v_i]) = __pyx_v_i; + } + + /* "sklearn/tree/_tree.pyx":2246 + * features[i] = i + * + * safe_realloc(&self.feature_values, self.n_samples) # <<<<<<<<<<<<<< + * safe_realloc(&self.constant_features, self.n_features) + * + */ + __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.feature_values), __pyx_v_self->__pyx_base.__pyx_base.n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "sklearn/tree/_tree.pyx":2247 + * + * safe_realloc(&self.feature_values, self.n_samples) + * safe_realloc(&self.constant_features, self.n_features) # <<<<<<<<<<<<<< + * + * # Save y as a reference to a buffer for memory efficient access + */ + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.constant_features), __pyx_v_self->__pyx_base.__pyx_base.n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + + /* "sklearn/tree/_tree.pyx":2250 + * + * # Save y as a reference to a buffer for memory efficient access + * self.y = y.data # <<<<<<<<<<<<<< + * self.y_stride = y.strides[0] / y.itemsize + * + */ + __pyx_v_self->__pyx_base.__pyx_base.y = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_y->data); + + /* "sklearn/tree/_tree.pyx":2251 + * # Save y as a reference to a buffer for memory efficient access + * self.y = y.data + * self.y_stride = y.strides[0] / y.itemsize # <<<<<<<<<<<<<< + * + * # Store the weight of each sample + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_self->__pyx_base.__pyx_base.y_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_y->strides[0])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); + + /* "sklearn/tree/_tree.pyx":2254 + * + * # Store the weight of each sample + * self.sample_weight = sample_weight # <<<<<<<<<<<<<< + * + * # Pre-sort X so that we can access sorted columns easier; in essence + */ + __pyx_v_self->__pyx_base.__pyx_base.sample_weight = __pyx_v_sample_weight; + + /* "sklearn/tree/_tree.pyx":2258 + * # Pre-sort X so that we can access sorted columns easier; in essence + * # caching the sort. + * if self.X_old != self.X: # <<<<<<<<<<<<<< + * self.X_old = self.X + * + */ + __pyx_t_11 = ((__pyx_v_self->X_old != __pyx_v_self->__pyx_base.X) != 0); + if (__pyx_t_11) { + + /* "sklearn/tree/_tree.pyx":2259 + * # caching the sort. + * if self.X_old != self.X: + * self.X_old = self.X # <<<<<<<<<<<<<< + * + * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), + */ + __pyx_t_13 = __pyx_v_self->__pyx_base.X; + __pyx_v_self->X_old = __pyx_t_13; + + /* "sklearn/tree/_tree.pyx":2261 + * self.X_old = self.X + * + * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), # <<<<<<<<<<<<<< + * dtype=np.int32) + * self.X_idx_sorted_ptr = self.X_idx_sorted.data + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_v_X_ndarray)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_X_ndarray)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_X_ndarray)); + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + + /* "sklearn/tree/_tree.pyx":2262 + * + * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), + * dtype=np.int32) # <<<<<<<<<<<<<< + * self.X_idx_sorted_ptr = self.X_idx_sorted.data + * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / + */ + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "sklearn/tree/_tree.pyx":2261 + * self.X_old = self.X + * + * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), # <<<<<<<<<<<<<< + * dtype=np.int32) + * self.X_idx_sorted_ptr = self.X_idx_sorted.data + */ + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GIVEREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_v_self->X_idx_sorted); + __Pyx_DECREF(((PyObject *)__pyx_v_self->X_idx_sorted)); + __pyx_v_self->X_idx_sorted = ((PyArrayObject *)__pyx_t_8); + __pyx_t_8 = 0; + + /* "sklearn/tree/_tree.pyx":2263 + * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), + * dtype=np.int32) + * self.X_idx_sorted_ptr = self.X_idx_sorted.data # <<<<<<<<<<<<<< + * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / + * self.X_idx_sorted.itemsize) + */ + __pyx_v_self->X_idx_sorted_ptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_self->X_idx_sorted->data); + + /* "sklearn/tree/_tree.pyx":2265 + * self.X_idx_sorted_ptr = self.X_idx_sorted.data + * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / + * self.X_idx_sorted.itemsize) # <<<<<<<<<<<<<< + * + * sample_mask = safe_realloc(&self.sample_mask, self.n_samples) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->X_idx_sorted), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "sklearn/tree/_tree.pyx":2264 + * dtype=np.int32) + * self.X_idx_sorted_ptr = self.X_idx_sorted.data + * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / # <<<<<<<<<<<<<< + * self.X_idx_sorted.itemsize) + * + */ + __pyx_v_self->X_idx_sorted_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_self->X_idx_sorted->strides[1])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); + + /* "sklearn/tree/_tree.pyx":2267 + * self.X_idx_sorted.itemsize) + * + * sample_mask = safe_realloc(&self.sample_mask, self.n_samples) # <<<<<<<<<<<<<< + * memset(sample_mask, 0, self.n_samples) + * + */ + __pyx_t_14 = __pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sample_mask), __pyx_v_self->__pyx_base.__pyx_base.n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_sample_mask = __pyx_t_14; + + /* "sklearn/tree/_tree.pyx":2268 + * + * sample_mask = safe_realloc(&self.sample_mask, self.n_samples) + * memset(sample_mask, 0, self.n_samples) # <<<<<<<<<<<<<< + * + * cdef void node_split(self, double impurity, SplitRecord* split, + */ + memset(__pyx_v_sample_mask, 0, __pyx_v_self->__pyx_base.__pyx_base.n_samples); + goto __pyx_L11; + } + __pyx_L11:; + + /* "sklearn/tree/_tree.pyx":2195 + * self.random_state), self.__getstate__() ) + * + * cdef void init(self, object X, # <<<<<<<<<<<<<< + * np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, + * DOUBLE_t* sample_weight) except *: + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("sklearn.tree._tree.SpeedSplitter.init", __pyx_clineno, __pyx_lineno, __pyx_filename); + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_XDECREF((PyObject *)__pyx_v_X_ndarray); + __Pyx_RefNannyFinishContext(); +} + +/* "sklearn/tree/_tree.pyx":2270 + * memset(sample_mask, 0, self.n_samples) + * + * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< + * SIZE_t* n_constant_features) nogil: + * """ + */ + +static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features) { + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_features; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_constant_features; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_features; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_samples; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_w; + unsigned char *__pyx_v_sample_mask; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_v_X; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_v_X_i; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_X_sample_stride; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_X_feature_stride; + __pyx_t_7sklearn_4tree_5_tree_INT32_t *__pyx_v_X_idx_sorted; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_X_idx_sorted_stride; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_min_weight_leaf; + __pyx_t_7sklearn_4tree_5_tree_UINT32_t *__pyx_v_random_state; + struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord __pyx_v_best; + struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord __pyx_v_current; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_tmp; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_found_constants; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_drawn_constants; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_known_constants; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_total_constants; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_visited_features; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_partition_end; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_j; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_yw_cl; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_w_cl; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_yw_sq; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_yw_cr; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_w_cr; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_yw_sq_r; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_yw_sq_sum; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_yw_sum; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_w_sum; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_t_2; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_t_3; + unsigned char *__pyx_t_4; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_t_5; + __pyx_t_7sklearn_4tree_5_tree_INT32_t *__pyx_t_6; + double __pyx_t_7; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_t_11; + long __pyx_t_12; + + /* "sklearn/tree/_tree.pyx":2277 + * + * # Unpack range related items + * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< + * cdef SIZE_t end = self.end + * + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.start; + __pyx_v_start = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2278 + * # Unpack range related items + * cdef SIZE_t start = self.start + * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< + * + * # Unpack feature related items + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.end; + __pyx_v_end = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2281 + * + * # Unpack feature related items + * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< + * cdef SIZE_t* constant_features = self.constant_features + * cdef SIZE_t n_features = self.n_features + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.features; + __pyx_v_features = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":2282 + * # Unpack feature related items + * cdef SIZE_t* features = self.features + * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< + * cdef SIZE_t n_features = self.n_features + * + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; + __pyx_v_constant_features = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":2283 + * cdef SIZE_t* features = self.features + * cdef SIZE_t* constant_features = self.constant_features + * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< + * + * # Unpack sample related items + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_features; + __pyx_v_n_features = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2286 + * + * # Unpack sample related items + * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< + * cdef SIZE_t n_samples = self.n_samples + * cdef DOUBLE_t* w = self.sample_weight + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.samples; + __pyx_v_samples = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":2287 + * # Unpack sample related items + * cdef SIZE_t* samples = self.samples + * cdef SIZE_t n_samples = self.n_samples # <<<<<<<<<<<<<< + * cdef DOUBLE_t* w = self.sample_weight + * cdef unsigned char* sample_mask = self.sample_mask + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_samples; + __pyx_v_n_samples = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2288 + * cdef SIZE_t* samples = self.samples + * cdef SIZE_t n_samples = self.n_samples + * cdef DOUBLE_t* w = self.sample_weight # <<<<<<<<<<<<<< + * cdef unsigned char* sample_mask = self.sample_mask + * + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.sample_weight; + __pyx_v_w = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":2289 + * cdef SIZE_t n_samples = self.n_samples + * cdef DOUBLE_t* w = self.sample_weight + * cdef unsigned char* sample_mask = self.sample_mask # <<<<<<<<<<<<<< + * + * # Unpack X related items + */ + __pyx_t_4 = __pyx_v_self->sample_mask; + __pyx_v_sample_mask = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":2292 + * + * # Unpack X related items + * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< + * cdef DTYPE_t* X_i = self.feature_values + * cdef SIZE_t X_sample_stride = self.X_sample_stride + */ + __pyx_t_5 = __pyx_v_self->__pyx_base.X; + __pyx_v_X = __pyx_t_5; + + /* "sklearn/tree/_tree.pyx":2293 + * # Unpack X related items + * cdef DTYPE_t* X = self.X + * cdef DTYPE_t* X_i = self.feature_values # <<<<<<<<<<<<<< + * cdef SIZE_t X_sample_stride = self.X_sample_stride + * cdef SIZE_t X_feature_stride = self.X_feature_stride + */ + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; + __pyx_v_X_i = __pyx_t_5; + + /* "sklearn/tree/_tree.pyx":2294 + * cdef DTYPE_t* X = self.X + * cdef DTYPE_t* X_i = self.feature_values + * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< + * cdef SIZE_t X_feature_stride = self.X_feature_stride + * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.X_sample_stride; + __pyx_v_X_sample_stride = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2295 + * cdef DTYPE_t* X_i = self.feature_values + * cdef SIZE_t X_sample_stride = self.X_sample_stride + * cdef SIZE_t X_feature_stride = self.X_feature_stride # <<<<<<<<<<<<<< + * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr + * cdef SIZE_t X_idx_sorted_stride = self.X_idx_sorted_stride + */ + __pyx_t_1 = __pyx_v_self->X_feature_stride; + __pyx_v_X_feature_stride = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2296 + * cdef SIZE_t X_sample_stride = self.X_sample_stride + * cdef SIZE_t X_feature_stride = self.X_feature_stride + * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr # <<<<<<<<<<<<<< + * cdef SIZE_t X_idx_sorted_stride = self.X_idx_sorted_stride + * + */ + __pyx_t_6 = __pyx_v_self->X_idx_sorted_ptr; + __pyx_v_X_idx_sorted = __pyx_t_6; + + /* "sklearn/tree/_tree.pyx":2297 + * cdef SIZE_t X_feature_stride = self.X_feature_stride + * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr + * cdef SIZE_t X_idx_sorted_stride = self.X_idx_sorted_stride # <<<<<<<<<<<<<< + * + * # Unpack y + */ + __pyx_t_1 = __pyx_v_self->X_idx_sorted_stride; + __pyx_v_X_idx_sorted_stride = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2300 + * + * # Unpack y + * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< + * cdef SIZE_t y_stride = self.y_stride + * + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.y; + __pyx_v_y = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":2301 + * # Unpack y + * cdef DOUBLE_t* y = self.y + * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< + * + * # Unpack constraints + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.y_stride; + __pyx_v_y_stride = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2304 + * + * # Unpack constraints + * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< + * cdef SIZE_t min_samples_leaf = self.min_samples_leaf + * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.max_features; + __pyx_v_max_features = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2305 + * # Unpack constraints + * cdef SIZE_t max_features = self.max_features + * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< + * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf + * cdef UINT32_t* random_state = &self.rand_r_state + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; + __pyx_v_min_samples_leaf = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2306 + * cdef SIZE_t max_features = self.max_features + * cdef SIZE_t min_samples_leaf = self.min_samples_leaf + * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< + * cdef UINT32_t* random_state = &self.rand_r_state + * + */ + __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; + __pyx_v_min_weight_leaf = __pyx_t_7; + + /* "sklearn/tree/_tree.pyx":2307 + * cdef SIZE_t min_samples_leaf = self.min_samples_leaf + * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf + * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< + * + * # Keeping track of the current split and the best split + */ + __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); + + /* "sklearn/tree/_tree.pyx":2314 + * # Numbers involved in keeping features ordered such that constant + * # features are not considered + * cdef SIZE_t f_j, f_i = n_features, tmp # <<<<<<<<<<<<<< + * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 + * cdef SIZE_t n_known_constants = n_constant_features[0] + */ + __pyx_v_f_i = __pyx_v_n_features; + + /* "sklearn/tree/_tree.pyx":2315 + * # features are not considered + * cdef SIZE_t f_j, f_i = n_features, tmp + * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 # <<<<<<<<<<<<<< + * cdef SIZE_t n_known_constants = n_constant_features[0] + * cdef SIZE_t n_total_constants = n_known_constants + */ + __pyx_v_n_found_constants = 0; + __pyx_v_n_drawn_constants = 0; + + /* "sklearn/tree/_tree.pyx":2316 + * cdef SIZE_t f_j, f_i = n_features, tmp + * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 + * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< + * cdef SIZE_t n_total_constants = n_known_constants + * cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k + */ + __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); + + /* "sklearn/tree/_tree.pyx":2317 + * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 + * cdef SIZE_t n_known_constants = n_constant_features[0] + * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< + * cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k + * + */ + __pyx_v_n_total_constants = __pyx_v_n_known_constants; + + /* "sklearn/tree/_tree.pyx":2318 + * cdef SIZE_t n_known_constants = n_constant_features[0] + * cdef SIZE_t n_total_constants = n_known_constants + * cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k # <<<<<<<<<<<<<< + * + * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) + */ + __pyx_v_n_visited_features = 0; + + /* "sklearn/tree/_tree.pyx":2320 + * cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k + * + * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) # <<<<<<<<<<<<<< + * cdef DOUBLE_t* w_cl = calloc(n_samples, sizeof(DOUBLE_t)) + * cdef DOUBLE_t* yw_sq = calloc(n_samples, sizeof(DOUBLE_t)) + */ + __pyx_v_yw_cl = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)calloc(__pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t)))); + + /* "sklearn/tree/_tree.pyx":2321 + * + * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) + * cdef DOUBLE_t* w_cl = calloc(n_samples, sizeof(DOUBLE_t)) # <<<<<<<<<<<<<< + * cdef DOUBLE_t* yw_sq = calloc(n_samples, sizeof(DOUBLE_t)) + * cdef DOUBLE_t yw_cr, w_cr, yw_sq_r, yw_sq_sum, yw_sum, w_sum + */ + __pyx_v_w_cl = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)calloc(__pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t)))); + + /* "sklearn/tree/_tree.pyx":2322 + * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) + * cdef DOUBLE_t* w_cl = calloc(n_samples, sizeof(DOUBLE_t)) + * cdef DOUBLE_t* yw_sq = calloc(n_samples, sizeof(DOUBLE_t)) # <<<<<<<<<<<<<< + * cdef DOUBLE_t yw_cr, w_cr, yw_sq_r, yw_sq_sum, yw_sum, w_sum + * cdef SIZE_t n_possible_splits + */ + __pyx_v_yw_sq = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)calloc(__pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t)))); + + /* "sklearn/tree/_tree.pyx":2326 + * cdef SIZE_t n_possible_splits + * + * _init_split(&best, end) # <<<<<<<<<<<<<< + * + * # Set the sample mask + */ + __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); + + /* "sklearn/tree/_tree.pyx":2329 + * + * # Set the sample mask + * for p in range(start, end): # <<<<<<<<<<<<<< + * sample_mask[samples[p]] = 1 + * + */ + __pyx_t_1 = __pyx_v_end; + for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_p = __pyx_t_8; + + /* "sklearn/tree/_tree.pyx":2330 + * # Set the sample mask + * for p in range(start, end): + * sample_mask[samples[p]] = 1 # <<<<<<<<<<<<<< + * + * # Sample up to max_features without replacement using a + */ + (__pyx_v_sample_mask[(__pyx_v_samples[__pyx_v_p])]) = 1; + } + + /* "sklearn/tree/_tree.pyx":2341 + * # newly discovered constant features to spare computation on descendant + * # nodes. + * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< + * # are constant + * (n_visited_features < max_features or + */ + while (1) { + __pyx_t_10 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L7_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":2343 + * while (f_i > n_total_constants and # Stop early if remaining features + * # are constant + * (n_visited_features < max_features or # <<<<<<<<<<<<<< + * # At least one drawn features must be non constant + * n_visited_features <= n_found_constants + n_drawn_constants)): + */ + __pyx_t_10 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L7_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":2345 + * (n_visited_features < max_features or + * # At least one drawn features must be non constant + * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< + * n_visited_features += 1 + * + */ + __pyx_t_10 = ((__pyx_v_n_visited_features <= (__pyx_v_n_found_constants + __pyx_v_n_drawn_constants)) != 0); + __pyx_t_9 = __pyx_t_10; + __pyx_L7_bool_binop_done:; + if (!__pyx_t_9) break; + + /* "sklearn/tree/_tree.pyx":2346 + * # At least one drawn features must be non constant + * n_visited_features <= n_found_constants + n_drawn_constants)): + * n_visited_features += 1 # <<<<<<<<<<<<<< + * + * # Loop invariant: elements of features in + */ + __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); + + /* "sklearn/tree/_tree.pyx":2360 + * + * # Draw a feature at random + * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< + * random_state) + * + */ + __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); + + /* "sklearn/tree/_tree.pyx":2363 + * random_state) + * + * if f_j < n_known_constants: # <<<<<<<<<<<<<< + * # f_j is in [n_drawn_constants, n_known_constants] + * tmp = features[f_j] + */ + __pyx_t_9 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2365 + * if f_j < n_known_constants: + * # f_j is in [n_drawn_constants, n_known_constants] + * tmp = features[f_j] # <<<<<<<<<<<<<< + * features[f_j] = features[n_drawn_constants] + * features[n_drawn_constants] = tmp + */ + __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); + + /* "sklearn/tree/_tree.pyx":2366 + * # f_j is in [n_drawn_constants, n_known_constants] + * tmp = features[f_j] + * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< + * features[n_drawn_constants] = tmp + * + */ + (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); + + /* "sklearn/tree/_tree.pyx":2367 + * tmp = features[f_j] + * features[f_j] = features[n_drawn_constants] + * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< + * + * n_drawn_constants += 1 + */ + (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; + + /* "sklearn/tree/_tree.pyx":2369 + * features[n_drawn_constants] = tmp + * + * n_drawn_constants += 1 # <<<<<<<<<<<<<< + * else: + * # f_j in the interval [n_known_constants, f_i - n_found_constants] + */ + __pyx_v_n_drawn_constants = (__pyx_v_n_drawn_constants + 1); + goto __pyx_L10; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":2372 + * else: + * # f_j in the interval [n_known_constants, f_i - n_found_constants] + * f_j += n_found_constants # <<<<<<<<<<<<<< + * # f_j in the interval [n_total_constants, f_i] + * + */ + __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); + + /* "sklearn/tree/_tree.pyx":2375 + * # f_j in the interval [n_total_constants, f_i] + * + * current.feature = features[f_j] # <<<<<<<<<<<<<< + * + * # Extract the relevant samples from that feature, ordered + */ + __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); + + /* "sklearn/tree/_tree.pyx":2379 + * # Extract the relevant samples from that feature, ordered + * # according to the presorting, into a single array + * p = start # <<<<<<<<<<<<<< + * for i in range(n_samples): + * # Get the next index from memory + */ + __pyx_v_p = __pyx_v_start; + + /* "sklearn/tree/_tree.pyx":2380 + * # according to the presorting, into a single array + * p = start + * for i in range(n_samples): # <<<<<<<<<<<<<< + * # Get the next index from memory + * j = X_idx_sorted[X_idx_sorted_stride * current.feature + i] + */ + __pyx_t_1 = __pyx_v_n_samples; + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "sklearn/tree/_tree.pyx":2382 + * for i in range(n_samples): + * # Get the next index from memory + * j = X_idx_sorted[X_idx_sorted_stride * current.feature + i] # <<<<<<<<<<<<<< + * + * # See if we are using this sample or not + */ + __pyx_v_j = (__pyx_v_X_idx_sorted[((__pyx_v_X_idx_sorted_stride * __pyx_v_current.feature) + __pyx_v_i)]); + + /* "sklearn/tree/_tree.pyx":2385 + * + * # See if we are using this sample or not + * if sample_mask[j] == 1: # <<<<<<<<<<<<<< + * samples[p] = j + * X_i[p] = X[X_sample_stride * j + + */ + __pyx_t_9 = (((__pyx_v_sample_mask[__pyx_v_j]) == 1) != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2386 + * # See if we are using this sample or not + * if sample_mask[j] == 1: + * samples[p] = j # <<<<<<<<<<<<<< + * X_i[p] = X[X_sample_stride * j + + * X_feature_stride * current.feature] + */ + (__pyx_v_samples[__pyx_v_p]) = __pyx_v_j; + + /* "sklearn/tree/_tree.pyx":2387 + * if sample_mask[j] == 1: + * samples[p] = j + * X_i[p] = X[X_sample_stride * j + # <<<<<<<<<<<<<< + * X_feature_stride * current.feature] + * p += 1 + */ + (__pyx_v_X_i[__pyx_v_p]) = (__pyx_v_X[((__pyx_v_X_sample_stride * __pyx_v_j) + (__pyx_v_X_feature_stride * __pyx_v_current.feature))]); + + /* "sklearn/tree/_tree.pyx":2389 + * X_i[p] = X[X_sample_stride * j + + * X_feature_stride * current.feature] + * p += 1 # <<<<<<<<<<<<<< + * + * # Ensure this feature is not constant + */ + __pyx_v_p = (__pyx_v_p + 1); + goto __pyx_L13; + } + __pyx_L13:; + } + + /* "sklearn/tree/_tree.pyx":2392 + * + * # Ensure this feature is not constant + * if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< + * features[f_j] = features[n_total_constants] + * features[n_total_constants] = current.feature + */ + __pyx_t_9 = (((__pyx_v_X_i[(__pyx_v_end - 1)]) <= ((__pyx_v_X_i[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2393 + * # Ensure this feature is not constant + * if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: + * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< + * features[n_total_constants] = current.feature + * + */ + (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); + + /* "sklearn/tree/_tree.pyx":2394 + * if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: + * features[f_j] = features[n_total_constants] + * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< + * + * n_found_constants += 1 + */ + __pyx_t_1 = __pyx_v_current.feature; + (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":2396 + * features[n_total_constants] = current.feature + * + * n_found_constants += 1 # <<<<<<<<<<<<<< + * n_total_constants += 1 + * + */ + __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); + + /* "sklearn/tree/_tree.pyx":2397 + * + * n_found_constants += 1 + * n_total_constants += 1 # <<<<<<<<<<<<<< + * + * # Otherwise, find a good split on the feature. ALL CODE ABOVE + */ + __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); + goto __pyx_L14; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":2402 + * # INVOLVED IN FINDING THE NEXT FEATURE TO SPLIT ON. + * else: + * f_i -= 1 # <<<<<<<<<<<<<< + * features[f_i], features[f_j] = features[f_j], features[f_i] + * + */ + __pyx_v_f_i = (__pyx_v_f_i - 1); + + /* "sklearn/tree/_tree.pyx":2403 + * else: + * f_i -= 1 + * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< + * + * # Now try to find the best split in this data by going + */ + __pyx_t_1 = (__pyx_v_features[__pyx_v_f_j]); + __pyx_t_8 = (__pyx_v_features[__pyx_v_f_i]); + (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_1; + (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; + + /* "sklearn/tree/_tree.pyx":2409 + * # statistics, and using those later on to calculate the + * # best split. + * for i in range(end-start): # <<<<<<<<<<<<<< + * p = samples[i+start] + * + */ + __pyx_t_11 = (__pyx_v_end - __pyx_v_start); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_11; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "sklearn/tree/_tree.pyx":2410 + * # best split. + * for i in range(end-start): + * p = samples[i+start] # <<<<<<<<<<<<<< + * + * # Since we are taking cumulatives, start off by just + */ + __pyx_v_p = (__pyx_v_samples[(__pyx_v_i + __pyx_v_start)]); + + /* "sklearn/tree/_tree.pyx":2417 + * # multiplied by the response (y), and of that value + * # squared. + * if i == 0: # <<<<<<<<<<<<<< + * w_cl[0] = w[p] + * yw_cl[0] = w[p] * y[p*y_stride] + */ + __pyx_t_9 = ((__pyx_v_i == 0) != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2418 + * # squared. + * if i == 0: + * w_cl[0] = w[p] # <<<<<<<<<<<<<< + * yw_cl[0] = w[p] * y[p*y_stride] + * yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] + */ + (__pyx_v_w_cl[0]) = (__pyx_v_w[__pyx_v_p]); + + /* "sklearn/tree/_tree.pyx":2419 + * if i == 0: + * w_cl[0] = w[p] + * yw_cl[0] = w[p] * y[p*y_stride] # <<<<<<<<<<<<<< + * yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] + * else: + */ + (__pyx_v_yw_cl[0]) = ((__pyx_v_w[__pyx_v_p]) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])); + + /* "sklearn/tree/_tree.pyx":2420 + * w_cl[0] = w[p] + * yw_cl[0] = w[p] * y[p*y_stride] + * yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] # <<<<<<<<<<<<<< + * else: + * w_cl[i] = w[p] + w_cl[i-1] + */ + (__pyx_v_yw_sq[0]) = (((__pyx_v_w[__pyx_v_p]) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])); + goto __pyx_L17; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":2422 + * yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] + * else: + * w_cl[i] = w[p] + w_cl[i-1] # <<<<<<<<<<<<<< + * yw_cl[i] = w[p] * y[p*y_stride] + yw_cl[i-1] + * yw_sq[i] = (w[p] * y[p*y_stride] * y[p*y_stride] + */ + (__pyx_v_w_cl[__pyx_v_i]) = ((__pyx_v_w[__pyx_v_p]) + (__pyx_v_w_cl[(__pyx_v_i - 1)])); + + /* "sklearn/tree/_tree.pyx":2423 + * else: + * w_cl[i] = w[p] + w_cl[i-1] + * yw_cl[i] = w[p] * y[p*y_stride] + yw_cl[i-1] # <<<<<<<<<<<<<< + * yw_sq[i] = (w[p] * y[p*y_stride] * y[p*y_stride] + * + yw_sq[i-1]) + */ + (__pyx_v_yw_cl[__pyx_v_i]) = (((__pyx_v_w[__pyx_v_p]) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])) + (__pyx_v_yw_cl[(__pyx_v_i - 1)])); + + /* "sklearn/tree/_tree.pyx":2424 + * w_cl[i] = w[p] + w_cl[i-1] + * yw_cl[i] = w[p] * y[p*y_stride] + yw_cl[i-1] + * yw_sq[i] = (w[p] * y[p*y_stride] * y[p*y_stride] # <<<<<<<<<<<<<< + * + yw_sq[i-1]) + * + */ + (__pyx_v_yw_sq[__pyx_v_i]) = ((((__pyx_v_w[__pyx_v_p]) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])) + (__pyx_v_yw_sq[(__pyx_v_i - 1)])); + } + __pyx_L17:; + } + + /* "sklearn/tree/_tree.pyx":2430 + * # improvement of that split using Friedman's correction to + * # the MSE criterion, and determine which split is the best. + * for i in range(end-start-1): # <<<<<<<<<<<<<< + * if i < end-start-1 and X_i[i+start+1] <= X_i[i+start] + FEATURE_THRESHOLD: + * continue + */ + __pyx_t_12 = ((__pyx_v_end - __pyx_v_start) - 1); + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_12; __pyx_t_8+=1) { + __pyx_v_i = __pyx_t_8; + + /* "sklearn/tree/_tree.pyx":2431 + * # the MSE criterion, and determine which split is the best. + * for i in range(end-start-1): + * if i < end-start-1 and X_i[i+start+1] <= X_i[i+start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< + * continue + * # Don't even consider possibilities which don't fall under + */ + __pyx_t_10 = ((__pyx_v_i < ((__pyx_v_end - __pyx_v_start) - 1)) != 0); + if (__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L21_bool_binop_done; + } + __pyx_t_10 = (((__pyx_v_X_i[((__pyx_v_i + __pyx_v_start) + 1)]) <= ((__pyx_v_X_i[(__pyx_v_i + __pyx_v_start)]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); + __pyx_t_9 = __pyx_t_10; + __pyx_L21_bool_binop_done:; + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2432 + * for i in range(end-start-1): + * if i < end-start-1 and X_i[i+start+1] <= X_i[i+start] + FEATURE_THRESHOLD: + * continue # <<<<<<<<<<<<<< + * # Don't even consider possibilities which don't fall under + * # the constraints imposed by the user. + */ + goto __pyx_L18_continue; + } + + /* "sklearn/tree/_tree.pyx":2435 + * # Don't even consider possibilities which don't fall under + * # the constraints imposed by the user. + * if (i+1 < min_samples_leaf or # <<<<<<<<<<<<<< + * end-start-i+1 < min_samples_leaf): + * continue + */ + __pyx_t_10 = (((__pyx_v_i + 1) < __pyx_v_min_samples_leaf) != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L24_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":2436 + * # the constraints imposed by the user. + * if (i+1 < min_samples_leaf or + * end-start-i+1 < min_samples_leaf): # <<<<<<<<<<<<<< + * continue + * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] + */ + __pyx_t_10 = (((((__pyx_v_end - __pyx_v_start) - __pyx_v_i) + 1) < __pyx_v_min_samples_leaf) != 0); + __pyx_t_9 = __pyx_t_10; + __pyx_L24_bool_binop_done:; + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2437 + * if (i+1 < min_samples_leaf or + * end-start-i+1 < min_samples_leaf): + * continue # <<<<<<<<<<<<<< + * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] + * - w_cl[i] < min_weight_leaf): + */ + goto __pyx_L18_continue; + } + + /* "sklearn/tree/_tree.pyx":2438 + * end-start-i+1 < min_samples_leaf): + * continue + * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] # <<<<<<<<<<<<<< + * - w_cl[i] < min_weight_leaf): + * continue + */ + __pyx_t_10 = (((__pyx_v_w_cl[__pyx_v_i]) < __pyx_v_min_weight_leaf) != 0); + if (!__pyx_t_10) { + } else { + __pyx_t_9 = __pyx_t_10; + goto __pyx_L27_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":2439 + * continue + * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] + * - w_cl[i] < min_weight_leaf): # <<<<<<<<<<<<<< + * continue + * + */ + __pyx_t_10 = ((((__pyx_v_w_cl[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_w_cl[__pyx_v_i])) < __pyx_v_min_weight_leaf) != 0); + __pyx_t_9 = __pyx_t_10; + __pyx_L27_bool_binop_done:; + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":2440 + * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] + * - w_cl[i] < min_weight_leaf): + * continue # <<<<<<<<<<<<<< + * + * p = i+start+1 + */ + goto __pyx_L18_continue; + } + + /* "sklearn/tree/_tree.pyx":2442 + * continue + * + * p = i+start+1 # <<<<<<<<<<<<<< + * + * w_cr = w_cl[end-start-1] - w_cl[i] + */ + __pyx_v_p = ((__pyx_v_i + __pyx_v_start) + 1); + + /* "sklearn/tree/_tree.pyx":2444 + * p = i+start+1 + * + * w_cr = w_cl[end-start-1] - w_cl[i] # <<<<<<<<<<<<<< + * yw_cr = yw_cl[end-start-1] - yw_cl[i] + * yw_sq_r = yw_sq[end-start-1] - yw_sq[i] + */ + __pyx_v_w_cr = ((__pyx_v_w_cl[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_w_cl[__pyx_v_i])); + + /* "sklearn/tree/_tree.pyx":2445 + * + * w_cr = w_cl[end-start-1] - w_cl[i] + * yw_cr = yw_cl[end-start-1] - yw_cl[i] # <<<<<<<<<<<<<< + * yw_sq_r = yw_sq[end-start-1] - yw_sq[i] + * + */ + __pyx_v_yw_cr = ((__pyx_v_yw_cl[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_yw_cl[__pyx_v_i])); + + /* "sklearn/tree/_tree.pyx":2446 + * w_cr = w_cl[end-start-1] - w_cl[i] + * yw_cr = yw_cl[end-start-1] - yw_cl[i] + * yw_sq_r = yw_sq[end-start-1] - yw_sq[i] # <<<<<<<<<<<<<< + * + * current.improvement = (w_cl[i] * w_cr * + */ + __pyx_v_yw_sq_r = ((__pyx_v_yw_sq[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_yw_sq[__pyx_v_i])); + + /* "sklearn/tree/_tree.pyx":2448 + * yw_sq_r = yw_sq[end-start-1] - yw_sq[i] + * + * current.improvement = (w_cl[i] * w_cr * # <<<<<<<<<<<<<< + * (yw_cl[i] / w_cl[i] - yw_cr / w_cr) ** 2.0) + * current.pos = p + */ + __pyx_v_current.improvement = (((__pyx_v_w_cl[__pyx_v_i]) * __pyx_v_w_cr) * pow(((double)(((__pyx_v_yw_cl[__pyx_v_i]) / (__pyx_v_w_cl[__pyx_v_i])) - (__pyx_v_yw_cr / __pyx_v_w_cr))), 2.0)); + + /* "sklearn/tree/_tree.pyx":2450 + * current.improvement = (w_cl[i] * w_cr * + * (yw_cl[i] / w_cl[i] - yw_cr / w_cr) ** 2.0) + * current.pos = p # <<<<<<<<<<<<<< + * + * if current.improvement > best.improvement: + */ + __pyx_v_current.pos = __pyx_v_p; + + /* "sklearn/tree/_tree.pyx":2452 + * current.pos = p * - * # Reject if min_weight_leaf is not satisfied + * if current.improvement > best.improvement: # <<<<<<<<<<<<<< + * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 + * if current.threshold == X_i[p]: */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); + __pyx_t_9 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1759 + /* "sklearn/tree/_tree.pyx":2453 * - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue + * if current.improvement > best.improvement: + * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 # <<<<<<<<<<<<<< + * if current.threshold == X_i[p]: + * current.threshold = X_i[p-1] */ - __pyx_t_9 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_left < __pyx_v_min_weight_leaf) != 0); - if (!__pyx_t_9) { - } else { - __pyx_t_8 = __pyx_t_9; - goto __pyx_L26_bool_binop_done; - } + __pyx_v_current.threshold = (((__pyx_v_X_i[__pyx_v_p]) + (__pyx_v_X_i[(__pyx_v_p - 1)])) / 2.0); - /* "sklearn/tree/_tree.pyx":1760 - * # Reject if min_weight_leaf is not satisfied - * if ((self.criterion.weighted_n_left < min_weight_leaf) or - * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< - * continue + /* "sklearn/tree/_tree.pyx":2454 + * if current.improvement > best.improvement: + * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 + * if current.threshold == X_i[p]: # <<<<<<<<<<<<<< + * current.threshold = X_i[p-1] * */ - __pyx_t_9 = ((__pyx_v_self->__pyx_base.__pyx_base.criterion->weighted_n_right < __pyx_v_min_weight_leaf) != 0); - __pyx_t_8 = __pyx_t_9; - __pyx_L26_bool_binop_done:; - if (__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_current.threshold == (__pyx_v_X_i[__pyx_v_p])) != 0); + if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1761 - * if ((self.criterion.weighted_n_left < min_weight_leaf) or - * (self.criterion.weighted_n_right < min_weight_leaf)): - * continue # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":2455 + * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 + * if current.threshold == X_i[p]: + * current.threshold = X_i[p-1] # <<<<<<<<<<<<<< * - * current.improvement = self.criterion.impurity_improvement(impurity) + * best = current */ - goto __pyx_L15_continue; + __pyx_v_current.threshold = (__pyx_v_X_i[(__pyx_v_p - 1)]); + goto __pyx_L30; } + __pyx_L30:; - /* "sklearn/tree/_tree.pyx":1763 - * continue + /* "sklearn/tree/_tree.pyx":2457 + * current.threshold = X_i[p-1] * - * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * best = current # <<<<<<<<<<<<<< * - * if current.improvement > best.improvement: + * # Constants pulling out the sum, to make the next equations simpler to */ - __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); + __pyx_v_best = __pyx_v_current; - /* "sklearn/tree/_tree.pyx":1765 - * current.improvement = self.criterion.impurity_improvement(impurity) - * - * if current.improvement > best.improvement: # <<<<<<<<<<<<<< - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":2461 + * # Constants pulling out the sum, to make the next equations simpler to + * # understand + * yw_sq_sum = yw_sq[end-start-1] # <<<<<<<<<<<<<< + * yw_sum = yw_cl[end-start-1] + * w_sum = w_cl[end-start-1] */ - __pyx_t_8 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); - if (__pyx_t_8) { + __pyx_v_yw_sq_sum = (__pyx_v_yw_sq[((__pyx_v_end - __pyx_v_start) - 1)]); - /* "sklearn/tree/_tree.pyx":1766 - * - * if current.improvement > best.improvement: - * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":2462 + * # understand + * yw_sq_sum = yw_sq[end-start-1] + * yw_sum = yw_cl[end-start-1] # <<<<<<<<<<<<<< + * w_sum = w_cl[end-start-1] * */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); + __pyx_v_yw_sum = (__pyx_v_yw_cl[((__pyx_v_end - __pyx_v_start) - 1)]); - /* "sklearn/tree/_tree.pyx":1769 - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":2463 + * yw_sq_sum = yw_sq[end-start-1] + * yw_sum = yw_cl[end-start-1] + * w_sum = w_cl[end-start-1] # <<<<<<<<<<<<<< * - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< - * if current.threshold == Xf[p]: - * current.threshold = Xf[p - 1] + * # Calculate the impurity of the entire array */ - __pyx_v_current.threshold = (((__pyx_v_Xf[(__pyx_v_p - 1)]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); + __pyx_v_w_sum = (__pyx_v_w_cl[((__pyx_v_end - __pyx_v_start) - 1)]); - /* "sklearn/tree/_tree.pyx":1770 + /* "sklearn/tree/_tree.pyx":2466 * - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 - * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< - * current.threshold = Xf[p - 1] + * # Calculate the impurity of the entire array + * self.impurity = yw_sq_sum / w_sum - (yw_sum / w_sum) ** 2.0 # <<<<<<<<<<<<<< * + * # Calculate the impurity on the left side of the array */ - __pyx_t_8 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); - if (__pyx_t_8) { + __pyx_v_self->impurity = ((__pyx_v_yw_sq_sum / __pyx_v_w_sum) - pow(((double)(__pyx_v_yw_sum / __pyx_v_w_sum)), 2.0)); - /* "sklearn/tree/_tree.pyx":1771 - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 - * if current.threshold == Xf[p]: - * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":2469 * - * best = current # copy + * # Calculate the impurity on the left side of the array + * best.impurity_left = yw_sq[i] / w_cl[i] - (yw_cl[i] / w_cl[i]) ** 2.0 # <<<<<<<<<<<<<< + * + * # Calculate the impurity on the right side of the array */ - __pyx_v_current.threshold = (__pyx_v_Xf[(__pyx_v_p - 1)]); - goto __pyx_L29; - } - __pyx_L29:; + __pyx_v_best.impurity_left = (((__pyx_v_yw_sq[__pyx_v_i]) / (__pyx_v_w_cl[__pyx_v_i])) - pow(((double)((__pyx_v_yw_cl[__pyx_v_i]) / (__pyx_v_w_cl[__pyx_v_i]))), 2.0)); - /* "sklearn/tree/_tree.pyx":1773 - * current.threshold = Xf[p - 1] + /* "sklearn/tree/_tree.pyx":2472 * - * best = current # copy # <<<<<<<<<<<<<< + * # Calculate the impurity on the right side of the array + * best.impurity_right = yw_sq_r / w_cr - (yw_cr / w_cr) ** 2.0 # <<<<<<<<<<<<<< * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ - __pyx_v_best = __pyx_v_current; - goto __pyx_L28; - } - __pyx_L28:; - goto __pyx_L21; + __pyx_v_best.impurity_right = ((__pyx_v_yw_sq_r / __pyx_v_w_cr) - pow(((double)(__pyx_v_yw_cr / __pyx_v_w_cr)), 2.0)); + goto __pyx_L29; } - __pyx_L21:; - __pyx_L15_continue:; + __pyx_L29:; + __pyx_L18_continue:; } } __pyx_L14:; @@ -14261,17 +16453,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":1776 + /* "sklearn/tree/_tree.pyx":2475 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< * partition_end = end * p = start */ - __pyx_t_8 = ((__pyx_v_best.pos < __pyx_v_end) != 0); - if (__pyx_t_8) { + __pyx_t_9 = ((__pyx_v_best.pos < __pyx_v_end) != 0); + if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1777 + /* "sklearn/tree/_tree.pyx":2476 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -14280,7 +16472,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1778 + /* "sklearn/tree/_tree.pyx":2477 * if best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -14289,40 +16481,40 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1780 + /* "sklearn/tree/_tree.pyx":2479 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< * if X[X_sample_stride * samples[p] + - * X_fx_stride * best.feature] <= best.threshold: + * X_feature_stride * best.feature] <= best.threshold: */ while (1) { - __pyx_t_8 = ((__pyx_v_p < __pyx_v_partition_end) != 0); - if (!__pyx_t_8) break; + __pyx_t_9 = ((__pyx_v_p < __pyx_v_partition_end) != 0); + if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":1782 + /* "sklearn/tree/_tree.pyx":2481 * while p < partition_end: * if X[X_sample_stride * samples[p] + - * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< + * X_feature_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< * p += 1 * */ - __pyx_t_8 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); - if (__pyx_t_8) { + __pyx_t_9 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_feature_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); + if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1783 + /* "sklearn/tree/_tree.pyx":2482 * if X[X_sample_stride * samples[p] + - * X_fx_stride * best.feature] <= best.threshold: + * X_feature_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< * * else: */ __pyx_v_p = (__pyx_v_p + 1); - goto __pyx_L33; + goto __pyx_L34; } /*else*/ { - /* "sklearn/tree/_tree.pyx":1786 + /* "sklearn/tree/_tree.pyx":2485 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -14331,7 +16523,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":1788 + /* "sklearn/tree/_tree.pyx":2487 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -14340,7 +16532,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1789 + /* "sklearn/tree/_tree.pyx":2488 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -14349,7 +16541,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1790 + /* "sklearn/tree/_tree.pyx":2489 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -14358,24 +16550,24 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; } - __pyx_L33:; + __pyx_L34:; } - goto __pyx_L30; + goto __pyx_L31; } - __pyx_L30:; + __pyx_L31:; - /* "sklearn/tree/_tree.pyx":1793 + /* "sklearn/tree/_tree.pyx":2492 * * # Reset sample mask * for p in range(start, end): # <<<<<<<<<<<<<< * sample_mask[samples[p]] = 0 * */ - __pyx_t_7 = __pyx_v_end; - for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_7; __pyx_t_2+=1) { - __pyx_v_p = __pyx_t_2; + __pyx_t_8 = __pyx_v_end; + for (__pyx_t_1 = __pyx_v_start; __pyx_t_1 < __pyx_t_8; __pyx_t_1+=1) { + __pyx_v_p = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1794 + /* "sklearn/tree/_tree.pyx":2493 * # Reset sample mask * for p in range(start, end): * sample_mask[samples[p]] = 0 # <<<<<<<<<<<<<< @@ -14385,7 +16577,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc (__pyx_v_sample_mask[(__pyx_v_samples[__pyx_v_p])]) = 0; } - /* "sklearn/tree/_tree.pyx":1799 + /* "sklearn/tree/_tree.pyx":2498 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -14394,7 +16586,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":1802 + /* "sklearn/tree/_tree.pyx":2501 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -14403,7 +16595,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":1807 + /* "sklearn/tree/_tree.pyx":2506 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -14412,27 +16604,88 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":1808 + /* "sklearn/tree/_tree.pyx":2507 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< * - * + * free(w_cl) */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":1618 - * memset(sample_mask, 0, self.n_total_samples) + /* "sklearn/tree/_tree.pyx":2509 + * n_constant_features[0] = n_total_constants + * + * free(w_cl) # <<<<<<<<<<<<<< + * free(yw_cl) + * free(yw_sq) + */ + free(__pyx_v_w_cl); + + /* "sklearn/tree/_tree.pyx":2510 + * + * free(w_cl) + * free(yw_cl) # <<<<<<<<<<<<<< + * free(yw_sq) + * + */ + free(__pyx_v_yw_cl); + + /* "sklearn/tree/_tree.pyx":2511 + * free(w_cl) + * free(yw_cl) + * free(yw_sq) # <<<<<<<<<<<<<< + * + * cdef double node_impurity(self) nogil: + */ + free(__pyx_v_yw_sq); + + /* "sklearn/tree/_tree.pyx":2270 + * memset(sample_mask, 0, self.n_samples) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< * SIZE_t* n_constant_features) nogil: - * """Find the best split on node samples[start:end].""" + * """ + */ + + /* function exit code */ +} + +/* "sklearn/tree/_tree.pyx":2513 + * free(yw_sq) + * + * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< + * """ + * Return the impurity of this node. + */ + +static double __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self) { + double __pyx_r; + + /* "sklearn/tree/_tree.pyx":2518 + * """ + * + * return self.impurity # <<<<<<<<<<<<<< + * + * cdef class BaseSparseSplitter(Splitter): + */ + __pyx_r = __pyx_v_self->impurity; + goto __pyx_L0; + + /* "sklearn/tree/_tree.pyx":2513 + * free(yw_sq) + * + * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< + * """ + * Return the impurity of this node. */ /* function exit code */ + __pyx_L0:; + return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1822 +/* "sklearn/tree/_tree.pyx":2531 * cdef SIZE_t* sorted_samples * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -14477,26 +16730,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_18BaseSparseSplitter_1__cinit__(PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -14508,20 +16761,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_18BaseSparseSplitter_1__cinit__(PyObje values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); - __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BaseSparseSplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); /* function exit code */ @@ -14538,7 +16791,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1827 + /* "sklearn/tree/_tree.pyx":2536 * # Parent __cinit__ is automatically called * * self.X_data = NULL # <<<<<<<<<<<<<< @@ -14547,7 +16800,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_data = NULL; - /* "sklearn/tree/_tree.pyx":1828 + /* "sklearn/tree/_tree.pyx":2537 * * self.X_data = NULL * self.X_indices = NULL # <<<<<<<<<<<<<< @@ -14556,7 +16809,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_indices = NULL; - /* "sklearn/tree/_tree.pyx":1829 + /* "sklearn/tree/_tree.pyx":2538 * self.X_data = NULL * self.X_indices = NULL * self.X_indptr = NULL # <<<<<<<<<<<<<< @@ -14565,7 +16818,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_indptr = NULL; - /* "sklearn/tree/_tree.pyx":1831 + /* "sklearn/tree/_tree.pyx":2540 * self.X_indptr = NULL * * self.n_total_samples = 0 # <<<<<<<<<<<<<< @@ -14574,7 +16827,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->n_total_samples = 0; - /* "sklearn/tree/_tree.pyx":1833 + /* "sklearn/tree/_tree.pyx":2542 * self.n_total_samples = 0 * * self.index_to_samples = NULL # <<<<<<<<<<<<<< @@ -14583,7 +16836,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->index_to_samples = NULL; - /* "sklearn/tree/_tree.pyx":1834 + /* "sklearn/tree/_tree.pyx":2543 * * self.index_to_samples = NULL * self.sorted_samples = NULL # <<<<<<<<<<<<<< @@ -14592,7 +16845,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->sorted_samples = NULL; - /* "sklearn/tree/_tree.pyx":1822 + /* "sklearn/tree/_tree.pyx":2531 * cdef SIZE_t* sorted_samples * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -14606,7 +16859,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1836 +/* "sklearn/tree/_tree.pyx":2545 * self.sorted_samples = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -14629,7 +16882,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":1838 + /* "sklearn/tree/_tree.pyx":2547 * def __dealloc__(self): * """Deallocate memory""" * free(self.index_to_samples) # <<<<<<<<<<<<<< @@ -14638,7 +16891,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str */ free(__pyx_v_self->index_to_samples); - /* "sklearn/tree/_tree.pyx":1839 + /* "sklearn/tree/_tree.pyx":2548 * """Deallocate memory""" * free(self.index_to_samples) * free(self.sorted_samples) # <<<<<<<<<<<<<< @@ -14647,7 +16900,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str */ free(__pyx_v_self->sorted_samples); - /* "sklearn/tree/_tree.pyx":1836 + /* "sklearn/tree/_tree.pyx":2545 * self.sorted_samples = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -14659,7 +16912,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1841 +/* "sklearn/tree/_tree.pyx":2550 * free(self.sorted_samples) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -14717,48 +16970,48 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; - /* "sklearn/tree/_tree.pyx":1848 + /* "sklearn/tree/_tree.pyx":2557 * * # Call parent init * Splitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< * * if not isinstance(X, csc_matrix): */ - __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1850 + /* "sklearn/tree/_tree.pyx":2559 * Splitter.init(self, X, y, sample_weight) * * if not isinstance(X, csc_matrix): # <<<<<<<<<<<<<< * raise ValueError("X should be in csc format") * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":1851 + /* "sklearn/tree/_tree.pyx":2560 * * if not isinstance(X, csc_matrix): * raise ValueError("X should be in csc format") # <<<<<<<<<<<<<< * * cdef SIZE_t* samples = self.samples */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1853 + /* "sklearn/tree/_tree.pyx":2562 * raise ValueError("X should be in csc format") * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -14768,7 +17021,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_t_4 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1854 + /* "sklearn/tree/_tree.pyx":2563 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t n_samples = self.n_samples # <<<<<<<<<<<<<< @@ -14778,22 +17031,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_t_5 = __pyx_v_self->__pyx_base.n_samples; __pyx_v_n_samples = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":1857 + /* "sklearn/tree/_tree.pyx":2566 * * # Initialize X * cdef np.ndarray[dtype=DTYPE_t, ndim=1] data = X.data # <<<<<<<<<<<<<< * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; } } @@ -14801,22 +17054,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_v_data = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":1858 + /* "sklearn/tree/_tree.pyx":2567 * # Initialize X * cdef np.ndarray[dtype=DTYPE_t, ndim=1] data = X.data * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices # <<<<<<<<<<<<<< * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr * cdef SIZE_t n_total_samples = X.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_indices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; } } @@ -14824,22 +17077,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_v_indices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":1859 + /* "sklearn/tree/_tree.pyx":2568 * cdef np.ndarray[dtype=DTYPE_t, ndim=1] data = X.data * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr # <<<<<<<<<<<<<< * cdef SIZE_t n_total_samples = X.shape[0] * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_indptr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indptr.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_indptr.diminfo[0].strides = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indptr.diminfo[0].shape = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.shape[0]; } } @@ -14847,23 +17100,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_v_indptr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":1860 + /* "sklearn/tree/_tree.pyx":2569 * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr * cdef SIZE_t n_total_samples = X.shape[0] # <<<<<<<<<<<<<< * * self.X_data = data.data */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_n_total_samples = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":1862 + /* "sklearn/tree/_tree.pyx":2571 * cdef SIZE_t n_total_samples = X.shape[0] * * self.X_data = data.data # <<<<<<<<<<<<<< @@ -14872,7 +17125,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->X_data = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_data->data); - /* "sklearn/tree/_tree.pyx":1863 + /* "sklearn/tree/_tree.pyx":2572 * * self.X_data = data.data * self.X_indices = indices.data # <<<<<<<<<<<<<< @@ -14881,7 +17134,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->X_indices = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_indices->data); - /* "sklearn/tree/_tree.pyx":1864 + /* "sklearn/tree/_tree.pyx":2573 * self.X_data = data.data * self.X_indices = indices.data * self.X_indptr = indptr.data # <<<<<<<<<<<<<< @@ -14890,7 +17143,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->X_indptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_indptr->data); - /* "sklearn/tree/_tree.pyx":1865 + /* "sklearn/tree/_tree.pyx":2574 * self.X_indices = indices.data * self.X_indptr = indptr.data * self.n_total_samples = n_total_samples # <<<<<<<<<<<<<< @@ -14899,25 +17152,25 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->n_total_samples = __pyx_v_n_total_samples; - /* "sklearn/tree/_tree.pyx":1868 + /* "sklearn/tree/_tree.pyx":2577 * * # Initialize auxiliary array used to perform split * safe_realloc(&self.index_to_samples, n_total_samples * sizeof(SIZE_t)) # <<<<<<<<<<<<<< * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) * */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->index_to_samples), (__pyx_v_n_total_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->index_to_samples), (__pyx_v_n_total_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1869 + /* "sklearn/tree/_tree.pyx":2578 * # Initialize auxiliary array used to perform split * safe_realloc(&self.index_to_samples, n_total_samples * sizeof(SIZE_t)) * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) # <<<<<<<<<<<<<< * * cdef SIZE_t* index_to_samples = self.index_to_samples */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sorted_samples), (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sorted_samples), (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1871 + /* "sklearn/tree/_tree.pyx":2580 * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) * * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -14927,7 +17180,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_t_4 = __pyx_v_self->index_to_samples; __pyx_v_index_to_samples = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1873 + /* "sklearn/tree/_tree.pyx":2582 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t p * for p in range(n_total_samples): # <<<<<<<<<<<<<< @@ -14938,7 +17191,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_5; __pyx_t_10+=1) { __pyx_v_p = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1874 + /* "sklearn/tree/_tree.pyx":2583 * cdef SIZE_t p * for p in range(n_total_samples): * index_to_samples[p] = -1 # <<<<<<<<<<<<<< @@ -14948,7 +17201,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx (__pyx_v_index_to_samples[__pyx_v_p]) = -1; } - /* "sklearn/tree/_tree.pyx":1876 + /* "sklearn/tree/_tree.pyx":2585 * index_to_samples[p] = -1 * * for p in range(n_samples): # <<<<<<<<<<<<<< @@ -14959,7 +17212,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_5; __pyx_t_10+=1) { __pyx_v_p = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1877 + /* "sklearn/tree/_tree.pyx":2586 * * for p in range(n_samples): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -14969,7 +17222,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_p])]) = __pyx_v_p; } - /* "sklearn/tree/_tree.pyx":1841 + /* "sklearn/tree/_tree.pyx":2550 * free(self.sorted_samples) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -15003,7 +17256,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1879 +/* "sklearn/tree/_tree.pyx":2588 * index_to_samples[samples[p]] = p * * cdef inline SIZE_t _partition(self, double threshold, # <<<<<<<<<<<<<< @@ -15024,7 +17277,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree int __pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1888 + /* "sklearn/tree/_tree.pyx":2597 * cdef SIZE_t p * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -15034,7 +17287,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_1 = __pyx_v_self->__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1889 + /* "sklearn/tree/_tree.pyx":2598 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -15044,7 +17297,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_2 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1890 + /* "sklearn/tree/_tree.pyx":2599 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* samples = self.samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -15054,7 +17307,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_2 = __pyx_v_self->index_to_samples; __pyx_v_index_to_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1892 + /* "sklearn/tree/_tree.pyx":2601 * cdef SIZE_t* index_to_samples = self.index_to_samples * * if threshold < 0.: # <<<<<<<<<<<<<< @@ -15064,7 +17317,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_threshold < 0.) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":1893 + /* "sklearn/tree/_tree.pyx":2602 * * if threshold < 0.: * p = self.start # <<<<<<<<<<<<<< @@ -15074,7 +17327,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_4 = __pyx_v_self->__pyx_base.start; __pyx_v_p = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1894 + /* "sklearn/tree/_tree.pyx":2603 * if threshold < 0.: * p = self.start * partition_end = end_negative # <<<<<<<<<<<<<< @@ -15085,7 +17338,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree goto __pyx_L3; } - /* "sklearn/tree/_tree.pyx":1895 + /* "sklearn/tree/_tree.pyx":2604 * p = self.start * partition_end = end_negative * elif threshold > 0.: # <<<<<<<<<<<<<< @@ -15095,7 +17348,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_threshold > 0.) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":1896 + /* "sklearn/tree/_tree.pyx":2605 * partition_end = end_negative * elif threshold > 0.: * p = start_positive # <<<<<<<<<<<<<< @@ -15104,7 +17357,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ __pyx_v_p = __pyx_v_start_positive; - /* "sklearn/tree/_tree.pyx":1897 + /* "sklearn/tree/_tree.pyx":2606 * elif threshold > 0.: * p = start_positive * partition_end = self.end # <<<<<<<<<<<<<< @@ -15117,7 +17370,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } /*else*/ { - /* "sklearn/tree/_tree.pyx":1900 + /* "sklearn/tree/_tree.pyx":2609 * else: * # Data are already split * return zero_pos # <<<<<<<<<<<<<< @@ -15129,7 +17382,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1902 + /* "sklearn/tree/_tree.pyx":2611 * return zero_pos * * while p < partition_end: # <<<<<<<<<<<<<< @@ -15140,7 +17393,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_3) break; - /* "sklearn/tree/_tree.pyx":1903 + /* "sklearn/tree/_tree.pyx":2612 * * while p < partition_end: * value = Xf[p] # <<<<<<<<<<<<<< @@ -15149,7 +17402,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ __pyx_v_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1905 + /* "sklearn/tree/_tree.pyx":2614 * value = Xf[p] * * if value <= threshold: # <<<<<<<<<<<<<< @@ -15159,7 +17412,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_value <= __pyx_v_threshold) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":1906 + /* "sklearn/tree/_tree.pyx":2615 * * if value <= threshold: * p += 1 # <<<<<<<<<<<<<< @@ -15171,7 +17424,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } /*else*/ { - /* "sklearn/tree/_tree.pyx":1909 + /* "sklearn/tree/_tree.pyx":2618 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -15180,7 +17433,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":1911 + /* "sklearn/tree/_tree.pyx":2620 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -15189,7 +17442,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ (__pyx_v_Xf[__pyx_v_p]) = (__pyx_v_Xf[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1912 + /* "sklearn/tree/_tree.pyx":2621 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = value # <<<<<<<<<<<<<< @@ -15198,7 +17451,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ (__pyx_v_Xf[__pyx_v_partition_end]) = __pyx_v_value; - /* "sklearn/tree/_tree.pyx":1913 + /* "sklearn/tree/_tree.pyx":2622 * Xf[p] = Xf[partition_end] * Xf[partition_end] = value * sparse_swap(index_to_samples, samples, p, partition_end) # <<<<<<<<<<<<<< @@ -15210,7 +17463,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_L6:; } - /* "sklearn/tree/_tree.pyx":1915 + /* "sklearn/tree/_tree.pyx":2624 * sparse_swap(index_to_samples, samples, p, partition_end) * * return partition_end # <<<<<<<<<<<<<< @@ -15220,7 +17473,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_r = __pyx_v_partition_end; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1879 + /* "sklearn/tree/_tree.pyx":2588 * index_to_samples[samples[p]] = p * * cdef inline SIZE_t _partition(self, double threshold, # <<<<<<<<<<<<<< @@ -15233,7 +17486,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1917 +/* "sklearn/tree/_tree.pyx":2626 * return partition_end * * cdef inline void extract_nnz(self, SIZE_t feature, # <<<<<<<<<<<<<< @@ -15248,7 +17501,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_samples; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1949 + /* "sklearn/tree/_tree.pyx":2658 * * """ * cdef SIZE_t indptr_start = self.X_indptr[feature], # <<<<<<<<<<<<<< @@ -15257,7 +17510,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_indptr_start = (__pyx_v_self->X_indptr[__pyx_v_feature]); - /* "sklearn/tree/_tree.pyx":1950 + /* "sklearn/tree/_tree.pyx":2659 * """ * cdef SIZE_t indptr_start = self.X_indptr[feature], * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] # <<<<<<<<<<<<<< @@ -15266,7 +17519,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_indptr_end = (__pyx_v_self->X_indptr[(__pyx_v_feature + 1)]); - /* "sklearn/tree/_tree.pyx":1951 + /* "sklearn/tree/_tree.pyx":2660 * cdef SIZE_t indptr_start = self.X_indptr[feature], * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] * cdef SIZE_t n_indices = (indptr_end - indptr_start) # <<<<<<<<<<<<<< @@ -15275,7 +17528,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_n_indices = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_indptr_end - __pyx_v_indptr_start)); - /* "sklearn/tree/_tree.pyx":1952 + /* "sklearn/tree/_tree.pyx":2661 * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] * cdef SIZE_t n_indices = (indptr_end - indptr_start) * cdef SIZE_t n_samples = self.end - self.start # <<<<<<<<<<<<<< @@ -15284,7 +17537,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_n_samples = (__pyx_v_self->__pyx_base.end - __pyx_v_self->__pyx_base.start); - /* "sklearn/tree/_tree.pyx":1960 + /* "sklearn/tree/_tree.pyx":2669 * # approach. * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): # <<<<<<<<<<<<<< @@ -15294,7 +17547,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext __pyx_t_1 = ((((((1 - (__pyx_v_is_samples_sorted[0])) * __pyx_v_n_samples) * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_n_samples)) + (__pyx_v_n_samples * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_n_indices))) < (__pyx_v_7sklearn_4tree_5_tree_EXTRACT_NNZ_SWITCH * __pyx_v_n_indices)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1961 + /* "sklearn/tree/_tree.pyx":2670 * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): * extract_nnz_binary_search(self.X_indices, self.X_data, # <<<<<<<<<<<<<< @@ -15306,7 +17559,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext } /*else*/ { - /* "sklearn/tree/_tree.pyx":1972 + /* "sklearn/tree/_tree.pyx":2681 * # index_to_samples is a mapping from X_indices to samples * else: * extract_nnz_index_to_samples(self.X_indices, self.X_data, # <<<<<<<<<<<<<< @@ -15317,7 +17570,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1917 + /* "sklearn/tree/_tree.pyx":2626 * return partition_end * * cdef inline void extract_nnz(self, SIZE_t feature, # <<<<<<<<<<<<<< @@ -15328,7 +17581,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1980 +/* "sklearn/tree/_tree.pyx":2689 * * * cdef int compare_SIZE_t(const void* a, const void* b) nogil: # <<<<<<<<<<<<<< @@ -15339,7 +17592,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext static int __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t(void const *__pyx_v_a, void const *__pyx_v_b) { int __pyx_r; - /* "sklearn/tree/_tree.pyx":1982 + /* "sklearn/tree/_tree.pyx":2691 * cdef int compare_SIZE_t(const void* a, const void* b) nogil: * """Comparison function for sort""" * return ((a)[0] - (b)[0]) # <<<<<<<<<<<<<< @@ -15349,7 +17602,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t(void const *__pyx_v_a, v __pyx_r = ((int)((((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_a)[0]) - (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_b)[0]))); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1980 + /* "sklearn/tree/_tree.pyx":2689 * * * cdef int compare_SIZE_t(const void* a, const void* b) nogil: # <<<<<<<<<<<<<< @@ -15362,7 +17615,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t(void const *__pyx_v_a, v return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1985 +/* "sklearn/tree/_tree.pyx":2694 * * * cdef inline void binary_search(INT32_t* sorted_array, # <<<<<<<<<<<<<< @@ -15374,7 +17627,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_7sklearn_4tree_5_tree_INT32_t __pyx_v_pivot; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1994 + /* "sklearn/tree/_tree.pyx":2703 * """ * cdef INT32_t pivot * index[0] = -1 # <<<<<<<<<<<<<< @@ -15383,7 +17636,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ (__pyx_v_index[0]) = -1; - /* "sklearn/tree/_tree.pyx":1995 + /* "sklearn/tree/_tree.pyx":2704 * cdef INT32_t pivot * index[0] = -1 * while start < end: # <<<<<<<<<<<<<< @@ -15394,7 +17647,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_1 = ((__pyx_v_start < __pyx_v_end) != 0); if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":1996 + /* "sklearn/tree/_tree.pyx":2705 * index[0] = -1 * while start < end: * pivot = start + (end - start) / 2 # <<<<<<<<<<<<<< @@ -15403,7 +17656,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ __pyx_v_pivot = (__pyx_v_start + ((__pyx_v_end - __pyx_v_start) / 2)); - /* "sklearn/tree/_tree.pyx":1998 + /* "sklearn/tree/_tree.pyx":2707 * pivot = start + (end - start) / 2 * * if sorted_array[pivot] == value: # <<<<<<<<<<<<<< @@ -15413,7 +17666,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_1 = (((__pyx_v_sorted_array[__pyx_v_pivot]) == __pyx_v_value) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1999 + /* "sklearn/tree/_tree.pyx":2708 * * if sorted_array[pivot] == value: * index[0] = pivot # <<<<<<<<<<<<<< @@ -15422,7 +17675,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ (__pyx_v_index[0]) = __pyx_v_pivot; - /* "sklearn/tree/_tree.pyx":2000 + /* "sklearn/tree/_tree.pyx":2709 * if sorted_array[pivot] == value: * index[0] = pivot * start = pivot + 1 # <<<<<<<<<<<<<< @@ -15431,7 +17684,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ __pyx_v_start = (__pyx_v_pivot + 1); - /* "sklearn/tree/_tree.pyx":2001 + /* "sklearn/tree/_tree.pyx":2710 * index[0] = pivot * start = pivot + 1 * break # <<<<<<<<<<<<<< @@ -15441,7 +17694,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":2003 + /* "sklearn/tree/_tree.pyx":2712 * break * * if sorted_array[pivot] < value: # <<<<<<<<<<<<<< @@ -15451,7 +17704,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_1 = (((__pyx_v_sorted_array[__pyx_v_pivot]) < __pyx_v_value) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2004 + /* "sklearn/tree/_tree.pyx":2713 * * if sorted_array[pivot] < value: * start = pivot + 1 # <<<<<<<<<<<<<< @@ -15463,7 +17716,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s } /*else*/ { - /* "sklearn/tree/_tree.pyx":2006 + /* "sklearn/tree/_tree.pyx":2715 * start = pivot + 1 * else: * end = pivot # <<<<<<<<<<<<<< @@ -15476,7 +17729,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":2007 + /* "sklearn/tree/_tree.pyx":2716 * else: * end = pivot * new_start[0] = start # <<<<<<<<<<<<<< @@ -15485,7 +17738,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ (__pyx_v_new_start[0]) = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1985 + /* "sklearn/tree/_tree.pyx":2694 * * * cdef inline void binary_search(INT32_t* sorted_array, # <<<<<<<<<<<<<< @@ -15496,7 +17749,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2010 +/* "sklearn/tree/_tree.pyx":2719 * * * cdef inline void extract_nnz_index_to_samples(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -15514,7 +17767,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam int __pyx_t_3; int __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2027 + /* "sklearn/tree/_tree.pyx":2736 * cdef INT32_t k * cdef SIZE_t index * cdef SIZE_t end_negative_ = start # <<<<<<<<<<<<<< @@ -15523,7 +17776,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_end_negative_ = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2028 + /* "sklearn/tree/_tree.pyx":2737 * cdef SIZE_t index * cdef SIZE_t end_negative_ = start * cdef SIZE_t start_positive_ = end # <<<<<<<<<<<<<< @@ -15532,7 +17785,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_start_positive_ = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2030 + /* "sklearn/tree/_tree.pyx":2739 * cdef SIZE_t start_positive_ = end * * for k in range(indptr_start, indptr_end): # <<<<<<<<<<<<<< @@ -15543,7 +17796,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam for (__pyx_t_2 = __pyx_v_indptr_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_k = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2031 + /* "sklearn/tree/_tree.pyx":2740 * * for k in range(indptr_start, indptr_end): * if start <= index_to_samples[X_indices[k]] < end: # <<<<<<<<<<<<<< @@ -15557,7 +17810,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2032 + /* "sklearn/tree/_tree.pyx":2741 * for k in range(indptr_start, indptr_end): * if start <= index_to_samples[X_indices[k]] < end: * if X_data[k] > 0: # <<<<<<<<<<<<<< @@ -15567,7 +17820,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_t_4 = (((__pyx_v_X_data[__pyx_v_k]) > 0.0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2033 + /* "sklearn/tree/_tree.pyx":2742 * if start <= index_to_samples[X_indices[k]] < end: * if X_data[k] > 0: * start_positive_ -= 1 # <<<<<<<<<<<<<< @@ -15576,7 +17829,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_start_positive_ = (__pyx_v_start_positive_ - 1); - /* "sklearn/tree/_tree.pyx":2034 + /* "sklearn/tree/_tree.pyx":2743 * if X_data[k] > 0: * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] # <<<<<<<<<<<<<< @@ -15585,7 +17838,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_Xf[__pyx_v_start_positive_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2035 + /* "sklearn/tree/_tree.pyx":2744 * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15594,7 +17847,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2036 + /* "sklearn/tree/_tree.pyx":2745 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, start_positive_) # <<<<<<<<<<<<<< @@ -15605,7 +17858,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam goto __pyx_L6; } - /* "sklearn/tree/_tree.pyx":2039 + /* "sklearn/tree/_tree.pyx":2748 * * * elif X_data[k] < 0: # <<<<<<<<<<<<<< @@ -15615,7 +17868,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_t_4 = (((__pyx_v_X_data[__pyx_v_k]) < 0.0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2040 + /* "sklearn/tree/_tree.pyx":2749 * * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] # <<<<<<<<<<<<<< @@ -15624,7 +17877,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_Xf[__pyx_v_end_negative_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2041 + /* "sklearn/tree/_tree.pyx":2750 * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15633,7 +17886,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2042 + /* "sklearn/tree/_tree.pyx":2751 * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) # <<<<<<<<<<<<<< @@ -15642,7 +17895,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_v_index_to_samples, __pyx_v_samples, __pyx_v_index, __pyx_v_end_negative_); - /* "sklearn/tree/_tree.pyx":2043 + /* "sklearn/tree/_tree.pyx":2752 * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 # <<<<<<<<<<<<<< @@ -15658,7 +17911,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":2046 + /* "sklearn/tree/_tree.pyx":2755 * * # Returned values * end_negative[0] = end_negative_ # <<<<<<<<<<<<<< @@ -15667,7 +17920,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_end_negative[0]) = __pyx_v_end_negative_; - /* "sklearn/tree/_tree.pyx":2047 + /* "sklearn/tree/_tree.pyx":2756 * # Returned values * end_negative[0] = end_negative_ * start_positive[0] = start_positive_ # <<<<<<<<<<<<<< @@ -15676,7 +17929,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_start_positive[0]) = __pyx_v_start_positive_; - /* "sklearn/tree/_tree.pyx":2010 + /* "sklearn/tree/_tree.pyx":2719 * * * cdef inline void extract_nnz_index_to_samples(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -15687,7 +17940,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2050 +/* "sklearn/tree/_tree.pyx":2759 * * * cdef inline void extract_nnz_binary_search(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -15705,7 +17958,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc int __pyx_t_1; int __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2073 + /* "sklearn/tree/_tree.pyx":2782 * cdef SIZE_t n_samples * * if not is_samples_sorted[0]: # <<<<<<<<<<<<<< @@ -15715,7 +17968,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = ((!((__pyx_v_is_samples_sorted[0]) != 0)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2074 + /* "sklearn/tree/_tree.pyx":2783 * * if not is_samples_sorted[0]: * n_samples = end - start # <<<<<<<<<<<<<< @@ -15724,7 +17977,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_n_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":2075 + /* "sklearn/tree/_tree.pyx":2784 * if not is_samples_sorted[0]: * n_samples = end - start * memcpy(sorted_samples + start, samples + start, # <<<<<<<<<<<<<< @@ -15733,7 +17986,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ memcpy((__pyx_v_sorted_samples + __pyx_v_start), (__pyx_v_samples + __pyx_v_start), (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); - /* "sklearn/tree/_tree.pyx":2077 + /* "sklearn/tree/_tree.pyx":2786 * memcpy(sorted_samples + start, samples + start, * n_samples * sizeof(SIZE_t)) * qsort(sorted_samples + start, n_samples, sizeof(SIZE_t), # <<<<<<<<<<<<<< @@ -15742,7 +17995,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ qsort((__pyx_v_sorted_samples + __pyx_v_start), __pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)), __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t); - /* "sklearn/tree/_tree.pyx":2079 + /* "sklearn/tree/_tree.pyx":2788 * qsort(sorted_samples + start, n_samples, sizeof(SIZE_t), * compare_SIZE_t) * is_samples_sorted[0] = 1 # <<<<<<<<<<<<<< @@ -15754,7 +18007,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2081 + /* "sklearn/tree/_tree.pyx":2790 * is_samples_sorted[0] = 1 * * while (indptr_start < indptr_end and # <<<<<<<<<<<<<< @@ -15769,7 +18022,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L6_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2082 + /* "sklearn/tree/_tree.pyx":2791 * * while (indptr_start < indptr_end and * sorted_samples[start] > X_indices[indptr_start]): # <<<<<<<<<<<<<< @@ -15781,7 +18034,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_L6_bool_binop_done:; if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2083 + /* "sklearn/tree/_tree.pyx":2792 * while (indptr_start < indptr_end and * sorted_samples[start] > X_indices[indptr_start]): * indptr_start += 1 # <<<<<<<<<<<<<< @@ -15791,7 +18044,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_v_indptr_start = (__pyx_v_indptr_start + 1); } - /* "sklearn/tree/_tree.pyx":2085 + /* "sklearn/tree/_tree.pyx":2794 * indptr_start += 1 * * while (indptr_start < indptr_end and # <<<<<<<<<<<<<< @@ -15806,7 +18059,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L10_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2086 + /* "sklearn/tree/_tree.pyx":2795 * * while (indptr_start < indptr_end and * sorted_samples[end - 1] < X_indices[indptr_end - 1]): # <<<<<<<<<<<<<< @@ -15818,7 +18071,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_L10_bool_binop_done:; if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2087 + /* "sklearn/tree/_tree.pyx":2796 * while (indptr_start < indptr_end and * sorted_samples[end - 1] < X_indices[indptr_end - 1]): * indptr_end -= 1 # <<<<<<<<<<<<<< @@ -15828,7 +18081,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_v_indptr_end = (__pyx_v_indptr_end - 1); } - /* "sklearn/tree/_tree.pyx":2089 + /* "sklearn/tree/_tree.pyx":2798 * indptr_end -= 1 * * cdef SIZE_t p = start # <<<<<<<<<<<<<< @@ -15837,7 +18090,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2092 + /* "sklearn/tree/_tree.pyx":2801 * cdef SIZE_t index * cdef SIZE_t k * cdef SIZE_t end_negative_ = start # <<<<<<<<<<<<<< @@ -15846,7 +18099,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_end_negative_ = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2093 + /* "sklearn/tree/_tree.pyx":2802 * cdef SIZE_t k * cdef SIZE_t end_negative_ = start * cdef SIZE_t start_positive_ = end # <<<<<<<<<<<<<< @@ -15855,7 +18108,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_start_positive_ = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2095 + /* "sklearn/tree/_tree.pyx":2804 * cdef SIZE_t start_positive_ = end * * while (p < end and indptr_start < indptr_end): # <<<<<<<<<<<<<< @@ -15874,7 +18127,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_L14_bool_binop_done:; if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2097 + /* "sklearn/tree/_tree.pyx":2806 * while (p < end and indptr_start < indptr_end): * # Find index of sorted_samples[p] in X_indices * binary_search(X_indices, indptr_start, indptr_end, # <<<<<<<<<<<<<< @@ -15883,7 +18136,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_v_X_indices, __pyx_v_indptr_start, __pyx_v_indptr_end, (__pyx_v_sorted_samples[__pyx_v_p]), (&__pyx_v_k), (&__pyx_v_indptr_start)); - /* "sklearn/tree/_tree.pyx":2100 + /* "sklearn/tree/_tree.pyx":2809 * sorted_samples[p], &k, &indptr_start) * * if k != -1: # <<<<<<<<<<<<<< @@ -15893,7 +18146,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = ((__pyx_v_k != -1) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2103 + /* "sklearn/tree/_tree.pyx":2812 * # If k != -1, we have found a non zero value * * if X_data[k] > 0: # <<<<<<<<<<<<<< @@ -15903,7 +18156,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = (((__pyx_v_X_data[__pyx_v_k]) > 0.0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2104 + /* "sklearn/tree/_tree.pyx":2813 * * if X_data[k] > 0: * start_positive_ -= 1 # <<<<<<<<<<<<<< @@ -15912,7 +18165,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_start_positive_ = (__pyx_v_start_positive_ - 1); - /* "sklearn/tree/_tree.pyx":2105 + /* "sklearn/tree/_tree.pyx":2814 * if X_data[k] > 0: * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] # <<<<<<<<<<<<<< @@ -15921,7 +18174,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_Xf[__pyx_v_start_positive_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2106 + /* "sklearn/tree/_tree.pyx":2815 * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15930,7 +18183,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2107 + /* "sklearn/tree/_tree.pyx":2816 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, start_positive_) # <<<<<<<<<<<<<< @@ -15941,7 +18194,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L17; } - /* "sklearn/tree/_tree.pyx":2110 + /* "sklearn/tree/_tree.pyx":2819 * * * elif X_data[k] < 0: # <<<<<<<<<<<<<< @@ -15951,7 +18204,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = (((__pyx_v_X_data[__pyx_v_k]) < 0.0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2111 + /* "sklearn/tree/_tree.pyx":2820 * * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] # <<<<<<<<<<<<<< @@ -15960,7 +18213,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_Xf[__pyx_v_end_negative_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2112 + /* "sklearn/tree/_tree.pyx":2821 * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15969,7 +18222,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2113 + /* "sklearn/tree/_tree.pyx":2822 * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) # <<<<<<<<<<<<<< @@ -15978,7 +18231,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_v_index_to_samples, __pyx_v_samples, __pyx_v_index, __pyx_v_end_negative_); - /* "sklearn/tree/_tree.pyx":2114 + /* "sklearn/tree/_tree.pyx":2823 * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 # <<<<<<<<<<<<<< @@ -15993,7 +18246,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":2115 + /* "sklearn/tree/_tree.pyx":2824 * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 * p += 1 # <<<<<<<<<<<<<< @@ -16003,7 +18256,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":2118 + /* "sklearn/tree/_tree.pyx":2827 * * # Returned values * end_negative[0] = end_negative_ # <<<<<<<<<<<<<< @@ -16012,7 +18265,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_end_negative[0]) = __pyx_v_end_negative_; - /* "sklearn/tree/_tree.pyx":2119 + /* "sklearn/tree/_tree.pyx":2828 * # Returned values * end_negative[0] = end_negative_ * start_positive[0] = start_positive_ # <<<<<<<<<<<<<< @@ -16021,7 +18274,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_start_positive[0]) = __pyx_v_start_positive_; - /* "sklearn/tree/_tree.pyx":2050 + /* "sklearn/tree/_tree.pyx":2759 * * * cdef inline void extract_nnz_binary_search(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -16032,7 +18285,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2122 +/* "sklearn/tree/_tree.pyx":2831 * * * cdef inline void sparse_swap(SIZE_t* index_to_samples, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -16044,7 +18297,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2125 + /* "sklearn/tree/_tree.pyx":2834 * SIZE_t pos_1, SIZE_t pos_2) nogil : * """Swap sample pos_1 and pos_2 preserving sparse invariant""" * samples[pos_1], samples[pos_2] = samples[pos_2], samples[pos_1] # <<<<<<<<<<<<<< @@ -16056,7 +18309,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl (__pyx_v_samples[__pyx_v_pos_1]) = __pyx_t_1; (__pyx_v_samples[__pyx_v_pos_2]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2126 + /* "sklearn/tree/_tree.pyx":2835 * """Swap sample pos_1 and pos_2 preserving sparse invariant""" * samples[pos_1], samples[pos_2] = samples[pos_2], samples[pos_1] * index_to_samples[samples[pos_1]] = pos_1 # <<<<<<<<<<<<<< @@ -16065,7 +18318,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl */ (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_pos_1])]) = __pyx_v_pos_1; - /* "sklearn/tree/_tree.pyx":2127 + /* "sklearn/tree/_tree.pyx":2836 * samples[pos_1], samples[pos_2] = samples[pos_2], samples[pos_1] * index_to_samples[samples[pos_1]] = pos_1 * index_to_samples[samples[pos_2]] = pos_2 # <<<<<<<<<<<<<< @@ -16074,7 +18327,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl */ (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_pos_2])]) = __pyx_v_pos_2; - /* "sklearn/tree/_tree.pyx":2122 + /* "sklearn/tree/_tree.pyx":2831 * * * cdef inline void sparse_swap(SIZE_t* index_to_samples, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -16085,7 +18338,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2133 +/* "sklearn/tree/_tree.pyx":2842 * """Splitter for finding the best split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -16118,7 +18371,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":2134 + /* "sklearn/tree/_tree.pyx":2843 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -16127,44 +18380,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":2135 + /* "sklearn/tree/_tree.pyx":2844 * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2136 + /* "sklearn/tree/_tree.pyx":2845 * return (BestSparseSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2137 + /* "sklearn/tree/_tree.pyx":2846 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2134 + /* "sklearn/tree/_tree.pyx":2843 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -16182,14 +18435,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2138 + /* "sklearn/tree/_tree.pyx":2847 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -16202,22 +18455,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2134 + /* "sklearn/tree/_tree.pyx":2843 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter))); @@ -16232,7 +18485,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2133 + /* "sklearn/tree/_tree.pyx":2842 * """Splitter for finding the best split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -16254,7 +18507,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2140 +/* "sklearn/tree/_tree.pyx":2849 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -16304,7 +18557,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct int __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2146 + /* "sklearn/tree/_tree.pyx":2855 * """ * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -16314,7 +18567,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2147 + /* "sklearn/tree/_tree.pyx":2856 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -16324,7 +18577,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2148 + /* "sklearn/tree/_tree.pyx":2857 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -16334,7 +18587,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2150 + /* "sklearn/tree/_tree.pyx":2859 * cdef SIZE_t end = self.end * * cdef INT32_t* X_indices = self.X_indices # <<<<<<<<<<<<<< @@ -16344,7 +18597,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_3 = __pyx_v_self->__pyx_base.X_indices; __pyx_v_X_indices = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2151 + /* "sklearn/tree/_tree.pyx":2860 * * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr # <<<<<<<<<<<<<< @@ -16354,7 +18607,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_3 = __pyx_v_self->__pyx_base.X_indptr; __pyx_v_X_indptr = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2152 + /* "sklearn/tree/_tree.pyx":2861 * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr * cdef DTYPE_t* X_data = self.X_data # <<<<<<<<<<<<<< @@ -16364,7 +18617,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_4 = __pyx_v_self->__pyx_base.X_data; __pyx_v_X_data = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2154 + /* "sklearn/tree/_tree.pyx":2863 * cdef DTYPE_t* X_data = self.X_data * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -16374,7 +18627,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2155 + /* "sklearn/tree/_tree.pyx":2864 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -16384,7 +18637,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2156 + /* "sklearn/tree/_tree.pyx":2865 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -16394,7 +18647,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2158 + /* "sklearn/tree/_tree.pyx":2867 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -16404,7 +18657,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2159 + /* "sklearn/tree/_tree.pyx":2868 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples # <<<<<<<<<<<<<< @@ -16414,7 +18667,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.sorted_samples; __pyx_v_sorted_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2160 + /* "sklearn/tree/_tree.pyx":2869 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -16424,7 +18677,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.index_to_samples; __pyx_v_index_to_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2161 + /* "sklearn/tree/_tree.pyx":2870 * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -16434,7 +18687,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2162 + /* "sklearn/tree/_tree.pyx":2871 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -16444,7 +18697,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2163 + /* "sklearn/tree/_tree.pyx":2872 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -16454,7 +18707,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2164 + /* "sklearn/tree/_tree.pyx":2873 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -16463,7 +18716,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":2167 + /* "sklearn/tree/_tree.pyx":2876 * * cdef SplitRecord best, current * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -16472,7 +18725,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":2169 + /* "sklearn/tree/_tree.pyx":2878 * _init_split(&best, end) * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -16481,7 +18734,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":2171 + /* "sklearn/tree/_tree.pyx":2880 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -16490,7 +18743,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":2173 + /* "sklearn/tree/_tree.pyx":2882 * cdef SIZE_t n_visited_features = 0 * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -16499,7 +18752,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":2175 + /* "sklearn/tree/_tree.pyx":2884 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -16508,7 +18761,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":2176 + /* "sklearn/tree/_tree.pyx":2885 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -16517,7 +18770,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":2178 + /* "sklearn/tree/_tree.pyx":2887 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -16526,7 +18779,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":2183 + /* "sklearn/tree/_tree.pyx":2892 * cdef SIZE_t p_next * cdef SIZE_t p_prev * cdef bint is_samples_sorted = 0 # indicate is sorted_samples is # <<<<<<<<<<<<<< @@ -16535,7 +18788,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_is_samples_sorted = 0; - /* "sklearn/tree/_tree.pyx":2200 + /* "sklearn/tree/_tree.pyx":2909 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -16550,7 +18803,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2202 + /* "sklearn/tree/_tree.pyx":2911 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -16564,7 +18817,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2204 + /* "sklearn/tree/_tree.pyx":2913 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -16576,7 +18829,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L5_bool_binop_done:; if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2206 + /* "sklearn/tree/_tree.pyx":2915 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -16585,7 +18838,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":2220 + /* "sklearn/tree/_tree.pyx":2929 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -16594,7 +18847,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":2223 + /* "sklearn/tree/_tree.pyx":2932 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -16604,7 +18857,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2225 + /* "sklearn/tree/_tree.pyx":2934 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -16613,7 +18866,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2226 + /* "sklearn/tree/_tree.pyx":2935 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -16622,7 +18875,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":2227 + /* "sklearn/tree/_tree.pyx":2936 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -16631,7 +18884,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":2229 + /* "sklearn/tree/_tree.pyx":2938 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -16643,7 +18896,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2233 + /* "sklearn/tree/_tree.pyx":2942 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -16652,7 +18905,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":2236 + /* "sklearn/tree/_tree.pyx":2945 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -16661,7 +18914,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2237 + /* "sklearn/tree/_tree.pyx":2946 * * current.feature = features[f_j] * self.extract_nnz(current.feature, # <<<<<<<<<<<<<< @@ -16670,7 +18923,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_current.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":2242 + /* "sklearn/tree/_tree.pyx":2951 * * # Sort the positive and negative parts of `Xf` * sort(Xf + start, samples + start, end_negative - start) # <<<<<<<<<<<<<< @@ -16679,7 +18932,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_sort((__pyx_v_Xf + __pyx_v_start), (__pyx_v_samples + __pyx_v_start), (__pyx_v_end_negative - __pyx_v_start)); - /* "sklearn/tree/_tree.pyx":2243 + /* "sklearn/tree/_tree.pyx":2952 * # Sort the positive and negative parts of `Xf` * sort(Xf + start, samples + start, end_negative - start) * sort(Xf + start_positive, samples + start_positive, # <<<<<<<<<<<<<< @@ -16688,7 +18941,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_sort((__pyx_v_Xf + __pyx_v_start_positive), (__pyx_v_samples + __pyx_v_start_positive), (__pyx_v_end - __pyx_v_start_positive)); - /* "sklearn/tree/_tree.pyx":2247 + /* "sklearn/tree/_tree.pyx":2956 * * # Update index_to_samples to take into account the sort * for p in range(start, end_negative): # <<<<<<<<<<<<<< @@ -16699,7 +18952,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2248 + /* "sklearn/tree/_tree.pyx":2957 * # Update index_to_samples to take into account the sort * for p in range(start, end_negative): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -16709,7 +18962,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_p])]) = __pyx_v_p; } - /* "sklearn/tree/_tree.pyx":2249 + /* "sklearn/tree/_tree.pyx":2958 * for p in range(start, end_negative): * index_to_samples[samples[p]] = p * for p in range(start_positive, end): # <<<<<<<<<<<<<< @@ -16720,7 +18973,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct for (__pyx_t_8 = __pyx_v_start_positive; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2250 + /* "sklearn/tree/_tree.pyx":2959 * index_to_samples[samples[p]] = p * for p in range(start_positive, end): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -16730,7 +18983,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_p])]) = __pyx_v_p; } - /* "sklearn/tree/_tree.pyx":2253 + /* "sklearn/tree/_tree.pyx":2962 * * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: # <<<<<<<<<<<<<< @@ -16740,7 +18993,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_end_negative < __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2254 + /* "sklearn/tree/_tree.pyx":2963 * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: * start_positive -= 1 # <<<<<<<<<<<<<< @@ -16749,7 +19002,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_start_positive = (__pyx_v_start_positive - 1); - /* "sklearn/tree/_tree.pyx":2255 + /* "sklearn/tree/_tree.pyx":2964 * if end_negative < start_positive: * start_positive -= 1 * Xf[start_positive] = 0. # <<<<<<<<<<<<<< @@ -16758,7 +19011,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_Xf[__pyx_v_start_positive]) = 0.; - /* "sklearn/tree/_tree.pyx":2257 + /* "sklearn/tree/_tree.pyx":2966 * Xf[start_positive] = 0. * * if end_negative != start_positive: # <<<<<<<<<<<<<< @@ -16768,7 +19021,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_end_negative != __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2258 + /* "sklearn/tree/_tree.pyx":2967 * * if end_negative != start_positive: * Xf[end_negative] = 0. # <<<<<<<<<<<<<< @@ -16777,7 +19030,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_Xf[__pyx_v_end_negative]) = 0.; - /* "sklearn/tree/_tree.pyx":2259 + /* "sklearn/tree/_tree.pyx":2968 * if end_negative != start_positive: * Xf[end_negative] = 0. * end_negative += 1 # <<<<<<<<<<<<<< @@ -16792,7 +19045,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":2261 + /* "sklearn/tree/_tree.pyx":2970 * end_negative += 1 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -16802,7 +19055,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_Xf[(__pyx_v_end - 1)]) <= ((__pyx_v_Xf[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2262 + /* "sklearn/tree/_tree.pyx":2971 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -16811,7 +19064,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":2263 + /* "sklearn/tree/_tree.pyx":2972 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -16821,7 +19074,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2265 + /* "sklearn/tree/_tree.pyx":2974 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -16830,7 +19083,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":2266 + /* "sklearn/tree/_tree.pyx":2975 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -16842,7 +19095,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2269 + /* "sklearn/tree/_tree.pyx":2978 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -16851,7 +19104,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":2270 + /* "sklearn/tree/_tree.pyx":2979 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -16863,7 +19116,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2273 + /* "sklearn/tree/_tree.pyx":2982 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -16872,7 +19125,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":2274 + /* "sklearn/tree/_tree.pyx":2983 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -16881,7 +19134,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2276 + /* "sklearn/tree/_tree.pyx":2985 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -16892,7 +19145,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2277 + /* "sklearn/tree/_tree.pyx":2986 * * while p < end: * if p + 1 != end_negative: # <<<<<<<<<<<<<< @@ -16902,7 +19155,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_p + 1) != __pyx_v_end_negative) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2278 + /* "sklearn/tree/_tree.pyx":2987 * while p < end: * if p + 1 != end_negative: * p_next = p + 1 # <<<<<<<<<<<<<< @@ -16914,7 +19167,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2280 + /* "sklearn/tree/_tree.pyx":2989 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< @@ -16925,7 +19178,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":2282 + /* "sklearn/tree/_tree.pyx":2991 * p_next = start_positive * * while (p_next < end and # <<<<<<<<<<<<<< @@ -16940,7 +19193,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L21_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2283 + /* "sklearn/tree/_tree.pyx":2992 * * while (p_next < end and * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -16952,7 +19205,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L21_bool_binop_done:; if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2284 + /* "sklearn/tree/_tree.pyx":2993 * while (p_next < end and * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): * p = p_next # <<<<<<<<<<<<<< @@ -16961,7 +19214,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_p_next; - /* "sklearn/tree/_tree.pyx":2285 + /* "sklearn/tree/_tree.pyx":2994 * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): * p = p_next * if p + 1 != end_negative: # <<<<<<<<<<<<<< @@ -16971,7 +19224,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_p + 1) != __pyx_v_end_negative) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2286 + /* "sklearn/tree/_tree.pyx":2995 * p = p_next * if p + 1 != end_negative: * p_next = p + 1 # <<<<<<<<<<<<<< @@ -16983,7 +19236,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2288 + /* "sklearn/tree/_tree.pyx":2997 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< @@ -16995,7 +19248,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L23:; } - /* "sklearn/tree/_tree.pyx":2293 + /* "sklearn/tree/_tree.pyx":3002 * # (p_next >= end) or (X[samples[p_next], current.feature] > * # X[samples[p], current.feature]) * p_prev = p # <<<<<<<<<<<<<< @@ -17004,7 +19257,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p_prev = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":2294 + /* "sklearn/tree/_tree.pyx":3003 * # X[samples[p], current.feature]) * p_prev = p * p = p_next # <<<<<<<<<<<<<< @@ -17013,7 +19266,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_p_next; - /* "sklearn/tree/_tree.pyx":2299 + /* "sklearn/tree/_tree.pyx":3008 * * * if p < end: # <<<<<<<<<<<<<< @@ -17023,7 +19276,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2300 + /* "sklearn/tree/_tree.pyx":3009 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -17032,7 +19285,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":2303 + /* "sklearn/tree/_tree.pyx":3012 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -17046,7 +19299,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L26_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2304 + /* "sklearn/tree/_tree.pyx":3013 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -17058,7 +19311,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L26_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2305 + /* "sklearn/tree/_tree.pyx":3014 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -17068,7 +19321,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L16_continue; } - /* "sklearn/tree/_tree.pyx":2307 + /* "sklearn/tree/_tree.pyx":3016 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -17077,7 +19330,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":2310 + /* "sklearn/tree/_tree.pyx":3019 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -17091,7 +19344,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L29_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2311 + /* "sklearn/tree/_tree.pyx":3020 * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< @@ -17103,7 +19356,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L29_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2312 + /* "sklearn/tree/_tree.pyx":3021 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -17113,7 +19366,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L16_continue; } - /* "sklearn/tree/_tree.pyx":2314 + /* "sklearn/tree/_tree.pyx":3023 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -17122,7 +19375,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":2315 + /* "sklearn/tree/_tree.pyx":3024 * * current.improvement = self.criterion.impurity_improvement(impurity) * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -17132,7 +19385,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2316 + /* "sklearn/tree/_tree.pyx":3025 * current.improvement = self.criterion.impurity_improvement(impurity) * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -17141,7 +19394,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":2319 + /* "sklearn/tree/_tree.pyx":3028 * ¤t.impurity_right) * * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< @@ -17150,7 +19403,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.threshold = (((__pyx_v_Xf[__pyx_v_p_prev]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); - /* "sklearn/tree/_tree.pyx":2320 + /* "sklearn/tree/_tree.pyx":3029 * * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -17160,7 +19413,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2321 + /* "sklearn/tree/_tree.pyx":3030 * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: * current.threshold = Xf[p_prev] # <<<<<<<<<<<<<< @@ -17172,7 +19425,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L32:; - /* "sklearn/tree/_tree.pyx":2323 + /* "sklearn/tree/_tree.pyx":3032 * current.threshold = Xf[p_prev] * * best = current # <<<<<<<<<<<<<< @@ -17194,7 +19447,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":2326 + /* "sklearn/tree/_tree.pyx":3035 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -17204,7 +19457,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2327 + /* "sklearn/tree/_tree.pyx":3036 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * self.extract_nnz(best.feature, &end_negative, &start_positive, # <<<<<<<<<<<<<< @@ -17213,7 +19466,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":2330 + /* "sklearn/tree/_tree.pyx":3039 * &is_samples_sorted) * * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< @@ -17225,7 +19478,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L33:; - /* "sklearn/tree/_tree.pyx":2336 + /* "sklearn/tree/_tree.pyx":3045 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -17234,7 +19487,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":2339 + /* "sklearn/tree/_tree.pyx":3048 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -17243,7 +19496,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":2344 + /* "sklearn/tree/_tree.pyx":3053 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -17252,7 +19505,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":2345 + /* "sklearn/tree/_tree.pyx":3054 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -17261,7 +19514,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":2140 + /* "sklearn/tree/_tree.pyx":2849 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -17272,7 +19525,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2351 +/* "sklearn/tree/_tree.pyx":3060 * """Splitter for finding a random split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -17305,7 +19558,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":2352 + /* "sklearn/tree/_tree.pyx":3061 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -17314,44 +19567,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":2353 + /* "sklearn/tree/_tree.pyx":3062 * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2354 + /* "sklearn/tree/_tree.pyx":3063 * return (RandomSparseSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2355 + /* "sklearn/tree/_tree.pyx":3064 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2352 + /* "sklearn/tree/_tree.pyx":3061 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -17369,14 +19622,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2356 + /* "sklearn/tree/_tree.pyx":3065 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -17389,22 +19642,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2352 + /* "sklearn/tree/_tree.pyx":3061 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter))); @@ -17419,7 +19672,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2351 + /* "sklearn/tree/_tree.pyx":3060 * """Splitter for finding a random split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -17441,7 +19694,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2358 +/* "sklearn/tree/_tree.pyx":3067 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -17492,7 +19745,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru int __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2364 + /* "sklearn/tree/_tree.pyx":3073 * """ * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -17502,7 +19755,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2365 + /* "sklearn/tree/_tree.pyx":3074 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -17512,7 +19765,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2366 + /* "sklearn/tree/_tree.pyx":3075 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -17522,7 +19775,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2368 + /* "sklearn/tree/_tree.pyx":3077 * cdef SIZE_t end = self.end * * cdef INT32_t* X_indices = self.X_indices # <<<<<<<<<<<<<< @@ -17532,7 +19785,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_3 = __pyx_v_self->__pyx_base.X_indices; __pyx_v_X_indices = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2369 + /* "sklearn/tree/_tree.pyx":3078 * * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr # <<<<<<<<<<<<<< @@ -17542,7 +19795,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_3 = __pyx_v_self->__pyx_base.X_indptr; __pyx_v_X_indptr = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2370 + /* "sklearn/tree/_tree.pyx":3079 * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr * cdef DTYPE_t* X_data = self.X_data # <<<<<<<<<<<<<< @@ -17552,7 +19805,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_4 = __pyx_v_self->__pyx_base.X_data; __pyx_v_X_data = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2372 + /* "sklearn/tree/_tree.pyx":3081 * cdef DTYPE_t* X_data = self.X_data * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -17562,7 +19815,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2373 + /* "sklearn/tree/_tree.pyx":3082 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -17572,7 +19825,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2374 + /* "sklearn/tree/_tree.pyx":3083 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -17582,7 +19835,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2376 + /* "sklearn/tree/_tree.pyx":3085 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -17592,7 +19845,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2377 + /* "sklearn/tree/_tree.pyx":3086 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples # <<<<<<<<<<<<<< @@ -17602,7 +19855,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.sorted_samples; __pyx_v_sorted_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2378 + /* "sklearn/tree/_tree.pyx":3087 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -17612,7 +19865,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.index_to_samples; __pyx_v_index_to_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2379 + /* "sklearn/tree/_tree.pyx":3088 * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -17622,7 +19875,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2380 + /* "sklearn/tree/_tree.pyx":3089 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -17632,7 +19885,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2381 + /* "sklearn/tree/_tree.pyx":3090 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -17642,7 +19895,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2382 + /* "sklearn/tree/_tree.pyx":3091 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -17651,7 +19904,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":2385 + /* "sklearn/tree/_tree.pyx":3094 * * cdef SplitRecord best, current * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -17660,7 +19913,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":2389 + /* "sklearn/tree/_tree.pyx":3098 * cdef DTYPE_t current_feature_value * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -17669,7 +19922,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":2391 + /* "sklearn/tree/_tree.pyx":3100 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -17678,7 +19931,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":2393 + /* "sklearn/tree/_tree.pyx":3102 * cdef SIZE_t n_visited_features = 0 * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -17687,7 +19940,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":2395 + /* "sklearn/tree/_tree.pyx":3104 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -17696,7 +19949,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":2396 + /* "sklearn/tree/_tree.pyx":3105 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -17705,7 +19958,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":2398 + /* "sklearn/tree/_tree.pyx":3107 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -17714,7 +19967,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":2404 + /* "sklearn/tree/_tree.pyx":3113 * cdef DTYPE_t max_feature_value * * cdef bint is_samples_sorted = 0 # indicate that sorted_samples is # <<<<<<<<<<<<<< @@ -17723,7 +19976,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_is_samples_sorted = 0; - /* "sklearn/tree/_tree.pyx":2421 + /* "sklearn/tree/_tree.pyx":3130 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -17738,7 +19991,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2423 + /* "sklearn/tree/_tree.pyx":3132 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -17752,7 +20005,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2425 + /* "sklearn/tree/_tree.pyx":3134 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -17764,7 +20017,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L5_bool_binop_done:; if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2427 + /* "sklearn/tree/_tree.pyx":3136 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -17773,7 +20026,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":2441 + /* "sklearn/tree/_tree.pyx":3150 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -17782,7 +20035,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":2444 + /* "sklearn/tree/_tree.pyx":3153 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -17792,7 +20045,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2446 + /* "sklearn/tree/_tree.pyx":3155 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -17801,7 +20054,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2447 + /* "sklearn/tree/_tree.pyx":3156 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -17810,7 +20063,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":2448 + /* "sklearn/tree/_tree.pyx":3157 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -17819,7 +20072,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":2450 + /* "sklearn/tree/_tree.pyx":3159 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -17831,7 +20084,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2454 + /* "sklearn/tree/_tree.pyx":3163 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -17840,7 +20093,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":2457 + /* "sklearn/tree/_tree.pyx":3166 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -17849,7 +20102,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2459 + /* "sklearn/tree/_tree.pyx":3168 * current.feature = features[f_j] * * self.extract_nnz(current.feature, # <<<<<<<<<<<<<< @@ -17858,7 +20111,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_current.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":2464 + /* "sklearn/tree/_tree.pyx":3173 * * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: # <<<<<<<<<<<<<< @@ -17868,7 +20121,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_end_negative < __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2465 + /* "sklearn/tree/_tree.pyx":3174 * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: * start_positive -= 1 # <<<<<<<<<<<<<< @@ -17877,7 +20130,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_start_positive = (__pyx_v_start_positive - 1); - /* "sklearn/tree/_tree.pyx":2466 + /* "sklearn/tree/_tree.pyx":3175 * if end_negative < start_positive: * start_positive -= 1 * Xf[start_positive] = 0. # <<<<<<<<<<<<<< @@ -17886,7 +20139,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_Xf[__pyx_v_start_positive]) = 0.; - /* "sklearn/tree/_tree.pyx":2468 + /* "sklearn/tree/_tree.pyx":3177 * Xf[start_positive] = 0. * * if end_negative != start_positive: # <<<<<<<<<<<<<< @@ -17896,7 +20149,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_end_negative != __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2469 + /* "sklearn/tree/_tree.pyx":3178 * * if end_negative != start_positive: * Xf[end_negative] = 0. # <<<<<<<<<<<<<< @@ -17905,7 +20158,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_Xf[__pyx_v_end_negative]) = 0.; - /* "sklearn/tree/_tree.pyx":2470 + /* "sklearn/tree/_tree.pyx":3179 * if end_negative != start_positive: * Xf[end_negative] = 0. * end_negative += 1 # <<<<<<<<<<<<<< @@ -17920,7 +20173,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":2473 + /* "sklearn/tree/_tree.pyx":3182 * * # Find min, max in Xf[start:end_negative] * min_feature_value = Xf[start] # <<<<<<<<<<<<<< @@ -17929,7 +20182,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_min_feature_value = (__pyx_v_Xf[__pyx_v_start]); - /* "sklearn/tree/_tree.pyx":2474 + /* "sklearn/tree/_tree.pyx":3183 * # Find min, max in Xf[start:end_negative] * min_feature_value = Xf[start] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -17938,7 +20191,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_max_feature_value = __pyx_v_min_feature_value; - /* "sklearn/tree/_tree.pyx":2476 + /* "sklearn/tree/_tree.pyx":3185 * max_feature_value = min_feature_value * * for p in range(start, end_negative): # <<<<<<<<<<<<<< @@ -17949,7 +20202,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2477 + /* "sklearn/tree/_tree.pyx":3186 * * for p in range(start, end_negative): * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -17958,7 +20211,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current_feature_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":2479 + /* "sklearn/tree/_tree.pyx":3188 * current_feature_value = Xf[p] * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -17968,7 +20221,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2480 + /* "sklearn/tree/_tree.pyx":3189 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -17979,7 +20232,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L13; } - /* "sklearn/tree/_tree.pyx":2481 + /* "sklearn/tree/_tree.pyx":3190 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -17989,7 +20242,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2482 + /* "sklearn/tree/_tree.pyx":3191 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -18002,7 +20255,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":2485 + /* "sklearn/tree/_tree.pyx":3194 * * # Update min, max given Xf[start_positive:end] * for p in range(start_positive, end): # <<<<<<<<<<<<<< @@ -18013,7 +20266,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru for (__pyx_t_8 = __pyx_v_start_positive; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2486 + /* "sklearn/tree/_tree.pyx":3195 * # Update min, max given Xf[start_positive:end] * for p in range(start_positive, end): * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -18022,7 +20275,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current_feature_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":2488 + /* "sklearn/tree/_tree.pyx":3197 * current_feature_value = Xf[p] * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -18032,7 +20285,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2489 + /* "sklearn/tree/_tree.pyx":3198 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -18043,7 +20296,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L16; } - /* "sklearn/tree/_tree.pyx":2490 + /* "sklearn/tree/_tree.pyx":3199 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -18053,7 +20306,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2491 + /* "sklearn/tree/_tree.pyx":3200 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -18066,7 +20319,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L16:; } - /* "sklearn/tree/_tree.pyx":2493 + /* "sklearn/tree/_tree.pyx":3202 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -18076,7 +20329,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_max_feature_value <= (__pyx_v_min_feature_value + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2494 + /* "sklearn/tree/_tree.pyx":3203 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -18085,7 +20338,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":2495 + /* "sklearn/tree/_tree.pyx":3204 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -18095,7 +20348,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2497 + /* "sklearn/tree/_tree.pyx":3206 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -18104,7 +20357,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":2498 + /* "sklearn/tree/_tree.pyx":3207 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -18116,7 +20369,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2501 + /* "sklearn/tree/_tree.pyx":3210 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -18125,7 +20378,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":2502 + /* "sklearn/tree/_tree.pyx":3211 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -18137,7 +20390,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2505 + /* "sklearn/tree/_tree.pyx":3214 * * # Draw a random threshold * current.threshold = rand_uniform(min_feature_value, # <<<<<<<<<<<<<< @@ -18146,7 +20399,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.threshold = __pyx_f_7sklearn_4tree_5_tree_rand_uniform(__pyx_v_min_feature_value, __pyx_v_max_feature_value, __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":2509 + /* "sklearn/tree/_tree.pyx":3218 * random_state) * * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -18156,7 +20409,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current.threshold == __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2510 + /* "sklearn/tree/_tree.pyx":3219 * * if current.threshold == max_feature_value: * current.threshold = min_feature_value # <<<<<<<<<<<<<< @@ -18168,7 +20421,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":2513 + /* "sklearn/tree/_tree.pyx":3222 * * # Partition * current.pos = self._partition(current.threshold, # <<<<<<<<<<<<<< @@ -18177,7 +20430,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.pos = __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_current.threshold, __pyx_v_end_negative, __pyx_v_start_positive, (__pyx_v_start_positive + ((__pyx_v_Xf[__pyx_v_start_positive]) == 0.))); - /* "sklearn/tree/_tree.pyx":2520 + /* "sklearn/tree/_tree.pyx":3229 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -18191,7 +20444,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L20_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2521 + /* "sklearn/tree/_tree.pyx":3230 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -18203,7 +20456,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L20_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2522 + /* "sklearn/tree/_tree.pyx":3231 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -18213,7 +20466,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":2525 + /* "sklearn/tree/_tree.pyx":3234 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -18222,7 +20475,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":2526 + /* "sklearn/tree/_tree.pyx":3235 * # Evaluate split * self.criterion.reset() * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -18231,7 +20484,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":2529 + /* "sklearn/tree/_tree.pyx":3238 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -18245,7 +20498,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2530 + /* "sklearn/tree/_tree.pyx":3239 * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< @@ -18257,7 +20510,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L23_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2531 + /* "sklearn/tree/_tree.pyx":3240 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -18267,7 +20520,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":2533 + /* "sklearn/tree/_tree.pyx":3242 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -18276,7 +20529,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":2535 + /* "sklearn/tree/_tree.pyx":3244 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -18286,7 +20539,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2536 + /* "sklearn/tree/_tree.pyx":3245 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -18295,7 +20548,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":2538 + /* "sklearn/tree/_tree.pyx":3247 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) * best = current # <<<<<<<<<<<<<< @@ -18313,7 +20566,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":2541 + /* "sklearn/tree/_tree.pyx":3250 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: # <<<<<<<<<<<<<< @@ -18331,7 +20584,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L27_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2542 + /* "sklearn/tree/_tree.pyx":3251 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: * self.extract_nnz(best.feature, &end_negative, &start_positive, # <<<<<<<<<<<<<< @@ -18340,7 +20593,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":2545 + /* "sklearn/tree/_tree.pyx":3254 * &is_samples_sorted) * * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< @@ -18352,7 +20605,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L26:; - /* "sklearn/tree/_tree.pyx":2551 + /* "sklearn/tree/_tree.pyx":3260 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -18361,7 +20614,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":2554 + /* "sklearn/tree/_tree.pyx":3263 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -18370,7 +20623,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":2559 + /* "sklearn/tree/_tree.pyx":3268 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -18379,7 +20632,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":2560 + /* "sklearn/tree/_tree.pyx":3269 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -18388,7 +20641,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":2358 + /* "sklearn/tree/_tree.pyx":3067 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -18399,7 +20652,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2569 +/* "sklearn/tree/_tree.pyx":3278 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -18410,7 +20663,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, CYTHON_UNUSED PyObject *__pyx_v_X, CYTHON_UNUSED PyArrayObject *__pyx_v_y, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args) { - /* "sklearn/tree/_tree.pyx":2570 + /* "sklearn/tree/_tree.pyx":3279 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -18436,7 +20689,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED } } - /* "sklearn/tree/_tree.pyx":2569 + /* "sklearn/tree/_tree.pyx":3278 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -18447,7 +20700,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build)) { __Pyx_XDECREF(__pyx_r); @@ -18464,7 +20717,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -18481,7 +20734,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18493,7 +20746,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":2571 + /* "sklearn/tree/_tree.pyx":3280 * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): * """Build a decision tree from the training set (X, y).""" # <<<<<<<<<<<<<< @@ -18518,7 +20771,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2569 +/* "sklearn/tree/_tree.pyx":3278 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -18544,7 +20797,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_X,&__pyx_n_s_y,&__pyx_n_s_sample_weight,0}; PyObject* values[4] = {0,0,0,0}; - /* "sklearn/tree/_tree.pyx":2570 + /* "sklearn/tree/_tree.pyx":3279 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -18571,12 +20824,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -18585,7 +20838,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -18604,18 +20857,18 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.TreeBuilder.build", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":2569 + /* "sklearn/tree/_tree.pyx":3278 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -18644,7 +20897,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.sample_weight = __pyx_v_sample_weight; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder->build(__pyx_v_self, __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder->build(__pyx_v_self, __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18661,7 +20914,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2574 +/* "sklearn/tree/_tree.pyx":3283 * pass * * cdef inline _check_input(self, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -18687,14 +20940,14 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __Pyx_INCREF((PyObject *)__pyx_v_y); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":2577 + /* "sklearn/tree/_tree.pyx":3286 * np.ndarray sample_weight): * """Check input dtype, layout and format""" * if issparse(X): # <<<<<<<<<<<<<< * X = X.tocsc() * X.sort_indices() */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -18707,32 +20960,32 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_X); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2578 + /* "sklearn/tree/_tree.pyx":3287 * """Check input dtype, layout and format""" * if issparse(X): * X = X.tocsc() # <<<<<<<<<<<<<< * X.sort_indices() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -18745,24 +20998,24 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } } if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2579 + /* "sklearn/tree/_tree.pyx":3288 * if issparse(X): * X = X.tocsc() * X.sort_indices() # <<<<<<<<<<<<<< * * if X.data.dtype != DTYPE: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -18775,176 +21028,176 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } } if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2581 + /* "sklearn/tree/_tree.pyx":3290 * X.sort_indices() * * if X.data.dtype != DTYPE: # <<<<<<<<<<<<<< * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2582 + /* "sklearn/tree/_tree.pyx":3291 * * if X.data.dtype != DTYPE: * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) # <<<<<<<<<<<<<< * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_X, __pyx_n_s_data, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PyObject_SetAttrStr(__pyx_v_X, __pyx_n_s_data, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4; } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":2584 + /* "sklearn/tree/_tree.pyx":3293 * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: # <<<<<<<<<<<<<< * raise ValueError("No support for np.int64 index based " * "sparse matrices") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2585 + /* "sklearn/tree/_tree.pyx":3294 * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: * raise ValueError("No support for np.int64 index based " # <<<<<<<<<<<<<< * "sparse matrices") * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } goto __pyx_L3; } - /* "sklearn/tree/_tree.pyx":2588 + /* "sklearn/tree/_tree.pyx":3297 * "sparse matrices") * * elif X.dtype != DTYPE: # <<<<<<<<<<<<<< * # since we have to copy we will make it fortran for efficiency * X = np.asfortranarray(X, dtype=DTYPE) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2590 + /* "sklearn/tree/_tree.pyx":3299 * elif X.dtype != DTYPE: * # since we have to copy we will make it fortran for efficiency * X = np.asfortranarray(X, dtype=DTYPE) # <<<<<<<<<<<<<< * * if y.dtype != DOUBLE or not y.flags.contiguous: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_X); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -18955,75 +21208,75 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2592 + /* "sklearn/tree/_tree.pyx":3301 * X = np.asfortranarray(X, dtype=DTYPE) * * if y.dtype != DOUBLE or not y.flags.contiguous: # <<<<<<<<<<<<<< * y = np.ascontiguousarray(y, dtype=DOUBLE) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L9_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = ((!__pyx_t_6) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L9_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2593 + /* "sklearn/tree/_tree.pyx":3302 * * if y.dtype != DOUBLE or not y.flags.contiguous: * y = np.ascontiguousarray(y, dtype=DOUBLE) # <<<<<<<<<<<<<< * * if (sample_weight is not None and */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_y)); __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_y)); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L8; } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":2595 + /* "sklearn/tree/_tree.pyx":3304 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * if (sample_weight is not None and # <<<<<<<<<<<<<< @@ -19038,21 +21291,21 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON goto __pyx_L12_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2596 + /* "sklearn/tree/_tree.pyx":3305 * * if (sample_weight is not None and * (sample_weight.dtype != DOUBLE or # <<<<<<<<<<<<<< * not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, dtype=DOUBLE, */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { @@ -19060,62 +21313,62 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON goto __pyx_L12_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2597 + /* "sklearn/tree/_tree.pyx":3306 * if (sample_weight is not None and * (sample_weight.dtype != DOUBLE or * not sample_weight.flags.contiguous)): # <<<<<<<<<<<<<< * sample_weight = np.asarray(sample_weight, dtype=DOUBLE, * order="C") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_6) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L12_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2598 + /* "sklearn/tree/_tree.pyx":3307 * (sample_weight.dtype != DOUBLE or * not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, dtype=DOUBLE, # <<<<<<<<<<<<<< * order="C") * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; goto __pyx_L11; } __pyx_L11:; - /* "sklearn/tree/_tree.pyx":2601 + /* "sklearn/tree/_tree.pyx":3310 * order="C") * * return X, y, sample_weight # <<<<<<<<<<<<<< @@ -19123,7 +21376,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON * # Depth first builder --------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -19138,7 +21391,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2574 + /* "sklearn/tree/_tree.pyx":3283 * pass * * cdef inline _check_input(self, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -19163,7 +21416,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2608 +/* "sklearn/tree/_tree.pyx":3317 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -19208,26 +21461,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_1__cinit__(PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_split)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -19239,20 +21492,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_1__cinit__(PyO values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)values[0]); - __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2610; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.DepthFirstTreeBuilder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *)__pyx_v_self), __pyx_v_splitter, __pyx_v_min_samples_split, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_max_depth); /* function exit code */ @@ -19269,7 +21522,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2611 + /* "sklearn/tree/_tree.pyx":3320 * SIZE_t min_samples_leaf, double min_weight_leaf, * SIZE_t max_depth): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -19282,7 +21535,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.splitter)); __pyx_v_self->__pyx_base.splitter = __pyx_v_splitter; - /* "sklearn/tree/_tree.pyx":2612 + /* "sklearn/tree/_tree.pyx":3321 * SIZE_t max_depth): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -19291,7 +21544,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.min_samples_split = __pyx_v_min_samples_split; - /* "sklearn/tree/_tree.pyx":2613 + /* "sklearn/tree/_tree.pyx":3322 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -19300,7 +21553,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.min_samples_leaf = __pyx_v_min_samples_leaf; - /* "sklearn/tree/_tree.pyx":2614 + /* "sklearn/tree/_tree.pyx":3323 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -19309,7 +21562,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.min_weight_leaf = __pyx_v_min_weight_leaf; - /* "sklearn/tree/_tree.pyx":2615 + /* "sklearn/tree/_tree.pyx":3324 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -19318,7 +21571,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.max_depth = __pyx_v_max_depth; - /* "sklearn/tree/_tree.pyx":2608 + /* "sklearn/tree/_tree.pyx":3317 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -19332,7 +21585,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2617 +/* "sklearn/tree/_tree.pyx":3326 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -19343,7 +21596,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build *__pyx_optional_args) { - /* "sklearn/tree/_tree.pyx":2618 + /* "sklearn/tree/_tree.pyx":3327 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -19405,7 +21658,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF((PyObject *)__pyx_v_y); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":2617 + /* "sklearn/tree/_tree.pyx":3326 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -19416,7 +21669,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build)) { __Pyx_XDECREF(__pyx_r); @@ -19433,7 +21686,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -19450,7 +21703,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19462,14 +21715,14 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":2622 + /* "sklearn/tree/_tree.pyx":3331 * * # check input * X, y, sample_weight = self._check_input(X, y, sample_weight) # <<<<<<<<<<<<<< * * cdef DOUBLE_t* sample_weight_ptr = NULL */ - __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -19481,7 +21734,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -19497,17 +21750,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -19517,7 +21770,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; @@ -19525,11 +21778,11 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_3)); @@ -19537,7 +21790,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "sklearn/tree/_tree.pyx":2624 + /* "sklearn/tree/_tree.pyx":3333 * X, y, sample_weight = self._check_input(X, y, sample_weight) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -19546,7 +21799,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":2625 + /* "sklearn/tree/_tree.pyx":3334 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -19557,7 +21810,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2626 + /* "sklearn/tree/_tree.pyx":3335 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -19569,7 +21822,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2631 + /* "sklearn/tree/_tree.pyx":3340 * cdef int init_capacity * * if tree.max_depth <= 10: # <<<<<<<<<<<<<< @@ -19579,7 +21832,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_tree->max_depth <= 10) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2632 + /* "sklearn/tree/_tree.pyx":3341 * * if tree.max_depth <= 10: * init_capacity = (2 ** (tree.max_depth + 1)) - 1 # <<<<<<<<<<<<<< @@ -19591,7 +21844,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":2634 + /* "sklearn/tree/_tree.pyx":3343 * init_capacity = (2 ** (tree.max_depth + 1)) - 1 * else: * init_capacity = 2047 # <<<<<<<<<<<<<< @@ -19602,16 +21855,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":2636 + /* "sklearn/tree/_tree.pyx":3345 * init_capacity = 2047 * * tree._resize(init_capacity) # <<<<<<<<<<<<<< * * # Parameters */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2639 + /* "sklearn/tree/_tree.pyx":3348 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -19623,7 +21876,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2640 + /* "sklearn/tree/_tree.pyx":3349 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth # <<<<<<<<<<<<<< @@ -19633,7 +21886,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_self->__pyx_base.max_depth; __pyx_v_max_depth = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2641 + /* "sklearn/tree/_tree.pyx":3350 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -19643,7 +21896,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2642 + /* "sklearn/tree/_tree.pyx":3351 * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -19653,7 +21906,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_11 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":2643 + /* "sklearn/tree/_tree.pyx":3352 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef SIZE_t min_samples_split = self.min_samples_split # <<<<<<<<<<<<<< @@ -19663,16 +21916,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_split; __pyx_v_min_samples_split = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2646 + /* "sklearn/tree/_tree.pyx":3355 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< * * cdef SIZE_t start */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2653 + /* "sklearn/tree/_tree.pyx":3362 * cdef SIZE_t parent * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -19682,7 +21935,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_splitter->n_samples; __pyx_v_n_node_samples = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2654 + /* "sklearn/tree/_tree.pyx":3363 * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -19692,7 +21945,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_11 = __pyx_v_splitter->weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":2660 + /* "sklearn/tree/_tree.pyx":3369 * * cdef double threshold * cdef double impurity = INFINITY # <<<<<<<<<<<<<< @@ -19701,7 +21954,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_impurity = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":2663 + /* "sklearn/tree/_tree.pyx":3372 * cdef SIZE_t n_constant_features * cdef bint is_leaf * cdef bint first = 1 # <<<<<<<<<<<<<< @@ -19710,7 +21963,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_first = 1; - /* "sklearn/tree/_tree.pyx":2664 + /* "sklearn/tree/_tree.pyx":3373 * cdef bint is_leaf * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -19719,7 +21972,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":2665 + /* "sklearn/tree/_tree.pyx":3374 * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -19728,27 +21981,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":2667 + /* "sklearn/tree/_tree.pyx":3376 * cdef int rc = 0 * * cdef Stack stack = Stack(INITIAL_STACK_SIZE) # <<<<<<<<<<<<<< * cdef StackRecord stack_record * */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_stack = ((struct __pyx_obj_7sklearn_4tree_6_utils_Stack *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2671 + /* "sklearn/tree/_tree.pyx":3380 * * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) # <<<<<<<<<<<<<< @@ -19757,7 +22010,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->push(__pyx_v_stack, 0, __pyx_v_n_node_samples, 0, __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED, 0, __pyx_v_7sklearn_4tree_5_tree_INFINITY, 0); - /* "sklearn/tree/_tree.pyx":2672 + /* "sklearn/tree/_tree.pyx":3381 * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) * if rc == -1: # <<<<<<<<<<<<<< @@ -19767,17 +22020,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2674 + /* "sklearn/tree/_tree.pyx":3383 * if rc == -1: * # got return code -1 - out-of-memory * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2676 + /* "sklearn/tree/_tree.pyx":3385 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -19791,7 +22044,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2677 + /* "sklearn/tree/_tree.pyx":3386 * * with nogil: * while not stack.is_empty(): # <<<<<<<<<<<<<< @@ -19802,7 +22055,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((!(((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->is_empty(__pyx_v_stack) != 0)) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":2678 + /* "sklearn/tree/_tree.pyx":3387 * with nogil: * while not stack.is_empty(): * stack.pop(&stack_record) # <<<<<<<<<<<<<< @@ -19811,7 +22064,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->pop(__pyx_v_stack, (&__pyx_v_stack_record)); - /* "sklearn/tree/_tree.pyx":2680 + /* "sklearn/tree/_tree.pyx":3389 * stack.pop(&stack_record) * * start = stack_record.start # <<<<<<<<<<<<<< @@ -19821,7 +22074,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.start; __pyx_v_start = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2681 + /* "sklearn/tree/_tree.pyx":3390 * * start = stack_record.start * end = stack_record.end # <<<<<<<<<<<<<< @@ -19831,7 +22084,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.end; __pyx_v_end = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2682 + /* "sklearn/tree/_tree.pyx":3391 * start = stack_record.start * end = stack_record.end * depth = stack_record.depth # <<<<<<<<<<<<<< @@ -19841,7 +22094,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.depth; __pyx_v_depth = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2683 + /* "sklearn/tree/_tree.pyx":3392 * end = stack_record.end * depth = stack_record.depth * parent = stack_record.parent # <<<<<<<<<<<<<< @@ -19851,7 +22104,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.parent; __pyx_v_parent = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2684 + /* "sklearn/tree/_tree.pyx":3393 * depth = stack_record.depth * parent = stack_record.parent * is_left = stack_record.is_left # <<<<<<<<<<<<<< @@ -19861,7 +22114,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.is_left; __pyx_v_is_left = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2685 + /* "sklearn/tree/_tree.pyx":3394 * parent = stack_record.parent * is_left = stack_record.is_left * impurity = stack_record.impurity # <<<<<<<<<<<<<< @@ -19871,7 +22124,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_11 = __pyx_v_stack_record.impurity; __pyx_v_impurity = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":2686 + /* "sklearn/tree/_tree.pyx":3395 * is_left = stack_record.is_left * impurity = stack_record.impurity * n_constant_features = stack_record.n_constant_features # <<<<<<<<<<<<<< @@ -19881,7 +22134,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.n_constant_features; __pyx_v_n_constant_features = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2688 + /* "sklearn/tree/_tree.pyx":3397 * n_constant_features = stack_record.n_constant_features * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -19890,7 +22143,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":2689 + /* "sklearn/tree/_tree.pyx":3398 * * n_node_samples = end - start * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -19899,7 +22152,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_reset(__pyx_v_splitter, __pyx_v_start, __pyx_v_end, (&__pyx_v_weighted_n_node_samples)); - /* "sklearn/tree/_tree.pyx":2691 + /* "sklearn/tree/_tree.pyx":3400 * splitter.node_reset(start, end, &weighted_n_node_samples) * * is_leaf = ((depth >= max_depth) or # <<<<<<<<<<<<<< @@ -19913,7 +22166,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2692 + /* "sklearn/tree/_tree.pyx":3401 * * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or # <<<<<<<<<<<<<< @@ -19927,7 +22180,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2693 + /* "sklearn/tree/_tree.pyx":3402 * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf) or # <<<<<<<<<<<<<< @@ -19941,20 +22194,60 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2694 + /* "sklearn/tree/_tree.pyx":3403 * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf) or * (weighted_n_node_samples < min_weight_leaf)) # <<<<<<<<<<<<<< * - * if first: + * if not is_leaf: */ __pyx_t_8 = ((__pyx_v_weighted_n_node_samples < __pyx_v_min_weight_leaf) != 0); __pyx_t_9 = __pyx_t_8; __pyx_L13_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2696 - * (weighted_n_node_samples < min_weight_leaf)) + /* "sklearn/tree/_tree.pyx":3405 + * (weighted_n_node_samples < min_weight_leaf)) + * + * if not is_leaf: # <<<<<<<<<<<<<< + * splitter.node_split(impurity, &split, &n_constant_features) + * is_leaf = is_leaf or (split.pos >= end) + */ + __pyx_t_9 = ((!(__pyx_v_is_leaf != 0)) != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":3406 + * + * if not is_leaf: + * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< + * is_leaf = is_leaf or (split.pos >= end) + * + */ + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_split(__pyx_v_splitter, __pyx_v_impurity, (&__pyx_v_split), (&__pyx_v_n_constant_features)); + + /* "sklearn/tree/_tree.pyx":3407 + * if not is_leaf: + * splitter.node_split(impurity, &split, &n_constant_features) + * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< + * + * if first: + */ + __pyx_t_8 = (__pyx_v_is_leaf != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_9 = __pyx_t_8; + goto __pyx_L18_bool_binop_done; + } + __pyx_t_8 = ((__pyx_v_split.pos >= __pyx_v_end) != 0); + __pyx_t_9 = __pyx_t_8; + __pyx_L18_bool_binop_done:; + __pyx_v_is_leaf = __pyx_t_9; + goto __pyx_L17; + } + __pyx_L17:; + + /* "sklearn/tree/_tree.pyx":3409 + * is_leaf = is_leaf or (split.pos >= end) * * if first: # <<<<<<<<<<<<<< * impurity = splitter.node_impurity() @@ -19963,7 +22256,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = (__pyx_v_first != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2697 + /* "sklearn/tree/_tree.pyx":3410 * * if first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -19972,7 +22265,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_impurity = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_impurity(__pyx_v_splitter); - /* "sklearn/tree/_tree.pyx":2698 + /* "sklearn/tree/_tree.pyx":3411 * if first: * impurity = splitter.node_impurity() * first = 0 # <<<<<<<<<<<<<< @@ -19980,70 +22273,30 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) */ __pyx_v_first = 0; - goto __pyx_L17; + goto __pyx_L20; } - __pyx_L17:; + __pyx_L20:; - /* "sklearn/tree/_tree.pyx":2700 + /* "sklearn/tree/_tree.pyx":3413 * first = 0 * * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) # <<<<<<<<<<<<<< * - * if not is_leaf: + * */ __pyx_t_8 = (__pyx_v_is_leaf != 0); if (!__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; - goto __pyx_L18_bool_binop_done; + goto __pyx_L21_bool_binop_done; } __pyx_t_8 = ((__pyx_v_impurity <= __pyx_v_7sklearn_4tree_5_tree_MIN_IMPURITY_SPLIT) != 0); __pyx_t_9 = __pyx_t_8; - __pyx_L18_bool_binop_done:; + __pyx_L21_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2702 - * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) - * - * if not is_leaf: # <<<<<<<<<<<<<< - * splitter.node_split(impurity, &split, &n_constant_features) - * is_leaf = is_leaf or (split.pos >= end) - */ - __pyx_t_9 = ((!(__pyx_v_is_leaf != 0)) != 0); - if (__pyx_t_9) { - - /* "sklearn/tree/_tree.pyx":2703 - * - * if not is_leaf: - * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< - * is_leaf = is_leaf or (split.pos >= end) - * - */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_split(__pyx_v_splitter, __pyx_v_impurity, (&__pyx_v_split), (&__pyx_v_n_constant_features)); - - /* "sklearn/tree/_tree.pyx":2704 - * if not is_leaf: - * splitter.node_split(impurity, &split, &n_constant_features) - * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":3416 * - * node_id = tree._add_node(parent, is_left, is_leaf, split.feature, - */ - __pyx_t_8 = (__pyx_v_is_leaf != 0); - if (!__pyx_t_8) { - } else { - __pyx_t_9 = __pyx_t_8; - goto __pyx_L21_bool_binop_done; - } - __pyx_t_8 = ((__pyx_v_split.pos >= __pyx_v_end) != 0); - __pyx_t_9 = __pyx_t_8; - __pyx_L21_bool_binop_done:; - __pyx_v_is_leaf = __pyx_t_9; - goto __pyx_L20; - } - __pyx_L20:; - - /* "sklearn/tree/_tree.pyx":2706 - * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent, is_left, is_leaf, split.feature, # <<<<<<<<<<<<<< * split.threshold, impurity, n_node_samples, @@ -20051,7 +22304,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_node_id = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_add_node(__pyx_v_tree, __pyx_v_parent, __pyx_v_is_left, __pyx_v_is_leaf, __pyx_v_split.feature, __pyx_v_split.threshold, __pyx_v_impurity, __pyx_v_n_node_samples, __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":2710 + /* "sklearn/tree/_tree.pyx":3420 * weighted_n_node_samples) * * if node_id == (-1): # <<<<<<<<<<<<<< @@ -20061,7 +22314,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_node_id == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2711 + /* "sklearn/tree/_tree.pyx":3421 * * if node_id == (-1): * rc = -1 # <<<<<<<<<<<<<< @@ -20070,7 +22323,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = -1; - /* "sklearn/tree/_tree.pyx":2712 + /* "sklearn/tree/_tree.pyx":3422 * if node_id == (-1): * rc = -1 * break # <<<<<<<<<<<<<< @@ -20080,7 +22333,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L12_break; } - /* "sklearn/tree/_tree.pyx":2716 + /* "sklearn/tree/_tree.pyx":3426 * # Store value for all nodes, to facilitate tree/model * # inspection and interpretation * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -20089,27 +22342,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_value(__pyx_v_splitter, (__pyx_v_tree->value + (__pyx_v_node_id * __pyx_v_tree->value_stride))); - /* "sklearn/tree/_tree.pyx":2718 + /* "sklearn/tree/_tree.pyx":3428 * splitter.node_value(tree.value + node_id * tree.value_stride) * * if not is_leaf: # <<<<<<<<<<<<<< * # Push right child on stack - * rc = stack.push(split.pos, end, depth + 1, node_id, 0, + * rc = stack.push(split.pos, end, depth+1, node_id, 0, */ __pyx_t_9 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2720 + /* "sklearn/tree/_tree.pyx":3430 * if not is_leaf: * # Push right child on stack - * rc = stack.push(split.pos, end, depth + 1, node_id, 0, # <<<<<<<<<<<<<< + * rc = stack.push(split.pos, end, depth+1, node_id, 0, # <<<<<<<<<<<<<< * split.impurity_right, n_constant_features) * if rc == -1: */ __pyx_v_rc = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->push(__pyx_v_stack, __pyx_v_split.pos, __pyx_v_end, (__pyx_v_depth + 1), __pyx_v_node_id, 0, __pyx_v_split.impurity_right, __pyx_v_n_constant_features); - /* "sklearn/tree/_tree.pyx":2722 - * rc = stack.push(split.pos, end, depth + 1, node_id, 0, + /* "sklearn/tree/_tree.pyx":3432 + * rc = stack.push(split.pos, end, depth+1, node_id, 0, * split.impurity_right, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< * break @@ -20118,7 +22371,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2723 + /* "sklearn/tree/_tree.pyx":3433 * split.impurity_right, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -20128,17 +22381,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L12_break; } - /* "sklearn/tree/_tree.pyx":2726 + /* "sklearn/tree/_tree.pyx":3436 * * # Push left child on stack - * rc = stack.push(start, split.pos, depth + 1, node_id, 1, # <<<<<<<<<<<<<< + * rc = stack.push(start, split.pos, depth+1, node_id, 1, # <<<<<<<<<<<<<< * split.impurity_left, n_constant_features) * if rc == -1: */ __pyx_v_rc = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->push(__pyx_v_stack, __pyx_v_start, __pyx_v_split.pos, (__pyx_v_depth + 1), __pyx_v_node_id, 1, __pyx_v_split.impurity_left, __pyx_v_n_constant_features); - /* "sklearn/tree/_tree.pyx":2728 - * rc = stack.push(start, split.pos, depth + 1, node_id, 1, + /* "sklearn/tree/_tree.pyx":3438 + * rc = stack.push(start, split.pos, depth+1, node_id, 1, * split.impurity_left, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< * break @@ -20147,7 +22400,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2729 + /* "sklearn/tree/_tree.pyx":3439 * split.impurity_left, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -20160,7 +22413,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":2731 + /* "sklearn/tree/_tree.pyx":3441 * break * * if depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -20170,7 +22423,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_depth > __pyx_v_max_depth_seen) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2732 + /* "sklearn/tree/_tree.pyx":3442 * * if depth > max_depth_seen: * max_depth_seen = depth # <<<<<<<<<<<<<< @@ -20184,7 +22437,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L12_break:; - /* "sklearn/tree/_tree.pyx":2734 + /* "sklearn/tree/_tree.pyx":3444 * max_depth_seen = depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -20194,7 +22447,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2735 + /* "sklearn/tree/_tree.pyx":3445 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -20209,7 +22462,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L28:; - /* "sklearn/tree/_tree.pyx":2737 + /* "sklearn/tree/_tree.pyx":3447 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -20219,7 +22472,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2738 + /* "sklearn/tree/_tree.pyx":3448 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -20232,7 +22485,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_L29:; } - /* "sklearn/tree/_tree.pyx":2676 + /* "sklearn/tree/_tree.pyx":3385 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -20250,7 +22503,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } } - /* "sklearn/tree/_tree.pyx":2739 + /* "sklearn/tree/_tree.pyx":3449 * if rc >= 0: * tree.max_depth = max_depth_seen * if rc == -1: # <<<<<<<<<<<<<< @@ -20260,17 +22513,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2740 + /* "sklearn/tree/_tree.pyx":3450 * tree.max_depth = max_depth_seen * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2617 + /* "sklearn/tree/_tree.pyx":3326 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20318,7 +22571,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_X,&__pyx_n_s_y,&__pyx_n_s_sample_weight,0}; PyObject* values[4] = {0,0,0,0}; - /* "sklearn/tree/_tree.pyx":2618 + /* "sklearn/tree/_tree.pyx":3327 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -20345,12 +22598,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -20359,7 +22612,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20378,18 +22631,18 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.DepthFirstTreeBuilder.build", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(((struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":2617 + /* "sklearn/tree/_tree.pyx":3326 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20418,7 +22671,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.sample_weight = __pyx_v_sample_weight; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20435,7 +22688,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2745 +/* "sklearn/tree/_tree.pyx":3455 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -20446,7 +22699,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *__pyx_v_rec, struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_frontier) { int __pyx_r; - /* "sklearn/tree/_tree.pyx":2749 + /* "sklearn/tree/_tree.pyx":3459 * """Adds record ``rec`` to the priority queue ``frontier``; returns -1 * on memory-error. """ * return frontier.push(rec.node_id, rec.start, rec.end, rec.pos, rec.depth, # <<<<<<<<<<<<<< @@ -20456,7 +22709,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ __pyx_r = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->push(__pyx_v_frontier, __pyx_v_rec->node_id, __pyx_v_rec->start, __pyx_v_rec->end, __pyx_v_rec->pos, __pyx_v_rec->depth, __pyx_v_rec->is_leaf, __pyx_v_rec->improvement, __pyx_v_rec->impurity, __pyx_v_rec->impurity_left, __pyx_v_rec->impurity_right); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2745 + /* "sklearn/tree/_tree.pyx":3455 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -20469,7 +22722,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2764 +/* "sklearn/tree/_tree.pyx":3474 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -20516,31 +22769,31 @@ static int __pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_split)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_leaf_nodes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -20553,21 +22806,21 @@ static int __pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(PyOb values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)values[0]); - __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2765; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_min_weight_leaf = values[3]; - __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_leaf_nodes = __Pyx_PyInt_As_Py_intptr_t(values[5]); if (unlikely((__pyx_v_max_leaf_nodes == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_leaf_nodes = __Pyx_PyInt_As_Py_intptr_t(values[5]); if (unlikely((__pyx_v_max_leaf_nodes == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BestFirstTreeBuilder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2764; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)__pyx_v_self), __pyx_v_splitter, __pyx_v_min_samples_split, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_max_depth, __pyx_v_max_leaf_nodes); /* function exit code */ @@ -20588,7 +22841,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2767 + /* "sklearn/tree/_tree.pyx":3477 * SIZE_t min_samples_leaf, min_weight_leaf, * SIZE_t max_depth, SIZE_t max_leaf_nodes): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -20601,7 +22854,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.splitter)); __pyx_v_self->__pyx_base.splitter = __pyx_v_splitter; - /* "sklearn/tree/_tree.pyx":2768 + /* "sklearn/tree/_tree.pyx":3478 * SIZE_t max_depth, SIZE_t max_leaf_nodes): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -20610,7 +22863,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.min_samples_split = __pyx_v_min_samples_split; - /* "sklearn/tree/_tree.pyx":2769 + /* "sklearn/tree/_tree.pyx":3479 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -20619,17 +22872,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.min_samples_leaf = __pyx_v_min_samples_leaf; - /* "sklearn/tree/_tree.pyx":2770 + /* "sklearn/tree/_tree.pyx":3480 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes */ - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_min_weight_leaf); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_min_weight_leaf); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->__pyx_base.min_weight_leaf = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2771 + /* "sklearn/tree/_tree.pyx":3481 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -20638,7 +22891,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.max_depth = __pyx_v_max_depth; - /* "sklearn/tree/_tree.pyx":2772 + /* "sklearn/tree/_tree.pyx":3482 * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes # <<<<<<<<<<<<<< @@ -20647,7 +22900,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->max_leaf_nodes = __pyx_v_max_leaf_nodes; - /* "sklearn/tree/_tree.pyx":2764 + /* "sklearn/tree/_tree.pyx":3474 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -20666,7 +22919,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2774 +/* "sklearn/tree/_tree.pyx":3484 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20677,7 +22930,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build *__pyx_optional_args) { - /* "sklearn/tree/_tree.pyx":2775 + /* "sklearn/tree/_tree.pyx":3485 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -20731,7 +22984,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF((PyObject *)__pyx_v_y); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":2774 + /* "sklearn/tree/_tree.pyx":3484 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20742,7 +22995,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build)) { __Pyx_XDECREF(__pyx_r); @@ -20759,7 +23012,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -20776,7 +23029,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -20788,14 +23041,14 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":2779 + /* "sklearn/tree/_tree.pyx":3489 * * # check input * X, y, sample_weight = self._check_input(X, y, sample_weight) # <<<<<<<<<<<<<< * * cdef DOUBLE_t* sample_weight_ptr = NULL */ - __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -20807,7 +23060,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -20823,17 +23076,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -20843,7 +23096,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; @@ -20851,11 +23104,11 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_3)); @@ -20863,7 +23116,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "sklearn/tree/_tree.pyx":2781 + /* "sklearn/tree/_tree.pyx":3491 * X, y, sample_weight = self._check_input(X, y, sample_weight) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -20872,7 +23125,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":2782 + /* "sklearn/tree/_tree.pyx":3492 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -20883,7 +23136,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2783 + /* "sklearn/tree/_tree.pyx":3493 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -20895,7 +23148,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2786 + /* "sklearn/tree/_tree.pyx":3496 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -20907,7 +23160,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2787 + /* "sklearn/tree/_tree.pyx":3497 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes # <<<<<<<<<<<<<< @@ -20917,7 +23170,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_self->max_leaf_nodes; __pyx_v_max_leaf_nodes = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2788 + /* "sklearn/tree/_tree.pyx":3498 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -20927,7 +23180,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2789 + /* "sklearn/tree/_tree.pyx":3499 * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -20937,7 +23190,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_11 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":2790 + /* "sklearn/tree/_tree.pyx":3500 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef SIZE_t min_samples_split = self.min_samples_split # <<<<<<<<<<<<<< @@ -20947,36 +23200,36 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_split; __pyx_v_min_samples_split = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2793 + /* "sklearn/tree/_tree.pyx":3503 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< * * cdef PriorityHeap frontier = PriorityHeap(INITIAL_STACK_SIZE) */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2795 + /* "sklearn/tree/_tree.pyx":3505 * splitter.init(X, y, sample_weight_ptr) * * cdef PriorityHeap frontier = PriorityHeap(INITIAL_STACK_SIZE) # <<<<<<<<<<<<<< * cdef PriorityHeapRecord record * cdef PriorityHeapRecord split_node_left */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_frontier = ((struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2800 + /* "sklearn/tree/_tree.pyx":3510 * cdef PriorityHeapRecord split_node_right * * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -20986,7 +23239,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_splitter->n_samples; __pyx_v_n_node_samples = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2801 + /* "sklearn/tree/_tree.pyx":3511 * * cdef SIZE_t n_node_samples = splitter.n_samples * cdef SIZE_t max_split_nodes = max_leaf_nodes - 1 # <<<<<<<<<<<<<< @@ -20995,7 +23248,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_split_nodes = (__pyx_v_max_leaf_nodes - 1); - /* "sklearn/tree/_tree.pyx":2803 + /* "sklearn/tree/_tree.pyx":3513 * cdef SIZE_t max_split_nodes = max_leaf_nodes - 1 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -21004,7 +23257,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":2804 + /* "sklearn/tree/_tree.pyx":3514 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -21013,7 +23266,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":2808 + /* "sklearn/tree/_tree.pyx":3518 * * # Initial capacity * cdef SIZE_t init_capacity = max_split_nodes + max_leaf_nodes # <<<<<<<<<<<<<< @@ -21022,16 +23275,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_init_capacity = (__pyx_v_max_split_nodes + __pyx_v_max_leaf_nodes); - /* "sklearn/tree/_tree.pyx":2809 + /* "sklearn/tree/_tree.pyx":3519 * # Initial capacity * cdef SIZE_t init_capacity = max_split_nodes + max_leaf_nodes * tree._resize(init_capacity) # <<<<<<<<<<<<<< * * with nogil: */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2811 + /* "sklearn/tree/_tree.pyx":3521 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -21045,7 +23298,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2813 + /* "sklearn/tree/_tree.pyx":3523 * with nogil: * # add root to frontier * rc = self._add_split_node(splitter, tree, 0, n_node_samples, # <<<<<<<<<<<<<< @@ -21054,7 +23307,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(__pyx_v_self, __pyx_v_splitter, __pyx_v_tree, 0, __pyx_v_n_node_samples, __pyx_v_7sklearn_4tree_5_tree_INFINITY, __pyx_v_7sklearn_4tree_5_tree_IS_FIRST, __pyx_v_7sklearn_4tree_5_tree_IS_LEFT, NULL, 0, (&__pyx_v_split_node_left)); - /* "sklearn/tree/_tree.pyx":2816 + /* "sklearn/tree/_tree.pyx":3526 * INFINITY, IS_FIRST, IS_LEFT, NULL, 0, * &split_node_left) * if rc >= 0: # <<<<<<<<<<<<<< @@ -21064,7 +23317,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2817 + /* "sklearn/tree/_tree.pyx":3527 * &split_node_left) * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -21077,7 +23330,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L9:; } - /* "sklearn/tree/_tree.pyx":2811 + /* "sklearn/tree/_tree.pyx":3521 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -21095,7 +23348,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":2818 + /* "sklearn/tree/_tree.pyx":3528 * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -21105,17 +23358,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2819 + /* "sklearn/tree/_tree.pyx":3529 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2821 + /* "sklearn/tree/_tree.pyx":3531 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -21129,7 +23382,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2822 + /* "sklearn/tree/_tree.pyx":3532 * * with nogil: * while not frontier.is_empty(): # <<<<<<<<<<<<<< @@ -21140,7 +23393,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((!(((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->is_empty(__pyx_v_frontier) != 0)) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":2823 + /* "sklearn/tree/_tree.pyx":3533 * with nogil: * while not frontier.is_empty(): * frontier.pop(&record) # <<<<<<<<<<<<<< @@ -21149,7 +23402,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->pop(__pyx_v_frontier, (&__pyx_v_record)); - /* "sklearn/tree/_tree.pyx":2825 + /* "sklearn/tree/_tree.pyx":3535 * frontier.pop(&record) * * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -21158,7 +23411,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node = (&(__pyx_v_tree->nodes[__pyx_v_record.node_id])); - /* "sklearn/tree/_tree.pyx":2826 + /* "sklearn/tree/_tree.pyx":3536 * * node = &tree.nodes[record.node_id] * is_leaf = (record.is_leaf or max_split_nodes <= 0) # <<<<<<<<<<<<<< @@ -21176,7 +23429,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L16_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2828 + /* "sklearn/tree/_tree.pyx":3538 * is_leaf = (record.is_leaf or max_split_nodes <= 0) * * if is_leaf: # <<<<<<<<<<<<<< @@ -21186,7 +23439,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = (__pyx_v_is_leaf != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2830 + /* "sklearn/tree/_tree.pyx":3540 * if is_leaf: * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -21195,7 +23448,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node->left_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":2831 + /* "sklearn/tree/_tree.pyx":3541 * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -21204,7 +23457,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node->right_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":2832 + /* "sklearn/tree/_tree.pyx":3542 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -21213,7 +23466,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node->feature = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; - /* "sklearn/tree/_tree.pyx":2833 + /* "sklearn/tree/_tree.pyx":3543 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -21225,7 +23478,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2839 + /* "sklearn/tree/_tree.pyx":3549 * * # Decrement number of split nodes available * max_split_nodes -= 1 # <<<<<<<<<<<<<< @@ -21234,7 +23487,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_split_nodes = (__pyx_v_max_split_nodes - 1); - /* "sklearn/tree/_tree.pyx":2842 + /* "sklearn/tree/_tree.pyx":3552 * * # Compute left split node * rc = self._add_split_node(splitter, tree, # <<<<<<<<<<<<<< @@ -21243,7 +23496,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(__pyx_v_self, __pyx_v_splitter, __pyx_v_tree, __pyx_v_record.start, __pyx_v_record.pos, __pyx_v_record.impurity_left, __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST, __pyx_v_7sklearn_4tree_5_tree_IS_LEFT, __pyx_v_node, (__pyx_v_record.depth + 1), (&__pyx_v_split_node_left)); - /* "sklearn/tree/_tree.pyx":2848 + /* "sklearn/tree/_tree.pyx":3558 * record.depth + 1, * &split_node_left) * if rc == -1: # <<<<<<<<<<<<<< @@ -21253,7 +23506,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2849 + /* "sklearn/tree/_tree.pyx":3559 * &split_node_left) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21263,7 +23516,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":2852 + /* "sklearn/tree/_tree.pyx":3562 * * # tree.nodes may have changed * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -21272,7 +23525,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node = (&(__pyx_v_tree->nodes[__pyx_v_record.node_id])); - /* "sklearn/tree/_tree.pyx":2855 + /* "sklearn/tree/_tree.pyx":3565 * * # Compute right split node * rc = self._add_split_node(splitter, tree, record.pos, # <<<<<<<<<<<<<< @@ -21281,7 +23534,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(__pyx_v_self, __pyx_v_splitter, __pyx_v_tree, __pyx_v_record.pos, __pyx_v_record.end, __pyx_v_record.impurity_right, __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST, __pyx_v_7sklearn_4tree_5_tree_IS_NOT_LEFT, __pyx_v_node, (__pyx_v_record.depth + 1), (&__pyx_v_split_node_right)); - /* "sklearn/tree/_tree.pyx":2861 + /* "sklearn/tree/_tree.pyx":3571 * record.depth + 1, * &split_node_right) * if rc == -1: # <<<<<<<<<<<<<< @@ -21291,7 +23544,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2862 + /* "sklearn/tree/_tree.pyx":3572 * &split_node_right) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21301,7 +23554,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":2865 + /* "sklearn/tree/_tree.pyx":3575 * * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -21310,7 +23563,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree__add_to_frontier((&__pyx_v_split_node_left), __pyx_v_frontier); - /* "sklearn/tree/_tree.pyx":2866 + /* "sklearn/tree/_tree.pyx":3576 * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -21320,7 +23573,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2867 + /* "sklearn/tree/_tree.pyx":3577 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21330,7 +23583,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":2869 + /* "sklearn/tree/_tree.pyx":3579 * break * * rc = _add_to_frontier(&split_node_right, frontier) # <<<<<<<<<<<<<< @@ -21339,7 +23592,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree__add_to_frontier((&__pyx_v_split_node_right), __pyx_v_frontier); - /* "sklearn/tree/_tree.pyx":2870 + /* "sklearn/tree/_tree.pyx":3580 * * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -21349,7 +23602,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2871 + /* "sklearn/tree/_tree.pyx":3581 * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21361,7 +23614,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":2873 + /* "sklearn/tree/_tree.pyx":3583 * break * * if record.depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -21371,7 +23624,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_record.depth > __pyx_v_max_depth_seen) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2874 + /* "sklearn/tree/_tree.pyx":3584 * * if record.depth > max_depth_seen: * max_depth_seen = record.depth # <<<<<<<<<<<<<< @@ -21386,7 +23639,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L15_break:; - /* "sklearn/tree/_tree.pyx":2876 + /* "sklearn/tree/_tree.pyx":3586 * max_depth_seen = record.depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -21396,7 +23649,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2877 + /* "sklearn/tree/_tree.pyx":3587 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -21411,7 +23664,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":2879 + /* "sklearn/tree/_tree.pyx":3589 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -21421,7 +23674,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2880 + /* "sklearn/tree/_tree.pyx":3590 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -21434,7 +23687,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L25:; } - /* "sklearn/tree/_tree.pyx":2821 + /* "sklearn/tree/_tree.pyx":3531 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -21452,7 +23705,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":2882 + /* "sklearn/tree/_tree.pyx":3592 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -21462,17 +23715,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2883 + /* "sklearn/tree/_tree.pyx":3593 * * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2774 + /* "sklearn/tree/_tree.pyx":3484 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21520,7 +23773,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_X,&__pyx_n_s_y,&__pyx_n_s_sample_weight,0}; PyObject* values[4] = {0,0,0,0}; - /* "sklearn/tree/_tree.pyx":2775 + /* "sklearn/tree/_tree.pyx":3485 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -21547,12 +23800,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -21561,7 +23814,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -21580,18 +23833,18 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BestFirstTreeBuilder.build", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(((struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":2774 + /* "sklearn/tree/_tree.pyx":3484 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21620,7 +23873,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.sample_weight = __pyx_v_sample_weight; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21637,7 +23890,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2885 +/* "sklearn/tree/_tree.pyx":3595 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -21660,7 +23913,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a ptrdiff_t __pyx_t_4; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2894 + /* "sklearn/tree/_tree.pyx":3604 * cdef SIZE_t node_id * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 # <<<<<<<<<<<<<< @@ -21669,7 +23922,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_constant_features = 0; - /* "sklearn/tree/_tree.pyx":2895 + /* "sklearn/tree/_tree.pyx":3605 * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -21679,7 +23932,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = __pyx_v_splitter->weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2901 + /* "sklearn/tree/_tree.pyx":3611 * cdef double imp_diff * * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -21688,7 +23941,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_reset(__pyx_v_splitter, __pyx_v_start, __pyx_v_end, (&__pyx_v_weighted_n_node_samples)); - /* "sklearn/tree/_tree.pyx":2903 + /* "sklearn/tree/_tree.pyx":3613 * splitter.node_reset(start, end, &weighted_n_node_samples) * * if is_first: # <<<<<<<<<<<<<< @@ -21698,7 +23951,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = (__pyx_v_is_first != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2904 + /* "sklearn/tree/_tree.pyx":3614 * * if is_first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -21710,7 +23963,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2906 + /* "sklearn/tree/_tree.pyx":3616 * impurity = splitter.node_impurity() * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -21719,7 +23972,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":2907 + /* "sklearn/tree/_tree.pyx":3617 * * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or # <<<<<<<<<<<<<< @@ -21733,7 +23986,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2908 + /* "sklearn/tree/_tree.pyx":3618 * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or # <<<<<<<<<<<<<< @@ -21747,7 +24000,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2909 + /* "sklearn/tree/_tree.pyx":3619 * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or # <<<<<<<<<<<<<< @@ -21761,7 +24014,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2910 + /* "sklearn/tree/_tree.pyx":3620 * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or * (weighted_n_node_samples < self.min_weight_leaf) or # <<<<<<<<<<<<<< @@ -21775,7 +24028,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2911 + /* "sklearn/tree/_tree.pyx":3621 * (n_node_samples < 2 * self.min_samples_leaf) or * (weighted_n_node_samples < self.min_weight_leaf) or * (impurity <= MIN_IMPURITY_SPLIT)) # <<<<<<<<<<<<<< @@ -21787,7 +24040,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_L4_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2913 + /* "sklearn/tree/_tree.pyx":3623 * (impurity <= MIN_IMPURITY_SPLIT)) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -21797,7 +24050,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2914 + /* "sklearn/tree/_tree.pyx":3624 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -21806,7 +24059,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_split(__pyx_v_splitter, __pyx_v_impurity, (&__pyx_v_split), (&__pyx_v_n_constant_features)); - /* "sklearn/tree/_tree.pyx":2915 + /* "sklearn/tree/_tree.pyx":3625 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< @@ -21827,7 +24080,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":2918 + /* "sklearn/tree/_tree.pyx":3628 * * node_id = tree._add_node(parent - tree.nodes * if parent != NULL # <<<<<<<<<<<<<< @@ -21836,7 +24089,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ if (((__pyx_v_parent != NULL) != 0)) { - /* "sklearn/tree/_tree.pyx":2917 + /* "sklearn/tree/_tree.pyx":3627 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -21846,7 +24099,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_4 = (__pyx_v_parent - __pyx_v_tree->nodes); } else { - /* "sklearn/tree/_tree.pyx":2919 + /* "sklearn/tree/_tree.pyx":3629 * node_id = tree._add_node(parent - tree.nodes * if parent != NULL * else _TREE_UNDEFINED, # <<<<<<<<<<<<<< @@ -21856,7 +24109,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_4 = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; } - /* "sklearn/tree/_tree.pyx":2917 + /* "sklearn/tree/_tree.pyx":3627 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -21865,7 +24118,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_node_id = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_add_node(__pyx_v_tree, __pyx_t_4, __pyx_v_is_left, __pyx_v_is_leaf, __pyx_v_split.feature, __pyx_v_split.threshold, __pyx_v_impurity, __pyx_v_n_node_samples, __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":2923 + /* "sklearn/tree/_tree.pyx":3633 * split.feature, split.threshold, impurity, n_node_samples, * weighted_n_node_samples) * if node_id == (-1): # <<<<<<<<<<<<<< @@ -21875,7 +24128,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = ((__pyx_v_node_id == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2924 + /* "sklearn/tree/_tree.pyx":3634 * weighted_n_node_samples) * if node_id == (-1): * return -1 # <<<<<<<<<<<<<< @@ -21886,7 +24139,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2927 + /* "sklearn/tree/_tree.pyx":3637 * * # compute values also for split nodes (might become leafs later). * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -21895,7 +24148,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_value(__pyx_v_splitter, (__pyx_v_tree->value + (__pyx_v_node_id * __pyx_v_tree->value_stride))); - /* "sklearn/tree/_tree.pyx":2929 + /* "sklearn/tree/_tree.pyx":3639 * splitter.node_value(tree.value + node_id * tree.value_stride) * * res.node_id = node_id # <<<<<<<<<<<<<< @@ -21904,7 +24157,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->node_id = __pyx_v_node_id; - /* "sklearn/tree/_tree.pyx":2930 + /* "sklearn/tree/_tree.pyx":3640 * * res.node_id = node_id * res.start = start # <<<<<<<<<<<<<< @@ -21913,7 +24166,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2931 + /* "sklearn/tree/_tree.pyx":3641 * res.node_id = node_id * res.start = start * res.end = end # <<<<<<<<<<<<<< @@ -21922,7 +24175,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2932 + /* "sklearn/tree/_tree.pyx":3642 * res.start = start * res.end = end * res.depth = depth # <<<<<<<<<<<<<< @@ -21931,7 +24184,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->depth = __pyx_v_depth; - /* "sklearn/tree/_tree.pyx":2933 + /* "sklearn/tree/_tree.pyx":3643 * res.end = end * res.depth = depth * res.impurity = impurity # <<<<<<<<<<<<<< @@ -21940,7 +24193,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":2935 + /* "sklearn/tree/_tree.pyx":3645 * res.impurity = impurity * * if not is_leaf: # <<<<<<<<<<<<<< @@ -21950,7 +24203,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2937 + /* "sklearn/tree/_tree.pyx":3647 * if not is_leaf: * # is split node * res.pos = split.pos # <<<<<<<<<<<<<< @@ -21960,7 +24213,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_5 = __pyx_v_split.pos; __pyx_v_res->pos = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2938 + /* "sklearn/tree/_tree.pyx":3648 * # is split node * res.pos = split.pos * res.is_leaf = 0 # <<<<<<<<<<<<<< @@ -21969,7 +24222,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 0; - /* "sklearn/tree/_tree.pyx":2939 + /* "sklearn/tree/_tree.pyx":3649 * res.pos = split.pos * res.is_leaf = 0 * res.improvement = split.improvement # <<<<<<<<<<<<<< @@ -21979,7 +24232,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = __pyx_v_split.improvement; __pyx_v_res->improvement = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2940 + /* "sklearn/tree/_tree.pyx":3650 * res.is_leaf = 0 * res.improvement = split.improvement * res.impurity_left = split.impurity_left # <<<<<<<<<<<<<< @@ -21989,7 +24242,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = __pyx_v_split.impurity_left; __pyx_v_res->impurity_left = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2941 + /* "sklearn/tree/_tree.pyx":3651 * res.improvement = split.improvement * res.impurity_left = split.impurity_left * res.impurity_right = split.impurity_right # <<<<<<<<<<<<<< @@ -22002,7 +24255,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } /*else*/ { - /* "sklearn/tree/_tree.pyx":2945 + /* "sklearn/tree/_tree.pyx":3655 * else: * # is leaf => 0 improvement * res.pos = end # <<<<<<<<<<<<<< @@ -22011,7 +24264,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2946 + /* "sklearn/tree/_tree.pyx":3656 * # is leaf => 0 improvement * res.pos = end * res.is_leaf = 1 # <<<<<<<<<<<<<< @@ -22020,7 +24273,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 1; - /* "sklearn/tree/_tree.pyx":2947 + /* "sklearn/tree/_tree.pyx":3657 * res.pos = end * res.is_leaf = 1 * res.improvement = 0.0 # <<<<<<<<<<<<<< @@ -22029,7 +24282,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->improvement = 0.0; - /* "sklearn/tree/_tree.pyx":2948 + /* "sklearn/tree/_tree.pyx":3658 * res.is_leaf = 1 * res.improvement = 0.0 * res.impurity_left = impurity # <<<<<<<<<<<<<< @@ -22038,7 +24291,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity_left = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":2949 + /* "sklearn/tree/_tree.pyx":3659 * res.improvement = 0.0 * res.impurity_left = impurity * res.impurity_right = impurity # <<<<<<<<<<<<<< @@ -22049,7 +24302,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":2951 + /* "sklearn/tree/_tree.pyx":3661 * res.impurity_right = impurity * * return 0 # <<<<<<<<<<<<<< @@ -22059,7 +24312,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2885 + /* "sklearn/tree/_tree.pyx":3595 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -22072,7 +24325,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3017 +/* "sklearn/tree/_tree.pyx":3727 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -22104,7 +24357,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3019 + /* "sklearn/tree/_tree.pyx":3729 * def __get__(self): * # it's small; copy for memory safety * return sizet_ptr_to_ndarray(self.n_classes, self.n_outputs).copy() # <<<<<<<<<<<<<< @@ -22112,9 +24365,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct * property children_left: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -22128,10 +24381,10 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct } } if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22139,7 +24392,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3017 + /* "sklearn/tree/_tree.pyx":3727 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -22160,7 +24413,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3022 +/* "sklearn/tree/_tree.pyx":3732 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -22191,7 +24444,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3023 + /* "sklearn/tree/_tree.pyx":3733 * property children_left: * def __get__(self): * return self._get_node_ndarray()['left_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -22199,19 +24452,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st * property children_right: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_left_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_left_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3022 + /* "sklearn/tree/_tree.pyx":3732 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -22231,7 +24484,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3026 +/* "sklearn/tree/_tree.pyx":3736 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -22262,7 +24515,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3027 + /* "sklearn/tree/_tree.pyx":3737 * property children_right: * def __get__(self): * return self._get_node_ndarray()['right_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -22270,19 +24523,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s * property feature: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_right_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_right_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3026 + /* "sklearn/tree/_tree.pyx":3736 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -22302,7 +24555,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3030 +/* "sklearn/tree/_tree.pyx":3740 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -22333,7 +24586,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3031 + /* "sklearn/tree/_tree.pyx":3741 * property feature: * def __get__(self): * return self._get_node_ndarray()['feature'][:self.node_count] # <<<<<<<<<<<<<< @@ -22341,19 +24594,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ * property threshold: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_feature); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_feature); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3030 + /* "sklearn/tree/_tree.pyx":3740 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -22373,7 +24626,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3034 +/* "sklearn/tree/_tree.pyx":3744 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -22404,7 +24657,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3035 + /* "sklearn/tree/_tree.pyx":3745 * property threshold: * def __get__(self): * return self._get_node_ndarray()['threshold'][:self.node_count] # <<<<<<<<<<<<<< @@ -22412,19 +24665,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct * property impurity: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_threshold); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_threshold); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3034 + /* "sklearn/tree/_tree.pyx":3744 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -22444,7 +24697,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3038 +/* "sklearn/tree/_tree.pyx":3748 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -22475,7 +24728,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3039 + /* "sklearn/tree/_tree.pyx":3749 * property impurity: * def __get__(self): * return self._get_node_ndarray()['impurity'][:self.node_count] # <<<<<<<<<<<<<< @@ -22483,19 +24736,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ * property n_node_samples: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_impurity); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_impurity); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3038 + /* "sklearn/tree/_tree.pyx":3748 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -22515,7 +24768,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3042 +/* "sklearn/tree/_tree.pyx":3752 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22546,7 +24799,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3043 + /* "sklearn/tree/_tree.pyx":3753 * property n_node_samples: * def __get__(self): * return self._get_node_ndarray()['n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -22554,19 +24807,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s * property weighted_n_node_samples: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3042 + /* "sklearn/tree/_tree.pyx":3752 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22586,7 +24839,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3046 +/* "sklearn/tree/_tree.pyx":3756 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22617,7 +24870,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3047 + /* "sklearn/tree/_tree.pyx":3757 * property weighted_n_node_samples: * def __get__(self): * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -22625,19 +24878,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ * property value: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_weighted_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_weighted_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3046 + /* "sklearn/tree/_tree.pyx":3756 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22657,7 +24910,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3050 +/* "sklearn/tree/_tree.pyx":3760 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -22688,7 +24941,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3051 + /* "sklearn/tree/_tree.pyx":3761 * property value: * def __get__(self): * return self._get_value_ndarray()[:self.node_count] # <<<<<<<<<<<<<< @@ -22696,16 +24949,16 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3050 + /* "sklearn/tree/_tree.pyx":3760 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -22725,7 +24978,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3053 +/* "sklearn/tree/_tree.pyx":3763 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -22766,16 +25019,16 @@ static int __pyx_pw_7sklearn_4tree_5_tree_4Tree_1__cinit__(PyObject *__pyx_v_sel case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_classes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_outputs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -22784,19 +25037,19 @@ static int __pyx_pw_7sklearn_4tree_5_tree_4Tree_1__cinit__(PyObject *__pyx_v_sel values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_n_features = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n_features == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_features = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n_features == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_n_classes = ((PyArrayObject *)values[1]); - __pyx_v_n_outputs = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n_outputs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_outputs = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n_outputs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.Tree.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_Tree *)__pyx_v_self), __pyx_v_n_features, __pyx_v_n_classes, __pyx_v_n_outputs); /* function exit code */ @@ -22831,11 +25084,11 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle __pyx_pybuffernd_n_classes.rcbuffer = &__pyx_pybuffer_n_classes; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_n_classes.diminfo[0].strides = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n_classes.diminfo[0].shape = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.shape[0]; - /* "sklearn/tree/_tree.pyx":3057 + /* "sklearn/tree/_tree.pyx":3767 * """Constructor.""" * # Input/Output layout * self.n_features = n_features # <<<<<<<<<<<<<< @@ -22844,7 +25097,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_features = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":3058 + /* "sklearn/tree/_tree.pyx":3768 * # Input/Output layout * self.n_features = n_features * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -22853,7 +25106,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_outputs = __pyx_v_n_outputs; - /* "sklearn/tree/_tree.pyx":3059 + /* "sklearn/tree/_tree.pyx":3769 * self.n_features = n_features * self.n_outputs = n_outputs * self.n_classes = NULL # <<<<<<<<<<<<<< @@ -22862,25 +25115,25 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_tree.pyx":3060 + /* "sklearn/tree/_tree.pyx":3770 * self.n_outputs = n_outputs * self.n_classes = NULL * safe_realloc(&self.n_classes, n_outputs) # <<<<<<<<<<<<<< * * self.max_n_classes = np.max(n_classes) */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3062 + /* "sklearn/tree/_tree.pyx":3772 * safe_realloc(&self.n_classes, n_outputs) * * self.max_n_classes = np.max(n_classes) # <<<<<<<<<<<<<< * self.value_stride = n_outputs * self.max_n_classes * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -22894,25 +25147,25 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_n_classes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_n_classes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_n_classes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n_classes)); PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_n_classes)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->max_n_classes = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3063 + /* "sklearn/tree/_tree.pyx":3773 * * self.max_n_classes = np.max(n_classes) * self.value_stride = n_outputs * self.max_n_classes # <<<<<<<<<<<<<< @@ -22921,7 +25174,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value_stride = (__pyx_v_n_outputs * __pyx_v_self->max_n_classes); - /* "sklearn/tree/_tree.pyx":3066 + /* "sklearn/tree/_tree.pyx":3776 * * cdef SIZE_t k * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -22932,7 +25185,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_6; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3067 + /* "sklearn/tree/_tree.pyx":3777 * cdef SIZE_t k * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -22943,7 +25196,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle (__pyx_v_self->n_classes[__pyx_v_k]) = (*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_n_classes.diminfo[0].strides)); } - /* "sklearn/tree/_tree.pyx":3070 + /* "sklearn/tree/_tree.pyx":3780 * * # Inner structures * self.max_depth = 0 # <<<<<<<<<<<<<< @@ -22952,7 +25205,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->max_depth = 0; - /* "sklearn/tree/_tree.pyx":3071 + /* "sklearn/tree/_tree.pyx":3781 * # Inner structures * self.max_depth = 0 * self.node_count = 0 # <<<<<<<<<<<<<< @@ -22961,7 +25214,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->node_count = 0; - /* "sklearn/tree/_tree.pyx":3072 + /* "sklearn/tree/_tree.pyx":3782 * self.max_depth = 0 * self.node_count = 0 * self.capacity = 0 # <<<<<<<<<<<<<< @@ -22970,7 +25223,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->capacity = 0; - /* "sklearn/tree/_tree.pyx":3073 + /* "sklearn/tree/_tree.pyx":3783 * self.node_count = 0 * self.capacity = 0 * self.value = NULL # <<<<<<<<<<<<<< @@ -22979,7 +25232,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value = NULL; - /* "sklearn/tree/_tree.pyx":3074 + /* "sklearn/tree/_tree.pyx":3784 * self.capacity = 0 * self.value = NULL * self.nodes = NULL # <<<<<<<<<<<<<< @@ -22988,7 +25241,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->nodes = NULL; - /* "sklearn/tree/_tree.pyx":3053 + /* "sklearn/tree/_tree.pyx":3763 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -23018,7 +25271,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3076 +/* "sklearn/tree/_tree.pyx":3786 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23041,7 +25294,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":3079 + /* "sklearn/tree/_tree.pyx":3789 * """Destructor.""" * # Free all inner structures * free(self.n_classes) # <<<<<<<<<<<<<< @@ -23050,7 +25303,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 */ free(__pyx_v_self->n_classes); - /* "sklearn/tree/_tree.pyx":3080 + /* "sklearn/tree/_tree.pyx":3790 * # Free all inner structures * free(self.n_classes) * free(self.value) # <<<<<<<<<<<<<< @@ -23059,7 +25312,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 */ free(__pyx_v_self->value); - /* "sklearn/tree/_tree.pyx":3081 + /* "sklearn/tree/_tree.pyx":3791 * free(self.n_classes) * free(self.value) * free(self.nodes) # <<<<<<<<<<<<<< @@ -23068,7 +25321,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 */ free(__pyx_v_self->nodes); - /* "sklearn/tree/_tree.pyx":3076 + /* "sklearn/tree/_tree.pyx":3786 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23080,7 +25333,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":3083 +/* "sklearn/tree/_tree.pyx":3793 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -23114,7 +25367,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":3085 + /* "sklearn/tree/_tree.pyx":3795 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< @@ -23122,37 +25375,37 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o * self.n_outputs), self.__getstate__()) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3086 + /* "sklearn/tree/_tree.pyx":3796 * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), # <<<<<<<<<<<<<< * self.n_outputs), self.__getstate__()) * */ - __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3086; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":3087 + /* "sklearn/tree/_tree.pyx":3797 * return (Tree, (self.n_features, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) # <<<<<<<<<<<<<< * * def __getstate__(self): */ - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3085 + /* "sklearn/tree/_tree.pyx":3795 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -23164,14 +25417,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":3087 + /* "sklearn/tree/_tree.pyx":3797 * return (Tree, (self.n_features, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) # <<<<<<<<<<<<<< * * def __getstate__(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -23184,22 +25437,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":3085 + /* "sklearn/tree/_tree.pyx":3795 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3085; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); @@ -23214,7 +25467,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3083 + /* "sklearn/tree/_tree.pyx":3793 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -23236,7 +25489,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3089 +/* "sklearn/tree/_tree.pyx":3799 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -23268,55 +25521,55 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":3091 + /* "sklearn/tree/_tree.pyx":3801 * def __getstate__(self): * """Getstate re-implementation, for pickling.""" * d = {} # <<<<<<<<<<<<<< * d["node_count"] = self.node_count * d["nodes"] = self._get_node_ndarray() */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3092 + /* "sklearn/tree/_tree.pyx":3802 * """Getstate re-implementation, for pickling.""" * d = {} * d["node_count"] = self.node_count # <<<<<<<<<<<<<< * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->node_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->node_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_node_count, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3092; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_node_count, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3093 + /* "sklearn/tree/_tree.pyx":3803 * d = {} * d["node_count"] = self.node_count * d["nodes"] = self._get_node_ndarray() # <<<<<<<<<<<<<< * d["values"] = self._get_value_ndarray() * return d */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_nodes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_nodes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3094 + /* "sklearn/tree/_tree.pyx":3804 * d["node_count"] = self.node_count * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() # <<<<<<<<<<<<<< * return d * */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_values, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3094; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_values, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3095 + /* "sklearn/tree/_tree.pyx":3805 * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() * return d # <<<<<<<<<<<<<< @@ -23328,7 +25581,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx __pyx_r = __pyx_v_d; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3089 + /* "sklearn/tree/_tree.pyx":3799 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -23348,7 +25601,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3097 +/* "sklearn/tree/_tree.pyx":3807 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -23393,101 +25646,101 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate__", 0); - /* "sklearn/tree/_tree.pyx":3099 + /* "sklearn/tree/_tree.pyx":3809 * def __setstate__(self, d): * """Setstate re-implementation, for unpickling.""" * self.node_count = d["node_count"] # <<<<<<<<<<<<<< * * if 'nodes' not in d: */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_node_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_node_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3099; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->node_count = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3101 + /* "sklearn/tree/_tree.pyx":3811 * self.node_count = d["node_count"] * * if 'nodes' not in d: # <<<<<<<<<<<<<< * raise ValueError('You have loaded Tree version which ' * 'cannot be imported') */ - __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_nodes, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_nodes, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3102 + /* "sklearn/tree/_tree.pyx":3812 * * if 'nodes' not in d: * raise ValueError('You have loaded Tree version which ' # <<<<<<<<<<<<<< * 'cannot be imported') * */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3105 + /* "sklearn/tree/_tree.pyx":3815 * 'cannot be imported') * * node_ndarray = d['nodes'] # <<<<<<<<<<<<<< * value_ndarray = d['values'] * */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_nodes); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_nodes); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_v_node_ndarray = __pyx_t_1; __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3106 + /* "sklearn/tree/_tree.pyx":3816 * * node_ndarray = d['nodes'] * value_ndarray = d['values'] # <<<<<<<<<<<<<< * * value_shape = (node_ndarray.shape[0], self.n_outputs, */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_values); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_values); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_v_value_ndarray = __pyx_t_1; __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3108 + /* "sklearn/tree/_tree.pyx":3818 * value_ndarray = d['values'] * * value_shape = (node_ndarray.shape[0], self.n_outputs, # <<<<<<<<<<<<<< * self.max_n_classes) * if (node_ndarray.ndim != 1 or */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3109 + /* "sklearn/tree/_tree.pyx":3819 * * value_shape = (node_ndarray.shape[0], self.n_outputs, * self.max_n_classes) # <<<<<<<<<<<<<< * if (node_ndarray.ndim != 1 or * node_ndarray.dtype != NODE_DTYPE or */ - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":3108 + /* "sklearn/tree/_tree.pyx":3818 * value_ndarray = d['values'] * * value_shape = (node_ndarray.shape[0], self.n_outputs, # <<<<<<<<<<<<<< * self.max_n_classes) * if (node_ndarray.ndim != 1 or */ - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); @@ -23501,18 +25754,18 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __pyx_v_value_shape = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "sklearn/tree/_tree.pyx":3110 + /* "sklearn/tree/_tree.pyx":3820 * value_shape = (node_ndarray.shape[0], self.n_outputs, * self.max_n_classes) * if (node_ndarray.ndim != 1 or # <<<<<<<<<<<<<< * node_ndarray.dtype != NODE_DTYPE or * not node_ndarray.flags.c_contiguous or */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { } else { @@ -23520,21 +25773,21 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3111 + /* "sklearn/tree/_tree.pyx":3821 * self.max_n_classes) * if (node_ndarray.ndim != 1 or * node_ndarray.dtype != NODE_DTYPE or # <<<<<<<<<<<<<< * not node_ndarray.flags.c_contiguous or * value_ndarray.shape != value_shape or */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) { } else { @@ -23542,19 +25795,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3112 + /* "sklearn/tree/_tree.pyx":3822 * if (node_ndarray.ndim != 1 or * node_ndarray.dtype != NODE_DTYPE or * not node_ndarray.flags.c_contiguous or # <<<<<<<<<<<<<< * value_ndarray.shape != value_shape or * not value_ndarray.flags.c_contiguous or */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = ((!__pyx_t_3) != 0); if (!__pyx_t_8) { @@ -23563,18 +25816,18 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3113 + /* "sklearn/tree/_tree.pyx":3823 * node_ndarray.dtype != NODE_DTYPE or * not node_ndarray.flags.c_contiguous or * value_ndarray.shape != value_shape or # <<<<<<<<<<<<<< * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_value_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_value_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { } else { @@ -23582,19 +25835,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3114 + /* "sklearn/tree/_tree.pyx":3824 * not node_ndarray.flags.c_contiguous or * value_ndarray.shape != value_shape or * not value_ndarray.flags.c_contiguous or # <<<<<<<<<<<<<< * value_ndarray.dtype != np.float64): * raise ValueError('Did not recognise loaded array layout') */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = ((!__pyx_t_8) != 0); if (!__pyx_t_3) { @@ -23603,60 +25856,60 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3115 + /* "sklearn/tree/_tree.pyx":3825 * value_ndarray.shape != value_shape or * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): # <<<<<<<<<<<<<< * raise ValueError('Did not recognise loaded array layout') * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3116 + /* "sklearn/tree/_tree.pyx":3826 * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): * raise ValueError('Did not recognise loaded array layout') # <<<<<<<<<<<<<< * * self.capacity = node_ndarray.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3118 + /* "sklearn/tree/_tree.pyx":3828 * raise ValueError('Did not recognise loaded array layout') * * self.capacity = node_ndarray.shape[0] # <<<<<<<<<<<<<< * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_self->capacity = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3119 + /* "sklearn/tree/_tree.pyx":3829 * * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: # <<<<<<<<<<<<<< @@ -23669,32 +25922,32 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __pyx_t_4 = ((__pyx_t_9 != 0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3120 + /* "sklearn/tree/_tree.pyx":3830 * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) # <<<<<<<<<<<<<< * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) */ - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->capacity); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->capacity); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_resizing_tree_to_d, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_resizing_tree_to_d, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3121 + /* "sklearn/tree/_tree.pyx":3831 * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) * nodes = memcpy(self.nodes, ( node_ndarray).data, # <<<<<<<<<<<<<< @@ -23703,7 +25956,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx */ __pyx_v_nodes = memcpy(__pyx_v_self->nodes, ((PyArrayObject *)__pyx_v_node_ndarray)->data, (__pyx_v_self->capacity * (sizeof(struct __pyx_t_7sklearn_4tree_5_tree_Node)))); - /* "sklearn/tree/_tree.pyx":3123 + /* "sklearn/tree/_tree.pyx":3833 * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) * value = memcpy(self.value, ( value_ndarray).data, # <<<<<<<<<<<<<< @@ -23712,7 +25965,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx */ __pyx_v_value = memcpy(__pyx_v_self->value, ((PyArrayObject *)__pyx_v_value_ndarray)->data, ((__pyx_v_self->capacity * __pyx_v_self->value_stride) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":3097 + /* "sklearn/tree/_tree.pyx":3807 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -23739,7 +25992,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3126 +/* "sklearn/tree/_tree.pyx":3836 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -23757,7 +26010,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_resize", 0); - /* "sklearn/tree/_tree.pyx":3129 + /* "sklearn/tree/_tree.pyx":3839 * """Resize all inner arrays to `capacity`, if `capacity` == -1, then * double the size of the inner arrays.""" * if self._resize_c(capacity) != 0: # <<<<<<<<<<<<<< @@ -23770,17 +26023,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __pyx_t_3 = ((__pyx_t_1 != 0) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3130 + /* "sklearn/tree/_tree.pyx":3840 * double the size of the inner arrays.""" * if self._resize_c(capacity) != 0: * raise MemoryError() # <<<<<<<<<<<<<< * * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3126 + /* "sklearn/tree/_tree.pyx":3836 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -23796,7 +26049,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":3134 +/* "sklearn/tree/_tree.pyx":3844 * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 * # (i.e., older MSVC). * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: # <<<<<<<<<<<<<< @@ -23816,7 +26069,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } } - /* "sklearn/tree/_tree.pyx":3136 + /* "sklearn/tree/_tree.pyx":3846 * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: # <<<<<<<<<<<<<< @@ -23834,7 +26087,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3137 + /* "sklearn/tree/_tree.pyx":3847 * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: * return 0 # <<<<<<<<<<<<<< @@ -23845,7 +26098,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3139 + /* "sklearn/tree/_tree.pyx":3849 * return 0 * * if capacity == (-1): # <<<<<<<<<<<<<< @@ -23855,7 +26108,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_capacity == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3140 + /* "sklearn/tree/_tree.pyx":3850 * * if capacity == (-1): * if self.capacity == 0: # <<<<<<<<<<<<<< @@ -23865,7 +26118,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_self->capacity == 0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3141 + /* "sklearn/tree/_tree.pyx":3851 * if capacity == (-1): * if self.capacity == 0: * capacity = 3 # default initial value # <<<<<<<<<<<<<< @@ -23877,7 +26130,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":3143 + /* "sklearn/tree/_tree.pyx":3853 * capacity = 3 # default initial value * else: * capacity = 2 * self.capacity # <<<<<<<<<<<<<< @@ -23891,7 +26144,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":3146 + /* "sklearn/tree/_tree.pyx":3856 * * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) # <<<<<<<<<<<<<< @@ -23900,7 +26153,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_ptr = realloc(__pyx_v_self->nodes, (__pyx_v_capacity * (sizeof(struct __pyx_t_7sklearn_4tree_5_tree_Node)))); - /* "sklearn/tree/_tree.pyx":3147 + /* "sklearn/tree/_tree.pyx":3857 * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -23910,7 +26163,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3148 + /* "sklearn/tree/_tree.pyx":3858 * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -23921,7 +26174,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3149 + /* "sklearn/tree/_tree.pyx":3859 * if ptr == NULL: * return -1 * self.nodes = ptr # <<<<<<<<<<<<<< @@ -23930,7 +26183,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_self->nodes = ((struct __pyx_t_7sklearn_4tree_5_tree_Node *)__pyx_v_ptr); - /* "sklearn/tree/_tree.pyx":3150 + /* "sklearn/tree/_tree.pyx":3860 * return -1 * self.nodes = ptr * ptr = realloc(self.value, # <<<<<<<<<<<<<< @@ -23939,7 +26192,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_ptr = realloc(__pyx_v_self->value, ((__pyx_v_capacity * __pyx_v_self->value_stride) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":3152 + /* "sklearn/tree/_tree.pyx":3862 * ptr = realloc(self.value, * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -23949,7 +26202,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3153 + /* "sklearn/tree/_tree.pyx":3863 * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -23960,7 +26213,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3154 + /* "sklearn/tree/_tree.pyx":3864 * if ptr == NULL: * return -1 * self.value = ptr # <<<<<<<<<<<<<< @@ -23969,7 +26222,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_self->value = ((double *)__pyx_v_ptr); - /* "sklearn/tree/_tree.pyx":3157 + /* "sklearn/tree/_tree.pyx":3867 * * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: # <<<<<<<<<<<<<< @@ -23979,7 +26232,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_capacity > __pyx_v_self->capacity) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3158 + /* "sklearn/tree/_tree.pyx":3868 * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: * memset((self.value + self.capacity * self.value_stride), 0, # <<<<<<<<<<<<<< @@ -23991,7 +26244,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L10:; - /* "sklearn/tree/_tree.pyx":3163 + /* "sklearn/tree/_tree.pyx":3873 * * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: # <<<<<<<<<<<<<< @@ -24001,7 +26254,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_capacity < __pyx_v_self->node_count) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3164 + /* "sklearn/tree/_tree.pyx":3874 * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: * self.node_count = capacity # <<<<<<<<<<<<<< @@ -24013,7 +26266,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L11:; - /* "sklearn/tree/_tree.pyx":3166 + /* "sklearn/tree/_tree.pyx":3876 * self.node_count = capacity * * self.capacity = capacity # <<<<<<<<<<<<<< @@ -24022,7 +26275,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_self->capacity = __pyx_v_capacity; - /* "sklearn/tree/_tree.pyx":3167 + /* "sklearn/tree/_tree.pyx":3877 * * self.capacity = capacity * return 0 # <<<<<<<<<<<<<< @@ -24032,7 +26285,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3134 + /* "sklearn/tree/_tree.pyx":3844 * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 * # (i.e., older MSVC). * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: # <<<<<<<<<<<<<< @@ -24045,7 +26298,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3169 +/* "sklearn/tree/_tree.pyx":3879 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -24060,7 +26313,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; int __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3178 + /* "sklearn/tree/_tree.pyx":3888 * Returns (size_t)(-1) on error. * """ * cdef SIZE_t node_id = self.node_count # <<<<<<<<<<<<<< @@ -24070,7 +26323,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_1 = __pyx_v_self->node_count; __pyx_v_node_id = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3180 + /* "sklearn/tree/_tree.pyx":3890 * cdef SIZE_t node_id = self.node_count * * if node_id >= self.capacity: # <<<<<<<<<<<<<< @@ -24080,7 +26333,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = ((__pyx_v_node_id >= __pyx_v_self->capacity) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3181 + /* "sklearn/tree/_tree.pyx":3891 * * if node_id >= self.capacity: * if self._resize_c() != 0: # <<<<<<<<<<<<<< @@ -24090,7 +26343,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = ((((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_resize_c(__pyx_v_self, NULL) != 0) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3182 + /* "sklearn/tree/_tree.pyx":3892 * if node_id >= self.capacity: * if self._resize_c() != 0: * return (-1) # <<<<<<<<<<<<<< @@ -24104,7 +26357,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3184 + /* "sklearn/tree/_tree.pyx":3894 * return (-1) * * cdef Node* node = &self.nodes[node_id] # <<<<<<<<<<<<<< @@ -24113,7 +26366,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node_id])); - /* "sklearn/tree/_tree.pyx":3185 + /* "sklearn/tree/_tree.pyx":3895 * * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity # <<<<<<<<<<<<<< @@ -24122,7 +26375,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":3186 + /* "sklearn/tree/_tree.pyx":3896 * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity * node.n_node_samples = n_node_samples # <<<<<<<<<<<<<< @@ -24131,7 +26384,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->n_node_samples = __pyx_v_n_node_samples; - /* "sklearn/tree/_tree.pyx":3187 + /* "sklearn/tree/_tree.pyx":3897 * node.impurity = impurity * node.n_node_samples = n_node_samples * node.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -24140,7 +26393,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":3189 + /* "sklearn/tree/_tree.pyx":3899 * node.weighted_n_node_samples = weighted_n_node_samples * * if parent != _TREE_UNDEFINED: # <<<<<<<<<<<<<< @@ -24150,7 +26403,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = ((__pyx_v_parent != __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3190 + /* "sklearn/tree/_tree.pyx":3900 * * if parent != _TREE_UNDEFINED: * if is_left: # <<<<<<<<<<<<<< @@ -24160,7 +26413,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = (__pyx_v_is_left != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3191 + /* "sklearn/tree/_tree.pyx":3901 * if parent != _TREE_UNDEFINED: * if is_left: * self.nodes[parent].left_child = node_id # <<<<<<<<<<<<<< @@ -24172,7 +26425,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3193 + /* "sklearn/tree/_tree.pyx":3903 * self.nodes[parent].left_child = node_id * else: * self.nodes[parent].right_child = node_id # <<<<<<<<<<<<<< @@ -24186,7 +26439,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":3195 + /* "sklearn/tree/_tree.pyx":3905 * self.nodes[parent].right_child = node_id * * if is_leaf: # <<<<<<<<<<<<<< @@ -24196,7 +26449,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = (__pyx_v_is_leaf != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3196 + /* "sklearn/tree/_tree.pyx":3906 * * if is_leaf: * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -24205,7 +26458,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->left_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":3197 + /* "sklearn/tree/_tree.pyx":3907 * if is_leaf: * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -24214,7 +26467,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->right_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":3198 + /* "sklearn/tree/_tree.pyx":3908 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -24223,7 +26476,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->feature = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; - /* "sklearn/tree/_tree.pyx":3199 + /* "sklearn/tree/_tree.pyx":3909 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -24235,7 +26488,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3203 + /* "sklearn/tree/_tree.pyx":3913 * else: * # left_child and right_child will be set later * node.feature = feature # <<<<<<<<<<<<<< @@ -24244,7 +26497,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->feature = __pyx_v_feature; - /* "sklearn/tree/_tree.pyx":3204 + /* "sklearn/tree/_tree.pyx":3914 * # left_child and right_child will be set later * node.feature = feature * node.threshold = threshold # <<<<<<<<<<<<<< @@ -24255,7 +26508,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":3206 + /* "sklearn/tree/_tree.pyx":3916 * node.threshold = threshold * * self.node_count += 1 # <<<<<<<<<<<<<< @@ -24264,7 +26517,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_self->node_count = (__pyx_v_self->node_count + 1); - /* "sklearn/tree/_tree.pyx":3208 + /* "sklearn/tree/_tree.pyx":3918 * self.node_count += 1 * * return node_id # <<<<<<<<<<<<<< @@ -24274,7 +26527,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_r = __pyx_v_node_id; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3169 + /* "sklearn/tree/_tree.pyx":3879 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -24287,7 +26540,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3210 +/* "sklearn/tree/_tree.pyx":3920 * return node_id * * cpdef np.ndarray predict(self, object X): # <<<<<<<<<<<<<< @@ -24316,7 +26569,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_predict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_predict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_4Tree_11predict)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -24332,21 +26585,21 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_X); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -24355,30 +26608,30 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3212 + /* "sklearn/tree/_tree.pyx":3922 * cpdef np.ndarray predict(self, object X): * """Predict target for X.""" * out = self._get_value_ndarray().take(self.apply(X), axis=0, # <<<<<<<<<<<<<< * mode='clip') * if self.n_outputs == 1: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->apply(__pyx_v_self, __pyx_v_X, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->apply(__pyx_v_self, __pyx_v_X, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mode, __pyx_n_s_clip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mode, __pyx_n_s_clip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24386,7 +26639,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_v_out = __pyx_t_5; __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":3214 + /* "sklearn/tree/_tree.pyx":3924 * out = self._get_value_ndarray().take(self.apply(X), axis=0, * mode='clip') * if self.n_outputs == 1: # <<<<<<<<<<<<<< @@ -24396,21 +26649,21 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_t_6 = ((__pyx_v_self->n_outputs == 1) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3215 + /* "sklearn/tree/_tree.pyx":3925 * mode='clip') * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) # <<<<<<<<<<<<<< * return out * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_7 = 0; @@ -24424,7 +26677,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_t_7 = 1; } } - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -24435,7 +26688,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -24445,7 +26698,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3216 + /* "sklearn/tree/_tree.pyx":3926 * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) * return out # <<<<<<<<<<<<<< @@ -24453,12 +26706,12 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o * cpdef np.ndarray apply(self, object X): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_out); __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3210 + /* "sklearn/tree/_tree.pyx":3920 * return node_id * * cpdef np.ndarray predict(self, object X): # <<<<<<<<<<<<<< @@ -24506,7 +26759,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("predict", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24523,7 +26776,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3218 +/* "sklearn/tree/_tree.pyx":3928 * return out * * cpdef np.ndarray apply(self, object X): # <<<<<<<<<<<<<< @@ -24549,7 +26802,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_4Tree_13apply)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -24565,21 +26818,21 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_X); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -24588,14 +26841,14 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3220 + /* "sklearn/tree/_tree.pyx":3930 * cpdef np.ndarray apply(self, object X): * """Finds the terminal region (=leaf node) for each sample in X.""" * if issparse(X): # <<<<<<<<<<<<<< * return self._apply_sparse_csr(X) * else: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -24608,25 +26861,25 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_X); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3221 + /* "sklearn/tree/_tree.pyx":3931 * """Finds the terminal region (=leaf node) for each sample in X.""" * if issparse(X): * return self._apply_sparse_csr(X) # <<<<<<<<<<<<<< @@ -24634,7 +26887,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj * return self._apply_dense(X) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -24642,7 +26895,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } /*else*/ { - /* "sklearn/tree/_tree.pyx":3223 + /* "sklearn/tree/_tree.pyx":3933 * return self._apply_sparse_csr(X) * else: * return self._apply_dense(X) # <<<<<<<<<<<<<< @@ -24650,14 +26903,14 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3218 + /* "sklearn/tree/_tree.pyx":3928 * return out * * cpdef np.ndarray apply(self, object X): # <<<<<<<<<<<<<< @@ -24703,7 +26956,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24720,7 +26973,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3226 +/* "sklearn/tree/_tree.pyx":3936 * * * cdef inline np.ndarray _apply_dense(self, object X): # <<<<<<<<<<<<<< @@ -24762,7 +27015,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_pybuffernd_out.data = NULL; __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; - /* "sklearn/tree/_tree.pyx":3230 + /* "sklearn/tree/_tree.pyx":3940 * * # Check input * if not isinstance(X, np.ndarray): # <<<<<<<<<<<<<< @@ -24773,93 +27026,93 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3232 + /* "sklearn/tree/_tree.pyx":3942 * if not isinstance(X, np.ndarray): * raise ValueError("X should be in np.ndarray format, got %s" * % type(X)) # <<<<<<<<<<<<<< * * if X.dtype != DTYPE: */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_np_ndarray_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_np_ndarray_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3231 + /* "sklearn/tree/_tree.pyx":3941 * # Check input * if not isinstance(X, np.ndarray): * raise ValueError("X should be in np.ndarray format, got %s" # <<<<<<<<<<<<<< * % type(X)) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3234 + /* "sklearn/tree/_tree.pyx":3944 * % type(X)) * * if X.dtype != DTYPE: # <<<<<<<<<<<<<< * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3235 + /* "sklearn/tree/_tree.pyx":3945 * * if X.dtype != DTYPE: * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) # <<<<<<<<<<<<<< * * # Extract input */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3238 + /* "sklearn/tree/_tree.pyx":3948 * * # Extract input * cdef np.ndarray X_ndarray = X # <<<<<<<<<<<<<< * cdef DTYPE_t* X_ptr = X_ndarray.data * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize */ - if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __pyx_v_X; __Pyx_INCREF(__pyx_t_4); __pyx_v_X_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3239 + /* "sklearn/tree/_tree.pyx":3949 * # Extract input * cdef np.ndarray X_ndarray = X * cdef DTYPE_t* X_ptr = X_ndarray.data # <<<<<<<<<<<<<< @@ -24868,107 +27121,107 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_X_ptr = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_ndarray->data); - /* "sklearn/tree/_tree.pyx":3240 + /* "sklearn/tree/_tree.pyx":3950 * cdef np.ndarray X_ndarray = X * cdef DTYPE_t* X_ptr = X_ndarray.data * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize # <<<<<<<<<<<<<< * cdef SIZE_t X_fx_stride = X.strides[1] / X.itemsize * cdef SIZE_t n_samples = X.shape[0] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_X_sample_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_6) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_7)); - /* "sklearn/tree/_tree.pyx":3241 + /* "sklearn/tree/_tree.pyx":3951 * cdef DTYPE_t* X_ptr = X_ndarray.data * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize * cdef SIZE_t X_fx_stride = X.strides[1] / X.itemsize # <<<<<<<<<<<<<< * cdef SIZE_t n_samples = X.shape[0] * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_X_fx_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_7) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_6)); - /* "sklearn/tree/_tree.pyx":3242 + /* "sklearn/tree/_tree.pyx":3952 * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize * cdef SIZE_t X_fx_stride = X.strides[1] / X.itemsize * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< * * # Initialize output */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_n_samples = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":3245 + /* "sklearn/tree/_tree.pyx":3955 * * # Initialize output * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) # <<<<<<<<<<<<<< * cdef SIZE_t* out_ptr = out.data * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_intp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_intp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; } } @@ -24976,7 +27229,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_v_out = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "sklearn/tree/_tree.pyx":3246 + /* "sklearn/tree/_tree.pyx":3956 * # Initialize output * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) * cdef SIZE_t* out_ptr = out.data # <<<<<<<<<<<<<< @@ -24985,7 +27238,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_out_ptr = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_out->data); - /* "sklearn/tree/_tree.pyx":3249 + /* "sklearn/tree/_tree.pyx":3959 * * # Initialize auxiliary data-structure * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -24994,7 +27247,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":3250 + /* "sklearn/tree/_tree.pyx":3960 * # Initialize auxiliary data-structure * cdef Node* node = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -25003,7 +27256,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":3252 + /* "sklearn/tree/_tree.pyx":3962 * cdef SIZE_t i = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -25017,7 +27270,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3253 + /* "sklearn/tree/_tree.pyx":3963 * * with nogil: * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -25028,7 +27281,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":3254 + /* "sklearn/tree/_tree.pyx":3964 * with nogil: * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -25038,7 +27291,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_11 = __pyx_v_self->nodes; __pyx_v_node = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":3256 + /* "sklearn/tree/_tree.pyx":3966 * node = self.nodes * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -25049,7 +27302,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_2 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (!__pyx_t_2) break; - /* "sklearn/tree/_tree.pyx":3259 + /* "sklearn/tree/_tree.pyx":3969 * # ... and node.right_child != _TREE_LEAF: * if X_ptr[X_sample_stride * i + * X_fx_stride * node.feature] <= node.threshold: # <<<<<<<<<<<<<< @@ -25059,7 +27312,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_2 = (((__pyx_v_X_ptr[((__pyx_v_X_sample_stride * __pyx_v_i) + (__pyx_v_X_fx_stride * __pyx_v_node->feature))]) <= __pyx_v_node->threshold) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3260 + /* "sklearn/tree/_tree.pyx":3970 * if X_ptr[X_sample_stride * i + * X_fx_stride * node.feature] <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -25071,7 +27324,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3262 + /* "sklearn/tree/_tree.pyx":3972 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -25083,7 +27336,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_L12:; } - /* "sklearn/tree/_tree.pyx":3264 + /* "sklearn/tree/_tree.pyx":3974 * node = &self.nodes[node.right_child] * * out_ptr[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -25094,7 +27347,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } } - /* "sklearn/tree/_tree.pyx":3252 + /* "sklearn/tree/_tree.pyx":3962 * cdef SIZE_t i = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -25112,7 +27365,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } } - /* "sklearn/tree/_tree.pyx":3266 + /* "sklearn/tree/_tree.pyx":3976 * out_ptr[i] = (node - self.nodes) # node offset * * return out # <<<<<<<<<<<<<< @@ -25124,7 +27377,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3226 + /* "sklearn/tree/_tree.pyx":3936 * * * cdef inline np.ndarray _apply_dense(self, object X): # <<<<<<<<<<<<<< @@ -25156,7 +27409,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3268 +/* "sklearn/tree/_tree.pyx":3978 * return out * * cdef inline np.ndarray _apply_sparse_csr(self, object X): # <<<<<<<<<<<<<< @@ -25228,109 +27481,109 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_pybuffernd_out.data = NULL; __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; - /* "sklearn/tree/_tree.pyx":3273 + /* "sklearn/tree/_tree.pyx":3983 * """ * # Check input * if not isinstance(X, csr_matrix): # <<<<<<<<<<<<<< * raise ValueError("X should be in csr_matrix format, got %s" * % type(X)) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3275 + /* "sklearn/tree/_tree.pyx":3985 * if not isinstance(X, csr_matrix): * raise ValueError("X should be in csr_matrix format, got %s" * % type(X)) # <<<<<<<<<<<<<< * * if X.dtype != DTYPE: */ - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_csr_matrix_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_csr_matrix_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3274 + /* "sklearn/tree/_tree.pyx":3984 * # Check input * if not isinstance(X, csr_matrix): * raise ValueError("X should be in csr_matrix format, got %s" # <<<<<<<<<<<<<< * % type(X)) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3277 + /* "sklearn/tree/_tree.pyx":3987 * % type(X)) * * if X.dtype != DTYPE: # <<<<<<<<<<<<<< * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3278 + /* "sklearn/tree/_tree.pyx":3988 * * if X.dtype != DTYPE: * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) # <<<<<<<<<<<<<< * * # Extract input */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3281 + /* "sklearn/tree/_tree.pyx":3991 * * # Extract input * cdef np.ndarray[ndim=1, dtype=DTYPE_t] X_data_ndarray = X.data # <<<<<<<<<<<<<< * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indices_ndarray = X.indices * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_X_data_ndarray = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_X_data_ndarray.diminfo[0].strides = __pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X_data_ndarray.diminfo[0].shape = __pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer.shape[0]; } } @@ -25338,22 +27591,22 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_X_data_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3282 + /* "sklearn/tree/_tree.pyx":3992 * # Extract input * cdef np.ndarray[ndim=1, dtype=DTYPE_t] X_data_ndarray = X.data * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indices_ndarray = X.indices # <<<<<<<<<<<<<< * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_X_indices_ndarray = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_X_indices_ndarray.diminfo[0].strides = __pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X_indices_ndarray.diminfo[0].shape = __pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer.shape[0]; } } @@ -25361,22 +27614,22 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_X_indices_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3283 + /* "sklearn/tree/_tree.pyx":3993 * cdef np.ndarray[ndim=1, dtype=DTYPE_t] X_data_ndarray = X.data * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indices_ndarray = X.indices * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr # <<<<<<<<<<<<<< * * cdef DTYPE_t* X_data = X_data_ndarray.data */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_X_indptr_ndarray = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_X_indptr_ndarray.diminfo[0].strides = __pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X_indptr_ndarray.diminfo[0].shape = __pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer.shape[0]; } } @@ -25384,7 +27637,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_X_indptr_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3285 + /* "sklearn/tree/_tree.pyx":3995 * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr * * cdef DTYPE_t* X_data = X_data_ndarray.data # <<<<<<<<<<<<<< @@ -25393,7 +27646,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_data = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_data_ndarray->data); - /* "sklearn/tree/_tree.pyx":3286 + /* "sklearn/tree/_tree.pyx":3996 * * cdef DTYPE_t* X_data = X_data_ndarray.data * cdef INT32_t* X_indices = X_indices_ndarray.data # <<<<<<<<<<<<<< @@ -25402,7 +27655,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_indices = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_X_indices_ndarray->data); - /* "sklearn/tree/_tree.pyx":3287 + /* "sklearn/tree/_tree.pyx":3997 * cdef DTYPE_t* X_data = X_data_ndarray.data * cdef INT32_t* X_indices = X_indices_ndarray.data * cdef INT32_t* X_indptr = X_indptr_ndarray.data # <<<<<<<<<<<<<< @@ -25411,99 +27664,99 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_indptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_X_indptr_ndarray->data); - /* "sklearn/tree/_tree.pyx":3289 + /* "sklearn/tree/_tree.pyx":3999 * cdef INT32_t* X_indptr = X_indptr_ndarray.data * * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< * cdef SIZE_t n_features = X.shape[1] * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_n_samples = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":3290 + /* "sklearn/tree/_tree.pyx":4000 * * cdef SIZE_t n_samples = X.shape[0] * cdef SIZE_t n_features = X.shape[1] # <<<<<<<<<<<<<< * * # Initialize output */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_n_features = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":3293 + /* "sklearn/tree/_tree.pyx":4003 * * # Initialize output * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), # <<<<<<<<<<<<<< * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3294 + /* "sklearn/tree/_tree.pyx":4004 * # Initialize output * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), * dtype=np.intp) # <<<<<<<<<<<<<< * cdef SIZE_t* out_ptr = out.data * */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_intp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_intp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "sklearn/tree/_tree.pyx":3293 + /* "sklearn/tree/_tree.pyx":4003 * * # Initialize output * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), # <<<<<<<<<<<<<< * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data */ - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_t_11); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; } } @@ -25511,7 +27764,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_out = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "sklearn/tree/_tree.pyx":3295 + /* "sklearn/tree/_tree.pyx":4005 * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data # <<<<<<<<<<<<<< @@ -25520,7 +27773,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_out_ptr = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_out->data); - /* "sklearn/tree/_tree.pyx":3298 + /* "sklearn/tree/_tree.pyx":4008 * * # Initialize auxiliary data-structure * cdef DTYPE_t feature_value = 0. # <<<<<<<<<<<<<< @@ -25529,7 +27782,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_feature_value = 0.; - /* "sklearn/tree/_tree.pyx":3299 + /* "sklearn/tree/_tree.pyx":4009 * # Initialize auxiliary data-structure * cdef DTYPE_t feature_value = 0. * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -25538,7 +27791,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":3300 + /* "sklearn/tree/_tree.pyx":4010 * cdef DTYPE_t feature_value = 0. * cdef Node* node = NULL * cdef DTYPE_t* X_sample = NULL # <<<<<<<<<<<<<< @@ -25547,7 +27800,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_sample = NULL; - /* "sklearn/tree/_tree.pyx":3301 + /* "sklearn/tree/_tree.pyx":4011 * cdef Node* node = NULL * cdef DTYPE_t* X_sample = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -25556,7 +27809,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":3302 + /* "sklearn/tree/_tree.pyx":4012 * cdef DTYPE_t* X_sample = NULL * cdef SIZE_t i = 0 * cdef INT32_t k = 0 # <<<<<<<<<<<<<< @@ -25565,7 +27818,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":3307 + /* "sklearn/tree/_tree.pyx":4017 * # for each feature; functionally, it is an efficient way to identify * # which features are nonzero in the present sample. * cdef SIZE_t* feature_to_sample = NULL # <<<<<<<<<<<<<< @@ -25574,25 +27827,25 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_feature_to_sample = NULL; - /* "sklearn/tree/_tree.pyx":3309 + /* "sklearn/tree/_tree.pyx":4019 * cdef SIZE_t* feature_to_sample = NULL * * safe_realloc(&X_sample, n_features * sizeof(DTYPE_t)) # <<<<<<<<<<<<<< * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * */ - __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_X_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_X_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3310 + /* "sklearn/tree/_tree.pyx":4020 * * safe_realloc(&X_sample, n_features * sizeof(DTYPE_t)) * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_feature_to_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_feature_to_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3312 + /* "sklearn/tree/_tree.pyx":4022 * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * * with nogil: # <<<<<<<<<<<<<< @@ -25606,7 +27859,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3313 + /* "sklearn/tree/_tree.pyx":4023 * * with nogil: * memset(feature_to_sample, -1, n_features * sizeof(SIZE_t)) # <<<<<<<<<<<<<< @@ -25615,7 +27868,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ memset(__pyx_v_feature_to_sample, -1, (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); - /* "sklearn/tree/_tree.pyx":3315 + /* "sklearn/tree/_tree.pyx":4025 * memset(feature_to_sample, -1, n_features * sizeof(SIZE_t)) * * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -25626,7 +27879,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_9; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; - /* "sklearn/tree/_tree.pyx":3316 + /* "sklearn/tree/_tree.pyx":4026 * * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -25636,7 +27889,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_14 = __pyx_v_self->nodes; __pyx_v_node = __pyx_t_14; - /* "sklearn/tree/_tree.pyx":3318 + /* "sklearn/tree/_tree.pyx":4028 * node = self.nodes * * for k in range(X_indptr[i], X_indptr[i + 1]): # <<<<<<<<<<<<<< @@ -25647,7 +27900,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru for (__pyx_t_16 = (__pyx_v_X_indptr[__pyx_v_i]); __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_k = __pyx_t_16; - /* "sklearn/tree/_tree.pyx":3319 + /* "sklearn/tree/_tree.pyx":4029 * * for k in range(X_indptr[i], X_indptr[i + 1]): * feature_to_sample[X_indices[k]] = i # <<<<<<<<<<<<<< @@ -25656,7 +27909,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ (__pyx_v_feature_to_sample[(__pyx_v_X_indices[__pyx_v_k])]) = __pyx_v_i; - /* "sklearn/tree/_tree.pyx":3320 + /* "sklearn/tree/_tree.pyx":4030 * for k in range(X_indptr[i], X_indptr[i + 1]): * feature_to_sample[X_indices[k]] = i * X_sample[X_indices[k]] = X_data[k] # <<<<<<<<<<<<<< @@ -25666,7 +27919,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru (__pyx_v_X_sample[(__pyx_v_X_indices[__pyx_v_k])]) = (__pyx_v_X_data[__pyx_v_k]); } - /* "sklearn/tree/_tree.pyx":3323 + /* "sklearn/tree/_tree.pyx":4033 * * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -25677,7 +27930,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_3 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (!__pyx_t_3) break; - /* "sklearn/tree/_tree.pyx":3325 + /* "sklearn/tree/_tree.pyx":4035 * while node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * if feature_to_sample[node.feature] == i: # <<<<<<<<<<<<<< @@ -25687,7 +27940,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_3 = (((__pyx_v_feature_to_sample[__pyx_v_node->feature]) == __pyx_v_i) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3326 + /* "sklearn/tree/_tree.pyx":4036 * # ... and node.right_child != _TREE_LEAF: * if feature_to_sample[node.feature] == i: * feature_value = X_sample[node.feature] # <<<<<<<<<<<<<< @@ -25699,7 +27952,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3329 + /* "sklearn/tree/_tree.pyx":4039 * * else: * feature_value = 0. # <<<<<<<<<<<<<< @@ -25710,7 +27963,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } __pyx_L14:; - /* "sklearn/tree/_tree.pyx":3331 + /* "sklearn/tree/_tree.pyx":4041 * feature_value = 0. * * if feature_value <= node.threshold: # <<<<<<<<<<<<<< @@ -25720,7 +27973,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_3 = ((__pyx_v_feature_value <= __pyx_v_node->threshold) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3332 + /* "sklearn/tree/_tree.pyx":4042 * * if feature_value <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -25732,7 +27985,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3334 + /* "sklearn/tree/_tree.pyx":4044 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -25744,7 +27997,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_L15:; } - /* "sklearn/tree/_tree.pyx":3336 + /* "sklearn/tree/_tree.pyx":4046 * node = &self.nodes[node.right_child] * * out_ptr[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -25754,7 +28007,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru (__pyx_v_out_ptr[__pyx_v_i]) = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_node - __pyx_v_self->nodes)); } - /* "sklearn/tree/_tree.pyx":3339 + /* "sklearn/tree/_tree.pyx":4049 * * # Free auxiliary arrays * free(X_sample) # <<<<<<<<<<<<<< @@ -25763,7 +28016,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ free(__pyx_v_X_sample); - /* "sklearn/tree/_tree.pyx":3340 + /* "sklearn/tree/_tree.pyx":4050 * # Free auxiliary arrays * free(X_sample) * free(feature_to_sample) # <<<<<<<<<<<<<< @@ -25773,7 +28026,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru free(__pyx_v_feature_to_sample); } - /* "sklearn/tree/_tree.pyx":3312 + /* "sklearn/tree/_tree.pyx":4022 * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * * with nogil: # <<<<<<<<<<<<<< @@ -25791,7 +28044,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } } - /* "sklearn/tree/_tree.pyx":3342 + /* "sklearn/tree/_tree.pyx":4052 * free(feature_to_sample) * * return out # <<<<<<<<<<<<<< @@ -25803,7 +28056,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3268 + /* "sklearn/tree/_tree.pyx":3978 * return out * * cdef inline np.ndarray _apply_sparse_csr(self, object X): # <<<<<<<<<<<<<< @@ -25843,7 +28096,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3344 +/* "sklearn/tree/_tree.pyx":4054 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -25897,7 +28150,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compute_feature_importances); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compute_feature_importances); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_4Tree_15compute_feature_importances)) { __Pyx_XDECREF(__pyx_r); @@ -25913,16 +28166,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_normalize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_normalize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_normalize); __Pyx_GIVEREF(__pyx_v_normalize); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_normalize); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -25935,7 +28188,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3348 + /* "sklearn/tree/_tree.pyx":4058 * cdef Node* left * cdef Node* right * cdef Node* nodes = self.nodes # <<<<<<<<<<<<<< @@ -25945,7 +28198,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_6 = __pyx_v_self->nodes; __pyx_v_nodes = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":3349 + /* "sklearn/tree/_tree.pyx":4059 * cdef Node* right * cdef Node* nodes = self.nodes * cdef Node* node = nodes # <<<<<<<<<<<<<< @@ -25954,7 +28207,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_node = __pyx_v_nodes; - /* "sklearn/tree/_tree.pyx":3350 + /* "sklearn/tree/_tree.pyx":4060 * cdef Node* nodes = self.nodes * cdef Node* node = nodes * cdef Node* end_node = node + self.node_count # <<<<<<<<<<<<<< @@ -25963,7 +28216,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_end_node = (__pyx_v_node + __pyx_v_self->node_count); - /* "sklearn/tree/_tree.pyx":3352 + /* "sklearn/tree/_tree.pyx":4062 * cdef Node* end_node = node + self.node_count * * cdef double normalizer = 0. # <<<<<<<<<<<<<< @@ -25972,21 +28225,21 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_normalizer = 0.; - /* "sklearn/tree/_tree.pyx":3355 + /* "sklearn/tree/_tree.pyx":4065 * * cdef np.ndarray[np.float64_t, ndim=1] importances * importances = np.zeros((self.n_features,)) # <<<<<<<<<<<<<< * cdef DOUBLE_t* importance_data = importances.data * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -26002,22 +28255,22 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -26033,13 +28286,13 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } __pyx_pybuffernd_importances.diminfo[0].strides = __pyx_pybuffernd_importances.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_importances.diminfo[0].shape = __pyx_pybuffernd_importances.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __pyx_v_importances = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3356 + /* "sklearn/tree/_tree.pyx":4066 * cdef np.ndarray[np.float64_t, ndim=1] importances * importances = np.zeros((self.n_features,)) * cdef DOUBLE_t* importance_data = importances.data # <<<<<<<<<<<<<< @@ -26048,7 +28301,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_importance_data = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_importances->data); - /* "sklearn/tree/_tree.pyx":3358 + /* "sklearn/tree/_tree.pyx":4068 * cdef DOUBLE_t* importance_data = importances.data * * with nogil: # <<<<<<<<<<<<<< @@ -26062,7 +28315,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3359 + /* "sklearn/tree/_tree.pyx":4069 * * with nogil: * while node != end_node: # <<<<<<<<<<<<<< @@ -26073,7 +28326,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_12 = ((__pyx_v_node != __pyx_v_end_node) != 0); if (!__pyx_t_12) break; - /* "sklearn/tree/_tree.pyx":3360 + /* "sklearn/tree/_tree.pyx":4070 * with nogil: * while node != end_node: * if node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -26083,7 +28336,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_12 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":3362 + /* "sklearn/tree/_tree.pyx":4072 * if node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] # <<<<<<<<<<<<<< @@ -26092,7 +28345,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_left = (&(__pyx_v_nodes[__pyx_v_node->left_child])); - /* "sklearn/tree/_tree.pyx":3363 + /* "sklearn/tree/_tree.pyx":4073 * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] * right = &nodes[node.right_child] # <<<<<<<<<<<<<< @@ -26101,7 +28354,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_right = (&(__pyx_v_nodes[__pyx_v_node->right_child])); - /* "sklearn/tree/_tree.pyx":3365 + /* "sklearn/tree/_tree.pyx":4075 * right = &nodes[node.right_child] * * importance_data[node.feature] += ( # <<<<<<<<<<<<<< @@ -26110,7 +28363,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_t_13 = __pyx_v_node->feature; - /* "sklearn/tree/_tree.pyx":3367 + /* "sklearn/tree/_tree.pyx":4077 * importance_data[node.feature] += ( * node.weighted_n_node_samples * node.impurity - * left.weighted_n_node_samples * left.impurity - # <<<<<<<<<<<<<< @@ -26122,7 +28375,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":3369 + /* "sklearn/tree/_tree.pyx":4079 * left.weighted_n_node_samples * left.impurity - * right.weighted_n_node_samples * right.impurity) * node += 1 # <<<<<<<<<<<<<< @@ -26133,7 +28386,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } - /* "sklearn/tree/_tree.pyx":3358 + /* "sklearn/tree/_tree.pyx":4068 * cdef DOUBLE_t* importance_data = importances.data * * with nogil: # <<<<<<<<<<<<<< @@ -26151,19 +28404,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } - /* "sklearn/tree/_tree.pyx":3371 + /* "sklearn/tree/_tree.pyx":4081 * node += 1 * * importances /= nodes[0].weighted_n_node_samples # <<<<<<<<<<<<<< * * if normalize: */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_node_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_node_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -26179,32 +28432,32 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } __pyx_pybuffernd_importances.diminfo[0].strides = __pyx_pybuffernd_importances.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_importances.diminfo[0].shape = __pyx_pybuffernd_importances.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":3373 + /* "sklearn/tree/_tree.pyx":4083 * importances /= nodes[0].weighted_n_node_samples * * if normalize: # <<<<<<<<<<<<<< * normalizer = np.sum(importances) * */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_normalize); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_normalize); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":3374 + /* "sklearn/tree/_tree.pyx":4084 * * if normalize: * normalizer = np.sum(importances) # <<<<<<<<<<<<<< * * if normalizer > 0.0: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -26218,25 +28471,25 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } if (!__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_importances)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_importances)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_importances)); __Pyx_GIVEREF(((PyObject *)__pyx_v_importances)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_importances)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_normalizer = __pyx_t_14; - /* "sklearn/tree/_tree.pyx":3376 + /* "sklearn/tree/_tree.pyx":4086 * normalizer = np.sum(importances) * * if normalizer > 0.0: # <<<<<<<<<<<<<< @@ -26246,19 +28499,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_12 = ((__pyx_v_normalizer > 0.0) != 0); if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":3378 + /* "sklearn/tree/_tree.pyx":4088 * if normalizer > 0.0: * # Avoid dividing by zero (e.g., when root is pure) * importances /= normalizer # <<<<<<<<<<<<<< * * return importances */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_normalizer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_normalizer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -26274,7 +28527,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } __pyx_pybuffernd_importances.diminfo[0].strides = __pyx_pybuffernd_importances.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_importances.diminfo[0].shape = __pyx_pybuffernd_importances.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_4)); @@ -26286,7 +28539,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":3380 + /* "sklearn/tree/_tree.pyx":4090 * importances /= normalizer * * return importances # <<<<<<<<<<<<<< @@ -26298,7 +28551,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_r = ((PyObject *)__pyx_v_importances); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3344 + /* "sklearn/tree/_tree.pyx":4054 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -26361,7 +28614,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_4Tree_15compute_feature_importan } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_feature_importances") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_feature_importances") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -26374,7 +28627,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_4Tree_15compute_feature_importan } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_feature_importances", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("compute_feature_importances", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.Tree.compute_feature_importances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -26399,7 +28652,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.normalize = __pyx_v_normalize; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_Tree->compute_feature_importances(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_Tree->compute_feature_importances(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26416,7 +28669,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3382 +/* "sklearn/tree/_tree.pyx":4092 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -26435,7 +28688,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_value_ndarray", 0); - /* "sklearn/tree/_tree.pyx":3389 + /* "sklearn/tree/_tree.pyx":4099 * """ * cdef np.npy_intp shape[3] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -26444,7 +28697,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ (__pyx_v_shape[0]) = ((npy_intp)__pyx_v_self->node_count); - /* "sklearn/tree/_tree.pyx":3390 + /* "sklearn/tree/_tree.pyx":4100 * cdef np.npy_intp shape[3] * shape[0] = self.node_count * shape[1] = self.n_outputs # <<<<<<<<<<<<<< @@ -26453,7 +28706,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ (__pyx_v_shape[1]) = ((npy_intp)__pyx_v_self->n_outputs); - /* "sklearn/tree/_tree.pyx":3391 + /* "sklearn/tree/_tree.pyx":4101 * shape[0] = self.node_count * shape[1] = self.n_outputs * shape[2] = self.max_n_classes # <<<<<<<<<<<<<< @@ -26462,20 +28715,20 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ (__pyx_v_shape[2]) = ((npy_intp)__pyx_v_self->max_n_classes); - /* "sklearn/tree/_tree.pyx":3393 + /* "sklearn/tree/_tree.pyx":4103 * shape[2] = self.max_n_classes * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) # <<<<<<<<<<<<<< * Py_INCREF(self) * arr.base = self */ - __pyx_t_1 = PyArray_SimpleNewFromData(3, __pyx_v_shape, NPY_DOUBLE, __pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_SimpleNewFromData(3, __pyx_v_shape, NPY_DOUBLE, __pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3394 + /* "sklearn/tree/_tree.pyx":4104 * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -26484,7 +28737,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":3395 + /* "sklearn/tree/_tree.pyx":4105 * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -26493,7 +28746,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ __pyx_v_arr->base = ((PyObject *)__pyx_v_self); - /* "sklearn/tree/_tree.pyx":3396 + /* "sklearn/tree/_tree.pyx":4106 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -26505,7 +28758,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3382 + /* "sklearn/tree/_tree.pyx":4092 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -26525,7 +28778,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3398 +/* "sklearn/tree/_tree.pyx":4108 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -26546,7 +28799,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_node_ndarray", 0); - /* "sklearn/tree/_tree.pyx":3406 + /* "sklearn/tree/_tree.pyx":4116 * """ * cdef np.npy_intp shape[1] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -26555,7 +28808,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ (__pyx_v_shape[0]) = ((npy_intp)__pyx_v_self->node_count); - /* "sklearn/tree/_tree.pyx":3408 + /* "sklearn/tree/_tree.pyx":4118 * shape[0] = self.node_count * cdef np.npy_intp strides[1] * strides[0] = sizeof(Node) # <<<<<<<<<<<<<< @@ -26564,51 +28817,51 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ (__pyx_v_strides[0]) = (sizeof(struct __pyx_t_7sklearn_4tree_5_tree_Node)); - /* "sklearn/tree/_tree.pyx":3410 + /* "sklearn/tree/_tree.pyx":4120 * strides[0] = sizeof(Node) * cdef np.ndarray arr * Py_INCREF(NODE_DTYPE) # <<<<<<<<<<<<<< * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, * strides, self.nodes, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); Py_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3411 + /* "sklearn/tree/_tree.pyx":4121 * cdef np.ndarray arr * Py_INCREF(NODE_DTYPE) * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, # <<<<<<<<<<<<<< * strides, self.nodes, * np.NPY_DEFAULT, None) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3413 + /* "sklearn/tree/_tree.pyx":4123 * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, * strides, self.nodes, * np.NPY_DEFAULT, None) # <<<<<<<<<<<<<< * Py_INCREF(self) * arr.base = self */ - __pyx_t_2 = PyArray_NewFromDescr(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->nodes), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_NewFromDescr(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->nodes), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3411 + /* "sklearn/tree/_tree.pyx":4121 * cdef np.ndarray arr * Py_INCREF(NODE_DTYPE) * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, # <<<<<<<<<<<<<< * strides, self.nodes, * np.NPY_DEFAULT, None) */ - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":3414 + /* "sklearn/tree/_tree.pyx":4124 * strides, self.nodes, * np.NPY_DEFAULT, None) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -26617,7 +28870,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":3415 + /* "sklearn/tree/_tree.pyx":4125 * np.NPY_DEFAULT, None) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -26626,7 +28879,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ __pyx_v_arr->base = ((PyObject *)__pyx_v_self); - /* "sklearn/tree/_tree.pyx":3416 + /* "sklearn/tree/_tree.pyx":4126 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -26638,7 +28891,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3398 + /* "sklearn/tree/_tree.pyx":4108 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -27151,7 +29404,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3433 +/* "sklearn/tree/_tree.pyx":4143 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27173,7 +29426,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_fuse_0safe_realloc", 0); - /* "sklearn/tree/_tree.pyx":3436 + /* "sklearn/tree/_tree.pyx":4146 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -27182,7 +29435,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ __pyx_v_nbytes = (__pyx_v_nelems * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":3437 + /* "sklearn/tree/_tree.pyx":4147 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -27192,18 +29445,18 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree __pyx_t_1 = (((__pyx_v_nbytes / (sizeof(((__pyx_v_p[0])[0])))) != __pyx_v_nelems) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3440 + /* "sklearn/tree/_tree.pyx":4150 * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) # <<<<<<<<<<<<<< * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -27211,31 +29464,31 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3439 + /* "sklearn/tree/_tree.pyx":4149 * if nbytes / sizeof(p[0][0]) != nelems: * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" # <<<<<<<<<<<<<< * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3441 + /* "sklearn/tree/_tree.pyx":4151 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -27244,7 +29497,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ __pyx_v_tmp = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)realloc((__pyx_v_p[0]), __pyx_v_nbytes)); - /* "sklearn/tree/_tree.pyx":3442 + /* "sklearn/tree/_tree.pyx":4152 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -27254,32 +29507,32 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3443 + /* "sklearn/tree/_tree.pyx":4153 * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3445 + /* "sklearn/tree/_tree.pyx":4155 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -27288,7 +29541,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ (__pyx_v_p[0]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":3446 + /* "sklearn/tree/_tree.pyx":4156 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -27298,7 +29551,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree __pyx_r = __pyx_v_tmp; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3433 + /* "sklearn/tree/_tree.pyx":4143 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27332,7 +29585,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_fuse_1safe_realloc", 0); - /* "sklearn/tree/_tree.pyx":3436 + /* "sklearn/tree/_tree.pyx":4146 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -27341,7 +29594,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ __pyx_v_nbytes = (__pyx_v_nelems * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":3437 + /* "sklearn/tree/_tree.pyx":4147 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -27351,18 +29604,18 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ __pyx_t_1 = (((__pyx_v_nbytes / (sizeof(((__pyx_v_p[0])[0])))) != __pyx_v_nelems) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3440 + /* "sklearn/tree/_tree.pyx":4150 * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) # <<<<<<<<<<<<<< * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -27370,31 +29623,31 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3439 + /* "sklearn/tree/_tree.pyx":4149 * if nbytes / sizeof(p[0][0]) != nelems: * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" # <<<<<<<<<<<<<< * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3441 + /* "sklearn/tree/_tree.pyx":4151 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -27403,7 +29656,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ __pyx_v_tmp = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)realloc((__pyx_v_p[0]), __pyx_v_nbytes)); - /* "sklearn/tree/_tree.pyx":3442 + /* "sklearn/tree/_tree.pyx":4152 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -27413,32 +29666,32 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3443 + /* "sklearn/tree/_tree.pyx":4153 * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3445 + /* "sklearn/tree/_tree.pyx":4155 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -27447,7 +29700,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ (__pyx_v_p[0]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":3446 + /* "sklearn/tree/_tree.pyx":4156 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -27457,7 +29710,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ __pyx_r = __pyx_v_tmp; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3433 + /* "sklearn/tree/_tree.pyx":4143 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27491,7 +29744,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_fuse_2safe_realloc", 0); - /* "sklearn/tree/_tree.pyx":3436 + /* "sklearn/tree/_tree.pyx":4146 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -27500,7 +29753,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ __pyx_v_nbytes = (__pyx_v_nelems * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":3437 + /* "sklearn/tree/_tree.pyx":4147 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -27510,18 +29763,18 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns __pyx_t_1 = (((__pyx_v_nbytes / (sizeof(((__pyx_v_p[0])[0])))) != __pyx_v_nelems) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3440 + /* "sklearn/tree/_tree.pyx":4150 * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) # <<<<<<<<<<<<<< * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -27529,31 +29782,31 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3439 + /* "sklearn/tree/_tree.pyx":4149 * if nbytes / sizeof(p[0][0]) != nelems: * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" # <<<<<<<<<<<<<< * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3441 + /* "sklearn/tree/_tree.pyx":4151 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -27562,7 +29815,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ __pyx_v_tmp = ((unsigned char *)realloc((__pyx_v_p[0]), __pyx_v_nbytes)); - /* "sklearn/tree/_tree.pyx":3442 + /* "sklearn/tree/_tree.pyx":4152 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -27572,32 +29825,32 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3443 + /* "sklearn/tree/_tree.pyx":4153 * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3445 + /* "sklearn/tree/_tree.pyx":4155 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -27606,7 +29859,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ (__pyx_v_p[0]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":3446 + /* "sklearn/tree/_tree.pyx":4156 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -27616,7 +29869,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns __pyx_r = __pyx_v_tmp; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3433 + /* "sklearn/tree/_tree.pyx":4143 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27636,7 +29889,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3449 +/* "sklearn/tree/_tree.pyx":4159 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -27668,7 +29921,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_realloc_test", 0); - /* "sklearn/tree/_tree.pyx":3452 + /* "sklearn/tree/_tree.pyx":4162 * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. * cdef SIZE_t* p = NULL # <<<<<<<<<<<<<< @@ -27677,16 +29930,16 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ __pyx_v_p = NULL; - /* "sklearn/tree/_tree.pyx":3453 + /* "sklearn/tree/_tree.pyx":4163 * # bytes, which will always overflow. * cdef SIZE_t* p = NULL * safe_realloc(&p, (-1) / 2) # <<<<<<<<<<<<<< * if p != NULL: * free(p) */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_p), (((size_t)-1) / 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_p), (((size_t)-1) / 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3454 + /* "sklearn/tree/_tree.pyx":4164 * cdef SIZE_t* p = NULL * safe_realloc(&p, (-1) / 2) * if p != NULL: # <<<<<<<<<<<<<< @@ -27696,7 +29949,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb __pyx_t_1 = ((__pyx_v_p != NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3455 + /* "sklearn/tree/_tree.pyx":4165 * safe_realloc(&p, (-1) / 2) * if p != NULL: * free(p) # <<<<<<<<<<<<<< @@ -27705,7 +29958,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ free(__pyx_v_p); - /* "sklearn/tree/_tree.pyx":3456 + /* "sklearn/tree/_tree.pyx":4166 * if p != NULL: * free(p) * assert False # <<<<<<<<<<<<<< @@ -27716,7 +29969,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!0)) { PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif @@ -27724,7 +29977,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3449 + /* "sklearn/tree/_tree.pyx":4159 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -27744,7 +29997,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3461 +/* "sklearn/tree/_tree.pyx":4171 * # rand_r replacement using a 32bit XorShift generator * # See http://www.jstatsoft.org/v08/i14/paper for details * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: # <<<<<<<<<<<<<< @@ -27756,7 +30009,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_r; long __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3462 + /* "sklearn/tree/_tree.pyx":4172 * # See http://www.jstatsoft.org/v08/i14/paper for details * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) # <<<<<<<<<<<<<< @@ -27766,7 +30019,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_1 = 0; (__pyx_v_seed[__pyx_t_1]) = ((__pyx_v_seed[__pyx_t_1]) ^ ((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)((__pyx_v_seed[0]) << 13))); - /* "sklearn/tree/_tree.pyx":3463 + /* "sklearn/tree/_tree.pyx":4173 * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) # <<<<<<<<<<<<<< @@ -27776,7 +30029,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_1 = 0; (__pyx_v_seed[__pyx_t_1]) = ((__pyx_v_seed[__pyx_t_1]) ^ ((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)((__pyx_v_seed[0]) >> 17))); - /* "sklearn/tree/_tree.pyx":3464 + /* "sklearn/tree/_tree.pyx":4174 * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) * seed[0] ^= (seed[0] << 5) # <<<<<<<<<<<<<< @@ -27786,7 +30039,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_1 = 0; (__pyx_v_seed[__pyx_t_1]) = ((__pyx_v_seed[__pyx_t_1]) ^ ((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)((__pyx_v_seed[0]) << 5))); - /* "sklearn/tree/_tree.pyx":3466 + /* "sklearn/tree/_tree.pyx":4176 * seed[0] ^= (seed[0] << 5) * * return seed[0] % (RAND_R_MAX + 1) # <<<<<<<<<<<<<< @@ -27796,7 +30049,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_r = ((__pyx_v_seed[0]) % (((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX) + 1)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3461 + /* "sklearn/tree/_tree.pyx":4171 * # rand_r replacement using a 32bit XorShift generator * # See http://www.jstatsoft.org/v08/i14/paper for details * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: # <<<<<<<<<<<<<< @@ -27809,7 +30062,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3468 +/* "sklearn/tree/_tree.pyx":4178 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -27827,7 +30080,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sizet_ptr_to_ndarray", 0); - /* "sklearn/tree/_tree.pyx":3471 + /* "sklearn/tree/_tree.pyx":4181 * """Encapsulate data into a 1D numpy array of intp's.""" * cdef np.npy_intp shape[1] * shape[0] = size # <<<<<<<<<<<<<< @@ -27836,7 +30089,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n */ (__pyx_v_shape[0]) = ((npy_intp)__pyx_v_size); - /* "sklearn/tree/_tree.pyx":3472 + /* "sklearn/tree/_tree.pyx":4182 * cdef np.npy_intp shape[1] * shape[0] = size * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) # <<<<<<<<<<<<<< @@ -27844,14 +30097,14 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_shape, NPY_INTP, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_shape, NPY_INTP, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3468 + /* "sklearn/tree/_tree.pyx":4178 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -27870,7 +30123,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3474 +/* "sklearn/tree/_tree.pyx":4184 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, # <<<<<<<<<<<<<< @@ -27881,7 +30134,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_low, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_high, __pyx_t_7sklearn_4tree_5_tree_UINT32_t *__pyx_v_random_state) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_r; - /* "sklearn/tree/_tree.pyx":3477 + /* "sklearn/tree/_tree.pyx":4187 * UINT32_t* random_state) nogil: * """Generate a random integer in [0; end).""" * return low + our_rand_r(random_state) % (high - low) # <<<<<<<<<<<<<< @@ -27891,7 +30144,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_r = (__pyx_v_low + (__pyx_f_7sklearn_4tree_5_tree_our_rand_r(__pyx_v_random_state) % (__pyx_v_high - __pyx_v_low))); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3474 + /* "sklearn/tree/_tree.pyx":4184 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, # <<<<<<<<<<<<<< @@ -27904,7 +30157,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3479 +/* "sklearn/tree/_tree.pyx":4189 * return low + our_rand_r(random_state) % (high - low) * * cdef inline double rand_uniform(double low, double high, # <<<<<<<<<<<<<< @@ -27915,7 +30168,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __pyx_v_low, double __pyx_v_high, __pyx_t_7sklearn_4tree_5_tree_UINT32_t *__pyx_v_random_state) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":3483 + /* "sklearn/tree/_tree.pyx":4193 * """Generate a random double in [low; high).""" * return ((high - low) * our_rand_r(random_state) / * RAND_R_MAX) + low # <<<<<<<<<<<<<< @@ -27925,7 +30178,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ __pyx_r = ((((__pyx_v_high - __pyx_v_low) * ((double)__pyx_f_7sklearn_4tree_5_tree_our_rand_r(__pyx_v_random_state))) / ((double)__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX)) + __pyx_v_low); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3479 + /* "sklearn/tree/_tree.pyx":4189 * return low + our_rand_r(random_state) % (high - low) * * cdef inline double rand_uniform(double low, double high, # <<<<<<<<<<<<<< @@ -27938,7 +30191,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3485 +/* "sklearn/tree/_tree.pyx":4195 * RAND_R_MAX) + low * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -27948,7 +30201,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":3486 + /* "sklearn/tree/_tree.pyx":4196 * * cdef inline double log(double x) nogil: * return ln(x) / ln(2.0) # <<<<<<<<<<<<<< @@ -27956,7 +30209,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) __pyx_r = (log(__pyx_v_x) / log(2.0)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3485 + /* "sklearn/tree/_tree.pyx":4195 * RAND_R_MAX) + low * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -30020,7 +32273,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Criterion = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Interface for impurity criteria.", /*tp_doc*/ + "\n Interface for impurity criteria. This object stores methods on how to\n calculate how good a split is using different metrics.\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30211,7 +32464,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Splitter = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ + "\n Interface for the splitter class. This is an object which handles efficient\n storage and splitting of a feature in the process of building a decision\n tree.\n ", /*tp_doc*/ __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter, /*tp_traverse*/ __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30654,7 +32907,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Abstract criterion for classification.", /*tp_doc*/ + "\n This is a criterion with methods specifically used for classification.\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30721,7 +32974,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Entropy = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Cross Entropy impurity criteria.\n\n Let the target be a classification outcome taking values in 0, 1, ..., K-1.\n If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The cross-entropy is then defined as\n\n cross-entropy = - \\sum_{k=0}^{K-1} pmk log(pmk)\n ", /*tp_doc*/ + "\n A class representing the Cross Entropy impurity criteria. This handles\n cases where the response is a classification taking values 0, 1, ...\n K-2, K-1. If node m represents a region Rm with Nm observations, then let\n\n pmk = 1 / Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The cross-entropy is then defined as\n\n cross-entropy = -\\sum_{k=0}^{K-1} pmk log(pmk)\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30788,7 +33041,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Gini = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Gini Index impurity criteria.\n\n Let the target be a classification outcome taking values in 0, 1, ..., K-1.\n If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The Gini Index is then defined as:\n\n index = \\sum_{k=0}^{K-1} pmk (1 - pmk)\n = 1 - \\sum_{k=0}^{K-1} pmk ** 2\n ", /*tp_doc*/ + "\n A class representing the Gini Index impurity criteria. This handles\n cases where the response is a classification taking values 0, 1, ...\n K-2, K-1. If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The Gini Index is then defined as:\n\n index = \\sum_{k=0}^{K-1} pmk (1 - pmk)\n = 1 - \\sum_{k=0}^{K-1} pmk ** 2\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30882,7 +33135,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_RegressionCriterion = { 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Abstract criterion for regression.\n\n Computes variance of the target values left and right of the split point.\n Computation is linear in `n_samples` by using ::\n\n var = \\sum_i^n (y_i - y_bar) ** 2\n = (\\sum_i^n y_i ** 2) - n_samples y_bar ** 2\n ", /*tp_doc*/ + "\n A class representing a regression criteria. This handles cases where the\n response is a continuous value, and is evaluated by computing the variance\n of the target values left and right of the split point. The computation\n takes linear time with `n_samples` by using ::\n\n var = \\sum_i^n (y_i - y_bar) ** 2\n = (\\sum_i^n y_i ** 2) - n_samples * y_bar ** 2 \n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -31382,6 +33635,123 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter = { 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_SpeedSplitter __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter; + +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_SpeedSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_BaseDenseSplitter(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter; + p->X_idx_sorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_SpeedSplitter(PyObject *o) { + struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->X_idx_sorted); + PyObject_GC_Track(o); + __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter(o); +} + +static int __pyx_tp_traverse_7sklearn_4tree_5_tree_SpeedSplitter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o; + e = __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter(o, v, a); if (e) return e; + if (p->X_idx_sorted) { + e = (*v)(((PyObject*)p->X_idx_sorted), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_7sklearn_4tree_5_tree_SpeedSplitter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o; + __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter(o); + tmp = ((PyObject*)p->X_idx_sorted); + p->X_idx_sorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_SpeedSplitter[] = { + {"__reduce", (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_5__reduce, METH_NOARGS, 0}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter = { + PyVarObject_HEAD_INIT(0, 0) + "sklearn.tree._tree.SpeedSplitter", /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "\n This object is a splitter which performs more caching in order to try to\n find splits faster.\n ", /*tp_doc*/ + __pyx_tp_traverse_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_traverse*/ + __pyx_tp_clear_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BaseSparseSplitter __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter; static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BaseSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -31856,6 +34226,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_min_samples_leaf, __pyx_k_min_samples_leaf, sizeof(__pyx_k_min_samples_leaf), 0, 0, 1, 1}, {&__pyx_n_s_min_samples_split, __pyx_k_min_samples_split, sizeof(__pyx_k_min_samples_split), 0, 0, 1, 1}, {&__pyx_n_s_min_weight_leaf, __pyx_k_min_weight_leaf, sizeof(__pyx_k_min_weight_leaf), 0, 0, 1, 1}, + {&__pyx_n_s_mn_samples_leaf, __pyx_k_mn_samples_leaf, sizeof(__pyx_k_mn_samples_leaf), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_n_classes, __pyx_k_n_classes, sizeof(__pyx_k_n_classes), 0, 0, 1, 1}, {&__pyx_n_s_n_features, __pyx_k_n_features, sizeof(__pyx_k_n_features), 0, 0, 1, 1}, @@ -31904,9 +34275,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; @@ -31917,47 +34288,47 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/tree/_tree.pyx":1851 + /* "sklearn/tree/_tree.pyx":2560 * * if not isinstance(X, csc_matrix): * raise ValueError("X should be in csc format") # <<<<<<<<<<<<<< * * cdef SIZE_t* samples = self.samples */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_X_should_be_in_csc_format); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_X_should_be_in_csc_format); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "sklearn/tree/_tree.pyx":2585 + /* "sklearn/tree/_tree.pyx":3294 * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: * raise ValueError("No support for np.int64 index based " # <<<<<<<<<<<<<< * "sparse matrices") * */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_No_support_for_np_int64_index_ba); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2585; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_No_support_for_np_int64_index_ba); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "sklearn/tree/_tree.pyx":3102 + /* "sklearn/tree/_tree.pyx":3812 * * if 'nodes' not in d: * raise ValueError('You have loaded Tree version which ' # <<<<<<<<<<<<<< * 'cannot be imported') * */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_You_have_loaded_Tree_version_whi); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_You_have_loaded_Tree_version_whi); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "sklearn/tree/_tree.pyx":3116 + /* "sklearn/tree/_tree.pyx":3826 * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): * raise ValueError('Did not recognise loaded array layout') # <<<<<<<<<<<<<< * * self.capacity = node_ndarray.shape[0] */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Did_not_recognise_loaded_array_l); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Did_not_recognise_loaded_array_l); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -32027,17 +34398,17 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "sklearn/tree/_tree.pyx":3449 + /* "sklearn/tree/_tree.pyx":4159 * * * def _realloc_test(): # <<<<<<<<<<<<<< * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_n_s_realloc_test, 3449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_n_s_realloc_test, 4159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -32154,10 +34525,10 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_Criterion.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity; __pyx_vtable_7sklearn_4tree_5_tree_Criterion.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value; __pyx_vtable_7sklearn_4tree_5_tree_Criterion.impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double))__pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_Criterion.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Criterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Criterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Criterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Criterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Criterion = &__pyx_type_7sklearn_4tree_5_tree_Criterion; __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter = &__pyx_vtable_7sklearn_4tree_5_tree_Splitter; __pyx_vtable_7sklearn_4tree_5_tree_Splitter.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_8Splitter_init; @@ -32165,10 +34536,10 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_Splitter.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split; __pyx_vtable_7sklearn_4tree_5_tree_Splitter.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double *))__pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value; __pyx_vtable_7sklearn_4tree_5_tree_Splitter.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *))__pyx_f_7sklearn_4tree_5_tree_8Splitter_node_impurity; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_Splitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Splitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Splitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Splitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Splitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Splitter = &__pyx_type_7sklearn_4tree_5_tree_Splitter; __pyx_vtabptr_7sklearn_4tree_5_tree_Tree = &__pyx_vtable_7sklearn_4tree_5_tree_Tree; __pyx_vtable_7sklearn_4tree_5_tree_Tree._add_node = (__pyx_t_7sklearn_4tree_5_tree_SIZE_t (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, int, int, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double, double, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double))__pyx_f_7sklearn_4tree_5_tree_4Tree__add_node; @@ -32181,18 +34552,18 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_Tree._apply_dense = (PyArrayObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *))__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense; __pyx_vtable_7sklearn_4tree_5_tree_Tree._apply_sparse_csr = (PyArrayObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *))__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr; __pyx_vtable_7sklearn_4tree_5_tree_Tree.compute_feature_importances = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_Tree.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Tree.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Tree", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Tree.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Tree", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Tree = &__pyx_type_7sklearn_4tree_5_tree_Tree; __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build; __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder._check_input = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, PyObject *, PyArrayObject *, PyArrayObject *))__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_TreeBuilder.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_TreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_TreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; @@ -32203,30 +34574,30 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_children_impurity; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *))__pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value; __pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_Criterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "ClassificationCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "ClassificationCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion = &__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtabptr_7sklearn_4tree_5_tree_Entropy = &__pyx_vtable_7sklearn_4tree_5_tree_Entropy; __pyx_vtable_7sklearn_4tree_5_tree_Entropy.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_5_tree_Entropy.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity; __pyx_vtable_7sklearn_4tree_5_tree_Entropy.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity; __pyx_type_7sklearn_4tree_5_tree_Entropy.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_Entropy.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Entropy.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Entropy", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Entropy.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Entropy", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Entropy = &__pyx_type_7sklearn_4tree_5_tree_Entropy; __pyx_vtabptr_7sklearn_4tree_5_tree_Gini = &__pyx_vtable_7sklearn_4tree_5_tree_Gini; __pyx_vtable_7sklearn_4tree_5_tree_Gini.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_5_tree_Gini.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity; __pyx_vtable_7sklearn_4tree_5_tree_Gini.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity; __pyx_type_7sklearn_4tree_5_tree_Gini.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_Gini.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Gini.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Gini", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Gini.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Gini", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Gini = &__pyx_type_7sklearn_4tree_5_tree_Gini; __pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; @@ -32237,114 +34608,125 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurity; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *))__pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value; __pyx_type_7sklearn_4tree_5_tree_RegressionCriterion.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_Criterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_RegressionCriterion.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "RegressionCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "RegressionCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion = &__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtabptr_7sklearn_4tree_5_tree_MSE = &__pyx_vtable_7sklearn_4tree_5_tree_MSE; __pyx_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity; __pyx_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity; __pyx_type_7sklearn_4tree_5_tree_MSE.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_MSE.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_MSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "MSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_MSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "MSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_MSE = &__pyx_type_7sklearn_4tree_5_tree_MSE; __pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE = &__pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSE; __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSE.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_MSE; __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSE.__pyx_base.__pyx_base.__pyx_base.impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double))__pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement; __pyx_type_7sklearn_4tree_5_tree_FriedmanMSE.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_MSE; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_FriedmanMSE.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "FriedmanMSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "FriedmanMSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSE = &__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE; __pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BaseDenseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseDenseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseDenseSplitter.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init; __pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_Splitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BaseDenseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BaseDenseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter = &__pyx_type_7sklearn_4tree_5_tree_BaseDenseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BestSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_BestSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BestSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestSplitter = &__pyx_type_7sklearn_4tree_5_tree_BestSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter; __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_RandomSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_RandomSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "RandomSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "RandomSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter = &__pyx_type_7sklearn_4tree_5_tree_RandomSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter; __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init; __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "PresortBestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "PresortBestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter = &__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter; + __pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter; + __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter; + __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init; + __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split; + __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *))__pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity; + __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter; + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "SpeedSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter = &__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter._partition = (__pyx_t_7sklearn_4tree_5_tree_SIZE_t (*)(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *, double, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.extract_nnz = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, int *))__pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz; __pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_Splitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BaseSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BaseSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter = &__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BestSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BestSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BestSparseSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BestSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BestSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter = &__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_RandomSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_RandomSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_RandomSparseSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "RandomSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "RandomSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter = &__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.__pyx_base.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build; __pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "DepthFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "DepthFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder.__pyx_base.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build; __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder._add_split_node = (int (*)(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double, int, int, struct __pyx_t_7sklearn_4tree_5_tree_Node *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *))__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node; __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BestFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BestFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestFirstTreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -32369,19 +34751,19 @@ PyMODINIT_FUNC PyInit__tree(void) /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "sklearn/tree/_tree.pyx":23 + /* "sklearn/tree/_tree.pyx":24 * from cpython cimport Py_INCREF, PyObject * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * np.import_array() */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":25 + /* "sklearn/tree/_tree.pyx":26 * import numpy as np * cimport numpy as np * np.import_array() # <<<<<<<<<<<<<< @@ -32390,14 +34772,14 @@ PyMODINIT_FUNC PyInit__tree(void) */ import_array(); - /* "sklearn/tree/_tree.pyx":27 + /* "sklearn/tree/_tree.pyx":28 * np.import_array() * * from scipy.sparse import issparse, csc_matrix, csr_matrix # <<<<<<<<<<<<<< * * from sklearn.tree._utils cimport Stack, StackRecord */ - __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_issparse); __Pyx_GIVEREF(__pyx_n_s_issparse); @@ -32408,126 +34790,126 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_INCREF(__pyx_n_s_csr_matrix); __Pyx_GIVEREF(__pyx_n_s_csr_matrix); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_csr_matrix); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_csc_matrix, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_csc_matrix, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":44 + /* "sklearn/tree/_tree.pyx":45 * # ============================================================================= * * from numpy import float32 as DTYPE # <<<<<<<<<<<<<< * from numpy import float64 as DOUBLE * */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_float32); __Pyx_GIVEREF(__pyx_n_s_float32); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_float32); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":45 + /* "sklearn/tree/_tree.pyx":46 * * from numpy import float32 as DTYPE * from numpy import float64 as DOUBLE # <<<<<<<<<<<<<< * * cdef double INFINITY = np.inf */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_float64); __Pyx_GIVEREF(__pyx_n_s_float64); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_float64); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":47 + /* "sklearn/tree/_tree.pyx":48 * from numpy import float64 as DOUBLE * * cdef double INFINITY = np.inf # <<<<<<<<<<<<<< * TREE_LEAF = -1 * TREE_UNDEFINED = -2 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_inf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_7sklearn_4tree_5_tree_INFINITY = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":48 + /* "sklearn/tree/_tree.pyx":49 * * cdef double INFINITY = np.inf * TREE_LEAF = -1 # <<<<<<<<<<<<<< * TREE_UNDEFINED = -2 * cdef SIZE_t _TREE_LEAF = TREE_LEAF */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_LEAF, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_LEAF, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":49 + /* "sklearn/tree/_tree.pyx":50 * cdef double INFINITY = np.inf * TREE_LEAF = -1 * TREE_UNDEFINED = -2 # <<<<<<<<<<<<<< * cdef SIZE_t _TREE_LEAF = TREE_LEAF * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_UNDEFINED, __pyx_int_neg_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_UNDEFINED, __pyx_int_neg_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":50 + /* "sklearn/tree/_tree.pyx":51 * TREE_LEAF = -1 * TREE_UNDEFINED = -2 * cdef SIZE_t _TREE_LEAF = TREE_LEAF # <<<<<<<<<<<<<< * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED * cdef SIZE_t INITIAL_STACK_SIZE = 10 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_LEAF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_LEAF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":51 + /* "sklearn/tree/_tree.pyx":52 * TREE_UNDEFINED = -2 * cdef SIZE_t _TREE_LEAF = TREE_LEAF * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED # <<<<<<<<<<<<<< * cdef SIZE_t INITIAL_STACK_SIZE = 10 * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_UNDEFINED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_UNDEFINED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":52 + /* "sklearn/tree/_tree.pyx":53 * cdef SIZE_t _TREE_LEAF = TREE_LEAF * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED * cdef SIZE_t INITIAL_STACK_SIZE = 10 # <<<<<<<<<<<<<< @@ -32536,7 +34918,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE = 10; - /* "sklearn/tree/_tree.pyx":54 + /* "sklearn/tree/_tree.pyx":55 * cdef SIZE_t INITIAL_STACK_SIZE = 10 * * cdef DTYPE_t MIN_IMPURITY_SPLIT = 1e-7 # <<<<<<<<<<<<<< @@ -32545,7 +34927,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_MIN_IMPURITY_SPLIT = 1e-7; - /* "sklearn/tree/_tree.pyx":57 + /* "sklearn/tree/_tree.pyx":58 * * # Mitigate precision differences between 32 bit and 64 bit * cdef DTYPE_t FEATURE_THRESHOLD = 1e-7 # <<<<<<<<<<<<<< @@ -32554,7 +34936,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD = 1e-7; - /* "sklearn/tree/_tree.pyx":61 + /* "sklearn/tree/_tree.pyx":62 * # Constant to switch between algorithm non zero value extract algorithm * # in SparseSplitter * cdef DTYPE_t EXTRACT_NNZ_SWITCH = 0.1 # <<<<<<<<<<<<<< @@ -32563,7 +34945,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_EXTRACT_NNZ_SWITCH = 0.1; - /* "sklearn/tree/_tree.pyx":64 + /* "sklearn/tree/_tree.pyx":65 * * # Some handy constants (BestFirstTreeBuilder) * cdef int IS_FIRST = 1 # <<<<<<<<<<<<<< @@ -32572,7 +34954,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_FIRST = 1; - /* "sklearn/tree/_tree.pyx":65 + /* "sklearn/tree/_tree.pyx":66 * # Some handy constants (BestFirstTreeBuilder) * cdef int IS_FIRST = 1 * cdef int IS_NOT_FIRST = 0 # <<<<<<<<<<<<<< @@ -32581,7 +34963,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST = 0; - /* "sklearn/tree/_tree.pyx":66 + /* "sklearn/tree/_tree.pyx":67 * cdef int IS_FIRST = 1 * cdef int IS_NOT_FIRST = 0 * cdef int IS_LEFT = 1 # <<<<<<<<<<<<<< @@ -32590,7 +34972,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_LEFT = 1; - /* "sklearn/tree/_tree.pyx":67 + /* "sklearn/tree/_tree.pyx":68 * cdef int IS_NOT_FIRST = 0 * cdef int IS_LEFT = 1 * cdef int IS_NOT_LEFT = 0 # <<<<<<<<<<<<<< @@ -32599,24 +34981,24 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_NOT_LEFT = 0; - /* "sklearn/tree/_tree.pyx":76 + /* "sklearn/tree/_tree.pyx":77 * * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":77 + /* "sklearn/tree/_tree.pyx":78 * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', # <<<<<<<<<<<<<< * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, */ - __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_left_child); __Pyx_GIVEREF(__pyx_n_s_left_child); @@ -32639,68 +35021,68 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_INCREF(__pyx_n_s_weighted_n_node_samples); __Pyx_GIVEREF(__pyx_n_s_weighted_n_node_samples); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_weighted_n_node_samples); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_names, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_names, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":79 + /* "sklearn/tree/_tree.pyx":80 * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, # <<<<<<<<<<<<<< * np.float64], * 'offsets': [ */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":80 + /* "sklearn/tree/_tree.pyx":81 * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, * np.float64], # <<<<<<<<<<<<<< * 'offsets': [ * &( NULL).left_child, */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":79 + /* "sklearn/tree/_tree.pyx":80 * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, # <<<<<<<<<<<<<< * np.float64], * 'offsets': [ */ - __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); @@ -32723,87 +35105,87 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_formats, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_formats, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":82 + /* "sklearn/tree/_tree.pyx":83 * np.float64], * 'offsets': [ * &( NULL).left_child, # <<<<<<<<<<<<<< * &( NULL).right_child, * &( NULL).feature, */ - __pyx_t_2 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->left_child))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->left_child))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":83 + /* "sklearn/tree/_tree.pyx":84 * 'offsets': [ * &( NULL).left_child, * &( NULL).right_child, # <<<<<<<<<<<<<< * &( NULL).feature, * &( NULL).threshold, */ - __pyx_t_11 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->right_child))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->right_child))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - /* "sklearn/tree/_tree.pyx":84 + /* "sklearn/tree/_tree.pyx":85 * &( NULL).left_child, * &( NULL).right_child, * &( NULL).feature, # <<<<<<<<<<<<<< * &( NULL).threshold, * &( NULL).impurity, */ - __pyx_t_10 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->feature))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->feature))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "sklearn/tree/_tree.pyx":85 + /* "sklearn/tree/_tree.pyx":86 * &( NULL).right_child, * &( NULL).feature, * &( NULL).threshold, # <<<<<<<<<<<<<< * &( NULL).impurity, * &( NULL).n_node_samples, */ - __pyx_t_9 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->threshold))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->threshold))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - /* "sklearn/tree/_tree.pyx":86 + /* "sklearn/tree/_tree.pyx":87 * &( NULL).feature, * &( NULL).threshold, * &( NULL).impurity, # <<<<<<<<<<<<<< * &( NULL).n_node_samples, * &( NULL).weighted_n_node_samples */ - __pyx_t_8 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->impurity))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->impurity))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - /* "sklearn/tree/_tree.pyx":87 + /* "sklearn/tree/_tree.pyx":88 * &( NULL).threshold, * &( NULL).impurity, * &( NULL).n_node_samples, # <<<<<<<<<<<<<< * &( NULL).weighted_n_node_samples * ] */ - __pyx_t_7 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->n_node_samples))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->n_node_samples))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "sklearn/tree/_tree.pyx":88 + /* "sklearn/tree/_tree.pyx":89 * &( NULL).impurity, * &( NULL).n_node_samples, * &( NULL).weighted_n_node_samples # <<<<<<<<<<<<<< * ] * }) */ - __pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->weighted_n_node_samples))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->weighted_n_node_samples))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":81 + /* "sklearn/tree/_tree.pyx":82 * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, * np.float64], * 'offsets': [ # <<<<<<<<<<<<<< * &( NULL).left_child, * &( NULL).right_child, */ - __pyx_t_5 = PyList_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -32826,28 +35208,28 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_offsets, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_offsets, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":76 + /* "sklearn/tree/_tree.pyx":77 * * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NODE_DTYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NODE_DTYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3134 + /* "sklearn/tree/_tree.pyx":3844 * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 * # (i.e., older MSVC). * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: # <<<<<<<<<<<<<< @@ -32856,16 +35238,16 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_k__5 = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1); - /* "sklearn/tree/_tree.pyx":3449 + /* "sklearn/tree/_tree.pyx":4159 * * * def _realloc_test(): # <<<<<<<<<<<<<< * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_4tree_5_tree_1_realloc_test, NULL, __pyx_n_s_sklearn_tree__tree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_4tree_5_tree_1_realloc_test, NULL, __pyx_n_s_sklearn_tree__tree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_realloc_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_realloc_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/tree/_tree.pyx":1 diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index ceada61fd85f7..fa4c27f90428a 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -11,6 +11,7 @@ # Arnaud Joly # Joel Nothman # Fares Hedayati +# Jacob Schreiber # # Licence: BSD 3 clause @@ -95,48 +96,117 @@ NODE_DTYPE = np.dtype({ # ============================================================================= cdef class Criterion: - """Interface for impurity criteria.""" + """ + Interface for impurity criteria. This object stores methods on how to + calculate how good a split is using different metrics. + """ cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, double weighted_n_samples, SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: - """Initialize the criterion at node samples[start:end] and - children samples[start:start] and samples[start:end].""" + """ + This is a placeholder for a method which will initialize the criterion. + + Parameters + ---------- + y: array-like, dtype=float64 + This is a vector of responses in a memory-efficient buffer format, + used to evaluate the split + y_stride: int64 + This indicates the stride of the buffer to allow access to elements + easily + sample_weight: array-like, dtype=float64 + The weight of each sample + weighted_n_samples: float64 + The total weight of the samples being considered + samples: array-like, dtype=float64 + The input data which is being split + start: int64 + The first sample to be used on this leaf + end: int64 + The last sample used in this leaf + + """ + pass cdef void reset(self) nogil: - """Reset the criterion at pos=start.""" + """ + This is a placeholder for a method which will reset the criterion at + pos=start. + """ + pass cdef void update(self, SIZE_t new_pos) nogil: - """Update the collected statistics by moving samples[pos:new_pos] from - the right child to the left child.""" + """ + This is a placeholder for a method which will update the collected + statistics by moving samples[pos:new_pos] from the right child to the + left child. + + Parameters + ---------- + new_pos: int64 + The index of the final sample to be moved over. + """ + pass cdef double node_impurity(self) nogil: - """Evaluate the impurity of the current node, i.e. the impurity of - samples[start:end].""" + """ + This is a placeholder for a method which will evaluate the impurity of + the current node, i.e. the impurity of samples[start:end]. This is the + primary function of the criterion class. + """ + pass cdef void children_impurity(self, double* impurity_left, double* impurity_right) nogil: - """Evaluate the impurity in children nodes, i.e. the impurity of - samples[start:pos] + the impurity of samples[pos:end].""" + """ + This is a placeholder for a method which will evaluate the impurity in + children nodes, i.e. the impurity of samples[start:pos] + the impurity + of samples[pos:end]. + + Parameters + ---------- + impurity_left: float64 + The memory address where the impurity of the left child should be + stored. + impurity_right: float64 + The memory address where te impurity of the right child should be + stored + """ + pass cdef void node_value(self, double* dest) nogil: - """Compute the node value of samples[start:end] into dest.""" + """ + This is a placeholder for a method which will compute the node value + of samples[start:end] and save the value into dest. + + Parameters + ---------- + dest: float64 + The memory address where the node value should be stored. + """ + pass cdef double impurity_improvement(self, double impurity) nogil: - """Weighted impurity improvement, i.e. + """ + This is a placeholder for a method which will compute the improvement + in impurity when a split occurs. The weighted impurity improvement + equation is the following: - N_t / N * (impurity - N_t_L / N_t * left impurity - - N_t_L / N_t * right impurity), + N_t / N * (impurity - N_t_R / N_t * right_impurity + - N_t_L / N_t * left_impurity) + + where N is the total number of samples, N_t is the number of samples + at the current node, N_t_L is the number of samples in the left child, + and N_t_R is the number of samples in the right child, + """ - where N is the total number of samples, N_t is the number of samples - in the current node, N_t_L is the number of samples in the left - child and N_t_R is the number of samples in the right child.""" cdef double impurity_left cdef double impurity_right @@ -148,7 +218,10 @@ cdef class Criterion: cdef class ClassificationCriterion(Criterion): - """Abstract criterion for classification.""" + """ + This is a criterion with methods specifically used for classification. + """ + cdef SIZE_t* n_classes cdef SIZE_t label_count_stride cdef double* label_count_left @@ -157,7 +230,18 @@ cdef class ClassificationCriterion(Criterion): def __cinit__(self, SIZE_t n_outputs, np.ndarray[SIZE_t, ndim=1] n_classes): - # Default values + """ + Initialize attributes for this classifier, automatically calling the + parent __cinit__ method as well. + + Parameters + ---------- + n_outputs: int64 + The number of responses, the dimensionality of the prediction + n_classes: numpy.ndarray, dtype=int64 + The number of unique classes in each response + """ + self.y = NULL self.y_stride = 0 self.sample_weight = NULL @@ -177,13 +261,18 @@ cdef class ClassificationCriterion(Criterion): self.label_count_right = NULL self.label_count_total = NULL - # Count labels for each output + # Initialize variables for each response based on the number of unique + # classes in that response self.n_classes = NULL + + # Allocate memory space for each response safe_realloc(&self.n_classes, n_outputs) cdef SIZE_t k = 0 cdef SIZE_t label_count_stride = 0 + # For each response, set the number of unique classes in that response, + # and also set the stride for that response for k in range(n_outputs): self.n_classes[k] = n_classes[k] @@ -205,7 +294,11 @@ cdef class ClassificationCriterion(Criterion): raise MemoryError() def __dealloc__(self): - """Destructor.""" + """ + Destructor for this class. We have allocated memory to the following + four arrays, and must ensure they are freed. + """ + free(self.n_classes) free(self.label_count_left) free(self.label_count_right) @@ -226,8 +319,29 @@ cdef class ClassificationCriterion(Criterion): cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, double weighted_n_samples, SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: - """Initialize the criterion at node samples[start:end] and - children samples[start:start] and samples[start:end].""" + """ + Initialize the criterion at node samples[start:end] and + children samples[start:start] and samples[start:end]. + + Parameters + ---------- + y: array-like, dtype=float64 + The response stored as a buffer for memory efficiency + y_stride: int64 + The stride between elements in the buffer, important if the + response is multivariate + sample_weight: array-like, dtype=float64 + The weight of each sample + weighted_n_samples: float64 + The total weight of all samples + samples: array-like, dtype=int64 + A mask on the samples, showing which ones we want to use + start: int64 + The first sample to use in the mask + end: int64 + The last sample to use in the mask + """ + # Initialize fields self.y = y self.y_stride = y_stride @@ -252,30 +366,44 @@ cdef class ClassificationCriterion(Criterion): cdef DOUBLE_t w = 1.0 cdef SIZE_t offset = 0 + # Allocate memory for each response to store the weighted number of + # samples in each class for k in range(n_outputs): memset(label_count_total + offset, 0, n_classes[k] * sizeof(double)) offset += label_count_stride + # Now go through and record the number of samples for each class for + # each response for p in range(start, end): + # Identify the next sample in the mask i = samples[p] + # w is originally set to be 1.0, meaning that if no sample weights + # are given, the default weight of each sample is 1.0 if sample_weight != NULL: w = sample_weight[i] + # Go through each response and add this sample's class in to the + # appropriate bin for k in range(n_outputs): c = y[i * y_stride + k] label_count_total[k * label_count_stride + c] += w + # Add the weight to the sum of weights so far weighted_n_node_samples += w + # Save the sum of weights so far self.weighted_n_node_samples = weighted_n_node_samples # Reset to pos=start self.reset() cdef void reset(self) nogil: - """Reset the criterion at pos=start.""" + """ + Reset the criterion at pos=start. + """ + self.pos = self.start self.weighted_n_left = 0.0 @@ -300,8 +428,17 @@ cdef class ClassificationCriterion(Criterion): label_count_right += label_count_stride cdef void update(self, SIZE_t new_pos) nogil: - """Update the collected statistics by moving samples[pos:new_pos] from - the right child to the left child.""" + """ + Update the collected statistics by moving samples[pos:new_pos] from + the right child to the left child. + + Parameters + ---------- + new_pos: int64 + The new ending position for which to move samples from the right + child to the left child. + """ + cdef DOUBLE_t* y = self.y cdef SIZE_t y_stride = self.y_stride cdef DOUBLE_t* sample_weight = self.sample_weight @@ -324,24 +461,32 @@ cdef class ClassificationCriterion(Criterion): cdef DOUBLE_t diff_w = 0.0 # Note: We assume start <= pos < new_pos <= end - + # Go through each sample in the new indexing for p in range(pos, new_pos): + # Unpack the sample from the mask i = samples[p] + # w is originally set to be 1.0, meaning that if no sample weights + # are given, the default weight of each sample is 1.0 if sample_weight != NULL: w = sample_weight[i] + # If the child has changed nodes, then we need to change the weight + # in the nodes. for k in range(n_outputs): label_index = (k * label_count_stride + y[i * y_stride + k]) label_count_left[label_index] += w label_count_right[label_index] -= w + # Change the difference in weights diff_w += w + # Adjust the left and right node weights by the difference determined before self.weighted_n_left += diff_w self.weighted_n_right -= diff_w + # Change the position to the new position self.pos = new_pos cdef double node_impurity(self) nogil: @@ -352,7 +497,15 @@ cdef class ClassificationCriterion(Criterion): pass cdef void node_value(self, double* dest) nogil: - """Compute the node value of samples[start:end] into dest.""" + """ + Compute the node value of samples[start:end] and save it into dest. + + Parameters + ---------- + dest: float64 + The memory address which we will save the node value into. + """ + cdef SIZE_t n_outputs = self.n_outputs cdef SIZE_t* n_classes = self.n_classes cdef SIZE_t label_count_stride = self.label_count_stride @@ -366,22 +519,26 @@ cdef class ClassificationCriterion(Criterion): cdef class Entropy(ClassificationCriterion): - """Cross Entropy impurity criteria. + """ + A class representing the Cross Entropy impurity criteria. This handles + cases where the response is a classification taking values 0, 1, ... + K-2, K-1. If node m represents a region Rm with Nm observations, then let - Let the target be a classification outcome taking values in 0, 1, ..., K-1. - If node m represents a region Rm with Nm observations, then let - - pmk = 1/ Nm \sum_{x_i in Rm} I(yi = k) + pmk = 1 / Nm \sum_{x_i in Rm} I(yi = k) be the proportion of class k observations in node m. The cross-entropy is then defined as - cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) + cross-entropy = -\sum_{k=0}^{K-1} pmk log(pmk) """ + cdef double node_impurity(self) nogil: - """Evaluate the impurity of the current node, i.e. the impurity of - samples[start:end].""" + """ + Evaluate the impurity of the current node, i.e. the impurity of + samples[start:end], using the cross-entropy criterion. + """ + cdef double weighted_n_node_samples = self.weighted_n_node_samples cdef SIZE_t n_outputs = self.n_outputs @@ -391,29 +548,49 @@ cdef class Entropy(ClassificationCriterion): cdef double entropy = 0.0 cdef double total = 0.0 - cdef double tmp + cdef double pmk cdef SIZE_t k cdef SIZE_t c + # Go through each response and calculate the entropy for k in range(n_outputs): + # Initialize the entropy to 0.0 for this response entropy = 0.0 + # For each class in this response for c in range(n_classes[k]): - tmp = label_count_total[c] - if tmp > 0.0: - tmp /= weighted_n_node_samples - entropy -= tmp * log(tmp) + # Look up the weighted number of points in this class + pmk = label_count_total[c] + + # If more than 0 weight, then calculate entropy + if pmk > 0.0: + pmk /= weighted_n_node_samples + entropy -= pmk * log(pmk) + # Otherwise the addition is 0. + # Add that class entropy to the total entropy total += entropy label_count_total += label_count_stride + # Return the total entropy over all responses divided by the number of + # responses. return total / n_outputs cdef void children_impurity(self, double* impurity_left, double* impurity_right) nogil: - """Evaluate the impurity in children nodes, i.e. the impurity of the - left child (samples[start:pos]) and the impurity the right child - (samples[pos:end]).""" + """ + Evaluate the impurity in children nodes, i.e. the impurity of the + left child (samples[start:pos]) and the impurity the right child + (samples[pos:end]). + + Parameters + ---------- + impurity_left: float64 + The memory address of where to save the impurity of the left node + impurity_right: float64 + The memory address of where to save the impurity of the right node + """ + cdef double weighted_n_node_samples = self.weighted_n_node_samples cdef double weighted_n_left = self.weighted_n_left cdef double weighted_n_right = self.weighted_n_right @@ -428,39 +605,46 @@ cdef class Entropy(ClassificationCriterion): cdef double entropy_right = 0.0 cdef double total_left = 0.0 cdef double total_right = 0.0 - cdef double tmp + cdef double pmk cdef SIZE_t k cdef SIZE_t c + # For each response for k in range(n_outputs): + # Initialize the left and right entropies to be 0 entropy_left = 0.0 entropy_right = 0.0 + # For each unique class in this response for c in range(n_classes[k]): - tmp = label_count_left[c] - if tmp > 0.0: - tmp /= weighted_n_left - entropy_left -= tmp * log(tmp) - - tmp = label_count_right[c] - if tmp > 0.0: - tmp /= weighted_n_right - entropy_right -= tmp * log(tmp) - + # Calculate this classes entropy on the left node + pmk = label_count_left[c] + if pmk > 0.0: + pmk /= weighted_n_left + entropy_left -= pmk * log(pmk) + + # Calculate this classes entropy on the right node + pmk = label_count_right[c] + if pmk > 0.0: + pmk /= weighted_n_right + entropy_right -= pmk * log(pmk) + + # Add local entropy to the total entropy on the appropriate side total_left += entropy_left total_right += entropy_right label_count_left += label_count_stride label_count_right += label_count_stride + # Save the average entropy over all responses impurity_left[0] = total_left / n_outputs impurity_right[0] = total_right / n_outputs cdef class Gini(ClassificationCriterion): - """Gini Index impurity criteria. - - Let the target be a classification outcome taking values in 0, 1, ..., K-1. - If node m represents a region Rm with Nm observations, then let + """ + A class representing the Gini Index impurity criteria. This handles + cases where the response is a classification taking values 0, 1, ... + K-2, K-1. If node m represents a region Rm with Nm observations, then let pmk = 1/ Nm \sum_{x_i in Rm} I(yi = k) @@ -471,9 +655,13 @@ cdef class Gini(ClassificationCriterion): index = \sum_{k=0}^{K-1} pmk (1 - pmk) = 1 - \sum_{k=0}^{K-1} pmk ** 2 """ + cdef double node_impurity(self) nogil: - """Evaluate the impurity of the current node, i.e. the impurity of - samples[start:end].""" + """ + Evaluate the impurity of the current node, i.e. the impurity of + samples[start:end] using the Gini criterion. + """ + cdef double weighted_n_node_samples = self.weighted_n_node_samples cdef SIZE_t n_outputs = self.n_outputs @@ -483,30 +671,49 @@ cdef class Gini(ClassificationCriterion): cdef double gini = 0.0 cdef double total = 0.0 - cdef double tmp + cdef double pmk cdef SIZE_t k cdef SIZE_t c + # For each response for k in range(n_outputs): + # Set the initial Gini index to 0 gini = 0.0 + # For each class in this response for c in range(n_classes[k]): - tmp = label_count_total[c] - gini += tmp * tmp + # Unpack the weighted count of this class + pmk = label_count_total[c] + + # Add the squared count to the Gini index + gini += pmk * pmk + # Calculate the Gini index by normalizing against the squared + # total weight of all samples gini = 1.0 - gini / (weighted_n_node_samples * weighted_n_node_samples) total += gini label_count_total += label_count_stride + # Return the average Gini index over all responses return total / n_outputs cdef void children_impurity(self, double* impurity_left, double* impurity_right) nogil: - """Evaluate the impurity in children nodes, i.e. the impurity of the - left child (samples[start:pos]) and the impurity the right child - (samples[pos:end]).""" + """ + Evaluate the impurity in children nodes, i.e. the impurity of the + left child (samples[start:pos]) and the impurity the right child + (samples[pos:end]) using the Gini index. + + Parameters + ---------- + impurity_left: float64 + The memory address to save the impurity of the left node to + impurity_right: float64 + The memory address to save the impurity of the right node to + """ + cdef double weighted_n_node_samples = self.weighted_n_node_samples cdef double weighted_n_left = self.weighted_n_left cdef double weighted_n_right = self.weighted_n_right @@ -522,22 +729,31 @@ cdef class Gini(ClassificationCriterion): cdef double total = 0.0 cdef double total_left = 0.0 cdef double total_right = 0.0 - cdef double tmp + cdef double pmk cdef SIZE_t k cdef SIZE_t c + # For each response for k in range(n_outputs): + # Initialize both children to be 0 gini_left = 0.0 gini_right = 0.0 + # Go through each unique class for c in range(n_classes[k]): - tmp = label_count_left[c] - gini_left += tmp * tmp - tmp = label_count_right[c] - gini_right += tmp * tmp + # Add to the Gini index of the left node + pmk = label_count_left[c] + gini_left += pmk * pmk + # Add to the Gini index of the right node + pmk = label_count_right[c] + gini_right += pmk * pmk + + # Normalize the Gini index of the left node gini_left = 1.0 - gini_left / (weighted_n_left * weighted_n_left) + + # Normalize the Gini index of the right node gini_right = 1.0 - gini_right / (weighted_n_right * weighted_n_right) @@ -546,19 +762,22 @@ cdef class Gini(ClassificationCriterion): label_count_left += label_count_stride label_count_right += label_count_stride + # Save the average Gini index over all responses impurity_left[0] = total_left / n_outputs impurity_right[0] = total_right / n_outputs cdef class RegressionCriterion(Criterion): - """Abstract criterion for regression. - - Computes variance of the target values left and right of the split point. - Computation is linear in `n_samples` by using :: + """ + A class representing a regression criteria. This handles cases where the + response is a continuous value, and is evaluated by computing the variance + of the target values left and right of the split point. The computation + takes linear time with `n_samples` by using :: var = \sum_i^n (y_i - y_bar) ** 2 - = (\sum_i^n y_i ** 2) - n_samples y_bar ** 2 + = (\sum_i^n y_i ** 2) - n_samples * y_bar ** 2 """ + cdef double* mean_left cdef double* mean_right cdef double* mean_total @@ -572,6 +791,16 @@ cdef class RegressionCriterion(Criterion): cdef double* sum_total def __cinit__(self, SIZE_t n_outputs): + """ + Initialize parameters for this criterion. The only input are the number + of responses to be predicted. + + Parameters + ---------- + n_outputs: int64 + The number of responses to be predicted + """ + # Default values self.y = NULL self.y_stride = 0 @@ -602,6 +831,7 @@ cdef class RegressionCriterion(Criterion): self.sum_right = NULL self.sum_total = NULL + # Allocate memory for the accumulators self.mean_left = calloc(n_outputs, sizeof(double)) self.mean_right = calloc(n_outputs, sizeof(double)) self.mean_total = calloc(n_outputs, sizeof(double)) @@ -628,7 +858,11 @@ cdef class RegressionCriterion(Criterion): raise MemoryError() def __dealloc__(self): - """Destructor.""" + """ + The destructor method for this class. Since we've allocated memory to + the accumulators, now deallocate the memory. + """ + free(self.mean_left) free(self.mean_right) free(self.mean_total) @@ -894,7 +1128,7 @@ cdef class FriedmanMSE(MSE): cdef double weighted_n_right = self.weighted_n_right cdef double diff = 0.0 - for k from 0 <= k < n_outputs: + for k in range(n_outputs): total_sum_left += sum_left[k] total_sum_right += sum_right[k] @@ -920,9 +1154,40 @@ cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: cdef class Splitter: + """ + Interface for the splitter class. This is an object which handles efficient + storage and splitting of a feature in the process of building a decision + tree. + """ + def __cinit__(self, Criterion criterion, SIZE_t max_features, SIZE_t min_samples_leaf, double min_weight_leaf, object random_state): + """ + A C-level initialization of the splitter object, where it's attributes + are initialized. Splitter.init provides an initialization based on + data. + + Parameters + ---------- + criterion: Criterion + The criterion to measure the quality of a split. + + max_features: int64 + The maximal number of features that a single decision tree can + consider. + + min_samples_leaf: int64 + The minimal number of samples each leaf can have. + + min_weight_leaf: float64 + The minimal weight each leaf can have, where the weight is the sum + of the weights of each sample in it. + + random_state: object + The user inputted random state to be used for pseudo-randomness + """ + self.criterion = criterion self.samples = NULL @@ -941,7 +1206,11 @@ cdef class Splitter: self.random_state = random_state def __dealloc__(self): - """Destructor.""" + """ + The destructor method for the Splitter class. Memory had to be + allocated for th following four objects, so we must free that memory. + """ + free(self.samples) free(self.features) free(self.constant_features) @@ -957,31 +1226,69 @@ cdef class Splitter: object X, np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, DOUBLE_t* sample_weight) except *: - """Initialize the splitter.""" + """ + Initialize the splitter by taking in the input data X, the response Y, + and optional sample weights. This involves creating a mask which blocks + all samples with 0 weight, and preparing other attributes for use by + specific splitting routines. + + Parameters + ---------- + X: object + This contains the inputs. Usually it is a 2d numpy array. + + y: numpy.ndarray, dtype=float + This is the vector of responses, or true labels, for the points + + sample_weight: numpy.ndarray, dtype=float64 (optional) + The weights of the points, where higher weighted points are fit + closer than lower weight points. If not provided, all points + are assumed to have uniform weight. + """ + # Reset random state self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) - # Initialize samples and features structures + + # Unpack the number of samples cdef SIZE_t n_samples = X.shape[0] + + # Create a new array which will be used to store nonzero + # samples from the feature of interest cdef SIZE_t* samples = safe_realloc(&self.samples, n_samples) cdef SIZE_t i, j cdef double weighted_n_samples = 0.0 j = 0 + # In order to only use positively weighted samples, we must go through + # each sample and check its associated weight, if given. If no weights + # are given, we assume the weight on each point is equal to 1. for i in range(n_samples): - # Only work with positively weighted samples + # If no sample weights are passed in, or the associated sample + # weight is greater than 0, add that sample to the growing array, + # and increment the count if sample_weight == NULL or sample_weight[i] != 0.0: samples[j] = i j += 1 + # Add the sample weight, or 1.0 if no sample weights are given. + # If the sample weight is 0.0, then it does not matter if added + # to the weight sum if sample_weight != NULL: weighted_n_samples += sample_weight[i] else: weighted_n_samples += 1.0 + # Reset the number of samples to be the number of non-zero-weight + # samples found from the original data self.n_samples = j + + # Reset the weighted number of samples to be the sum of the weights of the + # sample_weight vector self.weighted_n_samples = weighted_n_samples + # Get the number of features from the original dataset, and allocate a new + # array of features IDs which will help us index data in the future cdef SIZE_t n_features = X.shape[1] cdef SIZE_t* features = safe_realloc(&self.features, n_features) @@ -990,17 +1297,38 @@ cdef class Splitter: self.n_features = n_features + # Allocate a new array for the values a feature takes; which is + # maximally the number of non-zero-weight entries. safe_realloc(&self.feature_values, n_samples) safe_realloc(&self.constant_features, n_features) - # Initialize y, sample_weight + # Store y as a buffer for memory efficient storage self.y = y.data + + # Save the stride of y in order to access elements in the buffer easily + # in the future self.y_stride = y.strides[0] / y.itemsize + + # Finally, store the weight of each sample in the dataset self.sample_weight = sample_weight cdef void node_reset(self, SIZE_t start, SIZE_t end, double* weighted_n_node_samples) nogil: - """Reset splitter on node samples[start:end].""" + """ + Reset the splitter object, such that it will now consider samples + between start and end. This reinitializes the criterion using the + new start and end values. + + Parameters + ---------- + start: int32 + The index of the first sample to consider + end: int32 + The index of the last sample to consider + weighted_n_node_samples: numpy.ndarray, dtype=float64 + The cumulative weight of those samples + """ + self.start = start self.end = end @@ -1016,15 +1344,28 @@ cdef class Splitter: cdef void node_split(self, double impurity, SplitRecord* split, SIZE_t* n_constant_features) nogil: - """Find a split on node samples[start:end].""" + """ + This is a placeholder for a method which will find the best split on + samples[start:end]. The majority of the computation will be done in + this method. + """ + pass cdef void node_value(self, double* dest) nogil: - """Copy the value of node samples[start:end] into dest.""" + """ + Copy the value of node samples[start:end] into dest. + """ + self.criterion.node_value(dest) cdef double node_impurity(self) nogil: - """Copy the impurity of node samples[start:end.""" + """ + Return the impurity of the node where the last batch of samples + were put. This returns the node impurity from the last call to + the criterion object. + """ + return self.criterion.node_impurity() @@ -1036,7 +1377,9 @@ cdef class BaseDenseSplitter(Splitter): def __cinit__(self, Criterion criterion, SIZE_t max_features, SIZE_t min_samples_leaf, double min_weight_leaf, object random_state): - # Parent __cinit__ is automatically called + """ + Th + """ self.X = NULL self.X_sample_stride = 0 @@ -1186,7 +1529,7 @@ cdef class BestSplitter(BaseDenseSplitter): # (p + 1 >= end) or (X[samples[p + 1], current.feature] > # X[samples[p], current.feature]) p += 1 - # (p >= end) or (X[samples[p], current.feature] > + # (p >= end) or (X[samples[p], current.fe + 1 ature] > # X[samples[p - 1], current.feature]) if p < end: @@ -1807,6 +2150,373 @@ cdef class PresortBestSplitter(BaseDenseSplitter): split[0] = best n_constant_features[0] = n_total_constants +cdef class SpeedSplitter( BaseDenseSplitter ): + """ + This object is a splitter which performs more caching in order to try to + find splits faster. + """ + + cdef DTYPE_t* X_old + cdef np.ndarray X_idx_sorted + cdef SIZE_t X_idx_sorted_stride + cdef INT32_t* X_idx_sorted_ptr + + cdef unsigned char* sample_mask + cdef SIZE_t X_feature_stride + cdef double impurity + + def __cinit__(self, Criterion criterion, SIZE_t max_features, + SIZE_t mn_samples_leaf, + double min_weight_leaf, + object random_state): + + # Initialize the points to point at appropriate objects + self.X_old = NULL + self.X_idx_sorted_stride = 0 + self.X_idx_sorted_ptr = NULL + self.sample_mask = NULL + self.X_feature_stride = 0 + self.impurity = 0. + + def __dealloc__(self): + """ + Free the memory associated with this object. + """ + + free(self.sample_mask) + + def __reduce(self): + return (SpeedSplitter, (self.criterion, + self.max_features, + self.min_samples_leaf, + self.min_weight_leaf, + self.random_state), self.__getstate__() ) + + cdef void init(self, object X, + np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, + DOUBLE_t* sample_weight) except *: + """ + Initialize the values in this object. + """ + + # Unpack X and expose its memory buffer + self.n_samples = X.shape[0] + self.n_features = X.shape[1] + cdef np.ndarray X_ndarray = X + self.X = X_ndarray.data + self.X_sample_stride = X.strides[0] / X.itemsize + self.X_feature_stride = X.strides[1] / X.itemsize + self.impurity = 1.e2 + + cdef void* sample_mask = NULL + + # Get the random state + self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) + + cdef SIZE_t i, j = 0 + self.weighted_n_samples = 0.0 + + cdef SIZE_t* samples = safe_realloc(&self.samples, self.n_samples) + + # In order to only use positively weighted samples, we must go through + # each sample and check its associated weight, if given. If no weights + # are given, we assume the weight on each point is equal to 1. + for i in range(self.n_samples): + # If no sample weights are passed in, or the associated sample + # weight is greater than 0, add that sample to the growing array, + # and increment the count + if sample_weight == NULL or sample_weight[i] != 0.0: + samples[j] = i + j += 1 + + # Add the sample weight, or 1.0 if no sample weights are given. + # If the sample weight is 0.0, then it does not matter if added + # to the weight sum + if sample_weight != NULL: + self.weighted_n_samples += sample_weight[i] + else: + self.weighted_n_samples += 1 + + self.n_samples = j + + cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) + for i in range(self.n_features): + features[i] = i + + safe_realloc(&self.feature_values, self.n_samples) + safe_realloc(&self.constant_features, self.n_features) + + # Save y as a reference to a buffer for memory efficient access + self.y = y.data + self.y_stride = y.strides[0] / y.itemsize + + # Store the weight of each sample + self.sample_weight = sample_weight + + # Pre-sort X so that we can access sorted columns easier; in essence + # caching the sort. + if self.X_old != self.X: + self.X_old = self.X + + self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), + dtype=np.int32) + self.X_idx_sorted_ptr = self.X_idx_sorted.data + self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / + self.X_idx_sorted.itemsize) + + sample_mask = safe_realloc(&self.sample_mask, self.n_samples) + memset(sample_mask, 0, self.n_samples) + + cdef void node_split(self, double impurity, SplitRecord* split, + SIZE_t* n_constant_features) nogil: + """ + Find the best split for this node. + """ + + # Unpack range related items + cdef SIZE_t start = self.start + cdef SIZE_t end = self.end + + # Unpack feature related items + cdef SIZE_t* features = self.features + cdef SIZE_t* constant_features = self.constant_features + cdef SIZE_t n_features = self.n_features + + # Unpack sample related items + cdef SIZE_t* samples = self.samples + cdef SIZE_t n_samples = self.n_samples + cdef DOUBLE_t* w = self.sample_weight + cdef unsigned char* sample_mask = self.sample_mask + + # Unpack X related items + cdef DTYPE_t* X = self.X + cdef DTYPE_t* X_i = self.feature_values + cdef SIZE_t X_sample_stride = self.X_sample_stride + cdef SIZE_t X_feature_stride = self.X_feature_stride + cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr + cdef SIZE_t X_idx_sorted_stride = self.X_idx_sorted_stride + + # Unpack y + cdef DOUBLE_t* y = self.y + cdef SIZE_t y_stride = self.y_stride + + # Unpack constraints + cdef SIZE_t max_features = self.max_features + cdef SIZE_t min_samples_leaf = self.min_samples_leaf + cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf + cdef UINT32_t* random_state = &self.rand_r_state + + # Keeping track of the current split and the best split + cdef SplitRecord best, current + + # Numbers involved in keeping features ordered such that constant + # features are not considered + cdef SIZE_t f_j, f_i = n_features, tmp + cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 + cdef SIZE_t n_known_constants = n_constant_features[0] + cdef SIZE_t n_total_constants = n_known_constants + cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k + + cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) + cdef DOUBLE_t* w_cl = calloc(n_samples, sizeof(DOUBLE_t)) + cdef DOUBLE_t* yw_sq = calloc(n_samples, sizeof(DOUBLE_t)) + cdef DOUBLE_t yw_cr, w_cr, yw_sq_r, yw_sq_sum, yw_sum, w_sum + cdef SIZE_t n_possible_splits + + _init_split(&best, end) + + # Set the sample mask + for p in range(start, end): + sample_mask[samples[p]] = 1 + + # Sample up to max_features without replacement using a + # Fisher-Yates-based algorithm (using the local variables `f_i` and + # `f_j` to compute a permutation of the `features` array). + # + # Skip the CPU intensive evaluation of the impurity criterion for + # features that were already detected as constant (hence not suitable + # for good splitting) by ancestor nodes and save the information on + # newly discovered constant features to spare computation on descendant + # nodes. + while (f_i > n_total_constants and # Stop early if remaining features + # are constant + (n_visited_features < max_features or + # At least one drawn features must be non constant + n_visited_features <= n_found_constants + n_drawn_constants)): + n_visited_features += 1 + + # Loop invariant: elements of features in + # - [:n_drawn_constant] holds drawn and known constant features; + # - [n_drawn_constant:n_known_constant] holds known constant + # features that haven't been drawn yet; + # - [n_known_constant:n_total_constant] holds newly found constant + # features; + # - [n_total_constant:f_i] holds features that haven't been drawn + # yet and aren't constant apriori. + # - [f_i:n_features] holds features that have been drawn + # and aren't constant. + + # Draw a feature at random + f_j = rand_int(n_drawn_constants, f_i - n_found_constants, + random_state) + + if f_j < n_known_constants: + # f_j is in [n_drawn_constants, n_known_constants] + tmp = features[f_j] + features[f_j] = features[n_drawn_constants] + features[n_drawn_constants] = tmp + + n_drawn_constants += 1 + else: + # f_j in the interval [n_known_constants, f_i - n_found_constants] + f_j += n_found_constants + # f_j in the interval [n_total_constants, f_i] + + current.feature = features[f_j] + + # Extract the relevant samples from that feature, ordered + # according to the presorting, into a single array + p = start + for i in range(n_samples): + # Get the next index from memory + j = X_idx_sorted[X_idx_sorted_stride * current.feature + i] + + # See if we are using this sample or not + if sample_mask[j] == 1: + samples[p] = j + X_i[p] = X[X_sample_stride * j + + X_feature_stride * current.feature] + p += 1 + + # Ensure this feature is not constant + if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: + features[f_j] = features[n_total_constants] + features[n_total_constants] = current.feature + + n_found_constants += 1 + n_total_constants += 1 + + # Otherwise, find a good split on the feature. ALL CODE ABOVE + # INVOLVED IN FINDING THE NEXT FEATURE TO SPLIT ON. + else: + f_i -= 1 + features[f_i], features[f_j] = features[f_j], features[f_i] + + # Now try to find the best split in this data by going + # through each possible split, recording some summary + # statistics, and using those later on to calculate the + # best split. + for i in range(end-start): + p = samples[i+start] + + # Since we are taking cumulatives, start off by just + # determining the original contribution. We want the + # cumulative sum of the weights, of the weights + # multiplied by the response (y), and of that value + # squared. + if i == 0: + w_cl[0] = w[p] + yw_cl[0] = w[p] * y[p*y_stride] + yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] + else: + w_cl[i] = w[p] + w_cl[i-1] + yw_cl[i] = w[p] * y[p*y_stride] + yw_cl[i-1] + yw_sq[i] = (w[p] * y[p*y_stride] * y[p*y_stride] + + yw_sq[i-1]) + + # Now go through each possible split, calculate the + # improvement of that split using Friedman's correction to + # the MSE criterion, and determine which split is the best. + for i in range(end-start-1): + if (i < end-start-1 and X_i[i+start+1] <= + X_i[i+start] + FEATURE_THRESHOLD): + continue + # Don't even consider possibilities which don't fall under + # the constraints imposed by the user. + if (i+1 < min_samples_leaf or + end-start-i+1 < min_samples_leaf): + continue + if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] + - w_cl[i] < min_weight_leaf): + continue + + p = i+start+1 + + w_cr = w_cl[end-start-1] - w_cl[i] + yw_cr = yw_cl[end-start-1] - yw_cl[i] + yw_sq_r = yw_sq[end-start-1] - yw_sq[i] + + current.improvement = (w_cl[i] * w_cr * + (yw_cl[i] / w_cl[i] - yw_cr / w_cr) ** 2.0) + current.pos = p + + if current.improvement > best.improvement: + current.threshold = (X_i[p] + X_i[p-1]) / 2.0 + if current.threshold == X_i[p]: + current.threshold = X_i[p-1] + + best = current + + # Constants pulling out the sum, to make the next equations simpler to + # understand + yw_sq_sum = yw_sq[end-start-1] + yw_sum = yw_cl[end-start-1] + w_sum = w_cl[end-start-1] + + # Calculate the impurity of the entire array + self.impurity = yw_sq_sum / w_sum - (yw_sum / w_sum) ** 2.0 + + # Calculate the impurity on the left side of the array + best.impurity_left = yw_sq[i] / w_cl[i] - (yw_cl[i] / w_cl[i]) ** 2.0 + + # Calculate the impurity on the right side of the array + best.impurity_right = yw_sq_r / w_cr - (yw_cr / w_cr) ** 2.0 + + # Reorganize into samples[start:best.pos] + samples[best.pos:end] + if best.pos < end: + partition_end = end + p = start + + while p < partition_end: + if X[X_sample_stride * samples[p] + + X_feature_stride * best.feature] <= best.threshold: + p += 1 + + else: + partition_end -= 1 + + tmp = samples[partition_end] + samples[partition_end] = samples[p] + samples[p] = tmp + + # Reset sample mask + for p in range(start, end): + sample_mask[samples[p]] = 0 + + # Respect invariant for constant features: the original order of + # element in features[:n_known_constants] must be preserved for sibling + # and child nodes + memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) + + # Copy newly found constant features + memcpy(constant_features + n_known_constants, + features + n_known_constants, + sizeof(SIZE_t) * n_found_constants) + + # Return values + split[0] = best + n_constant_features[0] = n_total_constants + + free(w_cl) + free(yw_cl) + free(yw_sq) + + cdef double node_impurity(self) nogil: + """ + Return the impurity of this node. + """ + + return self.impurity cdef class BaseSparseSplitter(Splitter): # The sparse splitter works only with csc sparse matrix format @@ -2693,15 +3403,16 @@ cdef class DepthFirstTreeBuilder(TreeBuilder): (n_node_samples < 2 * min_samples_leaf) or (weighted_n_node_samples < min_weight_leaf)) + if not is_leaf: + splitter.node_split(impurity, &split, &n_constant_features) + is_leaf = is_leaf or (split.pos >= end) + if first: impurity = splitter.node_impurity() first = 0 is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) - if not is_leaf: - splitter.node_split(impurity, &split, &n_constant_features) - is_leaf = is_leaf or (split.pos >= end) node_id = tree._add_node(parent, is_left, is_leaf, split.feature, split.threshold, impurity, n_node_samples, @@ -2717,13 +3428,13 @@ cdef class DepthFirstTreeBuilder(TreeBuilder): if not is_leaf: # Push right child on stack - rc = stack.push(split.pos, end, depth + 1, node_id, 0, + rc = stack.push(split.pos, end, depth+1, node_id, 0, split.impurity_right, n_constant_features) if rc == -1: break # Push left child on stack - rc = stack.push(start, split.pos, depth + 1, node_id, 1, + rc = stack.push(start, split.pos, depth+1, node_id, 1, split.impurity_left, n_constant_features) if rc == -1: break From 760ffa4adee3f8648e434862e90237b568e9f299 Mon Sep 17 00:00:00 2001 From: Jacob Schreiber Date: Mon, 20 Jul 2015 13:48:27 +0200 Subject: [PATCH 3/3] Decision tree nosetests work now, memory issue fixed --- sklearn/ensemble/gradient_boosting.py | 10 +- sklearn/tree/_tree.c | 4275 +++++++++++-------------- sklearn/tree/_tree.pyx | 125 +- 3 files changed, 1915 insertions(+), 2495 deletions(-) diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py index 05e3c21361a4c..8ee33a223f9fe 100644 --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -45,7 +45,7 @@ from ..tree.tree import DecisionTreeRegressor from ..tree._tree import DTYPE, TREE_LEAF -from ..tree._tree import PresortBestSplitter, SpeedSplitter +from ..tree._tree import PresortBestSplitter, FriedmanMSESplitter from ..tree._tree import FriedmanMSE from ._gradient_boosting import predict_stages @@ -1011,13 +1011,7 @@ def _fit_stages(self, X, y, y_pred, sample_weight, random_state, # init criterion and splitter criterion = FriedmanMSE(1) - #splitter = PresortBestSplitter(criterion, - # self.max_features_, - # self.min_samples_leaf, - # min_weight_leaf, - # random_state) - - splitter = SpeedSplitter(criterion, + splitter = FriedmanMSESplitter(criterion, self.max_features_, self.min_samples_leaf, min_weight_leaf, diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index 2bc2aef9d4f9c..c83c9fdffeb11 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -792,7 +792,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter; -struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter; +struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter; struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_RandomSparseSplitter; @@ -961,7 +961,7 @@ enum { __pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX = 0x7FFFFFFF }; -/* "sklearn/tree/_tree.pyx":3326 +/* "sklearn/tree/_tree.pyx":3254 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -973,7 +973,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":3484 +/* "sklearn/tree/_tree.pyx":3414 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1263,23 +1263,21 @@ struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter { /* "sklearn/tree/_tree.pyx":2153 * n_constant_features[0] = n_total_constants * - * cdef class SpeedSplitter( BaseDenseSplitter ): # <<<<<<<<<<<<<< + * cdef class FriedmanMSESplitter(PresortBestSplitter): # <<<<<<<<<<<<<< * """ * This object is a splitter which performs more caching in order to try to */ -struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter { - struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter __pyx_base; - __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *X_old; +struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter { + struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter __pyx_base; PyArrayObject *X_idx_sorted; __pyx_t_7sklearn_4tree_5_tree_SIZE_t X_idx_sorted_stride; __pyx_t_7sklearn_4tree_5_tree_INT32_t *X_idx_sorted_ptr; - unsigned char *sample_mask; __pyx_t_7sklearn_4tree_5_tree_SIZE_t X_feature_stride; double impurity; }; -/* "sklearn/tree/_tree.pyx":2520 +/* "sklearn/tree/_tree.pyx":2448 * return self.impurity * * cdef class BaseSparseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1297,7 +1295,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2839 +/* "sklearn/tree/_tree.pyx":2767 * * * cdef class BestSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1309,7 +1307,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":3057 +/* "sklearn/tree/_tree.pyx":2985 * * * cdef class RandomSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1321,7 +1319,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":3314 +/* "sklearn/tree/_tree.pyx":3242 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1333,7 +1331,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { }; -/* "sklearn/tree/_tree.pyx":3464 +/* "sklearn/tree/_tree.pyx":3394 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1417,7 +1415,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; -/* "sklearn/tree/_tree.pyx":3668 +/* "sklearn/tree/_tree.pyx":3598 * # ============================================================================= * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1442,7 +1440,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *); -/* "sklearn/tree/_tree.pyx":3275 +/* "sklearn/tree/_tree.pyx":3203 * # Tree builders * # ============================================================================= * cdef class TreeBuilder: # <<<<<<<<<<<<<< @@ -1601,18 +1599,18 @@ static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_ /* "sklearn/tree/_tree.pyx":2153 * n_constant_features[0] = n_total_constants * - * cdef class SpeedSplitter( BaseDenseSplitter ): # <<<<<<<<<<<<<< + * cdef class FriedmanMSESplitter(PresortBestSplitter): # <<<<<<<<<<<<<< * """ * This object is a splitter which performs more caching in order to try to */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_SpeedSplitter { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BaseDenseSplitter __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSESplitter { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSESplitter; -/* "sklearn/tree/_tree.pyx":2520 +/* "sklearn/tree/_tree.pyx":2448 * return self.impurity * * cdef class BaseSparseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1630,7 +1628,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, int *); -/* "sklearn/tree/_tree.pyx":2839 +/* "sklearn/tree/_tree.pyx":2767 * * * cdef class BestSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1644,7 +1642,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSparseSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSparseSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter; -/* "sklearn/tree/_tree.pyx":3057 +/* "sklearn/tree/_tree.pyx":2985 * * * cdef class RandomSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1658,7 +1656,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSparseSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSparseSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter; -/* "sklearn/tree/_tree.pyx":3314 +/* "sklearn/tree/_tree.pyx":3242 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1672,7 +1670,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; -/* "sklearn/tree/_tree.pyx":3464 +/* "sklearn/tree/_tree.pyx":3394 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -2115,9 +2113,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter *__pyx_v_self, double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self, double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ -static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ -static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ -static double __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self); /* proto*/ +static void __pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ +static void __pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features); /* proto*/ +static double __pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight); /* proto*/ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, double __pyx_v_threshold, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end_negative, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start_positive, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_zero_pos); /* proto*/ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_feature, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_end_negative, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_start_positive, int *__pyx_v_is_samples_sorted); /* proto*/ @@ -2255,7 +2253,7 @@ static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter = 0; -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSESplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter = 0; @@ -2335,9 +2333,8 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce__(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_v_self); /* proto */ -static int __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ -static void __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self); /* proto */ +static int __pyx_pf_7sklearn_4tree_5_tree_19FriedmanMSESplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19FriedmanMSESplitter_2__reduce(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self); /* proto */ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_min_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state); /* proto */ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__(struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter *__pyx_v_self); /* proto */ @@ -2393,7 +2390,7 @@ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BaseDenseSplitter(PyTypeObje static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_SpeedSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_FriedmanMSESplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BaseSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSparseSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -14463,7 +14460,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< * - * cdef class SpeedSplitter( BaseDenseSplitter ): + * cdef class FriedmanMSESplitter(PresortBestSplitter): */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; @@ -14478,7 +14475,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2168 +/* "sklearn/tree/_tree.pyx":2166 * cdef double impurity * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -14487,8 +14484,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ /* Python wrapper */ -static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_7sklearn_4tree_5_tree_19FriedmanMSESplitter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_7sklearn_4tree_5_tree_19FriedmanMSESplitter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion = 0; CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features; CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf; @@ -14523,26 +14520,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mn_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -14554,21 +14551,21 @@ static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *_ values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); - __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_mn_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_mn_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_mn_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_mn_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; - __Pyx_AddTraceback("sklearn.tree._tree.SpeedSplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("sklearn.tree._tree.FriedmanMSESplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_mn_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_19FriedmanMSESplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_mn_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); /* function exit code */ goto __pyx_L0; @@ -14579,66 +14576,48 @@ static int __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(PyObject *_ return __pyx_r; } -static int __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state) { +static int __pyx_pf_7sklearn_4tree_5_tree_19FriedmanMSESplitter___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_criterion, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_max_features, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_mn_samples_leaf, CYTHON_UNUSED double __pyx_v_min_weight_leaf, CYTHON_UNUSED PyObject *__pyx_v_random_state) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2174 + /* "sklearn/tree/_tree.pyx":2171 + * object random_state): * - * # Initialize the points to point at appropriate objects - * self.X_old = NULL # <<<<<<<<<<<<<< - * self.X_idx_sorted_stride = 0 - * self.X_idx_sorted_ptr = NULL - */ - __pyx_v_self->X_old = NULL; - - /* "sklearn/tree/_tree.pyx":2175 - * # Initialize the points to point at appropriate objects - * self.X_old = NULL * self.X_idx_sorted_stride = 0 # <<<<<<<<<<<<<< * self.X_idx_sorted_ptr = NULL - * self.sample_mask = NULL + * self.X_feature_stride = 0 */ __pyx_v_self->X_idx_sorted_stride = 0; - /* "sklearn/tree/_tree.pyx":2176 - * self.X_old = NULL + /* "sklearn/tree/_tree.pyx":2172 + * * self.X_idx_sorted_stride = 0 * self.X_idx_sorted_ptr = NULL # <<<<<<<<<<<<<< - * self.sample_mask = NULL * self.X_feature_stride = 0 + * self.impurity = 0. */ __pyx_v_self->X_idx_sorted_ptr = NULL; - /* "sklearn/tree/_tree.pyx":2177 + /* "sklearn/tree/_tree.pyx":2173 * self.X_idx_sorted_stride = 0 * self.X_idx_sorted_ptr = NULL - * self.sample_mask = NULL # <<<<<<<<<<<<<< - * self.X_feature_stride = 0 - * self.impurity = 0. - */ - __pyx_v_self->sample_mask = NULL; - - /* "sklearn/tree/_tree.pyx":2178 - * self.X_idx_sorted_ptr = NULL - * self.sample_mask = NULL * self.X_feature_stride = 0 # <<<<<<<<<<<<<< * self.impurity = 0. * */ __pyx_v_self->X_feature_stride = 0; - /* "sklearn/tree/_tree.pyx":2179 - * self.sample_mask = NULL + /* "sklearn/tree/_tree.pyx":2174 + * self.X_idx_sorted_ptr = NULL * self.X_feature_stride = 0 * self.impurity = 0. # <<<<<<<<<<<<<< * - * def __dealloc__(self): + * def __reduce(self): */ __pyx_v_self->impurity = 0.; - /* "sklearn/tree/_tree.pyx":2168 + /* "sklearn/tree/_tree.pyx":2166 * cdef double impurity * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -14652,72 +14631,28 @@ static int __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter___cinit__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2181 - * self.impurity = 0. - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * """ - * Free the memory associated with this object. - */ - -/* Python wrapper */ -static void __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_3__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_2__dealloc__(((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)__pyx_v_self)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_2__dealloc__(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "sklearn/tree/_tree.pyx":2186 - * """ - * - * free(self.sample_mask) # <<<<<<<<<<<<<< - * - * def __reduce(self): - */ - free(__pyx_v_self->sample_mask); - - /* "sklearn/tree/_tree.pyx":2181 +/* "sklearn/tree/_tree.pyx":2176 * self.impurity = 0. * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * """ - * Free the memory associated with this object. - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "sklearn/tree/_tree.pyx":2188 - * free(self.sample_mask) - * * def __reduce(self): # <<<<<<<<<<<<<< - * return (SpeedSplitter, (self.criterion, + * return (FriedmanMSESplitter, (self.criterion, * self.max_features, */ /* Python wrapper */ -static PyObject *__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_5__reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_5__reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_7sklearn_4tree_5_tree_19FriedmanMSESplitter_3__reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_7sklearn_4tree_5_tree_19FriedmanMSESplitter_3__reduce(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce (wrapper)", 0); - __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)__pyx_v_self)); + __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_19FriedmanMSESplitter_2__reduce(((struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self) { +static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19FriedmanMSESplitter_2__reduce(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -14729,78 +14664,78 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce", 0); - /* "sklearn/tree/_tree.pyx":2189 + /* "sklearn/tree/_tree.pyx":2177 * * def __reduce(self): - * return (SpeedSplitter, (self.criterion, # <<<<<<<<<<<<<< + * return (FriedmanMSESplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":2190 + /* "sklearn/tree/_tree.pyx":2178 * def __reduce(self): - * return (SpeedSplitter, (self.criterion, + * return (FriedmanMSESplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2191 - * return (SpeedSplitter, (self.criterion, + /* "sklearn/tree/_tree.pyx":2179 + * return (FriedmanMSESplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__() ) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2192 + /* "sklearn/tree/_tree.pyx":2180 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__() ) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2189 + /* "sklearn/tree/_tree.pyx":2177 * * def __reduce(self): - * return (SpeedSplitter, (self.criterion, # <<<<<<<<<<<<<< + * return (FriedmanMSESplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); + __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.criterion)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.criterion)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); - __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.random_state); - __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.random_state); - PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->__pyx_base.__pyx_base.random_state); + __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.random_state); + __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.random_state); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.random_state); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2193 + /* "sklearn/tree/_tree.pyx":2181 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__() ) # <<<<<<<<<<<<<< * * cdef void init(self, object X, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -14813,26 +14748,26 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2189 + /* "sklearn/tree/_tree.pyx":2177 * * def __reduce(self): - * return (SpeedSplitter, (self.criterion, # <<<<<<<<<<<<<< + * return (FriedmanMSESplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter))); + __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSESplitter))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSESplitter))); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSESplitter))); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); @@ -14843,11 +14778,11 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2188 - * free(self.sample_mask) + /* "sklearn/tree/_tree.pyx":2176 + * self.impurity = 0. * * def __reduce(self): # <<<<<<<<<<<<<< - * return (SpeedSplitter, (self.criterion, + * return (FriedmanMSESplitter, (self.criterion, * self.max_features, */ @@ -14857,7 +14792,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("sklearn.tree._tree.SpeedSplitter.__reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("sklearn.tree._tree.FriedmanMSESplitter.__reduce", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -14865,7 +14800,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2195 +/* "sklearn/tree/_tree.pyx":2183 * self.random_state), self.__getstate__() ) * * cdef void init(self, object X, # <<<<<<<<<<<<<< @@ -14873,30 +14808,13 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_13SpeedSplitter_4__reduce(struct * DOUBLE_t* sample_weight) except *: */ -static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight) { - PyArrayObject *__pyx_v_X_ndarray = 0; - void *__pyx_v_sample_mask; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_j; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_features; +static void __pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight) { __Pyx_LocalBuf_ND __pyx_pybuffernd_y; __Pyx_Buffer __pyx_pybuffer_y; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_3; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_t_9; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_t_13; - unsigned char *__pyx_t_14; + __pyx_t_7sklearn_4tree_5_tree_INT32_t *__pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -14907,547 +14825,106 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init(struct __pyx_obj_ __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; - /* "sklearn/tree/_tree.pyx":2203 - * - * # Unpack X and expose its memory buffer - * self.n_samples = X.shape[0] # <<<<<<<<<<<<<< - * self.n_features = X.shape[1] - * cdef np.ndarray X_ndarray = X - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_self->__pyx_base.__pyx_base.n_samples = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":2204 - * # Unpack X and expose its memory buffer - * self.n_samples = X.shape[0] - * self.n_features = X.shape[1] # <<<<<<<<<<<<<< - * cdef np.ndarray X_ndarray = X - * self.X = X_ndarray.data - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_self->__pyx_base.__pyx_base.n_features = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":2205 - * self.n_samples = X.shape[0] - * self.n_features = X.shape[1] - * cdef np.ndarray X_ndarray = X # <<<<<<<<<<<<<< - * self.X = X_ndarray.data - * self.X_sample_stride = X.strides[0] / X.itemsize - */ - if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = __pyx_v_X; - __Pyx_INCREF(__pyx_t_1); - __pyx_v_X_ndarray = ((PyArrayObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "sklearn/tree/_tree.pyx":2206 - * self.n_features = X.shape[1] - * cdef np.ndarray X_ndarray = X - * self.X = X_ndarray.data # <<<<<<<<<<<<<< - * self.X_sample_stride = X.strides[0] / X.itemsize - * self.X_feature_stride = X.strides[1] / X.itemsize - */ - __pyx_v_self->__pyx_base.X = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_ndarray->data); - - /* "sklearn/tree/_tree.pyx":2207 - * cdef np.ndarray X_ndarray = X - * self.X = X_ndarray.data - * self.X_sample_stride = X.strides[0] / X.itemsize # <<<<<<<<<<<<<< - * self.X_feature_stride = X.strides[1] / X.itemsize - * self.impurity = 1.e2 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_self->__pyx_base.X_sample_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_4)); - - /* "sklearn/tree/_tree.pyx":2208 - * self.X = X_ndarray.data - * self.X_sample_stride = X.strides[0] / X.itemsize - * self.X_feature_stride = X.strides[1] / X.itemsize # <<<<<<<<<<<<<< - * self.impurity = 1.e2 + /* "sklearn/tree/_tree.pyx":2190 + * """ * + * PresortBestSplitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< + * self.X_feature_stride = self.X_fx_stride + * self.impurity = 100 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_self->X_feature_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_4) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); + __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2209 - * self.X_sample_stride = X.strides[0] / X.itemsize - * self.X_feature_stride = X.strides[1] / X.itemsize - * self.impurity = 1.e2 # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":2191 * - * cdef void* sample_mask = NULL + * PresortBestSplitter.init(self, X, y, sample_weight) + * self.X_feature_stride = self.X_fx_stride # <<<<<<<<<<<<<< + * self.impurity = 100 + * self.X_idx_sorted = self.X_argsorted */ - __pyx_v_self->impurity = 1.e2; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.X_fx_stride; + __pyx_v_self->X_feature_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2211 - * self.impurity = 1.e2 - * - * cdef void* sample_mask = NULL # <<<<<<<<<<<<<< - * - * # Get the random state + /* "sklearn/tree/_tree.pyx":2192 + * PresortBestSplitter.init(self, X, y, sample_weight) + * self.X_feature_stride = self.X_fx_stride + * self.impurity = 100 # <<<<<<<<<<<<<< + * self.X_idx_sorted = self.X_argsorted + * self.X_idx_sorted_stride = self.X_argsorted_stride */ - __pyx_v_sample_mask = NULL; + __pyx_v_self->impurity = 100.0; - /* "sklearn/tree/_tree.pyx":2214 - * - * # Get the random state - * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) # <<<<<<<<<<<<<< - * - * cdef SIZE_t i, j = 0 - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->__pyx_base.__pyx_base.random_state, __pyx_n_s_randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; - } - } - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - if (__pyx_t_6) { - __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; - } - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_int_0); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyInt_As_npy_uint32(__pyx_t_1); if (unlikely((__pyx_t_9 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_self->__pyx_base.__pyx_base.rand_r_state = __pyx_t_9; + /* "sklearn/tree/_tree.pyx":2193 + * self.X_feature_stride = self.X_fx_stride + * self.impurity = 100 + * self.X_idx_sorted = self.X_argsorted # <<<<<<<<<<<<<< + * self.X_idx_sorted_stride = self.X_argsorted_stride + * self.X_idx_sorted_ptr = self.X_argsorted_ptr + */ + __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.X_argsorted); + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_v_self->X_idx_sorted); + __Pyx_DECREF(((PyObject *)__pyx_v_self->X_idx_sorted)); + __pyx_v_self->X_idx_sorted = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2216 - * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) - * - * cdef SIZE_t i, j = 0 # <<<<<<<<<<<<<< - * self.weighted_n_samples = 0.0 + /* "sklearn/tree/_tree.pyx":2194 + * self.impurity = 100 + * self.X_idx_sorted = self.X_argsorted + * self.X_idx_sorted_stride = self.X_argsorted_stride # <<<<<<<<<<<<<< + * self.X_idx_sorted_ptr = self.X_argsorted_ptr * */ - __pyx_v_j = 0; + __pyx_t_1 = __pyx_v_self->__pyx_base.X_argsorted_stride; + __pyx_v_self->X_idx_sorted_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2217 - * - * cdef SIZE_t i, j = 0 - * self.weighted_n_samples = 0.0 # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":2195 + * self.X_idx_sorted = self.X_argsorted + * self.X_idx_sorted_stride = self.X_argsorted_stride + * self.X_idx_sorted_ptr = self.X_argsorted_ptr # <<<<<<<<<<<<<< * - * cdef SIZE_t* samples = safe_realloc(&self.samples, self.n_samples) + * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples = 0.0; + __pyx_t_3 = __pyx_v_self->__pyx_base.X_argsorted_ptr; + __pyx_v_self->X_idx_sorted_ptr = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2219 - * self.weighted_n_samples = 0.0 - * - * cdef SIZE_t* samples = safe_realloc(&self.samples, self.n_samples) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":2183 + * self.random_state), self.__getstate__() ) * - * # In order to only use positively weighted samples, we must go through - */ - __pyx_t_10 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.samples), __pyx_v_self->__pyx_base.__pyx_base.n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_samples = __pyx_t_10; - - /* "sklearn/tree/_tree.pyx":2224 - * # each sample and check its associated weight, if given. If no weights - * # are given, we assume the weight on each point is equal to 1. - * for i in range(self.n_samples): # <<<<<<<<<<<<<< - * # If no sample weights are passed in, or the associated sample - * # weight is greater than 0, add that sample to the growing array, + * cdef void init(self, object X, # <<<<<<<<<<<<<< + * np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, + * DOUBLE_t* sample_weight) except *: */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_samples; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2228 - * # weight is greater than 0, add that sample to the growing array, - * # and increment the count - * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< - * samples[j] = i - * j += 1 - */ - __pyx_t_12 = ((__pyx_v_sample_weight == NULL) != 0); - if (!__pyx_t_12) { - } else { - __pyx_t_11 = __pyx_t_12; - goto __pyx_L6_bool_binop_done; - } - __pyx_t_12 = (((__pyx_v_sample_weight[__pyx_v_i]) != 0.0) != 0); - __pyx_t_11 = __pyx_t_12; - __pyx_L6_bool_binop_done:; - if (__pyx_t_11) { + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; + __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} + __Pyx_AddTraceback("sklearn.tree._tree.FriedmanMSESplitter.init", __pyx_clineno, __pyx_lineno, __pyx_filename); + goto __pyx_L2; + __pyx_L0:; + __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); + __pyx_L2:; + __Pyx_RefNannyFinishContext(); +} - /* "sklearn/tree/_tree.pyx":2229 - * # and increment the count - * if sample_weight == NULL or sample_weight[i] != 0.0: - * samples[j] = i # <<<<<<<<<<<<<< - * j += 1 +/* "sklearn/tree/_tree.pyx":2197 + * self.X_idx_sorted_ptr = self.X_argsorted_ptr * + * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< + * SIZE_t* n_constant_features) nogil: + * """ */ - (__pyx_v_samples[__pyx_v_j]) = __pyx_v_i; - /* "sklearn/tree/_tree.pyx":2230 - * if sample_weight == NULL or sample_weight[i] != 0.0: - * samples[j] = i - * j += 1 # <<<<<<<<<<<<<< - * - * # Add the sample weight, or 1.0 if no sample weights are given. - */ - __pyx_v_j = (__pyx_v_j + 1); - goto __pyx_L5; - } - __pyx_L5:; - - /* "sklearn/tree/_tree.pyx":2235 - * # If the sample weight is 0.0, then it does not matter if added - * # to the weight sum - * if sample_weight != NULL: # <<<<<<<<<<<<<< - * self.weighted_n_samples += sample_weight[i] - * else: - */ - __pyx_t_11 = ((__pyx_v_sample_weight != NULL) != 0); - if (__pyx_t_11) { - - /* "sklearn/tree/_tree.pyx":2236 - * # to the weight sum - * if sample_weight != NULL: - * self.weighted_n_samples += sample_weight[i] # <<<<<<<<<<<<<< - * else: - * self.weighted_n_samples += 1 - */ - __pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples = (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples + (__pyx_v_sample_weight[__pyx_v_i])); - goto __pyx_L8; - } - /*else*/ { - - /* "sklearn/tree/_tree.pyx":2238 - * self.weighted_n_samples += sample_weight[i] - * else: - * self.weighted_n_samples += 1 # <<<<<<<<<<<<<< - * - * self.n_samples = j - */ - __pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples = (__pyx_v_self->__pyx_base.__pyx_base.weighted_n_samples + 1.0); - } - __pyx_L8:; - } - - /* "sklearn/tree/_tree.pyx":2240 - * self.weighted_n_samples += 1 - * - * self.n_samples = j # <<<<<<<<<<<<<< - * - * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) - */ - __pyx_v_self->__pyx_base.__pyx_base.n_samples = __pyx_v_j; - - /* "sklearn/tree/_tree.pyx":2242 - * self.n_samples = j - * - * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) # <<<<<<<<<<<<<< - * for i in range(self.n_features): - * features[i] = i - */ - __pyx_t_10 = __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.features), __pyx_v_self->__pyx_base.__pyx_base.n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_features = __pyx_t_10; - - /* "sklearn/tree/_tree.pyx":2243 - * - * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) - * for i in range(self.n_features): # <<<<<<<<<<<<<< - * features[i] = i - * - */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.n_features; - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { - __pyx_v_i = __pyx_t_4; - - /* "sklearn/tree/_tree.pyx":2244 - * cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) - * for i in range(self.n_features): - * features[i] = i # <<<<<<<<<<<<<< - * - * safe_realloc(&self.feature_values, self.n_samples) - */ - (__pyx_v_features[__pyx_v_i]) = __pyx_v_i; - } - - /* "sklearn/tree/_tree.pyx":2246 - * features[i] = i - * - * safe_realloc(&self.feature_values, self.n_samples) # <<<<<<<<<<<<<< - * safe_realloc(&self.constant_features, self.n_features) - * - */ - __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.feature_values), __pyx_v_self->__pyx_base.__pyx_base.n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":2247 - * - * safe_realloc(&self.feature_values, self.n_samples) - * safe_realloc(&self.constant_features, self.n_features) # <<<<<<<<<<<<<< - * - * # Save y as a reference to a buffer for memory efficient access - */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->__pyx_base.__pyx_base.constant_features), __pyx_v_self->__pyx_base.__pyx_base.n_features); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "sklearn/tree/_tree.pyx":2250 - * - * # Save y as a reference to a buffer for memory efficient access - * self.y = y.data # <<<<<<<<<<<<<< - * self.y_stride = y.strides[0] / y.itemsize - * - */ - __pyx_v_self->__pyx_base.__pyx_base.y = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_y->data); - - /* "sklearn/tree/_tree.pyx":2251 - * # Save y as a reference to a buffer for memory efficient access - * self.y = y.data - * self.y_stride = y.strides[0] / y.itemsize # <<<<<<<<<<<<<< - * - * # Store the weight of each sample - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_self->__pyx_base.__pyx_base.y_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_y->strides[0])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); - - /* "sklearn/tree/_tree.pyx":2254 - * - * # Store the weight of each sample - * self.sample_weight = sample_weight # <<<<<<<<<<<<<< - * - * # Pre-sort X so that we can access sorted columns easier; in essence - */ - __pyx_v_self->__pyx_base.__pyx_base.sample_weight = __pyx_v_sample_weight; - - /* "sklearn/tree/_tree.pyx":2258 - * # Pre-sort X so that we can access sorted columns easier; in essence - * # caching the sort. - * if self.X_old != self.X: # <<<<<<<<<<<<<< - * self.X_old = self.X - * - */ - __pyx_t_11 = ((__pyx_v_self->X_old != __pyx_v_self->__pyx_base.X) != 0); - if (__pyx_t_11) { - - /* "sklearn/tree/_tree.pyx":2259 - * # caching the sort. - * if self.X_old != self.X: - * self.X_old = self.X # <<<<<<<<<<<<<< - * - * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), - */ - __pyx_t_13 = __pyx_v_self->__pyx_base.X; - __pyx_v_self->X_old = __pyx_t_13; - - /* "sklearn/tree/_tree.pyx":2261 - * self.X_old = self.X - * - * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), # <<<<<<<<<<<<<< - * dtype=np.int32) - * self.X_idx_sorted_ptr = self.X_idx_sorted.data - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_X_ndarray)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_X_ndarray)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_X_ndarray)); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - - /* "sklearn/tree/_tree.pyx":2262 - * - * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), - * dtype=np.int32) # <<<<<<<<<<<<<< - * self.X_idx_sorted_ptr = self.X_idx_sorted.data - * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "sklearn/tree/_tree.pyx":2261 - * self.X_old = self.X - * - * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), # <<<<<<<<<<<<<< - * dtype=np.int32) - * self.X_idx_sorted_ptr = self.X_idx_sorted.data - */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GIVEREF(__pyx_t_8); - __Pyx_GOTREF(__pyx_v_self->X_idx_sorted); - __Pyx_DECREF(((PyObject *)__pyx_v_self->X_idx_sorted)); - __pyx_v_self->X_idx_sorted = ((PyArrayObject *)__pyx_t_8); - __pyx_t_8 = 0; - - /* "sklearn/tree/_tree.pyx":2263 - * self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), - * dtype=np.int32) - * self.X_idx_sorted_ptr = self.X_idx_sorted.data # <<<<<<<<<<<<<< - * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / - * self.X_idx_sorted.itemsize) - */ - __pyx_v_self->X_idx_sorted_ptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_self->X_idx_sorted->data); - - /* "sklearn/tree/_tree.pyx":2265 - * self.X_idx_sorted_ptr = self.X_idx_sorted.data - * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / - * self.X_idx_sorted.itemsize) # <<<<<<<<<<<<<< - * - * sample_mask = safe_realloc(&self.sample_mask, self.n_samples) - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->X_idx_sorted), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_8); if (unlikely((__pyx_t_3 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "sklearn/tree/_tree.pyx":2264 - * dtype=np.int32) - * self.X_idx_sorted_ptr = self.X_idx_sorted.data - * self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / # <<<<<<<<<<<<<< - * self.X_idx_sorted.itemsize) - * - */ - __pyx_v_self->X_idx_sorted_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_self->X_idx_sorted->strides[1])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_3)); - - /* "sklearn/tree/_tree.pyx":2267 - * self.X_idx_sorted.itemsize) - * - * sample_mask = safe_realloc(&self.sample_mask, self.n_samples) # <<<<<<<<<<<<<< - * memset(sample_mask, 0, self.n_samples) - * - */ - __pyx_t_14 = __pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sample_mask), __pyx_v_self->__pyx_base.__pyx_base.n_samples); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_sample_mask = __pyx_t_14; - - /* "sklearn/tree/_tree.pyx":2268 - * - * sample_mask = safe_realloc(&self.sample_mask, self.n_samples) - * memset(sample_mask, 0, self.n_samples) # <<<<<<<<<<<<<< - * - * cdef void node_split(self, double impurity, SplitRecord* split, - */ - memset(__pyx_v_sample_mask, 0, __pyx_v_self->__pyx_base.__pyx_base.n_samples); - goto __pyx_L11; - } - __pyx_L11:; - - /* "sklearn/tree/_tree.pyx":2195 - * self.random_state), self.__getstate__() ) - * - * cdef void init(self, object X, # <<<<<<<<<<<<<< - * np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, - * DOUBLE_t* sample_weight) except *: - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); - { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; - __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} - __Pyx_AddTraceback("sklearn.tree._tree.SpeedSplitter.init", __pyx_clineno, __pyx_lineno, __pyx_filename); - goto __pyx_L2; - __pyx_L0:; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer); - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_X_ndarray); - __Pyx_RefNannyFinishContext(); -} - -/* "sklearn/tree/_tree.pyx":2270 - * memset(sample_mask, 0, self.n_samples) - * - * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< - * SIZE_t* n_constant_features) nogil: - * """ - */ - -static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features) { +static void __pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_node_split(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *__pyx_v_split, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_constant_features) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_features; @@ -15505,127 +14982,127 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py int __pyx_t_11; long __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2277 + /* "sklearn/tree/_tree.pyx":2204 * * # Unpack range related items * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< * cdef SIZE_t end = self.end * */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.start; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2278 + /* "sklearn/tree/_tree.pyx":2205 * # Unpack range related items * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< * * # Unpack feature related items */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.end; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2281 + /* "sklearn/tree/_tree.pyx":2208 * * # Unpack feature related items * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.features; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2282 + /* "sklearn/tree/_tree.pyx":2209 * # Unpack feature related items * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< * cdef SIZE_t n_features = self.n_features * */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2283 + /* "sklearn/tree/_tree.pyx":2210 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< * * # Unpack sample related items */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_features; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2286 + /* "sklearn/tree/_tree.pyx":2213 * * # Unpack sample related items * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< * cdef SIZE_t n_samples = self.n_samples * cdef DOUBLE_t* w = self.sample_weight */ - __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.samples; + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2287 + /* "sklearn/tree/_tree.pyx":2214 * # Unpack sample related items * cdef SIZE_t* samples = self.samples * cdef SIZE_t n_samples = self.n_samples # <<<<<<<<<<<<<< * cdef DOUBLE_t* w = self.sample_weight * cdef unsigned char* sample_mask = self.sample_mask */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_samples; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_samples; __pyx_v_n_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2288 + /* "sklearn/tree/_tree.pyx":2215 * cdef SIZE_t* samples = self.samples * cdef SIZE_t n_samples = self.n_samples * cdef DOUBLE_t* w = self.sample_weight # <<<<<<<<<<<<<< * cdef unsigned char* sample_mask = self.sample_mask * */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.sample_weight; + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.sample_weight; __pyx_v_w = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2289 + /* "sklearn/tree/_tree.pyx":2216 * cdef SIZE_t n_samples = self.n_samples * cdef DOUBLE_t* w = self.sample_weight * cdef unsigned char* sample_mask = self.sample_mask # <<<<<<<<<<<<<< * * # Unpack X related items */ - __pyx_t_4 = __pyx_v_self->sample_mask; + __pyx_t_4 = __pyx_v_self->__pyx_base.sample_mask; __pyx_v_sample_mask = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2292 + /* "sklearn/tree/_tree.pyx":2219 * * # Unpack X related items * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< * cdef DTYPE_t* X_i = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride */ - __pyx_t_5 = __pyx_v_self->__pyx_base.X; + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.X; __pyx_v_X = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2293 + /* "sklearn/tree/_tree.pyx":2220 * # Unpack X related items * cdef DTYPE_t* X = self.X * cdef DTYPE_t* X_i = self.feature_values # <<<<<<<<<<<<<< * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_feature_stride = self.X_feature_stride */ - __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.feature_values; __pyx_v_X_i = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2294 + /* "sklearn/tree/_tree.pyx":2221 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* X_i = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< * cdef SIZE_t X_feature_stride = self.X_feature_stride * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr */ - __pyx_t_1 = __pyx_v_self->__pyx_base.X_sample_stride; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.X_sample_stride; __pyx_v_X_sample_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2295 + /* "sklearn/tree/_tree.pyx":2222 * cdef DTYPE_t* X_i = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_feature_stride = self.X_feature_stride # <<<<<<<<<<<<<< @@ -15635,7 +15112,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_1 = __pyx_v_self->X_feature_stride; __pyx_v_X_feature_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2296 + /* "sklearn/tree/_tree.pyx":2223 * cdef SIZE_t X_sample_stride = self.X_sample_stride * cdef SIZE_t X_feature_stride = self.X_feature_stride * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr # <<<<<<<<<<<<<< @@ -15645,7 +15122,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_6 = __pyx_v_self->X_idx_sorted_ptr; __pyx_v_X_idx_sorted = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":2297 + /* "sklearn/tree/_tree.pyx":2224 * cdef SIZE_t X_feature_stride = self.X_feature_stride * cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr * cdef SIZE_t X_idx_sorted_stride = self.X_idx_sorted_stride # <<<<<<<<<<<<<< @@ -15655,66 +15132,66 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_1 = __pyx_v_self->X_idx_sorted_stride; __pyx_v_X_idx_sorted_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2300 + /* "sklearn/tree/_tree.pyx":2227 * * # Unpack y * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< * cdef SIZE_t y_stride = self.y_stride * */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.y; + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.y; __pyx_v_y = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2301 + /* "sklearn/tree/_tree.pyx":2228 * # Unpack y * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< * * # Unpack constraints */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.y_stride; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.y_stride; __pyx_v_y_stride = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2304 + /* "sklearn/tree/_tree.pyx":2231 * * # Unpack constraints * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.max_features; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2305 + /* "sklearn/tree/_tree.pyx":2232 * # Unpack constraints * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2306 + /* "sklearn/tree/_tree.pyx":2233 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< * cdef UINT32_t* random_state = &self.rand_r_state * */ - __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; + __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":2307 + /* "sklearn/tree/_tree.pyx":2234 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef DOUBLE_t min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< * * # Keeping track of the current split and the best split */ - __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); + __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":2314 + /* "sklearn/tree/_tree.pyx":2241 * # Numbers involved in keeping features ordered such that constant * # features are not considered * cdef SIZE_t f_j, f_i = n_features, tmp # <<<<<<<<<<<<<< @@ -15723,7 +15200,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":2315 + /* "sklearn/tree/_tree.pyx":2242 * # features are not considered * cdef SIZE_t f_j, f_i = n_features, tmp * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -15733,7 +15210,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_v_n_found_constants = 0; __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":2316 + /* "sklearn/tree/_tree.pyx":2243 * cdef SIZE_t f_j, f_i = n_features, tmp * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -15742,7 +15219,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":2317 + /* "sklearn/tree/_tree.pyx":2244 * cdef SIZE_t n_found_constants = 0, n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -15751,7 +15228,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":2318 + /* "sklearn/tree/_tree.pyx":2245 * cdef SIZE_t n_known_constants = n_constant_features[0] * cdef SIZE_t n_total_constants = n_known_constants * cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k # <<<<<<<<<<<<<< @@ -15760,7 +15237,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":2320 + /* "sklearn/tree/_tree.pyx":2247 * cdef SIZE_t n_visited_features = 0, partition_end, i, j, p, k * * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) # <<<<<<<<<<<<<< @@ -15769,7 +15246,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_yw_cl = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)calloc(__pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t)))); - /* "sklearn/tree/_tree.pyx":2321 + /* "sklearn/tree/_tree.pyx":2248 * * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) * cdef DOUBLE_t* w_cl = calloc(n_samples, sizeof(DOUBLE_t)) # <<<<<<<<<<<<<< @@ -15778,7 +15255,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_w_cl = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)calloc(__pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t)))); - /* "sklearn/tree/_tree.pyx":2322 + /* "sklearn/tree/_tree.pyx":2249 * cdef DOUBLE_t* yw_cl = calloc(n_samples, sizeof(DOUBLE_t)) * cdef DOUBLE_t* w_cl = calloc(n_samples, sizeof(DOUBLE_t)) * cdef DOUBLE_t* yw_sq = calloc(n_samples, sizeof(DOUBLE_t)) # <<<<<<<<<<<<<< @@ -15787,7 +15264,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_yw_sq = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)calloc(__pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t)))); - /* "sklearn/tree/_tree.pyx":2326 + /* "sklearn/tree/_tree.pyx":2253 * cdef SIZE_t n_possible_splits * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -15796,7 +15273,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":2329 + /* "sklearn/tree/_tree.pyx":2256 * * # Set the sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -15807,7 +15284,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2330 + /* "sklearn/tree/_tree.pyx":2257 * # Set the sample mask * for p in range(start, end): * sample_mask[samples[p]] = 1 # <<<<<<<<<<<<<< @@ -15817,7 +15294,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py (__pyx_v_sample_mask[(__pyx_v_samples[__pyx_v_p])]) = 1; } - /* "sklearn/tree/_tree.pyx":2341 + /* "sklearn/tree/_tree.pyx":2268 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -15832,7 +15309,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2343 + /* "sklearn/tree/_tree.pyx":2270 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -15846,7 +15323,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2345 + /* "sklearn/tree/_tree.pyx":2272 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -15858,7 +15335,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_L7_bool_binop_done:; if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":2346 + /* "sklearn/tree/_tree.pyx":2273 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -15867,7 +15344,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":2360 + /* "sklearn/tree/_tree.pyx":2287 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -15876,7 +15353,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":2363 + /* "sklearn/tree/_tree.pyx":2290 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -15886,7 +15363,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2365 + /* "sklearn/tree/_tree.pyx":2292 * if f_j < n_known_constants: * # f_j is in [n_drawn_constants, n_known_constants] * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -15895,7 +15372,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2366 + /* "sklearn/tree/_tree.pyx":2293 * # f_j is in [n_drawn_constants, n_known_constants] * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -15904,7 +15381,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":2367 + /* "sklearn/tree/_tree.pyx":2294 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -15913,7 +15390,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":2369 + /* "sklearn/tree/_tree.pyx":2296 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -15925,7 +15402,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py } /*else*/ { - /* "sklearn/tree/_tree.pyx":2372 + /* "sklearn/tree/_tree.pyx":2299 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants] * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -15934,7 +15411,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":2375 + /* "sklearn/tree/_tree.pyx":2302 * # f_j in the interval [n_total_constants, f_i] * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -15943,7 +15420,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2379 + /* "sklearn/tree/_tree.pyx":2306 * # Extract the relevant samples from that feature, ordered * # according to the presorting, into a single array * p = start # <<<<<<<<<<<<<< @@ -15952,7 +15429,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2380 + /* "sklearn/tree/_tree.pyx":2307 * # according to the presorting, into a single array * p = start * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -15963,7 +15440,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_1; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2382 + /* "sklearn/tree/_tree.pyx":2309 * for i in range(n_samples): * # Get the next index from memory * j = X_idx_sorted[X_idx_sorted_stride * current.feature + i] # <<<<<<<<<<<<<< @@ -15972,7 +15449,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_j = (__pyx_v_X_idx_sorted[((__pyx_v_X_idx_sorted_stride * __pyx_v_current.feature) + __pyx_v_i)]); - /* "sklearn/tree/_tree.pyx":2385 + /* "sklearn/tree/_tree.pyx":2312 * * # See if we are using this sample or not * if sample_mask[j] == 1: # <<<<<<<<<<<<<< @@ -15982,7 +15459,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = (((__pyx_v_sample_mask[__pyx_v_j]) == 1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2386 + /* "sklearn/tree/_tree.pyx":2313 * # See if we are using this sample or not * if sample_mask[j] == 1: * samples[p] = j # <<<<<<<<<<<<<< @@ -15991,7 +15468,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_samples[__pyx_v_p]) = __pyx_v_j; - /* "sklearn/tree/_tree.pyx":2387 + /* "sklearn/tree/_tree.pyx":2314 * if sample_mask[j] == 1: * samples[p] = j * X_i[p] = X[X_sample_stride * j + # <<<<<<<<<<<<<< @@ -16000,7 +15477,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_X_i[__pyx_v_p]) = (__pyx_v_X[((__pyx_v_X_sample_stride * __pyx_v_j) + (__pyx_v_X_feature_stride * __pyx_v_current.feature))]); - /* "sklearn/tree/_tree.pyx":2389 + /* "sklearn/tree/_tree.pyx":2316 * X_i[p] = X[X_sample_stride * j + * X_feature_stride * current.feature] * p += 1 # <<<<<<<<<<<<<< @@ -16013,7 +15490,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":2392 + /* "sklearn/tree/_tree.pyx":2319 * * # Ensure this feature is not constant * if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -16023,7 +15500,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = (((__pyx_v_X_i[(__pyx_v_end - 1)]) <= ((__pyx_v_X_i[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2393 + /* "sklearn/tree/_tree.pyx":2320 * # Ensure this feature is not constant * if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -16032,7 +15509,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":2394 + /* "sklearn/tree/_tree.pyx":2321 * if X_i[end-1] <= X_i[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -16042,7 +15519,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_1 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2396 + /* "sklearn/tree/_tree.pyx":2323 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -16051,7 +15528,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":2397 + /* "sklearn/tree/_tree.pyx":2324 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -16063,7 +15540,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py } /*else*/ { - /* "sklearn/tree/_tree.pyx":2402 + /* "sklearn/tree/_tree.pyx":2329 * # INVOLVED IN FINDING THE NEXT FEATURE TO SPLIT ON. * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -16072,7 +15549,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":2403 + /* "sklearn/tree/_tree.pyx":2330 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -16084,7 +15561,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_1; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2409 + /* "sklearn/tree/_tree.pyx":2336 * # statistics, and using those later on to calculate the * # best split. * for i in range(end-start): # <<<<<<<<<<<<<< @@ -16095,7 +15572,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_11; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2410 + /* "sklearn/tree/_tree.pyx":2337 * # best split. * for i in range(end-start): * p = samples[i+start] # <<<<<<<<<<<<<< @@ -16104,7 +15581,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_p = (__pyx_v_samples[(__pyx_v_i + __pyx_v_start)]); - /* "sklearn/tree/_tree.pyx":2417 + /* "sklearn/tree/_tree.pyx":2344 * # multiplied by the response (y), and of that value * # squared. * if i == 0: # <<<<<<<<<<<<<< @@ -16114,7 +15591,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = ((__pyx_v_i == 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2418 + /* "sklearn/tree/_tree.pyx":2345 * # squared. * if i == 0: * w_cl[0] = w[p] # <<<<<<<<<<<<<< @@ -16123,7 +15600,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_w_cl[0]) = (__pyx_v_w[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":2419 + /* "sklearn/tree/_tree.pyx":2346 * if i == 0: * w_cl[0] = w[p] * yw_cl[0] = w[p] * y[p*y_stride] # <<<<<<<<<<<<<< @@ -16132,7 +15609,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_yw_cl[0]) = ((__pyx_v_w[__pyx_v_p]) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])); - /* "sklearn/tree/_tree.pyx":2420 + /* "sklearn/tree/_tree.pyx":2347 * w_cl[0] = w[p] * yw_cl[0] = w[p] * y[p*y_stride] * yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] # <<<<<<<<<<<<<< @@ -16144,7 +15621,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py } /*else*/ { - /* "sklearn/tree/_tree.pyx":2422 + /* "sklearn/tree/_tree.pyx":2349 * yw_sq[0] = w[p] * y[p*y_stride] * y[p*y_stride] * else: * w_cl[i] = w[p] + w_cl[i-1] # <<<<<<<<<<<<<< @@ -16153,7 +15630,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_w_cl[__pyx_v_i]) = ((__pyx_v_w[__pyx_v_p]) + (__pyx_v_w_cl[(__pyx_v_i - 1)])); - /* "sklearn/tree/_tree.pyx":2423 + /* "sklearn/tree/_tree.pyx":2350 * else: * w_cl[i] = w[p] + w_cl[i-1] * yw_cl[i] = w[p] * y[p*y_stride] + yw_cl[i-1] # <<<<<<<<<<<<<< @@ -16162,7 +15639,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_yw_cl[__pyx_v_i]) = (((__pyx_v_w[__pyx_v_p]) * (__pyx_v_y[(__pyx_v_p * __pyx_v_y_stride)])) + (__pyx_v_yw_cl[(__pyx_v_i - 1)])); - /* "sklearn/tree/_tree.pyx":2424 + /* "sklearn/tree/_tree.pyx":2351 * w_cl[i] = w[p] + w_cl[i-1] * yw_cl[i] = w[p] * y[p*y_stride] + yw_cl[i-1] * yw_sq[i] = (w[p] * y[p*y_stride] * y[p*y_stride] # <<<<<<<<<<<<<< @@ -16174,23 +15651,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_L17:; } - /* "sklearn/tree/_tree.pyx":2430 + /* "sklearn/tree/_tree.pyx":2357 * # improvement of that split using Friedman's correction to * # the MSE criterion, and determine which split is the best. * for i in range(end-start-1): # <<<<<<<<<<<<<< - * if i < end-start-1 and X_i[i+start+1] <= X_i[i+start] + FEATURE_THRESHOLD: - * continue + * if (i < end-start-1 and X_i[i+start+1] <= + * X_i[i+start] + FEATURE_THRESHOLD): */ __pyx_t_12 = ((__pyx_v_end - __pyx_v_start) - 1); for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_12; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2431 + /* "sklearn/tree/_tree.pyx":2358 * # the MSE criterion, and determine which split is the best. * for i in range(end-start-1): - * if i < end-start-1 and X_i[i+start+1] <= X_i[i+start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< + * if (i < end-start-1 and X_i[i+start+1] <= # <<<<<<<<<<<<<< + * X_i[i+start] + FEATURE_THRESHOLD): * continue - * # Don't even consider possibilities which don't fall under */ __pyx_t_10 = ((__pyx_v_i < ((__pyx_v_end - __pyx_v_start) - 1)) != 0); if (__pyx_t_10) { @@ -16198,14 +15675,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = __pyx_t_10; goto __pyx_L21_bool_binop_done; } + + /* "sklearn/tree/_tree.pyx":2359 + * for i in range(end-start-1): + * if (i < end-start-1 and X_i[i+start+1] <= + * X_i[i+start] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< + * continue + * # Don't even consider possibilities which don't fall under + */ __pyx_t_10 = (((__pyx_v_X_i[((__pyx_v_i + __pyx_v_start) + 1)]) <= ((__pyx_v_X_i[(__pyx_v_i + __pyx_v_start)]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); __pyx_t_9 = __pyx_t_10; __pyx_L21_bool_binop_done:; if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2432 - * for i in range(end-start-1): - * if i < end-start-1 and X_i[i+start+1] <= X_i[i+start] + FEATURE_THRESHOLD: + /* "sklearn/tree/_tree.pyx":2360 + * if (i < end-start-1 and X_i[i+start+1] <= + * X_i[i+start] + FEATURE_THRESHOLD): * continue # <<<<<<<<<<<<<< * # Don't even consider possibilities which don't fall under * # the constraints imposed by the user. @@ -16213,7 +15698,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L18_continue; } - /* "sklearn/tree/_tree.pyx":2435 + /* "sklearn/tree/_tree.pyx":2363 * # Don't even consider possibilities which don't fall under * # the constraints imposed by the user. * if (i+1 < min_samples_leaf or # <<<<<<<<<<<<<< @@ -16227,7 +15712,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L24_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2436 + /* "sklearn/tree/_tree.pyx":2364 * # the constraints imposed by the user. * if (i+1 < min_samples_leaf or * end-start-i+1 < min_samples_leaf): # <<<<<<<<<<<<<< @@ -16239,7 +15724,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_L24_bool_binop_done:; if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2437 + /* "sklearn/tree/_tree.pyx":2365 * if (i+1 < min_samples_leaf or * end-start-i+1 < min_samples_leaf): * continue # <<<<<<<<<<<<<< @@ -16249,7 +15734,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L18_continue; } - /* "sklearn/tree/_tree.pyx":2438 + /* "sklearn/tree/_tree.pyx":2366 * end-start-i+1 < min_samples_leaf): * continue * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] # <<<<<<<<<<<<<< @@ -16263,7 +15748,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L27_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2439 + /* "sklearn/tree/_tree.pyx":2367 * continue * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] * - w_cl[i] < min_weight_leaf): # <<<<<<<<<<<<<< @@ -16275,7 +15760,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_L27_bool_binop_done:; if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2440 + /* "sklearn/tree/_tree.pyx":2368 * if (w_cl[i] < min_weight_leaf or w_cl[end-start-1] * - w_cl[i] < min_weight_leaf): * continue # <<<<<<<<<<<<<< @@ -16285,7 +15770,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py goto __pyx_L18_continue; } - /* "sklearn/tree/_tree.pyx":2442 + /* "sklearn/tree/_tree.pyx":2370 * continue * * p = i+start+1 # <<<<<<<<<<<<<< @@ -16294,7 +15779,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_p = ((__pyx_v_i + __pyx_v_start) + 1); - /* "sklearn/tree/_tree.pyx":2444 + /* "sklearn/tree/_tree.pyx":2372 * p = i+start+1 * * w_cr = w_cl[end-start-1] - w_cl[i] # <<<<<<<<<<<<<< @@ -16303,7 +15788,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_w_cr = ((__pyx_v_w_cl[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_w_cl[__pyx_v_i])); - /* "sklearn/tree/_tree.pyx":2445 + /* "sklearn/tree/_tree.pyx":2373 * * w_cr = w_cl[end-start-1] - w_cl[i] * yw_cr = yw_cl[end-start-1] - yw_cl[i] # <<<<<<<<<<<<<< @@ -16312,7 +15797,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_yw_cr = ((__pyx_v_yw_cl[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_yw_cl[__pyx_v_i])); - /* "sklearn/tree/_tree.pyx":2446 + /* "sklearn/tree/_tree.pyx":2374 * w_cr = w_cl[end-start-1] - w_cl[i] * yw_cr = yw_cl[end-start-1] - yw_cl[i] * yw_sq_r = yw_sq[end-start-1] - yw_sq[i] # <<<<<<<<<<<<<< @@ -16321,7 +15806,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_yw_sq_r = ((__pyx_v_yw_sq[((__pyx_v_end - __pyx_v_start) - 1)]) - (__pyx_v_yw_sq[__pyx_v_i])); - /* "sklearn/tree/_tree.pyx":2448 + /* "sklearn/tree/_tree.pyx":2376 * yw_sq_r = yw_sq[end-start-1] - yw_sq[i] * * current.improvement = (w_cl[i] * w_cr * # <<<<<<<<<<<<<< @@ -16330,7 +15815,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_current.improvement = (((__pyx_v_w_cl[__pyx_v_i]) * __pyx_v_w_cr) * pow(((double)(((__pyx_v_yw_cl[__pyx_v_i]) / (__pyx_v_w_cl[__pyx_v_i])) - (__pyx_v_yw_cr / __pyx_v_w_cr))), 2.0)); - /* "sklearn/tree/_tree.pyx":2450 + /* "sklearn/tree/_tree.pyx":2378 * current.improvement = (w_cl[i] * w_cr * * (yw_cl[i] / w_cl[i] - yw_cr / w_cr) ** 2.0) * current.pos = p # <<<<<<<<<<<<<< @@ -16339,7 +15824,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":2452 + /* "sklearn/tree/_tree.pyx":2380 * current.pos = p * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -16349,7 +15834,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2453 + /* "sklearn/tree/_tree.pyx":2381 * * if current.improvement > best.improvement: * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 # <<<<<<<<<<<<<< @@ -16358,7 +15843,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_current.threshold = (((__pyx_v_X_i[__pyx_v_p]) + (__pyx_v_X_i[(__pyx_v_p - 1)])) / 2.0); - /* "sklearn/tree/_tree.pyx":2454 + /* "sklearn/tree/_tree.pyx":2382 * if current.improvement > best.improvement: * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 * if current.threshold == X_i[p]: # <<<<<<<<<<<<<< @@ -16368,7 +15853,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = ((__pyx_v_current.threshold == (__pyx_v_X_i[__pyx_v_p])) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2455 + /* "sklearn/tree/_tree.pyx":2383 * current.threshold = (X_i[p] + X_i[p-1]) / 2.0 * if current.threshold == X_i[p]: * current.threshold = X_i[p-1] # <<<<<<<<<<<<<< @@ -16380,7 +15865,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py } __pyx_L30:; - /* "sklearn/tree/_tree.pyx":2457 + /* "sklearn/tree/_tree.pyx":2385 * current.threshold = X_i[p-1] * * best = current # <<<<<<<<<<<<<< @@ -16389,7 +15874,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_best = __pyx_v_current; - /* "sklearn/tree/_tree.pyx":2461 + /* "sklearn/tree/_tree.pyx":2389 * # Constants pulling out the sum, to make the next equations simpler to * # understand * yw_sq_sum = yw_sq[end-start-1] # <<<<<<<<<<<<<< @@ -16398,7 +15883,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_yw_sq_sum = (__pyx_v_yw_sq[((__pyx_v_end - __pyx_v_start) - 1)]); - /* "sklearn/tree/_tree.pyx":2462 + /* "sklearn/tree/_tree.pyx":2390 * # understand * yw_sq_sum = yw_sq[end-start-1] * yw_sum = yw_cl[end-start-1] # <<<<<<<<<<<<<< @@ -16407,7 +15892,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_yw_sum = (__pyx_v_yw_cl[((__pyx_v_end - __pyx_v_start) - 1)]); - /* "sklearn/tree/_tree.pyx":2463 + /* "sklearn/tree/_tree.pyx":2391 * yw_sq_sum = yw_sq[end-start-1] * yw_sum = yw_cl[end-start-1] * w_sum = w_cl[end-start-1] # <<<<<<<<<<<<<< @@ -16416,7 +15901,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_w_sum = (__pyx_v_w_cl[((__pyx_v_end - __pyx_v_start) - 1)]); - /* "sklearn/tree/_tree.pyx":2466 + /* "sklearn/tree/_tree.pyx":2394 * * # Calculate the impurity of the entire array * self.impurity = yw_sq_sum / w_sum - (yw_sum / w_sum) ** 2.0 # <<<<<<<<<<<<<< @@ -16425,7 +15910,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_self->impurity = ((__pyx_v_yw_sq_sum / __pyx_v_w_sum) - pow(((double)(__pyx_v_yw_sum / __pyx_v_w_sum)), 2.0)); - /* "sklearn/tree/_tree.pyx":2469 + /* "sklearn/tree/_tree.pyx":2397 * * # Calculate the impurity on the left side of the array * best.impurity_left = yw_sq[i] / w_cl[i] - (yw_cl[i] / w_cl[i]) ** 2.0 # <<<<<<<<<<<<<< @@ -16434,7 +15919,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_best.impurity_left = (((__pyx_v_yw_sq[__pyx_v_i]) / (__pyx_v_w_cl[__pyx_v_i])) - pow(((double)((__pyx_v_yw_cl[__pyx_v_i]) / (__pyx_v_w_cl[__pyx_v_i]))), 2.0)); - /* "sklearn/tree/_tree.pyx":2472 + /* "sklearn/tree/_tree.pyx":2400 * * # Calculate the impurity on the right side of the array * best.impurity_right = yw_sq_r / w_cr - (yw_cr / w_cr) ** 2.0 # <<<<<<<<<<<<<< @@ -16453,7 +15938,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":2475 + /* "sklearn/tree/_tree.pyx":2403 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -16463,7 +15948,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2476 + /* "sklearn/tree/_tree.pyx":2404 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -16472,7 +15957,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2477 + /* "sklearn/tree/_tree.pyx":2405 * if best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -16481,7 +15966,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2479 + /* "sklearn/tree/_tree.pyx":2407 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -16492,7 +15977,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":2481 + /* "sklearn/tree/_tree.pyx":2409 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_feature_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -16502,7 +15987,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py __pyx_t_9 = (((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_p])) + (__pyx_v_X_feature_stride * __pyx_v_best.feature))]) <= __pyx_v_best.threshold) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2482 + /* "sklearn/tree/_tree.pyx":2410 * if X[X_sample_stride * samples[p] + * X_feature_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -16514,7 +15999,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py } /*else*/ { - /* "sklearn/tree/_tree.pyx":2485 + /* "sklearn/tree/_tree.pyx":2413 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -16523,7 +16008,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":2487 + /* "sklearn/tree/_tree.pyx":2415 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -16532,7 +16017,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":2488 + /* "sklearn/tree/_tree.pyx":2416 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -16541,7 +16026,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":2489 + /* "sklearn/tree/_tree.pyx":2417 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -16556,7 +16041,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py } __pyx_L31:; - /* "sklearn/tree/_tree.pyx":2492 + /* "sklearn/tree/_tree.pyx":2420 * * # Reset sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -16567,7 +16052,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py for (__pyx_t_1 = __pyx_v_start; __pyx_t_1 < __pyx_t_8; __pyx_t_1+=1) { __pyx_v_p = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2493 + /* "sklearn/tree/_tree.pyx":2421 * # Reset sample mask * for p in range(start, end): * sample_mask[samples[p]] = 0 # <<<<<<<<<<<<<< @@ -16577,7 +16062,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py (__pyx_v_sample_mask[(__pyx_v_samples[__pyx_v_p])]) = 0; } - /* "sklearn/tree/_tree.pyx":2498 + /* "sklearn/tree/_tree.pyx":2426 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -16586,7 +16071,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":2501 + /* "sklearn/tree/_tree.pyx":2429 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -16595,7 +16080,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":2506 + /* "sklearn/tree/_tree.pyx":2434 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -16604,7 +16089,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":2507 + /* "sklearn/tree/_tree.pyx":2435 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -16613,7 +16098,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":2509 + /* "sklearn/tree/_tree.pyx":2437 * n_constant_features[0] = n_total_constants * * free(w_cl) # <<<<<<<<<<<<<< @@ -16622,7 +16107,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ free(__pyx_v_w_cl); - /* "sklearn/tree/_tree.pyx":2510 + /* "sklearn/tree/_tree.pyx":2438 * * free(w_cl) * free(yw_cl) # <<<<<<<<<<<<<< @@ -16631,7 +16116,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ free(__pyx_v_yw_cl); - /* "sklearn/tree/_tree.pyx":2511 + /* "sklearn/tree/_tree.pyx":2439 * free(w_cl) * free(yw_cl) * free(yw_sq) # <<<<<<<<<<<<<< @@ -16640,8 +16125,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py */ free(__pyx_v_yw_sq); - /* "sklearn/tree/_tree.pyx":2270 - * memset(sample_mask, 0, self.n_samples) + /* "sklearn/tree/_tree.pyx":2197 + * self.X_idx_sorted_ptr = self.X_argsorted_ptr * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< * SIZE_t* n_constant_features) nogil: @@ -16651,7 +16136,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2513 +/* "sklearn/tree/_tree.pyx":2441 * free(yw_sq) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -16659,10 +16144,10 @@ static void __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split(struct __py * Return the impurity of this node. */ -static double __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *__pyx_v_self) { +static double __pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *__pyx_v_self) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":2518 + /* "sklearn/tree/_tree.pyx":2446 * """ * * return self.impurity # <<<<<<<<<<<<<< @@ -16672,7 +16157,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity(struct __pyx_r = __pyx_v_self->impurity; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2513 + /* "sklearn/tree/_tree.pyx":2441 * free(yw_sq) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -16685,7 +16170,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2531 +/* "sklearn/tree/_tree.pyx":2459 * cdef SIZE_t* sorted_samples * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -16730,26 +16215,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_18BaseSparseSplitter_1__cinit__(PyObje case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_features)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -16761,20 +16246,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_18BaseSparseSplitter_1__cinit__(PyObje values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)values[0]); - __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_features = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_max_features == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BaseSparseSplitter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_criterion), __pyx_ptype_7sklearn_4tree_5_tree_Criterion, 1, "criterion", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_criterion, __pyx_v_max_features, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_random_state); /* function exit code */ @@ -16791,7 +16276,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2536 + /* "sklearn/tree/_tree.pyx":2464 * # Parent __cinit__ is automatically called * * self.X_data = NULL # <<<<<<<<<<<<<< @@ -16800,7 +16285,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_data = NULL; - /* "sklearn/tree/_tree.pyx":2537 + /* "sklearn/tree/_tree.pyx":2465 * * self.X_data = NULL * self.X_indices = NULL # <<<<<<<<<<<<<< @@ -16809,7 +16294,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_indices = NULL; - /* "sklearn/tree/_tree.pyx":2538 + /* "sklearn/tree/_tree.pyx":2466 * self.X_data = NULL * self.X_indices = NULL * self.X_indptr = NULL # <<<<<<<<<<<<<< @@ -16818,7 +16303,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_indptr = NULL; - /* "sklearn/tree/_tree.pyx":2540 + /* "sklearn/tree/_tree.pyx":2468 * self.X_indptr = NULL * * self.n_total_samples = 0 # <<<<<<<<<<<<<< @@ -16827,7 +16312,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->n_total_samples = 0; - /* "sklearn/tree/_tree.pyx":2542 + /* "sklearn/tree/_tree.pyx":2470 * self.n_total_samples = 0 * * self.index_to_samples = NULL # <<<<<<<<<<<<<< @@ -16836,7 +16321,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->index_to_samples = NULL; - /* "sklearn/tree/_tree.pyx":2543 + /* "sklearn/tree/_tree.pyx":2471 * * self.index_to_samples = NULL * self.sorted_samples = NULL # <<<<<<<<<<<<<< @@ -16845,7 +16330,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->sorted_samples = NULL; - /* "sklearn/tree/_tree.pyx":2531 + /* "sklearn/tree/_tree.pyx":2459 * cdef SIZE_t* sorted_samples * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -16859,7 +16344,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2545 +/* "sklearn/tree/_tree.pyx":2473 * self.sorted_samples = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -16882,7 +16367,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":2547 + /* "sklearn/tree/_tree.pyx":2475 * def __dealloc__(self): * """Deallocate memory""" * free(self.index_to_samples) # <<<<<<<<<<<<<< @@ -16891,7 +16376,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str */ free(__pyx_v_self->index_to_samples); - /* "sklearn/tree/_tree.pyx":2548 + /* "sklearn/tree/_tree.pyx":2476 * """Deallocate memory""" * free(self.index_to_samples) * free(self.sorted_samples) # <<<<<<<<<<<<<< @@ -16900,7 +16385,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str */ free(__pyx_v_self->sorted_samples); - /* "sklearn/tree/_tree.pyx":2545 + /* "sklearn/tree/_tree.pyx":2473 * self.sorted_samples = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -16912,7 +16397,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2550 +/* "sklearn/tree/_tree.pyx":2478 * free(self.sorted_samples) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -16970,48 +16455,48 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DOUBLE_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_y.diminfo[1].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_y.diminfo[1].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[1]; - /* "sklearn/tree/_tree.pyx":2557 + /* "sklearn/tree/_tree.pyx":2485 * * # Call parent init * Splitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< * * if not isinstance(X, csc_matrix): */ - __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), __pyx_v_X, ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2559 + /* "sklearn/tree/_tree.pyx":2487 * Splitter.init(self, X, y, sample_weight) * * if not isinstance(X, csc_matrix): # <<<<<<<<<<<<<< * raise ValueError("X should be in csc format") * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csc_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2560 + /* "sklearn/tree/_tree.pyx":2488 * * if not isinstance(X, csc_matrix): * raise ValueError("X should be in csc format") # <<<<<<<<<<<<<< * * cdef SIZE_t* samples = self.samples */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2562 + /* "sklearn/tree/_tree.pyx":2490 * raise ValueError("X should be in csc format") * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -17021,7 +16506,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_t_4 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2563 + /* "sklearn/tree/_tree.pyx":2491 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t n_samples = self.n_samples # <<<<<<<<<<<<<< @@ -17031,22 +16516,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_t_5 = __pyx_v_self->__pyx_base.n_samples; __pyx_v_n_samples = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2566 + /* "sklearn/tree/_tree.pyx":2494 * * # Initialize X * cdef np.ndarray[dtype=DTYPE_t, ndim=1] data = X.data # <<<<<<<<<<<<<< * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_data = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_data.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; } } @@ -17054,22 +16539,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_v_data = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2567 + /* "sklearn/tree/_tree.pyx":2495 * # Initialize X * cdef np.ndarray[dtype=DTYPE_t, ndim=1] data = X.data * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices # <<<<<<<<<<<<<< * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr * cdef SIZE_t n_total_samples = X.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_indices = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indices.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; } } @@ -17077,22 +16562,22 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_v_indices = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2568 + /* "sklearn/tree/_tree.pyx":2496 * cdef np.ndarray[dtype=DTYPE_t, ndim=1] data = X.data * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr # <<<<<<<<<<<<<< * cdef SIZE_t n_total_samples = X.shape[0] * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_indptr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_indptr.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_indptr.diminfo[0].strides = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indptr.diminfo[0].shape = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.shape[0]; } } @@ -17100,23 +16585,23 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_v_indptr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2569 + /* "sklearn/tree/_tree.pyx":2497 * cdef np.ndarray[dtype=INT32_t, ndim=1] indices = X.indices * cdef np.ndarray[dtype=INT32_t, ndim=1] indptr = X.indptr * cdef SIZE_t n_total_samples = X.shape[0] # <<<<<<<<<<<<<< * * self.X_data = data.data */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_9); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_n_total_samples = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2571 + /* "sklearn/tree/_tree.pyx":2499 * cdef SIZE_t n_total_samples = X.shape[0] * * self.X_data = data.data # <<<<<<<<<<<<<< @@ -17125,7 +16610,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->X_data = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_data->data); - /* "sklearn/tree/_tree.pyx":2572 + /* "sklearn/tree/_tree.pyx":2500 * * self.X_data = data.data * self.X_indices = indices.data # <<<<<<<<<<<<<< @@ -17134,7 +16619,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->X_indices = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_indices->data); - /* "sklearn/tree/_tree.pyx":2573 + /* "sklearn/tree/_tree.pyx":2501 * self.X_data = data.data * self.X_indices = indices.data * self.X_indptr = indptr.data # <<<<<<<<<<<<<< @@ -17143,7 +16628,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->X_indptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_indptr->data); - /* "sklearn/tree/_tree.pyx":2574 + /* "sklearn/tree/_tree.pyx":2502 * self.X_indices = indices.data * self.X_indptr = indptr.data * self.n_total_samples = n_total_samples # <<<<<<<<<<<<<< @@ -17152,25 +16637,25 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx */ __pyx_v_self->n_total_samples = __pyx_v_n_total_samples; - /* "sklearn/tree/_tree.pyx":2577 + /* "sklearn/tree/_tree.pyx":2505 * * # Initialize auxiliary array used to perform split * safe_realloc(&self.index_to_samples, n_total_samples * sizeof(SIZE_t)) # <<<<<<<<<<<<<< * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) * */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->index_to_samples), (__pyx_v_n_total_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->index_to_samples), (__pyx_v_n_total_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2578 + /* "sklearn/tree/_tree.pyx":2506 * # Initialize auxiliary array used to perform split * safe_realloc(&self.index_to_samples, n_total_samples * sizeof(SIZE_t)) * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) # <<<<<<<<<<<<<< * * cdef SIZE_t* index_to_samples = self.index_to_samples */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sorted_samples), (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->sorted_samples), (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2580 + /* "sklearn/tree/_tree.pyx":2508 * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) * * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -17180,7 +16665,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __pyx_t_4 = __pyx_v_self->index_to_samples; __pyx_v_index_to_samples = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2582 + /* "sklearn/tree/_tree.pyx":2510 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t p * for p in range(n_total_samples): # <<<<<<<<<<<<<< @@ -17191,7 +16676,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_5; __pyx_t_10+=1) { __pyx_v_p = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2583 + /* "sklearn/tree/_tree.pyx":2511 * cdef SIZE_t p * for p in range(n_total_samples): * index_to_samples[p] = -1 # <<<<<<<<<<<<<< @@ -17201,7 +16686,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx (__pyx_v_index_to_samples[__pyx_v_p]) = -1; } - /* "sklearn/tree/_tree.pyx":2585 + /* "sklearn/tree/_tree.pyx":2513 * index_to_samples[p] = -1 * * for p in range(n_samples): # <<<<<<<<<<<<<< @@ -17212,7 +16697,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_5; __pyx_t_10+=1) { __pyx_v_p = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":2586 + /* "sklearn/tree/_tree.pyx":2514 * * for p in range(n_samples): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -17222,7 +16707,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_p])]) = __pyx_v_p; } - /* "sklearn/tree/_tree.pyx":2550 + /* "sklearn/tree/_tree.pyx":2478 * free(self.sorted_samples) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -17256,7 +16741,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2588 +/* "sklearn/tree/_tree.pyx":2516 * index_to_samples[samples[p]] = p * * cdef inline SIZE_t _partition(self, double threshold, # <<<<<<<<<<<<<< @@ -17277,7 +16762,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree int __pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2597 + /* "sklearn/tree/_tree.pyx":2525 * cdef SIZE_t p * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -17287,7 +16772,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_1 = __pyx_v_self->__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2598 + /* "sklearn/tree/_tree.pyx":2526 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -17297,7 +16782,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_2 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2599 + /* "sklearn/tree/_tree.pyx":2527 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* samples = self.samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -17307,7 +16792,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_2 = __pyx_v_self->index_to_samples; __pyx_v_index_to_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2601 + /* "sklearn/tree/_tree.pyx":2529 * cdef SIZE_t* index_to_samples = self.index_to_samples * * if threshold < 0.: # <<<<<<<<<<<<<< @@ -17317,7 +16802,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_threshold < 0.) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2602 + /* "sklearn/tree/_tree.pyx":2530 * * if threshold < 0.: * p = self.start # <<<<<<<<<<<<<< @@ -17327,7 +16812,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_4 = __pyx_v_self->__pyx_base.start; __pyx_v_p = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2603 + /* "sklearn/tree/_tree.pyx":2531 * if threshold < 0.: * p = self.start * partition_end = end_negative # <<<<<<<<<<<<<< @@ -17338,7 +16823,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree goto __pyx_L3; } - /* "sklearn/tree/_tree.pyx":2604 + /* "sklearn/tree/_tree.pyx":2532 * p = self.start * partition_end = end_negative * elif threshold > 0.: # <<<<<<<<<<<<<< @@ -17348,7 +16833,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_threshold > 0.) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2605 + /* "sklearn/tree/_tree.pyx":2533 * partition_end = end_negative * elif threshold > 0.: * p = start_positive # <<<<<<<<<<<<<< @@ -17357,7 +16842,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ __pyx_v_p = __pyx_v_start_positive; - /* "sklearn/tree/_tree.pyx":2606 + /* "sklearn/tree/_tree.pyx":2534 * elif threshold > 0.: * p = start_positive * partition_end = self.end # <<<<<<<<<<<<<< @@ -17370,7 +16855,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } /*else*/ { - /* "sklearn/tree/_tree.pyx":2609 + /* "sklearn/tree/_tree.pyx":2537 * else: * # Data are already split * return zero_pos # <<<<<<<<<<<<<< @@ -17382,7 +16867,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2611 + /* "sklearn/tree/_tree.pyx":2539 * return zero_pos * * while p < partition_end: # <<<<<<<<<<<<<< @@ -17393,7 +16878,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_3) break; - /* "sklearn/tree/_tree.pyx":2612 + /* "sklearn/tree/_tree.pyx":2540 * * while p < partition_end: * value = Xf[p] # <<<<<<<<<<<<<< @@ -17402,7 +16887,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ __pyx_v_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":2614 + /* "sklearn/tree/_tree.pyx":2542 * value = Xf[p] * * if value <= threshold: # <<<<<<<<<<<<<< @@ -17412,7 +16897,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_t_3 = ((__pyx_v_value <= __pyx_v_threshold) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2615 + /* "sklearn/tree/_tree.pyx":2543 * * if value <= threshold: * p += 1 # <<<<<<<<<<<<<< @@ -17424,7 +16909,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } /*else*/ { - /* "sklearn/tree/_tree.pyx":2618 + /* "sklearn/tree/_tree.pyx":2546 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -17433,7 +16918,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":2620 + /* "sklearn/tree/_tree.pyx":2548 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -17442,7 +16927,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ (__pyx_v_Xf[__pyx_v_p]) = (__pyx_v_Xf[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":2621 + /* "sklearn/tree/_tree.pyx":2549 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = value # <<<<<<<<<<<<<< @@ -17451,7 +16936,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree */ (__pyx_v_Xf[__pyx_v_partition_end]) = __pyx_v_value; - /* "sklearn/tree/_tree.pyx":2622 + /* "sklearn/tree/_tree.pyx":2550 * Xf[p] = Xf[partition_end] * Xf[partition_end] = value * sparse_swap(index_to_samples, samples, p, partition_end) # <<<<<<<<<<<<<< @@ -17463,7 +16948,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_L6:; } - /* "sklearn/tree/_tree.pyx":2624 + /* "sklearn/tree/_tree.pyx":2552 * sparse_swap(index_to_samples, samples, p, partition_end) * * return partition_end # <<<<<<<<<<<<<< @@ -17473,7 +16958,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_r = __pyx_v_partition_end; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2588 + /* "sklearn/tree/_tree.pyx":2516 * index_to_samples[samples[p]] = p * * cdef inline SIZE_t _partition(self, double threshold, # <<<<<<<<<<<<<< @@ -17486,7 +16971,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2626 +/* "sklearn/tree/_tree.pyx":2554 * return partition_end * * cdef inline void extract_nnz(self, SIZE_t feature, # <<<<<<<<<<<<<< @@ -17501,7 +16986,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_samples; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2658 + /* "sklearn/tree/_tree.pyx":2586 * * """ * cdef SIZE_t indptr_start = self.X_indptr[feature], # <<<<<<<<<<<<<< @@ -17510,7 +16995,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_indptr_start = (__pyx_v_self->X_indptr[__pyx_v_feature]); - /* "sklearn/tree/_tree.pyx":2659 + /* "sklearn/tree/_tree.pyx":2587 * """ * cdef SIZE_t indptr_start = self.X_indptr[feature], * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] # <<<<<<<<<<<<<< @@ -17519,7 +17004,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_indptr_end = (__pyx_v_self->X_indptr[(__pyx_v_feature + 1)]); - /* "sklearn/tree/_tree.pyx":2660 + /* "sklearn/tree/_tree.pyx":2588 * cdef SIZE_t indptr_start = self.X_indptr[feature], * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] * cdef SIZE_t n_indices = (indptr_end - indptr_start) # <<<<<<<<<<<<<< @@ -17528,7 +17013,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_n_indices = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_indptr_end - __pyx_v_indptr_start)); - /* "sklearn/tree/_tree.pyx":2661 + /* "sklearn/tree/_tree.pyx":2589 * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] * cdef SIZE_t n_indices = (indptr_end - indptr_start) * cdef SIZE_t n_samples = self.end - self.start # <<<<<<<<<<<<<< @@ -17537,7 +17022,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext */ __pyx_v_n_samples = (__pyx_v_self->__pyx_base.end - __pyx_v_self->__pyx_base.start); - /* "sklearn/tree/_tree.pyx":2669 + /* "sklearn/tree/_tree.pyx":2597 * # approach. * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): # <<<<<<<<<<<<<< @@ -17547,7 +17032,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext __pyx_t_1 = ((((((1 - (__pyx_v_is_samples_sorted[0])) * __pyx_v_n_samples) * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_n_samples)) + (__pyx_v_n_samples * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_n_indices))) < (__pyx_v_7sklearn_4tree_5_tree_EXTRACT_NNZ_SWITCH * __pyx_v_n_indices)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2670 + /* "sklearn/tree/_tree.pyx":2598 * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): * extract_nnz_binary_search(self.X_indices, self.X_data, # <<<<<<<<<<<<<< @@ -17559,7 +17044,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext } /*else*/ { - /* "sklearn/tree/_tree.pyx":2681 + /* "sklearn/tree/_tree.pyx":2609 * # index_to_samples is a mapping from X_indices to samples * else: * extract_nnz_index_to_samples(self.X_indices, self.X_data, # <<<<<<<<<<<<<< @@ -17570,7 +17055,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2626 + /* "sklearn/tree/_tree.pyx":2554 * return partition_end * * cdef inline void extract_nnz(self, SIZE_t feature, # <<<<<<<<<<<<<< @@ -17581,7 +17066,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2689 +/* "sklearn/tree/_tree.pyx":2617 * * * cdef int compare_SIZE_t(const void* a, const void* b) nogil: # <<<<<<<<<<<<<< @@ -17592,7 +17077,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext static int __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t(void const *__pyx_v_a, void const *__pyx_v_b) { int __pyx_r; - /* "sklearn/tree/_tree.pyx":2691 + /* "sklearn/tree/_tree.pyx":2619 * cdef int compare_SIZE_t(const void* a, const void* b) nogil: * """Comparison function for sort""" * return ((a)[0] - (b)[0]) # <<<<<<<<<<<<<< @@ -17602,7 +17087,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t(void const *__pyx_v_a, v __pyx_r = ((int)((((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_a)[0]) - (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_b)[0]))); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2689 + /* "sklearn/tree/_tree.pyx":2617 * * * cdef int compare_SIZE_t(const void* a, const void* b) nogil: # <<<<<<<<<<<<<< @@ -17615,7 +17100,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t(void const *__pyx_v_a, v return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2694 +/* "sklearn/tree/_tree.pyx":2622 * * * cdef inline void binary_search(INT32_t* sorted_array, # <<<<<<<<<<<<<< @@ -17627,7 +17112,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_7sklearn_4tree_5_tree_INT32_t __pyx_v_pivot; int __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2703 + /* "sklearn/tree/_tree.pyx":2631 * """ * cdef INT32_t pivot * index[0] = -1 # <<<<<<<<<<<<<< @@ -17636,7 +17121,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ (__pyx_v_index[0]) = -1; - /* "sklearn/tree/_tree.pyx":2704 + /* "sklearn/tree/_tree.pyx":2632 * cdef INT32_t pivot * index[0] = -1 * while start < end: # <<<<<<<<<<<<<< @@ -17647,7 +17132,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_1 = ((__pyx_v_start < __pyx_v_end) != 0); if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2705 + /* "sklearn/tree/_tree.pyx":2633 * index[0] = -1 * while start < end: * pivot = start + (end - start) / 2 # <<<<<<<<<<<<<< @@ -17656,7 +17141,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ __pyx_v_pivot = (__pyx_v_start + ((__pyx_v_end - __pyx_v_start) / 2)); - /* "sklearn/tree/_tree.pyx":2707 + /* "sklearn/tree/_tree.pyx":2635 * pivot = start + (end - start) / 2 * * if sorted_array[pivot] == value: # <<<<<<<<<<<<<< @@ -17666,7 +17151,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_1 = (((__pyx_v_sorted_array[__pyx_v_pivot]) == __pyx_v_value) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2708 + /* "sklearn/tree/_tree.pyx":2636 * * if sorted_array[pivot] == value: * index[0] = pivot # <<<<<<<<<<<<<< @@ -17675,7 +17160,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ (__pyx_v_index[0]) = __pyx_v_pivot; - /* "sklearn/tree/_tree.pyx":2709 + /* "sklearn/tree/_tree.pyx":2637 * if sorted_array[pivot] == value: * index[0] = pivot * start = pivot + 1 # <<<<<<<<<<<<<< @@ -17684,7 +17169,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ __pyx_v_start = (__pyx_v_pivot + 1); - /* "sklearn/tree/_tree.pyx":2710 + /* "sklearn/tree/_tree.pyx":2638 * index[0] = pivot * start = pivot + 1 * break # <<<<<<<<<<<<<< @@ -17694,7 +17179,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":2712 + /* "sklearn/tree/_tree.pyx":2640 * break * * if sorted_array[pivot] < value: # <<<<<<<<<<<<<< @@ -17704,7 +17189,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s __pyx_t_1 = (((__pyx_v_sorted_array[__pyx_v_pivot]) < __pyx_v_value) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2713 + /* "sklearn/tree/_tree.pyx":2641 * * if sorted_array[pivot] < value: * start = pivot + 1 # <<<<<<<<<<<<<< @@ -17716,7 +17201,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s } /*else*/ { - /* "sklearn/tree/_tree.pyx":2715 + /* "sklearn/tree/_tree.pyx":2643 * start = pivot + 1 * else: * end = pivot # <<<<<<<<<<<<<< @@ -17729,7 +17214,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":2716 + /* "sklearn/tree/_tree.pyx":2644 * else: * end = pivot * new_start[0] = start # <<<<<<<<<<<<<< @@ -17738,7 +17223,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s */ (__pyx_v_new_start[0]) = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2694 + /* "sklearn/tree/_tree.pyx":2622 * * * cdef inline void binary_search(INT32_t* sorted_array, # <<<<<<<<<<<<<< @@ -17749,7 +17234,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2719 +/* "sklearn/tree/_tree.pyx":2647 * * * cdef inline void extract_nnz_index_to_samples(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -17767,7 +17252,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam int __pyx_t_3; int __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2736 + /* "sklearn/tree/_tree.pyx":2664 * cdef INT32_t k * cdef SIZE_t index * cdef SIZE_t end_negative_ = start # <<<<<<<<<<<<<< @@ -17776,7 +17261,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_end_negative_ = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2737 + /* "sklearn/tree/_tree.pyx":2665 * cdef SIZE_t index * cdef SIZE_t end_negative_ = start * cdef SIZE_t start_positive_ = end # <<<<<<<<<<<<<< @@ -17785,7 +17270,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_start_positive_ = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2739 + /* "sklearn/tree/_tree.pyx":2667 * cdef SIZE_t start_positive_ = end * * for k in range(indptr_start, indptr_end): # <<<<<<<<<<<<<< @@ -17796,7 +17281,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam for (__pyx_t_2 = __pyx_v_indptr_start; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_k = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2740 + /* "sklearn/tree/_tree.pyx":2668 * * for k in range(indptr_start, indptr_end): * if start <= index_to_samples[X_indices[k]] < end: # <<<<<<<<<<<<<< @@ -17810,7 +17295,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2741 + /* "sklearn/tree/_tree.pyx":2669 * for k in range(indptr_start, indptr_end): * if start <= index_to_samples[X_indices[k]] < end: * if X_data[k] > 0: # <<<<<<<<<<<<<< @@ -17820,7 +17305,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_t_4 = (((__pyx_v_X_data[__pyx_v_k]) > 0.0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2742 + /* "sklearn/tree/_tree.pyx":2670 * if start <= index_to_samples[X_indices[k]] < end: * if X_data[k] > 0: * start_positive_ -= 1 # <<<<<<<<<<<<<< @@ -17829,7 +17314,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_start_positive_ = (__pyx_v_start_positive_ - 1); - /* "sklearn/tree/_tree.pyx":2743 + /* "sklearn/tree/_tree.pyx":2671 * if X_data[k] > 0: * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] # <<<<<<<<<<<<<< @@ -17838,7 +17323,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_Xf[__pyx_v_start_positive_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2744 + /* "sklearn/tree/_tree.pyx":2672 * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -17847,7 +17332,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2745 + /* "sklearn/tree/_tree.pyx":2673 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, start_positive_) # <<<<<<<<<<<<<< @@ -17858,7 +17343,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam goto __pyx_L6; } - /* "sklearn/tree/_tree.pyx":2748 + /* "sklearn/tree/_tree.pyx":2676 * * * elif X_data[k] < 0: # <<<<<<<<<<<<<< @@ -17868,7 +17353,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_t_4 = (((__pyx_v_X_data[__pyx_v_k]) < 0.0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2749 + /* "sklearn/tree/_tree.pyx":2677 * * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] # <<<<<<<<<<<<<< @@ -17877,7 +17362,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_Xf[__pyx_v_end_negative_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2750 + /* "sklearn/tree/_tree.pyx":2678 * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -17886,7 +17371,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2751 + /* "sklearn/tree/_tree.pyx":2679 * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) # <<<<<<<<<<<<<< @@ -17895,7 +17380,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_v_index_to_samples, __pyx_v_samples, __pyx_v_index, __pyx_v_end_negative_); - /* "sklearn/tree/_tree.pyx":2752 + /* "sklearn/tree/_tree.pyx":2680 * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 # <<<<<<<<<<<<<< @@ -17911,7 +17396,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":2755 + /* "sklearn/tree/_tree.pyx":2683 * * # Returned values * end_negative[0] = end_negative_ # <<<<<<<<<<<<<< @@ -17920,7 +17405,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_end_negative[0]) = __pyx_v_end_negative_; - /* "sklearn/tree/_tree.pyx":2756 + /* "sklearn/tree/_tree.pyx":2684 * # Returned values * end_negative[0] = end_negative_ * start_positive[0] = start_positive_ # <<<<<<<<<<<<<< @@ -17929,7 +17414,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam */ (__pyx_v_start_positive[0]) = __pyx_v_start_positive_; - /* "sklearn/tree/_tree.pyx":2719 + /* "sklearn/tree/_tree.pyx":2647 * * * cdef inline void extract_nnz_index_to_samples(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -17940,7 +17425,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2759 +/* "sklearn/tree/_tree.pyx":2687 * * * cdef inline void extract_nnz_binary_search(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -17958,7 +17443,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc int __pyx_t_1; int __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2782 + /* "sklearn/tree/_tree.pyx":2710 * cdef SIZE_t n_samples * * if not is_samples_sorted[0]: # <<<<<<<<<<<<<< @@ -17968,7 +17453,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = ((!((__pyx_v_is_samples_sorted[0]) != 0)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2783 + /* "sklearn/tree/_tree.pyx":2711 * * if not is_samples_sorted[0]: * n_samples = end - start # <<<<<<<<<<<<<< @@ -17977,7 +17462,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_n_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":2784 + /* "sklearn/tree/_tree.pyx":2712 * if not is_samples_sorted[0]: * n_samples = end - start * memcpy(sorted_samples + start, samples + start, # <<<<<<<<<<<<<< @@ -17986,7 +17471,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ memcpy((__pyx_v_sorted_samples + __pyx_v_start), (__pyx_v_samples + __pyx_v_start), (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); - /* "sklearn/tree/_tree.pyx":2786 + /* "sklearn/tree/_tree.pyx":2714 * memcpy(sorted_samples + start, samples + start, * n_samples * sizeof(SIZE_t)) * qsort(sorted_samples + start, n_samples, sizeof(SIZE_t), # <<<<<<<<<<<<<< @@ -17995,7 +17480,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ qsort((__pyx_v_sorted_samples + __pyx_v_start), __pyx_v_n_samples, (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)), __pyx_f_7sklearn_4tree_5_tree_compare_SIZE_t); - /* "sklearn/tree/_tree.pyx":2788 + /* "sklearn/tree/_tree.pyx":2716 * qsort(sorted_samples + start, n_samples, sizeof(SIZE_t), * compare_SIZE_t) * is_samples_sorted[0] = 1 # <<<<<<<<<<<<<< @@ -18007,7 +17492,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2790 + /* "sklearn/tree/_tree.pyx":2718 * is_samples_sorted[0] = 1 * * while (indptr_start < indptr_end and # <<<<<<<<<<<<<< @@ -18022,7 +17507,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L6_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2791 + /* "sklearn/tree/_tree.pyx":2719 * * while (indptr_start < indptr_end and * sorted_samples[start] > X_indices[indptr_start]): # <<<<<<<<<<<<<< @@ -18034,7 +17519,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_L6_bool_binop_done:; if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2792 + /* "sklearn/tree/_tree.pyx":2720 * while (indptr_start < indptr_end and * sorted_samples[start] > X_indices[indptr_start]): * indptr_start += 1 # <<<<<<<<<<<<<< @@ -18044,7 +17529,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_v_indptr_start = (__pyx_v_indptr_start + 1); } - /* "sklearn/tree/_tree.pyx":2794 + /* "sklearn/tree/_tree.pyx":2722 * indptr_start += 1 * * while (indptr_start < indptr_end and # <<<<<<<<<<<<<< @@ -18059,7 +17544,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L10_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2795 + /* "sklearn/tree/_tree.pyx":2723 * * while (indptr_start < indptr_end and * sorted_samples[end - 1] < X_indices[indptr_end - 1]): # <<<<<<<<<<<<<< @@ -18071,7 +17556,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_L10_bool_binop_done:; if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2796 + /* "sklearn/tree/_tree.pyx":2724 * while (indptr_start < indptr_end and * sorted_samples[end - 1] < X_indices[indptr_end - 1]): * indptr_end -= 1 # <<<<<<<<<<<<<< @@ -18081,7 +17566,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_v_indptr_end = (__pyx_v_indptr_end - 1); } - /* "sklearn/tree/_tree.pyx":2798 + /* "sklearn/tree/_tree.pyx":2726 * indptr_end -= 1 * * cdef SIZE_t p = start # <<<<<<<<<<<<<< @@ -18090,7 +17575,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2801 + /* "sklearn/tree/_tree.pyx":2729 * cdef SIZE_t index * cdef SIZE_t k * cdef SIZE_t end_negative_ = start # <<<<<<<<<<<<<< @@ -18099,7 +17584,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_end_negative_ = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2802 + /* "sklearn/tree/_tree.pyx":2730 * cdef SIZE_t k * cdef SIZE_t end_negative_ = start * cdef SIZE_t start_positive_ = end # <<<<<<<<<<<<<< @@ -18108,7 +17593,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_start_positive_ = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2804 + /* "sklearn/tree/_tree.pyx":2732 * cdef SIZE_t start_positive_ = end * * while (p < end and indptr_start < indptr_end): # <<<<<<<<<<<<<< @@ -18127,7 +17612,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_L14_bool_binop_done:; if (!__pyx_t_1) break; - /* "sklearn/tree/_tree.pyx":2806 + /* "sklearn/tree/_tree.pyx":2734 * while (p < end and indptr_start < indptr_end): * # Find index of sorted_samples[p] in X_indices * binary_search(X_indices, indptr_start, indptr_end, # <<<<<<<<<<<<<< @@ -18136,7 +17621,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_v_X_indices, __pyx_v_indptr_start, __pyx_v_indptr_end, (__pyx_v_sorted_samples[__pyx_v_p]), (&__pyx_v_k), (&__pyx_v_indptr_start)); - /* "sklearn/tree/_tree.pyx":2809 + /* "sklearn/tree/_tree.pyx":2737 * sorted_samples[p], &k, &indptr_start) * * if k != -1: # <<<<<<<<<<<<<< @@ -18146,7 +17631,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = ((__pyx_v_k != -1) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2812 + /* "sklearn/tree/_tree.pyx":2740 * # If k != -1, we have found a non zero value * * if X_data[k] > 0: # <<<<<<<<<<<<<< @@ -18156,7 +17641,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = (((__pyx_v_X_data[__pyx_v_k]) > 0.0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2813 + /* "sklearn/tree/_tree.pyx":2741 * * if X_data[k] > 0: * start_positive_ -= 1 # <<<<<<<<<<<<<< @@ -18165,7 +17650,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_start_positive_ = (__pyx_v_start_positive_ - 1); - /* "sklearn/tree/_tree.pyx":2814 + /* "sklearn/tree/_tree.pyx":2742 * if X_data[k] > 0: * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] # <<<<<<<<<<<<<< @@ -18174,7 +17659,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_Xf[__pyx_v_start_positive_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2815 + /* "sklearn/tree/_tree.pyx":2743 * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -18183,7 +17668,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2816 + /* "sklearn/tree/_tree.pyx":2744 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, start_positive_) # <<<<<<<<<<<<<< @@ -18194,7 +17679,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L17; } - /* "sklearn/tree/_tree.pyx":2819 + /* "sklearn/tree/_tree.pyx":2747 * * * elif X_data[k] < 0: # <<<<<<<<<<<<<< @@ -18204,7 +17689,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_t_1 = (((__pyx_v_X_data[__pyx_v_k]) < 0.0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2820 + /* "sklearn/tree/_tree.pyx":2748 * * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] # <<<<<<<<<<<<<< @@ -18213,7 +17698,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_Xf[__pyx_v_end_negative_]) = (__pyx_v_X_data[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":2821 + /* "sklearn/tree/_tree.pyx":2749 * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -18222,7 +17707,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_v_index = (__pyx_v_index_to_samples[(__pyx_v_X_indices[__pyx_v_k])]); - /* "sklearn/tree/_tree.pyx":2822 + /* "sklearn/tree/_tree.pyx":2750 * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) # <<<<<<<<<<<<<< @@ -18231,7 +17716,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_v_index_to_samples, __pyx_v_samples, __pyx_v_index, __pyx_v_end_negative_); - /* "sklearn/tree/_tree.pyx":2823 + /* "sklearn/tree/_tree.pyx":2751 * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 # <<<<<<<<<<<<<< @@ -18246,7 +17731,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":2824 + /* "sklearn/tree/_tree.pyx":2752 * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 * p += 1 # <<<<<<<<<<<<<< @@ -18256,7 +17741,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":2827 + /* "sklearn/tree/_tree.pyx":2755 * * # Returned values * end_negative[0] = end_negative_ # <<<<<<<<<<<<<< @@ -18265,7 +17750,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_end_negative[0]) = __pyx_v_end_negative_; - /* "sklearn/tree/_tree.pyx":2828 + /* "sklearn/tree/_tree.pyx":2756 * # Returned values * end_negative[0] = end_negative_ * start_positive[0] = start_positive_ # <<<<<<<<<<<<<< @@ -18274,7 +17759,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc */ (__pyx_v_start_positive[0]) = __pyx_v_start_positive_; - /* "sklearn/tree/_tree.pyx":2759 + /* "sklearn/tree/_tree.pyx":2687 * * * cdef inline void extract_nnz_binary_search(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -18285,7 +17770,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2831 +/* "sklearn/tree/_tree.pyx":2759 * * * cdef inline void sparse_swap(SIZE_t* index_to_samples, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -18297,7 +17782,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2834 + /* "sklearn/tree/_tree.pyx":2762 * SIZE_t pos_1, SIZE_t pos_2) nogil : * """Swap sample pos_1 and pos_2 preserving sparse invariant""" * samples[pos_1], samples[pos_2] = samples[pos_2], samples[pos_1] # <<<<<<<<<<<<<< @@ -18309,7 +17794,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl (__pyx_v_samples[__pyx_v_pos_1]) = __pyx_t_1; (__pyx_v_samples[__pyx_v_pos_2]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2835 + /* "sklearn/tree/_tree.pyx":2763 * """Swap sample pos_1 and pos_2 preserving sparse invariant""" * samples[pos_1], samples[pos_2] = samples[pos_2], samples[pos_1] * index_to_samples[samples[pos_1]] = pos_1 # <<<<<<<<<<<<<< @@ -18318,7 +17803,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl */ (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_pos_1])]) = __pyx_v_pos_1; - /* "sklearn/tree/_tree.pyx":2836 + /* "sklearn/tree/_tree.pyx":2764 * samples[pos_1], samples[pos_2] = samples[pos_2], samples[pos_1] * index_to_samples[samples[pos_1]] = pos_1 * index_to_samples[samples[pos_2]] = pos_2 # <<<<<<<<<<<<<< @@ -18327,7 +17812,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl */ (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_pos_2])]) = __pyx_v_pos_2; - /* "sklearn/tree/_tree.pyx":2831 + /* "sklearn/tree/_tree.pyx":2759 * * * cdef inline void sparse_swap(SIZE_t* index_to_samples, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -18338,7 +17823,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7skl /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2842 +/* "sklearn/tree/_tree.pyx":2770 * """Splitter for finding the best split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -18371,7 +17856,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":2843 + /* "sklearn/tree/_tree.pyx":2771 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -18380,44 +17865,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":2844 + /* "sklearn/tree/_tree.pyx":2772 * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2845 + /* "sklearn/tree/_tree.pyx":2773 * return (BestSparseSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2846 + /* "sklearn/tree/_tree.pyx":2774 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2843 + /* "sklearn/tree/_tree.pyx":2771 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -18435,14 +17920,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2847 + /* "sklearn/tree/_tree.pyx":2775 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -18455,22 +17940,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2843 + /* "sklearn/tree/_tree.pyx":2771 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter))); @@ -18485,7 +17970,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2842 + /* "sklearn/tree/_tree.pyx":2770 * """Splitter for finding the best split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -18507,7 +17992,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2849 +/* "sklearn/tree/_tree.pyx":2777 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -18557,7 +18042,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct int __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2855 + /* "sklearn/tree/_tree.pyx":2783 * """ * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -18567,7 +18052,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2856 + /* "sklearn/tree/_tree.pyx":2784 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -18577,7 +18062,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2857 + /* "sklearn/tree/_tree.pyx":2785 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -18587,7 +18072,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2859 + /* "sklearn/tree/_tree.pyx":2787 * cdef SIZE_t end = self.end * * cdef INT32_t* X_indices = self.X_indices # <<<<<<<<<<<<<< @@ -18597,7 +18082,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_3 = __pyx_v_self->__pyx_base.X_indices; __pyx_v_X_indices = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2860 + /* "sklearn/tree/_tree.pyx":2788 * * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr # <<<<<<<<<<<<<< @@ -18607,7 +18092,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_3 = __pyx_v_self->__pyx_base.X_indptr; __pyx_v_X_indptr = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2861 + /* "sklearn/tree/_tree.pyx":2789 * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr * cdef DTYPE_t* X_data = self.X_data # <<<<<<<<<<<<<< @@ -18617,7 +18102,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_4 = __pyx_v_self->__pyx_base.X_data; __pyx_v_X_data = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2863 + /* "sklearn/tree/_tree.pyx":2791 * cdef DTYPE_t* X_data = self.X_data * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -18627,7 +18112,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2864 + /* "sklearn/tree/_tree.pyx":2792 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -18637,7 +18122,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2865 + /* "sklearn/tree/_tree.pyx":2793 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -18647,7 +18132,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2867 + /* "sklearn/tree/_tree.pyx":2795 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -18657,7 +18142,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2868 + /* "sklearn/tree/_tree.pyx":2796 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples # <<<<<<<<<<<<<< @@ -18667,7 +18152,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.sorted_samples; __pyx_v_sorted_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2869 + /* "sklearn/tree/_tree.pyx":2797 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -18677,7 +18162,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_1 = __pyx_v_self->__pyx_base.index_to_samples; __pyx_v_index_to_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":2870 + /* "sklearn/tree/_tree.pyx":2798 * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -18687,7 +18172,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2871 + /* "sklearn/tree/_tree.pyx":2799 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -18697,7 +18182,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2872 + /* "sklearn/tree/_tree.pyx":2800 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -18707,7 +18192,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2873 + /* "sklearn/tree/_tree.pyx":2801 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -18716,7 +18201,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":2876 + /* "sklearn/tree/_tree.pyx":2804 * * cdef SplitRecord best, current * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -18725,7 +18210,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":2878 + /* "sklearn/tree/_tree.pyx":2806 * _init_split(&best, end) * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -18734,7 +18219,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":2880 + /* "sklearn/tree/_tree.pyx":2808 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -18743,7 +18228,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":2882 + /* "sklearn/tree/_tree.pyx":2810 * cdef SIZE_t n_visited_features = 0 * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -18752,7 +18237,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":2884 + /* "sklearn/tree/_tree.pyx":2812 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -18761,7 +18246,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":2885 + /* "sklearn/tree/_tree.pyx":2813 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -18770,7 +18255,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":2887 + /* "sklearn/tree/_tree.pyx":2815 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -18779,7 +18264,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":2892 + /* "sklearn/tree/_tree.pyx":2820 * cdef SIZE_t p_next * cdef SIZE_t p_prev * cdef bint is_samples_sorted = 0 # indicate is sorted_samples is # <<<<<<<<<<<<<< @@ -18788,7 +18273,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_is_samples_sorted = 0; - /* "sklearn/tree/_tree.pyx":2909 + /* "sklearn/tree/_tree.pyx":2837 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -18803,7 +18288,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2911 + /* "sklearn/tree/_tree.pyx":2839 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -18817,7 +18302,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2913 + /* "sklearn/tree/_tree.pyx":2841 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -18829,7 +18314,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L5_bool_binop_done:; if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2915 + /* "sklearn/tree/_tree.pyx":2843 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -18838,7 +18323,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":2929 + /* "sklearn/tree/_tree.pyx":2857 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -18847,7 +18332,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":2932 + /* "sklearn/tree/_tree.pyx":2860 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -18857,7 +18342,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2934 + /* "sklearn/tree/_tree.pyx":2862 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -18866,7 +18351,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2935 + /* "sklearn/tree/_tree.pyx":2863 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -18875,7 +18360,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":2936 + /* "sklearn/tree/_tree.pyx":2864 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -18884,7 +18369,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":2938 + /* "sklearn/tree/_tree.pyx":2866 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -18896,7 +18381,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2942 + /* "sklearn/tree/_tree.pyx":2870 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -18905,7 +18390,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":2945 + /* "sklearn/tree/_tree.pyx":2873 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -18914,7 +18399,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":2946 + /* "sklearn/tree/_tree.pyx":2874 * * current.feature = features[f_j] * self.extract_nnz(current.feature, # <<<<<<<<<<<<<< @@ -18923,7 +18408,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_current.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":2951 + /* "sklearn/tree/_tree.pyx":2879 * * # Sort the positive and negative parts of `Xf` * sort(Xf + start, samples + start, end_negative - start) # <<<<<<<<<<<<<< @@ -18932,7 +18417,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_sort((__pyx_v_Xf + __pyx_v_start), (__pyx_v_samples + __pyx_v_start), (__pyx_v_end_negative - __pyx_v_start)); - /* "sklearn/tree/_tree.pyx":2952 + /* "sklearn/tree/_tree.pyx":2880 * # Sort the positive and negative parts of `Xf` * sort(Xf + start, samples + start, end_negative - start) * sort(Xf + start_positive, samples + start_positive, # <<<<<<<<<<<<<< @@ -18941,7 +18426,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_sort((__pyx_v_Xf + __pyx_v_start_positive), (__pyx_v_samples + __pyx_v_start_positive), (__pyx_v_end - __pyx_v_start_positive)); - /* "sklearn/tree/_tree.pyx":2956 + /* "sklearn/tree/_tree.pyx":2884 * * # Update index_to_samples to take into account the sort * for p in range(start, end_negative): # <<<<<<<<<<<<<< @@ -18952,7 +18437,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2957 + /* "sklearn/tree/_tree.pyx":2885 * # Update index_to_samples to take into account the sort * for p in range(start, end_negative): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -18962,7 +18447,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_p])]) = __pyx_v_p; } - /* "sklearn/tree/_tree.pyx":2958 + /* "sklearn/tree/_tree.pyx":2886 * for p in range(start, end_negative): * index_to_samples[samples[p]] = p * for p in range(start_positive, end): # <<<<<<<<<<<<<< @@ -18973,7 +18458,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct for (__pyx_t_8 = __pyx_v_start_positive; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2959 + /* "sklearn/tree/_tree.pyx":2887 * index_to_samples[samples[p]] = p * for p in range(start_positive, end): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -18983,7 +18468,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct (__pyx_v_index_to_samples[(__pyx_v_samples[__pyx_v_p])]) = __pyx_v_p; } - /* "sklearn/tree/_tree.pyx":2962 + /* "sklearn/tree/_tree.pyx":2890 * * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: # <<<<<<<<<<<<<< @@ -18993,7 +18478,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_end_negative < __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2963 + /* "sklearn/tree/_tree.pyx":2891 * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: * start_positive -= 1 # <<<<<<<<<<<<<< @@ -19002,7 +18487,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_start_positive = (__pyx_v_start_positive - 1); - /* "sklearn/tree/_tree.pyx":2964 + /* "sklearn/tree/_tree.pyx":2892 * if end_negative < start_positive: * start_positive -= 1 * Xf[start_positive] = 0. # <<<<<<<<<<<<<< @@ -19011,7 +18496,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_Xf[__pyx_v_start_positive]) = 0.; - /* "sklearn/tree/_tree.pyx":2966 + /* "sklearn/tree/_tree.pyx":2894 * Xf[start_positive] = 0. * * if end_negative != start_positive: # <<<<<<<<<<<<<< @@ -19021,7 +18506,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_end_negative != __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2967 + /* "sklearn/tree/_tree.pyx":2895 * * if end_negative != start_positive: * Xf[end_negative] = 0. # <<<<<<<<<<<<<< @@ -19030,7 +18515,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_Xf[__pyx_v_end_negative]) = 0.; - /* "sklearn/tree/_tree.pyx":2968 + /* "sklearn/tree/_tree.pyx":2896 * if end_negative != start_positive: * Xf[end_negative] = 0. * end_negative += 1 # <<<<<<<<<<<<<< @@ -19045,7 +18530,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":2970 + /* "sklearn/tree/_tree.pyx":2898 * end_negative += 1 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -19055,7 +18540,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_Xf[(__pyx_v_end - 1)]) <= ((__pyx_v_Xf[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2971 + /* "sklearn/tree/_tree.pyx":2899 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -19064,7 +18549,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":2972 + /* "sklearn/tree/_tree.pyx":2900 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -19074,7 +18559,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2974 + /* "sklearn/tree/_tree.pyx":2902 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -19083,7 +18568,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":2975 + /* "sklearn/tree/_tree.pyx":2903 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -19095,7 +18580,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2978 + /* "sklearn/tree/_tree.pyx":2906 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -19104,7 +18589,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":2979 + /* "sklearn/tree/_tree.pyx":2907 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -19116,7 +18601,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2982 + /* "sklearn/tree/_tree.pyx":2910 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -19125,7 +18610,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":2983 + /* "sklearn/tree/_tree.pyx":2911 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -19134,7 +18619,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2985 + /* "sklearn/tree/_tree.pyx":2913 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -19145,7 +18630,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2986 + /* "sklearn/tree/_tree.pyx":2914 * * while p < end: * if p + 1 != end_negative: # <<<<<<<<<<<<<< @@ -19155,7 +18640,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_p + 1) != __pyx_v_end_negative) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2987 + /* "sklearn/tree/_tree.pyx":2915 * while p < end: * if p + 1 != end_negative: * p_next = p + 1 # <<<<<<<<<<<<<< @@ -19167,7 +18652,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2989 + /* "sklearn/tree/_tree.pyx":2917 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< @@ -19178,7 +18663,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":2991 + /* "sklearn/tree/_tree.pyx":2919 * p_next = start_positive * * while (p_next < end and # <<<<<<<<<<<<<< @@ -19193,7 +18678,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L21_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2992 + /* "sklearn/tree/_tree.pyx":2920 * * while (p_next < end and * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -19205,7 +18690,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L21_bool_binop_done:; if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2993 + /* "sklearn/tree/_tree.pyx":2921 * while (p_next < end and * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): * p = p_next # <<<<<<<<<<<<<< @@ -19214,7 +18699,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_p_next; - /* "sklearn/tree/_tree.pyx":2994 + /* "sklearn/tree/_tree.pyx":2922 * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): * p = p_next * if p + 1 != end_negative: # <<<<<<<<<<<<<< @@ -19224,7 +18709,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = (((__pyx_v_p + 1) != __pyx_v_end_negative) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2995 + /* "sklearn/tree/_tree.pyx":2923 * p = p_next * if p + 1 != end_negative: * p_next = p + 1 # <<<<<<<<<<<<<< @@ -19236,7 +18721,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2997 + /* "sklearn/tree/_tree.pyx":2925 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< @@ -19248,7 +18733,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L23:; } - /* "sklearn/tree/_tree.pyx":3002 + /* "sklearn/tree/_tree.pyx":2930 * # (p_next >= end) or (X[samples[p_next], current.feature] > * # X[samples[p], current.feature]) * p_prev = p # <<<<<<<<<<<<<< @@ -19257,7 +18742,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p_prev = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":3003 + /* "sklearn/tree/_tree.pyx":2931 * # X[samples[p], current.feature]) * p_prev = p * p = p_next # <<<<<<<<<<<<<< @@ -19266,7 +18751,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_p_next; - /* "sklearn/tree/_tree.pyx":3008 + /* "sklearn/tree/_tree.pyx":2936 * * * if p < end: # <<<<<<<<<<<<<< @@ -19276,7 +18761,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3009 + /* "sklearn/tree/_tree.pyx":2937 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -19285,7 +18770,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":3012 + /* "sklearn/tree/_tree.pyx":2940 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -19299,7 +18784,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L26_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3013 + /* "sklearn/tree/_tree.pyx":2941 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -19311,7 +18796,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L26_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3014 + /* "sklearn/tree/_tree.pyx":2942 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -19321,7 +18806,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L16_continue; } - /* "sklearn/tree/_tree.pyx":3016 + /* "sklearn/tree/_tree.pyx":2944 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -19330,7 +18815,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":3019 + /* "sklearn/tree/_tree.pyx":2947 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -19344,7 +18829,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L29_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3020 + /* "sklearn/tree/_tree.pyx":2948 * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< @@ -19356,7 +18841,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L29_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3021 + /* "sklearn/tree/_tree.pyx":2949 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -19366,7 +18851,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L16_continue; } - /* "sklearn/tree/_tree.pyx":3023 + /* "sklearn/tree/_tree.pyx":2951 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -19375,7 +18860,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":3024 + /* "sklearn/tree/_tree.pyx":2952 * * current.improvement = self.criterion.impurity_improvement(impurity) * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -19385,7 +18870,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3025 + /* "sklearn/tree/_tree.pyx":2953 * current.improvement = self.criterion.impurity_improvement(impurity) * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -19394,7 +18879,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":3028 + /* "sklearn/tree/_tree.pyx":2956 * ¤t.impurity_right) * * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< @@ -19403,7 +18888,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.threshold = (((__pyx_v_Xf[__pyx_v_p_prev]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); - /* "sklearn/tree/_tree.pyx":3029 + /* "sklearn/tree/_tree.pyx":2957 * * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -19413,7 +18898,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3030 + /* "sklearn/tree/_tree.pyx":2958 * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: * current.threshold = Xf[p_prev] # <<<<<<<<<<<<<< @@ -19425,7 +18910,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L32:; - /* "sklearn/tree/_tree.pyx":3032 + /* "sklearn/tree/_tree.pyx":2960 * current.threshold = Xf[p_prev] * * best = current # <<<<<<<<<<<<<< @@ -19447,7 +18932,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":3035 + /* "sklearn/tree/_tree.pyx":2963 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -19457,7 +18942,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_t_6 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3036 + /* "sklearn/tree/_tree.pyx":2964 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * self.extract_nnz(best.feature, &end_negative, &start_positive, # <<<<<<<<<<<<<< @@ -19466,7 +18951,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":3039 + /* "sklearn/tree/_tree.pyx":2967 * &is_samples_sorted) * * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< @@ -19478,7 +18963,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L33:; - /* "sklearn/tree/_tree.pyx":3045 + /* "sklearn/tree/_tree.pyx":2973 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -19487,7 +18972,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":3048 + /* "sklearn/tree/_tree.pyx":2976 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -19496,7 +18981,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":3053 + /* "sklearn/tree/_tree.pyx":2981 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -19505,7 +18990,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":3054 + /* "sklearn/tree/_tree.pyx":2982 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -19514,7 +18999,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":2849 + /* "sklearn/tree/_tree.pyx":2777 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -19525,7 +19010,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":3060 +/* "sklearn/tree/_tree.pyx":2988 * """Splitter for finding a random split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -19558,7 +19043,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":3061 + /* "sklearn/tree/_tree.pyx":2989 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -19567,44 +19052,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":3062 + /* "sklearn/tree/_tree.pyx":2990 * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.min_weight_leaf, */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3063 + /* "sklearn/tree/_tree.pyx":2991 * return (RandomSparseSplitter, (self.criterion, * self.max_features, * self.min_samples_leaf, # <<<<<<<<<<<<<< * self.min_weight_leaf, * self.random_state), self.__getstate__()) */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3063; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":3064 + /* "sklearn/tree/_tree.pyx":2992 * self.max_features, * self.min_samples_leaf, * self.min_weight_leaf, # <<<<<<<<<<<<<< * self.random_state), self.__getstate__()) * */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3061 + /* "sklearn/tree/_tree.pyx":2989 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.criterion)); @@ -19622,14 +19107,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":3065 + /* "sklearn/tree/_tree.pyx":2993 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -19642,22 +19127,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":3061 + /* "sklearn/tree/_tree.pyx":2989 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter))); @@ -19672,7 +19157,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3060 + /* "sklearn/tree/_tree.pyx":2988 * """Splitter for finding a random split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -19694,7 +19179,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3067 +/* "sklearn/tree/_tree.pyx":2995 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -19745,7 +19230,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru int __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; - /* "sklearn/tree/_tree.pyx":3073 + /* "sklearn/tree/_tree.pyx":3001 * """ * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -19755,7 +19240,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3074 + /* "sklearn/tree/_tree.pyx":3002 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -19765,7 +19250,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3075 + /* "sklearn/tree/_tree.pyx":3003 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -19775,7 +19260,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3077 + /* "sklearn/tree/_tree.pyx":3005 * cdef SIZE_t end = self.end * * cdef INT32_t* X_indices = self.X_indices # <<<<<<<<<<<<<< @@ -19785,7 +19270,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_3 = __pyx_v_self->__pyx_base.X_indices; __pyx_v_X_indices = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":3078 + /* "sklearn/tree/_tree.pyx":3006 * * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr # <<<<<<<<<<<<<< @@ -19795,7 +19280,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_3 = __pyx_v_self->__pyx_base.X_indptr; __pyx_v_X_indptr = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":3079 + /* "sklearn/tree/_tree.pyx":3007 * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr * cdef DTYPE_t* X_data = self.X_data # <<<<<<<<<<<<<< @@ -19805,7 +19290,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_4 = __pyx_v_self->__pyx_base.X_data; __pyx_v_X_data = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":3081 + /* "sklearn/tree/_tree.pyx":3009 * cdef DTYPE_t* X_data = self.X_data * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -19815,7 +19300,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3082 + /* "sklearn/tree/_tree.pyx":3010 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -19825,7 +19310,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3083 + /* "sklearn/tree/_tree.pyx":3011 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -19835,7 +19320,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3085 + /* "sklearn/tree/_tree.pyx":3013 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -19845,7 +19330,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":3086 + /* "sklearn/tree/_tree.pyx":3014 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples # <<<<<<<<<<<<<< @@ -19855,7 +19340,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.sorted_samples; __pyx_v_sorted_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3087 + /* "sklearn/tree/_tree.pyx":3015 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -19865,7 +19350,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_1 = __pyx_v_self->__pyx_base.index_to_samples; __pyx_v_index_to_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3088 + /* "sklearn/tree/_tree.pyx":3016 * cdef SIZE_t* sorted_samples = self.sorted_samples * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -19875,7 +19360,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3089 + /* "sklearn/tree/_tree.pyx":3017 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -19885,7 +19370,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3090 + /* "sklearn/tree/_tree.pyx":3018 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -19895,7 +19380,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3091 + /* "sklearn/tree/_tree.pyx":3019 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -19904,7 +19389,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":3094 + /* "sklearn/tree/_tree.pyx":3022 * * cdef SplitRecord best, current * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -19913,7 +19398,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":3098 + /* "sklearn/tree/_tree.pyx":3026 * cdef DTYPE_t current_feature_value * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -19922,7 +19407,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":3100 + /* "sklearn/tree/_tree.pyx":3028 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -19931,7 +19416,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":3102 + /* "sklearn/tree/_tree.pyx":3030 * cdef SIZE_t n_visited_features = 0 * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -19940,7 +19425,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":3104 + /* "sklearn/tree/_tree.pyx":3032 * cdef SIZE_t n_found_constants = 0 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 # <<<<<<<<<<<<<< @@ -19949,7 +19434,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":3105 + /* "sklearn/tree/_tree.pyx":3033 * # Number of features known to be constant and drawn without replacement * cdef SIZE_t n_drawn_constants = 0 * cdef SIZE_t n_known_constants = n_constant_features[0] # <<<<<<<<<<<<<< @@ -19958,7 +19443,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_known_constants = (__pyx_v_n_constant_features[0]); - /* "sklearn/tree/_tree.pyx":3107 + /* "sklearn/tree/_tree.pyx":3035 * cdef SIZE_t n_known_constants = n_constant_features[0] * # n_total_constants = n_known_constants + n_found_constants * cdef SIZE_t n_total_constants = n_known_constants # <<<<<<<<<<<<<< @@ -19967,7 +19452,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":3113 + /* "sklearn/tree/_tree.pyx":3041 * cdef DTYPE_t max_feature_value * * cdef bint is_samples_sorted = 0 # indicate that sorted_samples is # <<<<<<<<<<<<<< @@ -19976,7 +19461,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_is_samples_sorted = 0; - /* "sklearn/tree/_tree.pyx":3130 + /* "sklearn/tree/_tree.pyx":3058 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -19991,7 +19476,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3132 + /* "sklearn/tree/_tree.pyx":3060 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -20005,7 +19490,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3134 + /* "sklearn/tree/_tree.pyx":3062 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -20017,7 +19502,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L5_bool_binop_done:; if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":3136 + /* "sklearn/tree/_tree.pyx":3064 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -20026,7 +19511,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":3150 + /* "sklearn/tree/_tree.pyx":3078 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -20035,7 +19520,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_j = __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_v_n_drawn_constants, (__pyx_v_f_i - __pyx_v_n_found_constants), __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":3153 + /* "sklearn/tree/_tree.pyx":3081 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -20045,7 +19530,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3155 + /* "sklearn/tree/_tree.pyx":3083 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -20054,7 +19539,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_tmp = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":3156 + /* "sklearn/tree/_tree.pyx":3084 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -20063,7 +19548,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_drawn_constants]); - /* "sklearn/tree/_tree.pyx":3157 + /* "sklearn/tree/_tree.pyx":3085 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -20072,7 +19557,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_features[__pyx_v_n_drawn_constants]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":3159 + /* "sklearn/tree/_tree.pyx":3087 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -20084,7 +19569,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3163 + /* "sklearn/tree/_tree.pyx":3091 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -20093,7 +19578,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_j = (__pyx_v_f_j + __pyx_v_n_found_constants); - /* "sklearn/tree/_tree.pyx":3166 + /* "sklearn/tree/_tree.pyx":3094 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -20102,7 +19587,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.feature = (__pyx_v_features[__pyx_v_f_j]); - /* "sklearn/tree/_tree.pyx":3168 + /* "sklearn/tree/_tree.pyx":3096 * current.feature = features[f_j] * * self.extract_nnz(current.feature, # <<<<<<<<<<<<<< @@ -20111,7 +19596,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_current.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":3173 + /* "sklearn/tree/_tree.pyx":3101 * * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: # <<<<<<<<<<<<<< @@ -20121,7 +19606,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_end_negative < __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3174 + /* "sklearn/tree/_tree.pyx":3102 * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: * start_positive -= 1 # <<<<<<<<<<<<<< @@ -20130,7 +19615,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_start_positive = (__pyx_v_start_positive - 1); - /* "sklearn/tree/_tree.pyx":3175 + /* "sklearn/tree/_tree.pyx":3103 * if end_negative < start_positive: * start_positive -= 1 * Xf[start_positive] = 0. # <<<<<<<<<<<<<< @@ -20139,7 +19624,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_Xf[__pyx_v_start_positive]) = 0.; - /* "sklearn/tree/_tree.pyx":3177 + /* "sklearn/tree/_tree.pyx":3105 * Xf[start_positive] = 0. * * if end_negative != start_positive: # <<<<<<<<<<<<<< @@ -20149,7 +19634,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_end_negative != __pyx_v_start_positive) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3178 + /* "sklearn/tree/_tree.pyx":3106 * * if end_negative != start_positive: * Xf[end_negative] = 0. # <<<<<<<<<<<<<< @@ -20158,7 +19643,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_Xf[__pyx_v_end_negative]) = 0.; - /* "sklearn/tree/_tree.pyx":3179 + /* "sklearn/tree/_tree.pyx":3107 * if end_negative != start_positive: * Xf[end_negative] = 0. * end_negative += 1 # <<<<<<<<<<<<<< @@ -20173,7 +19658,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":3182 + /* "sklearn/tree/_tree.pyx":3110 * * # Find min, max in Xf[start:end_negative] * min_feature_value = Xf[start] # <<<<<<<<<<<<<< @@ -20182,7 +19667,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_min_feature_value = (__pyx_v_Xf[__pyx_v_start]); - /* "sklearn/tree/_tree.pyx":3183 + /* "sklearn/tree/_tree.pyx":3111 * # Find min, max in Xf[start:end_negative] * min_feature_value = Xf[start] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -20191,7 +19676,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_max_feature_value = __pyx_v_min_feature_value; - /* "sklearn/tree/_tree.pyx":3185 + /* "sklearn/tree/_tree.pyx":3113 * max_feature_value = min_feature_value * * for p in range(start, end_negative): # <<<<<<<<<<<<<< @@ -20202,7 +19687,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":3186 + /* "sklearn/tree/_tree.pyx":3114 * * for p in range(start, end_negative): * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -20211,7 +19696,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current_feature_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":3188 + /* "sklearn/tree/_tree.pyx":3116 * current_feature_value = Xf[p] * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -20221,7 +19706,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3189 + /* "sklearn/tree/_tree.pyx":3117 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -20232,7 +19717,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L13; } - /* "sklearn/tree/_tree.pyx":3190 + /* "sklearn/tree/_tree.pyx":3118 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -20242,7 +19727,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3191 + /* "sklearn/tree/_tree.pyx":3119 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -20255,7 +19740,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":3194 + /* "sklearn/tree/_tree.pyx":3122 * * # Update min, max given Xf[start_positive:end] * for p in range(start_positive, end): # <<<<<<<<<<<<<< @@ -20266,7 +19751,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru for (__pyx_t_8 = __pyx_v_start_positive; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":3195 + /* "sklearn/tree/_tree.pyx":3123 * # Update min, max given Xf[start_positive:end] * for p in range(start_positive, end): * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -20275,7 +19760,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current_feature_value = (__pyx_v_Xf[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":3197 + /* "sklearn/tree/_tree.pyx":3125 * current_feature_value = Xf[p] * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -20285,7 +19770,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3198 + /* "sklearn/tree/_tree.pyx":3126 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -20296,7 +19781,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L16; } - /* "sklearn/tree/_tree.pyx":3199 + /* "sklearn/tree/_tree.pyx":3127 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -20306,7 +19791,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3200 + /* "sklearn/tree/_tree.pyx":3128 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -20319,7 +19804,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L16:; } - /* "sklearn/tree/_tree.pyx":3202 + /* "sklearn/tree/_tree.pyx":3130 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -20329,7 +19814,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_max_feature_value <= (__pyx_v_min_feature_value + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3203 + /* "sklearn/tree/_tree.pyx":3131 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -20338,7 +19823,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":3204 + /* "sklearn/tree/_tree.pyx":3132 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -20348,7 +19833,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_2 = __pyx_v_current.feature; (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3206 + /* "sklearn/tree/_tree.pyx":3134 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -20357,7 +19842,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":3207 + /* "sklearn/tree/_tree.pyx":3135 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -20369,7 +19854,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3210 + /* "sklearn/tree/_tree.pyx":3138 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -20378,7 +19863,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":3211 + /* "sklearn/tree/_tree.pyx":3139 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -20390,7 +19875,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":3214 + /* "sklearn/tree/_tree.pyx":3142 * * # Draw a random threshold * current.threshold = rand_uniform(min_feature_value, # <<<<<<<<<<<<<< @@ -20399,7 +19884,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.threshold = __pyx_f_7sklearn_4tree_5_tree_rand_uniform(__pyx_v_min_feature_value, __pyx_v_max_feature_value, __pyx_v_random_state); - /* "sklearn/tree/_tree.pyx":3218 + /* "sklearn/tree/_tree.pyx":3146 * random_state) * * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -20409,7 +19894,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current.threshold == __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3219 + /* "sklearn/tree/_tree.pyx":3147 * * if current.threshold == max_feature_value: * current.threshold = min_feature_value # <<<<<<<<<<<<<< @@ -20421,7 +19906,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":3222 + /* "sklearn/tree/_tree.pyx":3150 * * # Partition * current.pos = self._partition(current.threshold, # <<<<<<<<<<<<<< @@ -20430,7 +19915,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.pos = __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_current.threshold, __pyx_v_end_negative, __pyx_v_start_positive, (__pyx_v_start_positive + ((__pyx_v_Xf[__pyx_v_start_positive]) == 0.))); - /* "sklearn/tree/_tree.pyx":3229 + /* "sklearn/tree/_tree.pyx":3157 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -20444,7 +19929,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L20_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3230 + /* "sklearn/tree/_tree.pyx":3158 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -20456,7 +19941,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L20_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3231 + /* "sklearn/tree/_tree.pyx":3159 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -20466,7 +19951,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":3234 + /* "sklearn/tree/_tree.pyx":3162 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -20475,7 +19960,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":3235 + /* "sklearn/tree/_tree.pyx":3163 * # Evaluate split * self.criterion.reset() * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -20484,7 +19969,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":3238 + /* "sklearn/tree/_tree.pyx":3166 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -20498,7 +19983,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3239 + /* "sklearn/tree/_tree.pyx":3167 * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): # <<<<<<<<<<<<<< @@ -20510,7 +19995,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L23_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3240 + /* "sklearn/tree/_tree.pyx":3168 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -20520,7 +20005,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":3242 + /* "sklearn/tree/_tree.pyx":3170 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -20529,7 +20014,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":3244 + /* "sklearn/tree/_tree.pyx":3172 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -20539,7 +20024,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3245 + /* "sklearn/tree/_tree.pyx":3173 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -20548,7 +20033,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":3247 + /* "sklearn/tree/_tree.pyx":3175 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) * best = current # <<<<<<<<<<<<<< @@ -20566,7 +20051,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":3250 + /* "sklearn/tree/_tree.pyx":3178 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: # <<<<<<<<<<<<<< @@ -20584,7 +20069,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L27_bool_binop_done:; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3251 + /* "sklearn/tree/_tree.pyx":3179 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: * self.extract_nnz(best.feature, &end_negative, &start_positive, # <<<<<<<<<<<<<< @@ -20593,7 +20078,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.feature, (&__pyx_v_end_negative), (&__pyx_v_start_positive), (&__pyx_v_is_samples_sorted)); - /* "sklearn/tree/_tree.pyx":3254 + /* "sklearn/tree/_tree.pyx":3182 * &is_samples_sorted) * * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< @@ -20605,7 +20090,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L26:; - /* "sklearn/tree/_tree.pyx":3260 + /* "sklearn/tree/_tree.pyx":3188 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -20614,7 +20099,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ memcpy(__pyx_v_features, __pyx_v_constant_features, ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_known_constants)); - /* "sklearn/tree/_tree.pyx":3263 + /* "sklearn/tree/_tree.pyx":3191 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -20623,7 +20108,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ memcpy((__pyx_v_constant_features + __pyx_v_n_known_constants), (__pyx_v_features + __pyx_v_n_known_constants), ((sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)) * __pyx_v_n_found_constants)); - /* "sklearn/tree/_tree.pyx":3268 + /* "sklearn/tree/_tree.pyx":3196 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -20632,7 +20117,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":3269 + /* "sklearn/tree/_tree.pyx":3197 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -20641,7 +20126,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":3067 + /* "sklearn/tree/_tree.pyx":2995 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -20652,7 +20137,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru /* function exit code */ } -/* "sklearn/tree/_tree.pyx":3278 +/* "sklearn/tree/_tree.pyx":3206 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20663,7 +20148,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, CYTHON_UNUSED PyObject *__pyx_v_X, CYTHON_UNUSED PyArrayObject *__pyx_v_y, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args) { - /* "sklearn/tree/_tree.pyx":3279 + /* "sklearn/tree/_tree.pyx":3207 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -20689,7 +20174,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED } } - /* "sklearn/tree/_tree.pyx":3278 + /* "sklearn/tree/_tree.pyx":3206 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20700,7 +20185,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build)) { __Pyx_XDECREF(__pyx_r); @@ -20717,7 +20202,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -20734,7 +20219,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -20746,7 +20231,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3280 + /* "sklearn/tree/_tree.pyx":3208 * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): * """Build a decision tree from the training set (X, y).""" # <<<<<<<<<<<<<< @@ -20771,7 +20256,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3278 +/* "sklearn/tree/_tree.pyx":3206 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20797,7 +20282,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_X,&__pyx_n_s_y,&__pyx_n_s_sample_weight,0}; PyObject* values[4] = {0,0,0,0}; - /* "sklearn/tree/_tree.pyx":3279 + /* "sklearn/tree/_tree.pyx":3207 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -20824,12 +20309,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -20838,7 +20323,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20857,18 +20342,18 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build(PyObject *_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.TreeBuilder.build", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":3278 + /* "sklearn/tree/_tree.pyx":3206 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20897,7 +20382,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.sample_weight = __pyx_v_sample_weight; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder->build(__pyx_v_self, __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder->build(__pyx_v_self, __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20914,7 +20399,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3283 +/* "sklearn/tree/_tree.pyx":3211 * pass * * cdef inline _check_input(self, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20940,14 +20425,14 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __Pyx_INCREF((PyObject *)__pyx_v_y); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":3286 + /* "sklearn/tree/_tree.pyx":3214 * np.ndarray sample_weight): * """Check input dtype, layout and format""" * if issparse(X): # <<<<<<<<<<<<<< * X = X.tocsc() * X.sort_indices() */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -20960,32 +20445,32 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_X); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":3287 + /* "sklearn/tree/_tree.pyx":3215 * """Check input dtype, layout and format""" * if issparse(X): * X = X.tocsc() # <<<<<<<<<<<<<< * X.sort_indices() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_tocsc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -20998,24 +20483,24 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } } if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3288 + /* "sklearn/tree/_tree.pyx":3216 * if issparse(X): * X = X.tocsc() * X.sort_indices() # <<<<<<<<<<<<<< * * if X.data.dtype != DTYPE: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -21028,176 +20513,176 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } } if (__pyx_t_4) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3290 + /* "sklearn/tree/_tree.pyx":3218 * X.sort_indices() * * if X.data.dtype != DTYPE: # <<<<<<<<<<<<<< * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":3291 + /* "sklearn/tree/_tree.pyx":3219 * * if X.data.dtype != DTYPE: * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) # <<<<<<<<<<<<<< * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_X, __pyx_n_s_data, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_PyObject_SetAttrStr(__pyx_v_X, __pyx_n_s_data, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4; } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":3293 + /* "sklearn/tree/_tree.pyx":3221 * X.data = np.ascontiguousarray(X.data, dtype=DTYPE) * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: # <<<<<<<<<<<<<< * raise ValueError("No support for np.int64 index based " * "sparse matrices") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_6; __pyx_L6_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":3294 + /* "sklearn/tree/_tree.pyx":3222 * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: * raise ValueError("No support for np.int64 index based " # <<<<<<<<<<<<<< * "sparse matrices") * */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } goto __pyx_L3; } - /* "sklearn/tree/_tree.pyx":3297 + /* "sklearn/tree/_tree.pyx":3225 * "sparse matrices") * * elif X.dtype != DTYPE: # <<<<<<<<<<<<<< * # since we have to copy we will make it fortran for efficiency * X = np.asfortranarray(X, dtype=DTYPE) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":3299 + /* "sklearn/tree/_tree.pyx":3227 * elif X.dtype != DTYPE: * # since we have to copy we will make it fortran for efficiency * X = np.asfortranarray(X, dtype=DTYPE) # <<<<<<<<<<<<<< * * if y.dtype != DOUBLE or not y.flags.contiguous: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_X); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -21208,75 +20693,75 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3301 + /* "sklearn/tree/_tree.pyx":3229 * X = np.asfortranarray(X, dtype=DTYPE) * * if y.dtype != DOUBLE or not y.flags.contiguous: # <<<<<<<<<<<<<< * y = np.ascontiguousarray(y, dtype=DOUBLE) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L9_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = ((!__pyx_t_6) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L9_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":3302 + /* "sklearn/tree/_tree.pyx":3230 * * if y.dtype != DOUBLE or not y.flags.contiguous: * y = np.ascontiguousarray(y, dtype=DOUBLE) # <<<<<<<<<<<<<< * * if (sample_weight is not None and */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_y)); __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_y)); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_4)); __pyx_t_4 = 0; goto __pyx_L8; } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":3304 + /* "sklearn/tree/_tree.pyx":3232 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * if (sample_weight is not None and # <<<<<<<<<<<<<< @@ -21291,21 +20776,21 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON goto __pyx_L12_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3305 + /* "sklearn/tree/_tree.pyx":3233 * * if (sample_weight is not None and * (sample_weight.dtype != DOUBLE or # <<<<<<<<<<<<<< * not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, dtype=DOUBLE, */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { @@ -21313,62 +20798,62 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON goto __pyx_L12_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3306 + /* "sklearn/tree/_tree.pyx":3234 * if (sample_weight is not None and * (sample_weight.dtype != DOUBLE or * not sample_weight.flags.contiguous)): # <<<<<<<<<<<<<< * sample_weight = np.asarray(sample_weight, dtype=DOUBLE, * order="C") */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = ((!__pyx_t_6) != 0); __pyx_t_5 = __pyx_t_7; __pyx_L12_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":3307 + /* "sklearn/tree/_tree.pyx":3235 * (sample_weight.dtype != DOUBLE or * not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, dtype=DOUBLE, # <<<<<<<<<<<<<< * order="C") * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; goto __pyx_L11; } __pyx_L11:; - /* "sklearn/tree/_tree.pyx":3310 + /* "sklearn/tree/_tree.pyx":3238 * order="C") * * return X, y, sample_weight # <<<<<<<<<<<<<< @@ -21376,7 +20861,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON * # Depth first builder --------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -21391,7 +20876,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3283 + /* "sklearn/tree/_tree.pyx":3211 * pass * * cdef inline _check_input(self, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21416,7 +20901,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3317 +/* "sklearn/tree/_tree.pyx":3245 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -21461,26 +20946,26 @@ static int __pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_1__cinit__(PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_split)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -21492,20 +20977,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_1__cinit__(PyO values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)values[0]); - __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3319; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_weight_leaf = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_min_weight_leaf == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3246; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3247; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.DepthFirstTreeBuilder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *)__pyx_v_self), __pyx_v_splitter, __pyx_v_min_samples_split, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_max_depth); /* function exit code */ @@ -21522,7 +21007,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":3320 + /* "sklearn/tree/_tree.pyx":3248 * SIZE_t min_samples_leaf, double min_weight_leaf, * SIZE_t max_depth): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -21535,7 +21020,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.splitter)); __pyx_v_self->__pyx_base.splitter = __pyx_v_splitter; - /* "sklearn/tree/_tree.pyx":3321 + /* "sklearn/tree/_tree.pyx":3249 * SIZE_t max_depth): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -21544,7 +21029,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.min_samples_split = __pyx_v_min_samples_split; - /* "sklearn/tree/_tree.pyx":3322 + /* "sklearn/tree/_tree.pyx":3250 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -21553,7 +21038,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.min_samples_leaf = __pyx_v_min_samples_leaf; - /* "sklearn/tree/_tree.pyx":3323 + /* "sklearn/tree/_tree.pyx":3251 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -21562,7 +21047,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.min_weight_leaf = __pyx_v_min_weight_leaf; - /* "sklearn/tree/_tree.pyx":3324 + /* "sklearn/tree/_tree.pyx":3252 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -21571,7 +21056,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru */ __pyx_v_self->__pyx_base.max_depth = __pyx_v_max_depth; - /* "sklearn/tree/_tree.pyx":3317 + /* "sklearn/tree/_tree.pyx":3245 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -21585,7 +21070,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3326 +/* "sklearn/tree/_tree.pyx":3254 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21596,12 +21081,12 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build *__pyx_optional_args) { - /* "sklearn/tree/_tree.pyx":3327 + /* "sklearn/tree/_tree.pyx":3255 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< * """Build a decision tree from the training set (X, y).""" - * + * # check input */ PyArrayObject *__pyx_v_sample_weight = ((PyArrayObject *)Py_None); __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight_ptr; @@ -21658,7 +21143,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF((PyObject *)__pyx_v_y); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":3326 + /* "sklearn/tree/_tree.pyx":3254 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21669,7 +21154,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build)) { __Pyx_XDECREF(__pyx_r); @@ -21686,7 +21171,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -21703,7 +21188,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -21715,14 +21200,14 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3331 - * + /* "sklearn/tree/_tree.pyx":3258 + * """Build a decision tree from the training set (X, y).""" * # check input * X, y, sample_weight = self._check_input(X, y, sample_weight) # <<<<<<<<<<<<<< * * cdef DOUBLE_t* sample_weight_ptr = NULL */ - __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -21734,7 +21219,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -21750,17 +21235,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -21770,7 +21255,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; @@ -21778,11 +21263,11 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_3)); @@ -21790,7 +21275,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "sklearn/tree/_tree.pyx":3333 + /* "sklearn/tree/_tree.pyx":3260 * X, y, sample_weight = self._check_input(X, y, sample_weight) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -21799,7 +21284,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":3334 + /* "sklearn/tree/_tree.pyx":3261 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -21810,7 +21295,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3335 + /* "sklearn/tree/_tree.pyx":3262 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -21822,7 +21307,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":3340 + /* "sklearn/tree/_tree.pyx":3267 * cdef int init_capacity * * if tree.max_depth <= 10: # <<<<<<<<<<<<<< @@ -21832,7 +21317,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_tree->max_depth <= 10) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3341 + /* "sklearn/tree/_tree.pyx":3268 * * if tree.max_depth <= 10: * init_capacity = (2 ** (tree.max_depth + 1)) - 1 # <<<<<<<<<<<<<< @@ -21844,7 +21329,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":3343 + /* "sklearn/tree/_tree.pyx":3270 * init_capacity = (2 ** (tree.max_depth + 1)) - 1 * else: * init_capacity = 2047 # <<<<<<<<<<<<<< @@ -21855,16 +21340,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":3345 + /* "sklearn/tree/_tree.pyx":3272 * init_capacity = 2047 * * tree._resize(init_capacity) # <<<<<<<<<<<<<< * * # Parameters */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3348 + /* "sklearn/tree/_tree.pyx":3275 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -21876,7 +21361,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3349 + /* "sklearn/tree/_tree.pyx":3276 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth # <<<<<<<<<<<<<< @@ -21886,7 +21371,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_self->__pyx_base.max_depth; __pyx_v_max_depth = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3350 + /* "sklearn/tree/_tree.pyx":3277 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -21896,7 +21381,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3351 + /* "sklearn/tree/_tree.pyx":3278 * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -21906,7 +21391,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_11 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":3352 + /* "sklearn/tree/_tree.pyx":3279 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef SIZE_t min_samples_split = self.min_samples_split # <<<<<<<<<<<<<< @@ -21916,16 +21401,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_split; __pyx_v_min_samples_split = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3355 + /* "sklearn/tree/_tree.pyx":3282 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< * * cdef SIZE_t start */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3362 + /* "sklearn/tree/_tree.pyx":3289 * cdef SIZE_t parent * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -21935,7 +21420,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_splitter->n_samples; __pyx_v_n_node_samples = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3363 + /* "sklearn/tree/_tree.pyx":3290 * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -21945,7 +21430,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_11 = __pyx_v_splitter->weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":3369 + /* "sklearn/tree/_tree.pyx":3296 * * cdef double threshold * cdef double impurity = INFINITY # <<<<<<<<<<<<<< @@ -21954,7 +21439,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_impurity = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":3372 + /* "sklearn/tree/_tree.pyx":3299 * cdef SIZE_t n_constant_features * cdef bint is_leaf * cdef bint first = 1 # <<<<<<<<<<<<<< @@ -21963,7 +21448,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_first = 1; - /* "sklearn/tree/_tree.pyx":3373 + /* "sklearn/tree/_tree.pyx":3300 * cdef bint is_leaf * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -21972,7 +21457,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":3374 + /* "sklearn/tree/_tree.pyx":3301 * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -21981,27 +21466,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":3376 + /* "sklearn/tree/_tree.pyx":3303 * cdef int rc = 0 * * cdef Stack stack = Stack(INITIAL_STACK_SIZE) # <<<<<<<<<<<<<< * cdef StackRecord stack_record * */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_stack = ((struct __pyx_obj_7sklearn_4tree_6_utils_Stack *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3380 + /* "sklearn/tree/_tree.pyx":3307 * * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) # <<<<<<<<<<<<<< @@ -22010,7 +21495,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->push(__pyx_v_stack, 0, __pyx_v_n_node_samples, 0, __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED, 0, __pyx_v_7sklearn_4tree_5_tree_INFINITY, 0); - /* "sklearn/tree/_tree.pyx":3381 + /* "sklearn/tree/_tree.pyx":3308 * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) * if rc == -1: # <<<<<<<<<<<<<< @@ -22020,17 +21505,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3383 + /* "sklearn/tree/_tree.pyx":3310 * if rc == -1: * # got return code -1 - out-of-memory * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3385 + /* "sklearn/tree/_tree.pyx":3312 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -22044,7 +21529,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3386 + /* "sklearn/tree/_tree.pyx":3313 * * with nogil: * while not stack.is_empty(): # <<<<<<<<<<<<<< @@ -22055,7 +21540,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((!(((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->is_empty(__pyx_v_stack) != 0)) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":3387 + /* "sklearn/tree/_tree.pyx":3314 * with nogil: * while not stack.is_empty(): * stack.pop(&stack_record) # <<<<<<<<<<<<<< @@ -22064,7 +21549,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->pop(__pyx_v_stack, (&__pyx_v_stack_record)); - /* "sklearn/tree/_tree.pyx":3389 + /* "sklearn/tree/_tree.pyx":3316 * stack.pop(&stack_record) * * start = stack_record.start # <<<<<<<<<<<<<< @@ -22074,7 +21559,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.start; __pyx_v_start = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":3390 + /* "sklearn/tree/_tree.pyx":3317 * * start = stack_record.start * end = stack_record.end # <<<<<<<<<<<<<< @@ -22084,7 +21569,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.end; __pyx_v_end = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":3391 + /* "sklearn/tree/_tree.pyx":3318 * start = stack_record.start * end = stack_record.end * depth = stack_record.depth # <<<<<<<<<<<<<< @@ -22094,7 +21579,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.depth; __pyx_v_depth = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":3392 + /* "sklearn/tree/_tree.pyx":3319 * end = stack_record.end * depth = stack_record.depth * parent = stack_record.parent # <<<<<<<<<<<<<< @@ -22104,7 +21589,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.parent; __pyx_v_parent = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":3393 + /* "sklearn/tree/_tree.pyx":3320 * depth = stack_record.depth * parent = stack_record.parent * is_left = stack_record.is_left # <<<<<<<<<<<<<< @@ -22114,7 +21599,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.is_left; __pyx_v_is_left = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":3394 + /* "sklearn/tree/_tree.pyx":3321 * parent = stack_record.parent * is_left = stack_record.is_left * impurity = stack_record.impurity # <<<<<<<<<<<<<< @@ -22124,7 +21609,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_11 = __pyx_v_stack_record.impurity; __pyx_v_impurity = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":3395 + /* "sklearn/tree/_tree.pyx":3322 * is_left = stack_record.is_left * impurity = stack_record.impurity * n_constant_features = stack_record.n_constant_features # <<<<<<<<<<<<<< @@ -22134,7 +21619,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_12 = __pyx_v_stack_record.n_constant_features; __pyx_v_n_constant_features = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":3397 + /* "sklearn/tree/_tree.pyx":3324 * n_constant_features = stack_record.n_constant_features * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -22143,7 +21628,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":3398 + /* "sklearn/tree/_tree.pyx":3325 * * n_node_samples = end - start * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -22152,7 +21637,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_reset(__pyx_v_splitter, __pyx_v_start, __pyx_v_end, (&__pyx_v_weighted_n_node_samples)); - /* "sklearn/tree/_tree.pyx":3400 + /* "sklearn/tree/_tree.pyx":3327 * splitter.node_reset(start, end, &weighted_n_node_samples) * * is_leaf = ((depth >= max_depth) or # <<<<<<<<<<<<<< @@ -22166,48 +21651,97 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3401 + /* "sklearn/tree/_tree.pyx":3328 + * + * is_leaf = ((depth >= max_depth) or + * (n_node_samples < min_samples_split) or # <<<<<<<<<<<<<< + * (n_node_samples < 2 * min_samples_leaf) or + * (weighted_n_node_samples < min_weight_leaf)) + */ + __pyx_t_8 = ((__pyx_v_n_node_samples < __pyx_v_min_samples_split) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_9 = __pyx_t_8; + goto __pyx_L13_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":3329 + * is_leaf = ((depth >= max_depth) or + * (n_node_samples < min_samples_split) or + * (n_node_samples < 2 * min_samples_leaf) or # <<<<<<<<<<<<<< + * (weighted_n_node_samples < min_weight_leaf)) + * + */ + __pyx_t_8 = ((__pyx_v_n_node_samples < (2 * __pyx_v_min_samples_leaf)) != 0); + if (!__pyx_t_8) { + } else { + __pyx_t_9 = __pyx_t_8; + goto __pyx_L13_bool_binop_done; + } + + /* "sklearn/tree/_tree.pyx":3330 + * (n_node_samples < min_samples_split) or + * (n_node_samples < 2 * min_samples_leaf) or + * (weighted_n_node_samples < min_weight_leaf)) # <<<<<<<<<<<<<< + * + * if first: + */ + __pyx_t_8 = ((__pyx_v_weighted_n_node_samples < __pyx_v_min_weight_leaf) != 0); + __pyx_t_9 = __pyx_t_8; + __pyx_L13_bool_binop_done:; + __pyx_v_is_leaf = __pyx_t_9; + + /* "sklearn/tree/_tree.pyx":3332 + * (weighted_n_node_samples < min_weight_leaf)) + * + * if first: # <<<<<<<<<<<<<< + * impurity = splitter.node_impurity() + * first = 0 + */ + __pyx_t_9 = (__pyx_v_first != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":3333 + * + * if first: + * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< + * first = 0 + * + */ + __pyx_v_impurity = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_impurity(__pyx_v_splitter); + + /* "sklearn/tree/_tree.pyx":3334 + * if first: + * impurity = splitter.node_impurity() + * first = 0 # <<<<<<<<<<<<<< * - * is_leaf = ((depth >= max_depth) or - * (n_node_samples < min_samples_split) or # <<<<<<<<<<<<<< - * (n_node_samples < 2 * min_samples_leaf) or - * (weighted_n_node_samples < min_weight_leaf)) + * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) */ - __pyx_t_8 = ((__pyx_v_n_node_samples < __pyx_v_min_samples_split) != 0); - if (!__pyx_t_8) { - } else { - __pyx_t_9 = __pyx_t_8; - goto __pyx_L13_bool_binop_done; + __pyx_v_first = 0; + goto __pyx_L17; } + __pyx_L17:; - /* "sklearn/tree/_tree.pyx":3402 - * is_leaf = ((depth >= max_depth) or - * (n_node_samples < min_samples_split) or - * (n_node_samples < 2 * min_samples_leaf) or # <<<<<<<<<<<<<< - * (weighted_n_node_samples < min_weight_leaf)) + /* "sklearn/tree/_tree.pyx":3336 + * first = 0 + * + * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) # <<<<<<<<<<<<<< * + * if not is_leaf: */ - __pyx_t_8 = ((__pyx_v_n_node_samples < (2 * __pyx_v_min_samples_leaf)) != 0); + __pyx_t_8 = (__pyx_v_is_leaf != 0); if (!__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; - goto __pyx_L13_bool_binop_done; + goto __pyx_L18_bool_binop_done; } - - /* "sklearn/tree/_tree.pyx":3403 - * (n_node_samples < min_samples_split) or - * (n_node_samples < 2 * min_samples_leaf) or - * (weighted_n_node_samples < min_weight_leaf)) # <<<<<<<<<<<<<< - * - * if not is_leaf: - */ - __pyx_t_8 = ((__pyx_v_weighted_n_node_samples < __pyx_v_min_weight_leaf) != 0); + __pyx_t_8 = ((__pyx_v_impurity <= __pyx_v_7sklearn_4tree_5_tree_MIN_IMPURITY_SPLIT) != 0); __pyx_t_9 = __pyx_t_8; - __pyx_L13_bool_binop_done:; + __pyx_L18_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":3405 - * (weighted_n_node_samples < min_weight_leaf)) + /* "sklearn/tree/_tree.pyx":3338 + * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) * * if not is_leaf: # <<<<<<<<<<<<<< * splitter.node_split(impurity, &split, &n_constant_features) @@ -22216,7 +21750,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3406 + /* "sklearn/tree/_tree.pyx":3339 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -22225,78 +21759,51 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_split(__pyx_v_splitter, __pyx_v_impurity, (&__pyx_v_split), (&__pyx_v_n_constant_features)); - /* "sklearn/tree/_tree.pyx":3407 + /* "sklearn/tree/_tree.pyx":3340 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< * - * if first: + * if impurity == 100: */ __pyx_t_8 = (__pyx_v_is_leaf != 0); if (!__pyx_t_8) { } else { __pyx_t_9 = __pyx_t_8; - goto __pyx_L18_bool_binop_done; + goto __pyx_L21_bool_binop_done; } __pyx_t_8 = ((__pyx_v_split.pos >= __pyx_v_end) != 0); __pyx_t_9 = __pyx_t_8; - __pyx_L18_bool_binop_done:; + __pyx_L21_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - goto __pyx_L17; + goto __pyx_L20; } - __pyx_L17:; + __pyx_L20:; - /* "sklearn/tree/_tree.pyx":3409 + /* "sklearn/tree/_tree.pyx":3342 * is_leaf = is_leaf or (split.pos >= end) * - * if first: # <<<<<<<<<<<<<< + * if impurity == 100: # <<<<<<<<<<<<<< * impurity = splitter.node_impurity() - * first = 0 + * #is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) */ - __pyx_t_9 = (__pyx_v_first != 0); + __pyx_t_9 = ((__pyx_v_impurity == 100.0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3410 + /* "sklearn/tree/_tree.pyx":3343 * - * if first: + * if impurity == 100: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< - * first = 0 + * #is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) * */ __pyx_v_impurity = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_impurity(__pyx_v_splitter); - - /* "sklearn/tree/_tree.pyx":3411 - * if first: - * impurity = splitter.node_impurity() - * first = 0 # <<<<<<<<<<<<<< - * - * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) - */ - __pyx_v_first = 0; - goto __pyx_L20; - } - __pyx_L20:; - - /* "sklearn/tree/_tree.pyx":3413 - * first = 0 - * - * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_8 = (__pyx_v_is_leaf != 0); - if (!__pyx_t_8) { - } else { - __pyx_t_9 = __pyx_t_8; - goto __pyx_L21_bool_binop_done; + goto __pyx_L23; } - __pyx_t_8 = ((__pyx_v_impurity <= __pyx_v_7sklearn_4tree_5_tree_MIN_IMPURITY_SPLIT) != 0); - __pyx_t_9 = __pyx_t_8; - __pyx_L21_bool_binop_done:; - __pyx_v_is_leaf = __pyx_t_9; + __pyx_L23:; - /* "sklearn/tree/_tree.pyx":3416 - * + /* "sklearn/tree/_tree.pyx":3346 + * #is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) * * node_id = tree._add_node(parent, is_left, is_leaf, split.feature, # <<<<<<<<<<<<<< * split.threshold, impurity, n_node_samples, @@ -22304,7 +21811,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_node_id = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_add_node(__pyx_v_tree, __pyx_v_parent, __pyx_v_is_left, __pyx_v_is_leaf, __pyx_v_split.feature, __pyx_v_split.threshold, __pyx_v_impurity, __pyx_v_n_node_samples, __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":3420 + /* "sklearn/tree/_tree.pyx":3350 * weighted_n_node_samples) * * if node_id == (-1): # <<<<<<<<<<<<<< @@ -22314,7 +21821,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_node_id == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3421 + /* "sklearn/tree/_tree.pyx":3351 * * if node_id == (-1): * rc = -1 # <<<<<<<<<<<<<< @@ -22323,7 +21830,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = -1; - /* "sklearn/tree/_tree.pyx":3422 + /* "sklearn/tree/_tree.pyx":3352 * if node_id == (-1): * rc = -1 * break # <<<<<<<<<<<<<< @@ -22333,7 +21840,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L12_break; } - /* "sklearn/tree/_tree.pyx":3426 + /* "sklearn/tree/_tree.pyx":3356 * # Store value for all nodes, to facilitate tree/model * # inspection and interpretation * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -22342,7 +21849,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_value(__pyx_v_splitter, (__pyx_v_tree->value + (__pyx_v_node_id * __pyx_v_tree->value_stride))); - /* "sklearn/tree/_tree.pyx":3428 + /* "sklearn/tree/_tree.pyx":3358 * splitter.node_value(tree.value + node_id * tree.value_stride) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -22352,7 +21859,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3430 + /* "sklearn/tree/_tree.pyx":3360 * if not is_leaf: * # Push right child on stack * rc = stack.push(split.pos, end, depth+1, node_id, 0, # <<<<<<<<<<<<<< @@ -22361,7 +21868,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->push(__pyx_v_stack, __pyx_v_split.pos, __pyx_v_end, (__pyx_v_depth + 1), __pyx_v_node_id, 0, __pyx_v_split.impurity_right, __pyx_v_n_constant_features); - /* "sklearn/tree/_tree.pyx":3432 + /* "sklearn/tree/_tree.pyx":3362 * rc = stack.push(split.pos, end, depth+1, node_id, 0, * split.impurity_right, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -22371,7 +21878,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3433 + /* "sklearn/tree/_tree.pyx":3363 * split.impurity_right, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -22381,7 +21888,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L12_break; } - /* "sklearn/tree/_tree.pyx":3436 + /* "sklearn/tree/_tree.pyx":3366 * * # Push left child on stack * rc = stack.push(start, split.pos, depth+1, node_id, 1, # <<<<<<<<<<<<<< @@ -22390,7 +21897,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->push(__pyx_v_stack, __pyx_v_start, __pyx_v_split.pos, (__pyx_v_depth + 1), __pyx_v_node_id, 1, __pyx_v_split.impurity_left, __pyx_v_n_constant_features); - /* "sklearn/tree/_tree.pyx":3438 + /* "sklearn/tree/_tree.pyx":3368 * rc = stack.push(start, split.pos, depth+1, node_id, 1, * split.impurity_left, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -22400,7 +21907,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3439 + /* "sklearn/tree/_tree.pyx":3369 * split.impurity_left, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -22409,11 +21916,11 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ goto __pyx_L12_break; } - goto __pyx_L24; + goto __pyx_L25; } - __pyx_L24:; + __pyx_L25:; - /* "sklearn/tree/_tree.pyx":3441 + /* "sklearn/tree/_tree.pyx":3371 * break * * if depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -22423,7 +21930,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_depth > __pyx_v_max_depth_seen) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3442 + /* "sklearn/tree/_tree.pyx":3372 * * if depth > max_depth_seen: * max_depth_seen = depth # <<<<<<<<<<<<<< @@ -22431,13 +21938,13 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str * if rc >= 0: */ __pyx_v_max_depth_seen = __pyx_v_depth; - goto __pyx_L27; + goto __pyx_L28; } - __pyx_L27:; + __pyx_L28:; } __pyx_L12_break:; - /* "sklearn/tree/_tree.pyx":3444 + /* "sklearn/tree/_tree.pyx":3374 * max_depth_seen = depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -22447,7 +21954,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3445 + /* "sklearn/tree/_tree.pyx":3375 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -22458,34 +21965,34 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_14.capacity = __pyx_v_tree->node_count; __pyx_t_13 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize_c(__pyx_v_tree, &__pyx_t_14); __pyx_v_rc = __pyx_t_13; - goto __pyx_L28; + goto __pyx_L29; } - __pyx_L28:; + __pyx_L29:; - /* "sklearn/tree/_tree.pyx":3447 + /* "sklearn/tree/_tree.pyx":3377 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< * tree.max_depth = max_depth_seen - * if rc == -1: + * */ __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3448 + /* "sklearn/tree/_tree.pyx":3378 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< + * * if rc == -1: - * raise MemoryError() */ __pyx_v_tree->max_depth = __pyx_v_max_depth_seen; - goto __pyx_L29; + goto __pyx_L30; } - __pyx_L29:; + __pyx_L30:; } - /* "sklearn/tree/_tree.pyx":3385 + /* "sklearn/tree/_tree.pyx":3312 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -22503,9 +22010,9 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } } - /* "sklearn/tree/_tree.pyx":3449 - * if rc >= 0: + /* "sklearn/tree/_tree.pyx":3380 * tree.max_depth = max_depth_seen + * * if rc == -1: # <<<<<<<<<<<<<< * raise MemoryError() * @@ -22513,17 +22020,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3450 - * tree.max_depth = max_depth_seen + /* "sklearn/tree/_tree.pyx":3381 + * * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * - * + * # Best first builder ---------------------------------------------------------- */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3326 + /* "sklearn/tree/_tree.pyx":3254 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -22571,12 +22078,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_X,&__pyx_n_s_y,&__pyx_n_s_sample_weight,0}; PyObject* values[4] = {0,0,0,0}; - /* "sklearn/tree/_tree.pyx":3327 + /* "sklearn/tree/_tree.pyx":3255 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< * """Build a decision tree from the training set (X, y).""" - * + * # check input */ values[3] = (PyObject *)((PyArrayObject *)Py_None); if (unlikely(__pyx_kwds)) { @@ -22598,12 +22105,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -22612,7 +22119,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -22631,18 +22138,18 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_3build(P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.DepthFirstTreeBuilder.build", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(((struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":3326 + /* "sklearn/tree/_tree.pyx":3254 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -22671,7 +22178,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.sample_weight = __pyx_v_sample_weight; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -22688,7 +22195,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3455 +/* "sklearn/tree/_tree.pyx":3385 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -22699,7 +22206,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *__pyx_v_rec, struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_frontier) { int __pyx_r; - /* "sklearn/tree/_tree.pyx":3459 + /* "sklearn/tree/_tree.pyx":3389 * """Adds record ``rec`` to the priority queue ``frontier``; returns -1 * on memory-error. """ * return frontier.push(rec.node_id, rec.start, rec.end, rec.pos, rec.depth, # <<<<<<<<<<<<<< @@ -22709,7 +22216,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ __pyx_r = ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->push(__pyx_v_frontier, __pyx_v_rec->node_id, __pyx_v_rec->start, __pyx_v_rec->end, __pyx_v_rec->pos, __pyx_v_rec->depth, __pyx_v_rec->is_leaf, __pyx_v_rec->improvement, __pyx_v_rec->impurity, __pyx_v_rec->impurity_left, __pyx_v_rec->impurity_right); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3455 + /* "sklearn/tree/_tree.pyx":3385 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -22722,7 +22229,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3474 +/* "sklearn/tree/_tree.pyx":3404 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -22769,31 +22276,31 @@ static int __pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(PyOb case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_split)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_samples_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_weight_leaf)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_leaf_nodes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -22806,21 +22313,21 @@ static int __pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(PyOb values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)values[0]); - __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_split = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_min_samples_split == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_min_samples_leaf = __Pyx_PyInt_As_Py_intptr_t(values[2]); if (unlikely((__pyx_v_min_samples_leaf == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_min_weight_leaf = values[3]; - __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_leaf_nodes = __Pyx_PyInt_As_Py_intptr_t(values[5]); if (unlikely((__pyx_v_max_leaf_nodes == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_leaf_nodes = __Pyx_PyInt_As_Py_intptr_t(values[5]); if (unlikely((__pyx_v_max_leaf_nodes == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BestFirstTreeBuilder.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_splitter), __pyx_ptype_7sklearn_4tree_5_tree_Splitter, 1, "splitter", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)__pyx_v_self), __pyx_v_splitter, __pyx_v_min_samples_split, __pyx_v_min_samples_leaf, __pyx_v_min_weight_leaf, __pyx_v_max_depth, __pyx_v_max_leaf_nodes); /* function exit code */ @@ -22841,7 +22348,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":3477 + /* "sklearn/tree/_tree.pyx":3407 * SIZE_t min_samples_leaf, min_weight_leaf, * SIZE_t max_depth, SIZE_t max_leaf_nodes): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -22854,7 +22361,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.splitter)); __pyx_v_self->__pyx_base.splitter = __pyx_v_splitter; - /* "sklearn/tree/_tree.pyx":3478 + /* "sklearn/tree/_tree.pyx":3408 * SIZE_t max_depth, SIZE_t max_leaf_nodes): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -22863,7 +22370,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.min_samples_split = __pyx_v_min_samples_split; - /* "sklearn/tree/_tree.pyx":3479 + /* "sklearn/tree/_tree.pyx":3409 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -22872,17 +22379,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.min_samples_leaf = __pyx_v_min_samples_leaf; - /* "sklearn/tree/_tree.pyx":3480 + /* "sklearn/tree/_tree.pyx":3410 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes */ - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_min_weight_leaf); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_min_weight_leaf); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->__pyx_base.min_weight_leaf = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3481 + /* "sklearn/tree/_tree.pyx":3411 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -22891,7 +22398,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.max_depth = __pyx_v_max_depth; - /* "sklearn/tree/_tree.pyx":3482 + /* "sklearn/tree/_tree.pyx":3412 * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes # <<<<<<<<<<<<<< @@ -22900,7 +22407,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->max_leaf_nodes = __pyx_v_max_leaf_nodes; - /* "sklearn/tree/_tree.pyx":3474 + /* "sklearn/tree/_tree.pyx":3404 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -22919,7 +22426,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3484 +/* "sklearn/tree/_tree.pyx":3414 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -22930,7 +22437,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_v_self, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_tree, PyObject *__pyx_v_X, PyArrayObject *__pyx_v_y, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build *__pyx_optional_args) { - /* "sklearn/tree/_tree.pyx":3485 + /* "sklearn/tree/_tree.pyx":3415 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -22984,7 +22491,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF((PyObject *)__pyx_v_y); __Pyx_INCREF((PyObject *)__pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":3484 + /* "sklearn/tree/_tree.pyx":3414 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -22995,7 +22502,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build)) { __Pyx_XDECREF(__pyx_r); @@ -23012,7 +22519,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_5 = 1; } } - __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -23029,7 +22536,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, ((PyObject *)__pyx_v_sample_weight)); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -23041,14 +22548,14 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3489 + /* "sklearn/tree/_tree.pyx":3419 * * # check input * X, y, sample_weight = self._check_input(X, y, sample_weight) # <<<<<<<<<<<<<< * * cdef DOUBLE_t* sample_weight_ptr = NULL */ - __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; @@ -23060,7 +22567,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -23076,17 +22583,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; @@ -23096,7 +22603,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; @@ -23104,11 +22611,11 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_L4_unpacking_done:; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_X, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_3)); @@ -23116,7 +22623,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_6)); __pyx_t_6 = 0; - /* "sklearn/tree/_tree.pyx":3491 + /* "sklearn/tree/_tree.pyx":3421 * X, y, sample_weight = self._check_input(X, y, sample_weight) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -23125,7 +22632,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":3492 + /* "sklearn/tree/_tree.pyx":3422 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -23136,7 +22643,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3493 + /* "sklearn/tree/_tree.pyx":3423 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -23148,7 +22655,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":3496 + /* "sklearn/tree/_tree.pyx":3426 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -23160,7 +22667,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_v_splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3497 + /* "sklearn/tree/_tree.pyx":3427 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes # <<<<<<<<<<<<<< @@ -23170,7 +22677,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_self->max_leaf_nodes; __pyx_v_max_leaf_nodes = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3498 + /* "sklearn/tree/_tree.pyx":3428 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -23180,7 +22687,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3499 + /* "sklearn/tree/_tree.pyx":3429 * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf # <<<<<<<<<<<<<< @@ -23190,7 +22697,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_11 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":3500 + /* "sklearn/tree/_tree.pyx":3430 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef SIZE_t min_samples_split = self.min_samples_split # <<<<<<<<<<<<<< @@ -23200,36 +22707,36 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_self->__pyx_base.min_samples_split; __pyx_v_min_samples_split = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3503 + /* "sklearn/tree/_tree.pyx":3433 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< * * cdef PriorityHeap frontier = PriorityHeap(INITIAL_STACK_SIZE) */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3505 + /* "sklearn/tree/_tree.pyx":3435 * splitter.init(X, y, sample_weight_ptr) * * cdef PriorityHeap frontier = PriorityHeap(INITIAL_STACK_SIZE) # <<<<<<<<<<<<<< * cdef PriorityHeapRecord record * cdef PriorityHeapRecord split_node_left */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_frontier = ((struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3510 + /* "sklearn/tree/_tree.pyx":3440 * cdef PriorityHeapRecord split_node_right * * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -23239,7 +22746,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_10 = __pyx_v_splitter->n_samples; __pyx_v_n_node_samples = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":3511 + /* "sklearn/tree/_tree.pyx":3441 * * cdef SIZE_t n_node_samples = splitter.n_samples * cdef SIZE_t max_split_nodes = max_leaf_nodes - 1 # <<<<<<<<<<<<<< @@ -23248,7 +22755,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_split_nodes = (__pyx_v_max_leaf_nodes - 1); - /* "sklearn/tree/_tree.pyx":3513 + /* "sklearn/tree/_tree.pyx":3443 * cdef SIZE_t max_split_nodes = max_leaf_nodes - 1 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -23257,7 +22764,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":3514 + /* "sklearn/tree/_tree.pyx":3444 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -23266,7 +22773,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":3518 + /* "sklearn/tree/_tree.pyx":3448 * * # Initial capacity * cdef SIZE_t init_capacity = max_split_nodes + max_leaf_nodes # <<<<<<<<<<<<<< @@ -23275,16 +22782,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_init_capacity = (__pyx_v_max_split_nodes + __pyx_v_max_leaf_nodes); - /* "sklearn/tree/_tree.pyx":3519 + /* "sklearn/tree/_tree.pyx":3449 * # Initial capacity * cdef SIZE_t init_capacity = max_split_nodes + max_leaf_nodes * tree._resize(init_capacity) # <<<<<<<<<<<<<< * * with nogil: */ - ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3521 + /* "sklearn/tree/_tree.pyx":3451 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -23298,7 +22805,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3523 + /* "sklearn/tree/_tree.pyx":3453 * with nogil: * # add root to frontier * rc = self._add_split_node(splitter, tree, 0, n_node_samples, # <<<<<<<<<<<<<< @@ -23307,7 +22814,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(__pyx_v_self, __pyx_v_splitter, __pyx_v_tree, 0, __pyx_v_n_node_samples, __pyx_v_7sklearn_4tree_5_tree_INFINITY, __pyx_v_7sklearn_4tree_5_tree_IS_FIRST, __pyx_v_7sklearn_4tree_5_tree_IS_LEFT, NULL, 0, (&__pyx_v_split_node_left)); - /* "sklearn/tree/_tree.pyx":3526 + /* "sklearn/tree/_tree.pyx":3456 * INFINITY, IS_FIRST, IS_LEFT, NULL, 0, * &split_node_left) * if rc >= 0: # <<<<<<<<<<<<<< @@ -23317,7 +22824,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3527 + /* "sklearn/tree/_tree.pyx":3457 * &split_node_left) * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -23330,7 +22837,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L9:; } - /* "sklearn/tree/_tree.pyx":3521 + /* "sklearn/tree/_tree.pyx":3451 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -23348,7 +22855,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":3528 + /* "sklearn/tree/_tree.pyx":3458 * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -23358,17 +22865,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3529 + /* "sklearn/tree/_tree.pyx":3459 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3531 + /* "sklearn/tree/_tree.pyx":3461 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -23382,7 +22889,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3532 + /* "sklearn/tree/_tree.pyx":3462 * * with nogil: * while not frontier.is_empty(): # <<<<<<<<<<<<<< @@ -23393,7 +22900,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((!(((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->is_empty(__pyx_v_frontier) != 0)) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":3533 + /* "sklearn/tree/_tree.pyx":3463 * with nogil: * while not frontier.is_empty(): * frontier.pop(&record) # <<<<<<<<<<<<<< @@ -23402,7 +22909,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->pop(__pyx_v_frontier, (&__pyx_v_record)); - /* "sklearn/tree/_tree.pyx":3535 + /* "sklearn/tree/_tree.pyx":3465 * frontier.pop(&record) * * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -23411,7 +22918,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node = (&(__pyx_v_tree->nodes[__pyx_v_record.node_id])); - /* "sklearn/tree/_tree.pyx":3536 + /* "sklearn/tree/_tree.pyx":3466 * * node = &tree.nodes[record.node_id] * is_leaf = (record.is_leaf or max_split_nodes <= 0) # <<<<<<<<<<<<<< @@ -23429,7 +22936,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L16_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":3538 + /* "sklearn/tree/_tree.pyx":3468 * is_leaf = (record.is_leaf or max_split_nodes <= 0) * * if is_leaf: # <<<<<<<<<<<<<< @@ -23439,7 +22946,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = (__pyx_v_is_leaf != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3540 + /* "sklearn/tree/_tree.pyx":3470 * if is_leaf: * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -23448,7 +22955,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node->left_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":3541 + /* "sklearn/tree/_tree.pyx":3471 * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -23457,7 +22964,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node->right_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":3542 + /* "sklearn/tree/_tree.pyx":3472 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -23466,7 +22973,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node->feature = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; - /* "sklearn/tree/_tree.pyx":3543 + /* "sklearn/tree/_tree.pyx":3473 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -23478,7 +22985,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3549 + /* "sklearn/tree/_tree.pyx":3479 * * # Decrement number of split nodes available * max_split_nodes -= 1 # <<<<<<<<<<<<<< @@ -23487,7 +22994,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_split_nodes = (__pyx_v_max_split_nodes - 1); - /* "sklearn/tree/_tree.pyx":3552 + /* "sklearn/tree/_tree.pyx":3482 * * # Compute left split node * rc = self._add_split_node(splitter, tree, # <<<<<<<<<<<<<< @@ -23496,7 +23003,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(__pyx_v_self, __pyx_v_splitter, __pyx_v_tree, __pyx_v_record.start, __pyx_v_record.pos, __pyx_v_record.impurity_left, __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST, __pyx_v_7sklearn_4tree_5_tree_IS_LEFT, __pyx_v_node, (__pyx_v_record.depth + 1), (&__pyx_v_split_node_left)); - /* "sklearn/tree/_tree.pyx":3558 + /* "sklearn/tree/_tree.pyx":3488 * record.depth + 1, * &split_node_left) * if rc == -1: # <<<<<<<<<<<<<< @@ -23506,7 +23013,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3559 + /* "sklearn/tree/_tree.pyx":3489 * &split_node_left) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -23516,7 +23023,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":3562 + /* "sklearn/tree/_tree.pyx":3492 * * # tree.nodes may have changed * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -23525,7 +23032,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_node = (&(__pyx_v_tree->nodes[__pyx_v_record.node_id])); - /* "sklearn/tree/_tree.pyx":3565 + /* "sklearn/tree/_tree.pyx":3495 * * # Compute right split node * rc = self._add_split_node(splitter, tree, record.pos, # <<<<<<<<<<<<<< @@ -23534,7 +23041,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(__pyx_v_self, __pyx_v_splitter, __pyx_v_tree, __pyx_v_record.pos, __pyx_v_record.end, __pyx_v_record.impurity_right, __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST, __pyx_v_7sklearn_4tree_5_tree_IS_NOT_LEFT, __pyx_v_node, (__pyx_v_record.depth + 1), (&__pyx_v_split_node_right)); - /* "sklearn/tree/_tree.pyx":3571 + /* "sklearn/tree/_tree.pyx":3501 * record.depth + 1, * &split_node_right) * if rc == -1: # <<<<<<<<<<<<<< @@ -23544,7 +23051,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3572 + /* "sklearn/tree/_tree.pyx":3502 * &split_node_right) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -23554,7 +23061,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":3575 + /* "sklearn/tree/_tree.pyx":3505 * * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -23563,7 +23070,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree__add_to_frontier((&__pyx_v_split_node_left), __pyx_v_frontier); - /* "sklearn/tree/_tree.pyx":3576 + /* "sklearn/tree/_tree.pyx":3506 * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -23573,7 +23080,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3577 + /* "sklearn/tree/_tree.pyx":3507 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -23583,7 +23090,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":3579 + /* "sklearn/tree/_tree.pyx":3509 * break * * rc = _add_to_frontier(&split_node_right, frontier) # <<<<<<<<<<<<<< @@ -23592,7 +23099,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = __pyx_f_7sklearn_4tree_5_tree__add_to_frontier((&__pyx_v_split_node_right), __pyx_v_frontier); - /* "sklearn/tree/_tree.pyx":3580 + /* "sklearn/tree/_tree.pyx":3510 * * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -23602,7 +23109,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3581 + /* "sklearn/tree/_tree.pyx":3511 * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -23614,7 +23121,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":3583 + /* "sklearn/tree/_tree.pyx":3513 * break * * if record.depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -23624,7 +23131,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_record.depth > __pyx_v_max_depth_seen) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3584 + /* "sklearn/tree/_tree.pyx":3514 * * if record.depth > max_depth_seen: * max_depth_seen = record.depth # <<<<<<<<<<<<<< @@ -23639,7 +23146,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L15_break:; - /* "sklearn/tree/_tree.pyx":3586 + /* "sklearn/tree/_tree.pyx":3516 * max_depth_seen = record.depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -23649,7 +23156,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3587 + /* "sklearn/tree/_tree.pyx":3517 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -23664,7 +23171,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":3589 + /* "sklearn/tree/_tree.pyx":3519 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -23674,7 +23181,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3590 + /* "sklearn/tree/_tree.pyx":3520 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -23687,7 +23194,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L25:; } - /* "sklearn/tree/_tree.pyx":3531 + /* "sklearn/tree/_tree.pyx":3461 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -23705,7 +23212,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":3592 + /* "sklearn/tree/_tree.pyx":3522 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -23715,17 +23222,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":3593 + /* "sklearn/tree/_tree.pyx":3523 * * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3484 + /* "sklearn/tree/_tree.pyx":3414 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -23773,7 +23280,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_X,&__pyx_n_s_y,&__pyx_n_s_sample_weight,0}; PyObject* values[4] = {0,0,0,0}; - /* "sklearn/tree/_tree.pyx":3485 + /* "sklearn/tree/_tree.pyx":3415 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -23800,12 +23307,12 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -23814,7 +23321,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -23833,18 +23340,18 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build(Py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.BestFirstTreeBuilder.build", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_7sklearn_4tree_5_tree_Tree, 1, "tree", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sample_weight), __pyx_ptype_5numpy_ndarray, 1, "sample_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(((struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":3484 + /* "sklearn/tree/_tree.pyx":3414 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -23873,7 +23380,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.sample_weight = __pyx_v_sample_weight; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder->__pyx_base.build(((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self), __pyx_v_tree, __pyx_v_X, __pyx_v_y, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -23890,7 +23397,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3595 +/* "sklearn/tree/_tree.pyx":3525 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -23913,7 +23420,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a ptrdiff_t __pyx_t_4; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3604 + /* "sklearn/tree/_tree.pyx":3534 * cdef SIZE_t node_id * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 # <<<<<<<<<<<<<< @@ -23922,7 +23429,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_constant_features = 0; - /* "sklearn/tree/_tree.pyx":3605 + /* "sklearn/tree/_tree.pyx":3535 * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -23932,7 +23439,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = __pyx_v_splitter->weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3611 + /* "sklearn/tree/_tree.pyx":3541 * cdef double imp_diff * * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -23941,7 +23448,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_reset(__pyx_v_splitter, __pyx_v_start, __pyx_v_end, (&__pyx_v_weighted_n_node_samples)); - /* "sklearn/tree/_tree.pyx":3613 + /* "sklearn/tree/_tree.pyx":3543 * splitter.node_reset(start, end, &weighted_n_node_samples) * * if is_first: # <<<<<<<<<<<<<< @@ -23951,7 +23458,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = (__pyx_v_is_first != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3614 + /* "sklearn/tree/_tree.pyx":3544 * * if is_first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -23963,7 +23470,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3616 + /* "sklearn/tree/_tree.pyx":3546 * impurity = splitter.node_impurity() * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -23972,7 +23479,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":3617 + /* "sklearn/tree/_tree.pyx":3547 * * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or # <<<<<<<<<<<<<< @@ -23986,7 +23493,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3618 + /* "sklearn/tree/_tree.pyx":3548 * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or # <<<<<<<<<<<<<< @@ -24000,7 +23507,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3619 + /* "sklearn/tree/_tree.pyx":3549 * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or # <<<<<<<<<<<<<< @@ -24014,7 +23521,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3620 + /* "sklearn/tree/_tree.pyx":3550 * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or * (weighted_n_node_samples < self.min_weight_leaf) or # <<<<<<<<<<<<<< @@ -24028,7 +23535,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3621 + /* "sklearn/tree/_tree.pyx":3551 * (n_node_samples < 2 * self.min_samples_leaf) or * (weighted_n_node_samples < self.min_weight_leaf) or * (impurity <= MIN_IMPURITY_SPLIT)) # <<<<<<<<<<<<<< @@ -24040,7 +23547,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_L4_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3623 + /* "sklearn/tree/_tree.pyx":3553 * (impurity <= MIN_IMPURITY_SPLIT)) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -24050,7 +23557,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3624 + /* "sklearn/tree/_tree.pyx":3554 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -24059,7 +23566,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_split(__pyx_v_splitter, __pyx_v_impurity, (&__pyx_v_split), (&__pyx_v_n_constant_features)); - /* "sklearn/tree/_tree.pyx":3625 + /* "sklearn/tree/_tree.pyx":3555 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< @@ -24080,7 +23587,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":3628 + /* "sklearn/tree/_tree.pyx":3558 * * node_id = tree._add_node(parent - tree.nodes * if parent != NULL # <<<<<<<<<<<<<< @@ -24089,7 +23596,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ if (((__pyx_v_parent != NULL) != 0)) { - /* "sklearn/tree/_tree.pyx":3627 + /* "sklearn/tree/_tree.pyx":3557 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -24099,7 +23606,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_4 = (__pyx_v_parent - __pyx_v_tree->nodes); } else { - /* "sklearn/tree/_tree.pyx":3629 + /* "sklearn/tree/_tree.pyx":3559 * node_id = tree._add_node(parent - tree.nodes * if parent != NULL * else _TREE_UNDEFINED, # <<<<<<<<<<<<<< @@ -24109,7 +23616,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_4 = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; } - /* "sklearn/tree/_tree.pyx":3627 + /* "sklearn/tree/_tree.pyx":3557 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -24118,7 +23625,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_node_id = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_add_node(__pyx_v_tree, __pyx_t_4, __pyx_v_is_left, __pyx_v_is_leaf, __pyx_v_split.feature, __pyx_v_split.threshold, __pyx_v_impurity, __pyx_v_n_node_samples, __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":3633 + /* "sklearn/tree/_tree.pyx":3563 * split.feature, split.threshold, impurity, n_node_samples, * weighted_n_node_samples) * if node_id == (-1): # <<<<<<<<<<<<<< @@ -24128,7 +23635,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = ((__pyx_v_node_id == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3634 + /* "sklearn/tree/_tree.pyx":3564 * weighted_n_node_samples) * if node_id == (-1): * return -1 # <<<<<<<<<<<<<< @@ -24139,7 +23646,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3637 + /* "sklearn/tree/_tree.pyx":3567 * * # compute values also for split nodes (might become leafs later). * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -24148,7 +23655,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *)__pyx_v_splitter->__pyx_vtab)->node_value(__pyx_v_splitter, (__pyx_v_tree->value + (__pyx_v_node_id * __pyx_v_tree->value_stride))); - /* "sklearn/tree/_tree.pyx":3639 + /* "sklearn/tree/_tree.pyx":3569 * splitter.node_value(tree.value + node_id * tree.value_stride) * * res.node_id = node_id # <<<<<<<<<<<<<< @@ -24157,7 +23664,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->node_id = __pyx_v_node_id; - /* "sklearn/tree/_tree.pyx":3640 + /* "sklearn/tree/_tree.pyx":3570 * * res.node_id = node_id * res.start = start # <<<<<<<<<<<<<< @@ -24166,7 +23673,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":3641 + /* "sklearn/tree/_tree.pyx":3571 * res.node_id = node_id * res.start = start * res.end = end # <<<<<<<<<<<<<< @@ -24175,7 +23682,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":3642 + /* "sklearn/tree/_tree.pyx":3572 * res.start = start * res.end = end * res.depth = depth # <<<<<<<<<<<<<< @@ -24184,7 +23691,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->depth = __pyx_v_depth; - /* "sklearn/tree/_tree.pyx":3643 + /* "sklearn/tree/_tree.pyx":3573 * res.end = end * res.depth = depth * res.impurity = impurity # <<<<<<<<<<<<<< @@ -24193,7 +23700,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":3645 + /* "sklearn/tree/_tree.pyx":3575 * res.impurity = impurity * * if not is_leaf: # <<<<<<<<<<<<<< @@ -24203,7 +23710,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3647 + /* "sklearn/tree/_tree.pyx":3577 * if not is_leaf: * # is split node * res.pos = split.pos # <<<<<<<<<<<<<< @@ -24213,7 +23720,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_5 = __pyx_v_split.pos; __pyx_v_res->pos = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3648 + /* "sklearn/tree/_tree.pyx":3578 * # is split node * res.pos = split.pos * res.is_leaf = 0 # <<<<<<<<<<<<<< @@ -24222,7 +23729,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 0; - /* "sklearn/tree/_tree.pyx":3649 + /* "sklearn/tree/_tree.pyx":3579 * res.pos = split.pos * res.is_leaf = 0 * res.improvement = split.improvement # <<<<<<<<<<<<<< @@ -24232,7 +23739,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = __pyx_v_split.improvement; __pyx_v_res->improvement = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3650 + /* "sklearn/tree/_tree.pyx":3580 * res.is_leaf = 0 * res.improvement = split.improvement * res.impurity_left = split.impurity_left # <<<<<<<<<<<<<< @@ -24242,7 +23749,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = __pyx_v_split.impurity_left; __pyx_v_res->impurity_left = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3651 + /* "sklearn/tree/_tree.pyx":3581 * res.improvement = split.improvement * res.impurity_left = split.impurity_left * res.impurity_right = split.impurity_right # <<<<<<<<<<<<<< @@ -24255,7 +23762,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } /*else*/ { - /* "sklearn/tree/_tree.pyx":3655 + /* "sklearn/tree/_tree.pyx":3585 * else: * # is leaf => 0 improvement * res.pos = end # <<<<<<<<<<<<<< @@ -24264,7 +23771,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":3656 + /* "sklearn/tree/_tree.pyx":3586 * # is leaf => 0 improvement * res.pos = end * res.is_leaf = 1 # <<<<<<<<<<<<<< @@ -24273,7 +23780,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 1; - /* "sklearn/tree/_tree.pyx":3657 + /* "sklearn/tree/_tree.pyx":3587 * res.pos = end * res.is_leaf = 1 * res.improvement = 0.0 # <<<<<<<<<<<<<< @@ -24282,7 +23789,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->improvement = 0.0; - /* "sklearn/tree/_tree.pyx":3658 + /* "sklearn/tree/_tree.pyx":3588 * res.is_leaf = 1 * res.improvement = 0.0 * res.impurity_left = impurity # <<<<<<<<<<<<<< @@ -24291,7 +23798,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity_left = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":3659 + /* "sklearn/tree/_tree.pyx":3589 * res.improvement = 0.0 * res.impurity_left = impurity * res.impurity_right = impurity # <<<<<<<<<<<<<< @@ -24302,7 +23809,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":3661 + /* "sklearn/tree/_tree.pyx":3591 * res.impurity_right = impurity * * return 0 # <<<<<<<<<<<<<< @@ -24312,7 +23819,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3595 + /* "sklearn/tree/_tree.pyx":3525 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -24325,7 +23832,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3727 +/* "sklearn/tree/_tree.pyx":3657 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -24357,7 +23864,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3729 + /* "sklearn/tree/_tree.pyx":3659 * def __get__(self): * # it's small; copy for memory safety * return sizet_ptr_to_ndarray(self.n_classes, self.n_outputs).copy() # <<<<<<<<<<<<<< @@ -24365,9 +23872,9 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct * property children_left: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -24381,10 +23888,10 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct } } if (__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -24392,7 +23899,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3727 + /* "sklearn/tree/_tree.pyx":3657 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -24413,7 +23920,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3732 +/* "sklearn/tree/_tree.pyx":3662 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -24444,7 +23951,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3733 + /* "sklearn/tree/_tree.pyx":3663 * property children_left: * def __get__(self): * return self._get_node_ndarray()['left_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -24452,19 +23959,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st * property children_right: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_left_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_left_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3732 + /* "sklearn/tree/_tree.pyx":3662 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -24484,7 +23991,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3736 +/* "sklearn/tree/_tree.pyx":3666 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -24515,7 +24022,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3737 + /* "sklearn/tree/_tree.pyx":3667 * property children_right: * def __get__(self): * return self._get_node_ndarray()['right_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -24523,19 +24030,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s * property feature: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_right_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_right_child); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3667; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3736 + /* "sklearn/tree/_tree.pyx":3666 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -24555,7 +24062,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3740 +/* "sklearn/tree/_tree.pyx":3670 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -24586,7 +24093,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3741 + /* "sklearn/tree/_tree.pyx":3671 * property feature: * def __get__(self): * return self._get_node_ndarray()['feature'][:self.node_count] # <<<<<<<<<<<<<< @@ -24594,19 +24101,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ * property threshold: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_feature); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_feature); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3740 + /* "sklearn/tree/_tree.pyx":3670 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -24626,7 +24133,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3744 +/* "sklearn/tree/_tree.pyx":3674 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -24657,7 +24164,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3745 + /* "sklearn/tree/_tree.pyx":3675 * property threshold: * def __get__(self): * return self._get_node_ndarray()['threshold'][:self.node_count] # <<<<<<<<<<<<<< @@ -24665,19 +24172,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct * property impurity: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_threshold); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_threshold); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3744 + /* "sklearn/tree/_tree.pyx":3674 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -24697,7 +24204,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3748 +/* "sklearn/tree/_tree.pyx":3678 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -24728,7 +24235,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3749 + /* "sklearn/tree/_tree.pyx":3679 * property impurity: * def __get__(self): * return self._get_node_ndarray()['impurity'][:self.node_count] # <<<<<<<<<<<<<< @@ -24736,19 +24243,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ * property n_node_samples: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_impurity); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_impurity); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3748 + /* "sklearn/tree/_tree.pyx":3678 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -24768,7 +24275,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3752 +/* "sklearn/tree/_tree.pyx":3682 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -24799,7 +24306,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3753 + /* "sklearn/tree/_tree.pyx":3683 * property n_node_samples: * def __get__(self): * return self._get_node_ndarray()['n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -24807,19 +24314,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s * property weighted_n_node_samples: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3752 + /* "sklearn/tree/_tree.pyx":3682 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -24839,7 +24346,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3756 +/* "sklearn/tree/_tree.pyx":3686 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -24870,7 +24377,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3757 + /* "sklearn/tree/_tree.pyx":3687 * property weighted_n_node_samples: * def __get__(self): * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -24878,19 +24385,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ * property value: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_weighted_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_weighted_n_node_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3756 + /* "sklearn/tree/_tree.pyx":3686 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -24910,7 +24417,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3760 +/* "sklearn/tree/_tree.pyx":3690 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -24941,7 +24448,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "sklearn/tree/_tree.pyx":3761 + /* "sklearn/tree/_tree.pyx":3691 * property value: * def __get__(self): * return self._get_value_ndarray()[:self.node_count] # <<<<<<<<<<<<<< @@ -24949,16 +24456,16 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, __pyx_v_self->node_count, NULL, NULL, NULL, 0, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3760 + /* "sklearn/tree/_tree.pyx":3690 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -24978,7 +24485,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3763 +/* "sklearn/tree/_tree.pyx":3693 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -25019,16 +24526,16 @@ static int __pyx_pw_7sklearn_4tree_5_tree_4Tree_1__cinit__(PyObject *__pyx_v_sel case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_classes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_outputs)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -25037,19 +24544,19 @@ static int __pyx_pw_7sklearn_4tree_5_tree_4Tree_1__cinit__(PyObject *__pyx_v_sel values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } - __pyx_v_n_features = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n_features == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_features = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n_features == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_n_classes = ((PyArrayObject *)values[1]); - __pyx_v_n_outputs = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n_outputs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3764; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_outputs = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n_outputs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3694; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.Tree.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n_classes), __pyx_ptype_5numpy_ndarray, 1, "n_classes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(((struct __pyx_obj_7sklearn_4tree_5_tree_Tree *)__pyx_v_self), __pyx_v_n_features, __pyx_v_n_classes, __pyx_v_n_outputs); /* function exit code */ @@ -25084,11 +24591,11 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle __pyx_pybuffernd_n_classes.rcbuffer = &__pyx_pybuffer_n_classes; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3763; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n_classes.rcbuffer->pybuffer, (PyObject*)__pyx_v_n_classes, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_n_classes.diminfo[0].strides = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n_classes.diminfo[0].shape = __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.shape[0]; - /* "sklearn/tree/_tree.pyx":3767 + /* "sklearn/tree/_tree.pyx":3697 * """Constructor.""" * # Input/Output layout * self.n_features = n_features # <<<<<<<<<<<<<< @@ -25097,7 +24604,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_features = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":3768 + /* "sklearn/tree/_tree.pyx":3698 * # Input/Output layout * self.n_features = n_features * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -25106,7 +24613,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_outputs = __pyx_v_n_outputs; - /* "sklearn/tree/_tree.pyx":3769 + /* "sklearn/tree/_tree.pyx":3699 * self.n_features = n_features * self.n_outputs = n_outputs * self.n_classes = NULL # <<<<<<<<<<<<<< @@ -25115,25 +24622,25 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_tree.pyx":3770 + /* "sklearn/tree/_tree.pyx":3700 * self.n_outputs = n_outputs * self.n_classes = NULL * safe_realloc(&self.n_classes, n_outputs) # <<<<<<<<<<<<<< * * self.max_n_classes = np.max(n_classes) */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_self->n_classes), __pyx_v_n_outputs); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3772 + /* "sklearn/tree/_tree.pyx":3702 * safe_realloc(&self.n_classes, n_outputs) * * self.max_n_classes = np.max(n_classes) # <<<<<<<<<<<<<< * self.value_stride = n_outputs * self.max_n_classes * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_max); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -25147,25 +24654,25 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_n_classes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_n_classes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_n_classes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n_classes)); PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_n_classes)); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->max_n_classes = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3773 + /* "sklearn/tree/_tree.pyx":3703 * * self.max_n_classes = np.max(n_classes) * self.value_stride = n_outputs * self.max_n_classes # <<<<<<<<<<<<<< @@ -25174,7 +24681,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value_stride = (__pyx_v_n_outputs * __pyx_v_self->max_n_classes); - /* "sklearn/tree/_tree.pyx":3776 + /* "sklearn/tree/_tree.pyx":3706 * * cdef SIZE_t k * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -25185,7 +24692,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_6; __pyx_t_5+=1) { __pyx_v_k = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":3777 + /* "sklearn/tree/_tree.pyx":3707 * cdef SIZE_t k * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -25196,7 +24703,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle (__pyx_v_self->n_classes[__pyx_v_k]) = (*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_n_classes.diminfo[0].strides)); } - /* "sklearn/tree/_tree.pyx":3780 + /* "sklearn/tree/_tree.pyx":3710 * * # Inner structures * self.max_depth = 0 # <<<<<<<<<<<<<< @@ -25205,7 +24712,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->max_depth = 0; - /* "sklearn/tree/_tree.pyx":3781 + /* "sklearn/tree/_tree.pyx":3711 * # Inner structures * self.max_depth = 0 * self.node_count = 0 # <<<<<<<<<<<<<< @@ -25214,7 +24721,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->node_count = 0; - /* "sklearn/tree/_tree.pyx":3782 + /* "sklearn/tree/_tree.pyx":3712 * self.max_depth = 0 * self.node_count = 0 * self.capacity = 0 # <<<<<<<<<<<<<< @@ -25223,7 +24730,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->capacity = 0; - /* "sklearn/tree/_tree.pyx":3783 + /* "sklearn/tree/_tree.pyx":3713 * self.node_count = 0 * self.capacity = 0 * self.value = NULL # <<<<<<<<<<<<<< @@ -25232,7 +24739,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value = NULL; - /* "sklearn/tree/_tree.pyx":3784 + /* "sklearn/tree/_tree.pyx":3714 * self.capacity = 0 * self.value = NULL * self.nodes = NULL # <<<<<<<<<<<<<< @@ -25241,7 +24748,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->nodes = NULL; - /* "sklearn/tree/_tree.pyx":3763 + /* "sklearn/tree/_tree.pyx":3693 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -25271,7 +24778,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3786 +/* "sklearn/tree/_tree.pyx":3716 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -25294,7 +24801,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":3789 + /* "sklearn/tree/_tree.pyx":3719 * """Destructor.""" * # Free all inner structures * free(self.n_classes) # <<<<<<<<<<<<<< @@ -25303,7 +24810,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 */ free(__pyx_v_self->n_classes); - /* "sklearn/tree/_tree.pyx":3790 + /* "sklearn/tree/_tree.pyx":3720 * # Free all inner structures * free(self.n_classes) * free(self.value) # <<<<<<<<<<<<<< @@ -25312,7 +24819,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 */ free(__pyx_v_self->value); - /* "sklearn/tree/_tree.pyx":3791 + /* "sklearn/tree/_tree.pyx":3721 * free(self.n_classes) * free(self.value) * free(self.nodes) # <<<<<<<<<<<<<< @@ -25321,7 +24828,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 */ free(__pyx_v_self->nodes); - /* "sklearn/tree/_tree.pyx":3786 + /* "sklearn/tree/_tree.pyx":3716 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -25333,7 +24840,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":3793 +/* "sklearn/tree/_tree.pyx":3723 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -25367,7 +24874,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":3795 + /* "sklearn/tree/_tree.pyx":3725 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< @@ -25375,37 +24882,37 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o * self.n_outputs), self.__getstate__()) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3796 + /* "sklearn/tree/_tree.pyx":3726 * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), # <<<<<<<<<<<<<< * self.n_outputs), self.__getstate__()) * */ - __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_ndarray(__pyx_v_self->n_classes, __pyx_v_self->n_outputs)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":3797 + /* "sklearn/tree/_tree.pyx":3727 * return (Tree, (self.n_features, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) # <<<<<<<<<<<<<< * * def __getstate__(self): */ - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3795 + /* "sklearn/tree/_tree.pyx":3725 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) */ - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); @@ -25417,14 +24924,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":3797 + /* "sklearn/tree/_tree.pyx":3727 * return (Tree, (self.n_features, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) # <<<<<<<<<<<<<< * * def __getstate__(self): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { @@ -25437,22 +24944,22 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o } } if (__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":3795 + /* "sklearn/tree/_tree.pyx":3725 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs), * self.n_outputs), self.__getstate__()) */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); @@ -25467,7 +24974,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3793 + /* "sklearn/tree/_tree.pyx":3723 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -25489,7 +24996,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3799 +/* "sklearn/tree/_tree.pyx":3729 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -25521,55 +25028,55 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":3801 + /* "sklearn/tree/_tree.pyx":3731 * def __getstate__(self): * """Getstate re-implementation, for pickling.""" * d = {} # <<<<<<<<<<<<<< * d["node_count"] = self.node_count * d["nodes"] = self._get_node_ndarray() */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3801; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3802 + /* "sklearn/tree/_tree.pyx":3732 * """Getstate re-implementation, for pickling.""" * d = {} * d["node_count"] = self.node_count # <<<<<<<<<<<<<< * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() */ - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->node_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->node_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_node_count, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_node_count, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3732; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3803 + /* "sklearn/tree/_tree.pyx":3733 * d = {} * d["node_count"] = self.node_count * d["nodes"] = self._get_node_ndarray() # <<<<<<<<<<<<<< * d["values"] = self._get_value_ndarray() * return d */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_node_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_nodes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_nodes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3804 + /* "sklearn/tree/_tree.pyx":3734 * d["node_count"] = self.node_count * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() # <<<<<<<<<<<<<< * return d * */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_values, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3804; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_values, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3805 + /* "sklearn/tree/_tree.pyx":3735 * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() * return d # <<<<<<<<<<<<<< @@ -25581,7 +25088,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx __pyx_r = __pyx_v_d; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3799 + /* "sklearn/tree/_tree.pyx":3729 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -25601,7 +25108,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3807 +/* "sklearn/tree/_tree.pyx":3737 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -25646,101 +25153,101 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate__", 0); - /* "sklearn/tree/_tree.pyx":3809 + /* "sklearn/tree/_tree.pyx":3739 * def __setstate__(self, d): * """Setstate re-implementation, for unpickling.""" * self.node_count = d["node_count"] # <<<<<<<<<<<<<< * * if 'nodes' not in d: */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_node_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_node_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->node_count = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3811 + /* "sklearn/tree/_tree.pyx":3741 * self.node_count = d["node_count"] * * if 'nodes' not in d: # <<<<<<<<<<<<<< * raise ValueError('You have loaded Tree version which ' * 'cannot be imported') */ - __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_nodes, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3811; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_nodes, __pyx_v_d, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3812 + /* "sklearn/tree/_tree.pyx":3742 * * if 'nodes' not in d: * raise ValueError('You have loaded Tree version which ' # <<<<<<<<<<<<<< * 'cannot be imported') * */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3815 + /* "sklearn/tree/_tree.pyx":3745 * 'cannot be imported') * * node_ndarray = d['nodes'] # <<<<<<<<<<<<<< * value_ndarray = d['values'] * */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_nodes); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_nodes); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_v_node_ndarray = __pyx_t_1; __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3816 + /* "sklearn/tree/_tree.pyx":3746 * * node_ndarray = d['nodes'] * value_ndarray = d['values'] # <<<<<<<<<<<<<< * * value_shape = (node_ndarray.shape[0], self.n_outputs, */ - __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_values); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_s_values); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_1); __pyx_v_value_ndarray = __pyx_t_1; __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3818 + /* "sklearn/tree/_tree.pyx":3748 * value_ndarray = d['values'] * * value_shape = (node_ndarray.shape[0], self.n_outputs, # <<<<<<<<<<<<<< * self.max_n_classes) * if (node_ndarray.ndim != 1 or */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3819 + /* "sklearn/tree/_tree.pyx":3749 * * value_shape = (node_ndarray.shape[0], self.n_outputs, * self.max_n_classes) # <<<<<<<<<<<<<< * if (node_ndarray.ndim != 1 or * node_ndarray.dtype != NODE_DTYPE or */ - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":3818 + /* "sklearn/tree/_tree.pyx":3748 * value_ndarray = d['values'] * * value_shape = (node_ndarray.shape[0], self.n_outputs, # <<<<<<<<<<<<<< * self.max_n_classes) * if (node_ndarray.ndim != 1 or */ - __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); @@ -25754,18 +25261,18 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __pyx_v_value_shape = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "sklearn/tree/_tree.pyx":3820 + /* "sklearn/tree/_tree.pyx":3750 * value_shape = (node_ndarray.shape[0], self.n_outputs, * self.max_n_classes) * if (node_ndarray.ndim != 1 or # <<<<<<<<<<<<<< * node_ndarray.dtype != NODE_DTYPE or * not node_ndarray.flags.c_contiguous or */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { } else { @@ -25773,21 +25280,21 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3821 + /* "sklearn/tree/_tree.pyx":3751 * self.max_n_classes) * if (node_ndarray.ndim != 1 or * node_ndarray.dtype != NODE_DTYPE or # <<<<<<<<<<<<<< * not node_ndarray.flags.c_contiguous or * value_ndarray.shape != value_shape or */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) { } else { @@ -25795,19 +25302,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3822 + /* "sklearn/tree/_tree.pyx":3752 * if (node_ndarray.ndim != 1 or * node_ndarray.dtype != NODE_DTYPE or * not node_ndarray.flags.c_contiguous or # <<<<<<<<<<<<<< * value_ndarray.shape != value_shape or * not value_ndarray.flags.c_contiguous or */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = ((!__pyx_t_3) != 0); if (!__pyx_t_8) { @@ -25816,18 +25323,18 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3823 + /* "sklearn/tree/_tree.pyx":3753 * node_ndarray.dtype != NODE_DTYPE or * not node_ndarray.flags.c_contiguous or * value_ndarray.shape != value_shape or # <<<<<<<<<<<<<< * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_value_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_value_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { } else { @@ -25835,19 +25342,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3824 + /* "sklearn/tree/_tree.pyx":3754 * not node_ndarray.flags.c_contiguous or * value_ndarray.shape != value_shape or * not value_ndarray.flags.c_contiguous or # <<<<<<<<<<<<<< * value_ndarray.dtype != np.float64): * raise ValueError('Did not recognise loaded array layout') */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_c_contiguous); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_3 = ((!__pyx_t_8) != 0); if (!__pyx_t_3) { @@ -25856,60 +25363,60 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3825 + /* "sklearn/tree/_tree.pyx":3755 * value_ndarray.shape != value_shape or * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): # <<<<<<<<<<<<<< * raise ValueError('Did not recognise loaded array layout') * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_value_ndarray, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3826 + /* "sklearn/tree/_tree.pyx":3756 * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): * raise ValueError('Did not recognise loaded array layout') # <<<<<<<<<<<<<< * * self.capacity = node_ndarray.shape[0] */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3828 + /* "sklearn/tree/_tree.pyx":3758 * raise ValueError('Did not recognise loaded array layout') * * self.capacity = node_ndarray.shape[0] # <<<<<<<<<<<<<< * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_ndarray, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_6); if (unlikely((__pyx_t_2 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_self->capacity = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3829 + /* "sklearn/tree/_tree.pyx":3759 * * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: # <<<<<<<<<<<<<< @@ -25922,32 +25429,32 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __pyx_t_4 = ((__pyx_t_9 != 0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3830 + /* "sklearn/tree/_tree.pyx":3760 * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) # <<<<<<<<<<<<<< * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) */ - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->capacity); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->capacity); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_resizing_tree_to_d, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_resizing_tree_to_d, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3831 + /* "sklearn/tree/_tree.pyx":3761 * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) * nodes = memcpy(self.nodes, ( node_ndarray).data, # <<<<<<<<<<<<<< @@ -25956,7 +25463,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx */ __pyx_v_nodes = memcpy(__pyx_v_self->nodes, ((PyArrayObject *)__pyx_v_node_ndarray)->data, (__pyx_v_self->capacity * (sizeof(struct __pyx_t_7sklearn_4tree_5_tree_Node)))); - /* "sklearn/tree/_tree.pyx":3833 + /* "sklearn/tree/_tree.pyx":3763 * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) * value = memcpy(self.value, ( value_ndarray).data, # <<<<<<<<<<<<<< @@ -25965,7 +25472,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx */ __pyx_v_value = memcpy(__pyx_v_self->value, ((PyArrayObject *)__pyx_v_value_ndarray)->data, ((__pyx_v_self->capacity * __pyx_v_self->value_stride) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":3807 + /* "sklearn/tree/_tree.pyx":3737 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -25992,7 +25499,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3836 +/* "sklearn/tree/_tree.pyx":3766 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -26010,7 +25517,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_resize", 0); - /* "sklearn/tree/_tree.pyx":3839 + /* "sklearn/tree/_tree.pyx":3769 * """Resize all inner arrays to `capacity`, if `capacity` == -1, then * double the size of the inner arrays.""" * if self._resize_c(capacity) != 0: # <<<<<<<<<<<<<< @@ -26023,17 +25530,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __pyx_t_3 = ((__pyx_t_1 != 0) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3840 + /* "sklearn/tree/_tree.pyx":3770 * double the size of the inner arrays.""" * if self._resize_c(capacity) != 0: * raise MemoryError() # <<<<<<<<<<<<<< * * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3836 + /* "sklearn/tree/_tree.pyx":3766 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -26049,7 +25556,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":3844 +/* "sklearn/tree/_tree.pyx":3774 * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 * # (i.e., older MSVC). * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: # <<<<<<<<<<<<<< @@ -26069,7 +25576,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } } - /* "sklearn/tree/_tree.pyx":3846 + /* "sklearn/tree/_tree.pyx":3776 * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: # <<<<<<<<<<<<<< @@ -26087,7 +25594,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3847 + /* "sklearn/tree/_tree.pyx":3777 * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: * return 0 # <<<<<<<<<<<<<< @@ -26098,7 +25605,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3849 + /* "sklearn/tree/_tree.pyx":3779 * return 0 * * if capacity == (-1): # <<<<<<<<<<<<<< @@ -26108,7 +25615,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_capacity == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3850 + /* "sklearn/tree/_tree.pyx":3780 * * if capacity == (-1): * if self.capacity == 0: # <<<<<<<<<<<<<< @@ -26118,7 +25625,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_self->capacity == 0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3851 + /* "sklearn/tree/_tree.pyx":3781 * if capacity == (-1): * if self.capacity == 0: * capacity = 3 # default initial value # <<<<<<<<<<<<<< @@ -26130,7 +25637,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":3853 + /* "sklearn/tree/_tree.pyx":3783 * capacity = 3 # default initial value * else: * capacity = 2 * self.capacity # <<<<<<<<<<<<<< @@ -26144,7 +25651,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":3856 + /* "sklearn/tree/_tree.pyx":3786 * * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) # <<<<<<<<<<<<<< @@ -26153,7 +25660,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_ptr = realloc(__pyx_v_self->nodes, (__pyx_v_capacity * (sizeof(struct __pyx_t_7sklearn_4tree_5_tree_Node)))); - /* "sklearn/tree/_tree.pyx":3857 + /* "sklearn/tree/_tree.pyx":3787 * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -26163,7 +25670,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3858 + /* "sklearn/tree/_tree.pyx":3788 * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -26174,7 +25681,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3859 + /* "sklearn/tree/_tree.pyx":3789 * if ptr == NULL: * return -1 * self.nodes = ptr # <<<<<<<<<<<<<< @@ -26183,7 +25690,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_self->nodes = ((struct __pyx_t_7sklearn_4tree_5_tree_Node *)__pyx_v_ptr); - /* "sklearn/tree/_tree.pyx":3860 + /* "sklearn/tree/_tree.pyx":3790 * return -1 * self.nodes = ptr * ptr = realloc(self.value, # <<<<<<<<<<<<<< @@ -26192,7 +25699,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_ptr = realloc(__pyx_v_self->value, ((__pyx_v_capacity * __pyx_v_self->value_stride) * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":3862 + /* "sklearn/tree/_tree.pyx":3792 * ptr = realloc(self.value, * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -26202,7 +25709,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3863 + /* "sklearn/tree/_tree.pyx":3793 * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -26213,7 +25720,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3864 + /* "sklearn/tree/_tree.pyx":3794 * if ptr == NULL: * return -1 * self.value = ptr # <<<<<<<<<<<<<< @@ -26222,7 +25729,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_self->value = ((double *)__pyx_v_ptr); - /* "sklearn/tree/_tree.pyx":3867 + /* "sklearn/tree/_tree.pyx":3797 * * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: # <<<<<<<<<<<<<< @@ -26232,7 +25739,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_capacity > __pyx_v_self->capacity) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3868 + /* "sklearn/tree/_tree.pyx":3798 * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: * memset((self.value + self.capacity * self.value_stride), 0, # <<<<<<<<<<<<<< @@ -26244,7 +25751,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L10:; - /* "sklearn/tree/_tree.pyx":3873 + /* "sklearn/tree/_tree.pyx":3803 * * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: # <<<<<<<<<<<<<< @@ -26254,7 +25761,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_1 = ((__pyx_v_capacity < __pyx_v_self->node_count) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":3874 + /* "sklearn/tree/_tree.pyx":3804 * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: * self.node_count = capacity # <<<<<<<<<<<<<< @@ -26266,7 +25773,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L11:; - /* "sklearn/tree/_tree.pyx":3876 + /* "sklearn/tree/_tree.pyx":3806 * self.node_count = capacity * * self.capacity = capacity # <<<<<<<<<<<<<< @@ -26275,7 +25782,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea */ __pyx_v_self->capacity = __pyx_v_capacity; - /* "sklearn/tree/_tree.pyx":3877 + /* "sklearn/tree/_tree.pyx":3807 * * self.capacity = capacity * return 0 # <<<<<<<<<<<<<< @@ -26285,7 +25792,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3844 + /* "sklearn/tree/_tree.pyx":3774 * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 * # (i.e., older MSVC). * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: # <<<<<<<<<<<<<< @@ -26298,7 +25805,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3879 +/* "sklearn/tree/_tree.pyx":3809 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -26313,7 +25820,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; int __pyx_t_2; - /* "sklearn/tree/_tree.pyx":3888 + /* "sklearn/tree/_tree.pyx":3818 * Returns (size_t)(-1) on error. * """ * cdef SIZE_t node_id = self.node_count # <<<<<<<<<<<<<< @@ -26323,7 +25830,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_1 = __pyx_v_self->node_count; __pyx_v_node_id = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3890 + /* "sklearn/tree/_tree.pyx":3820 * cdef SIZE_t node_id = self.node_count * * if node_id >= self.capacity: # <<<<<<<<<<<<<< @@ -26333,7 +25840,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = ((__pyx_v_node_id >= __pyx_v_self->capacity) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3891 + /* "sklearn/tree/_tree.pyx":3821 * * if node_id >= self.capacity: * if self._resize_c() != 0: # <<<<<<<<<<<<<< @@ -26343,7 +25850,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = ((((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_resize_c(__pyx_v_self, NULL) != 0) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3892 + /* "sklearn/tree/_tree.pyx":3822 * if node_id >= self.capacity: * if self._resize_c() != 0: * return (-1) # <<<<<<<<<<<<<< @@ -26357,7 +25864,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3894 + /* "sklearn/tree/_tree.pyx":3824 * return (-1) * * cdef Node* node = &self.nodes[node_id] # <<<<<<<<<<<<<< @@ -26366,7 +25873,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node_id])); - /* "sklearn/tree/_tree.pyx":3895 + /* "sklearn/tree/_tree.pyx":3825 * * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity # <<<<<<<<<<<<<< @@ -26375,7 +25882,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":3896 + /* "sklearn/tree/_tree.pyx":3826 * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity * node.n_node_samples = n_node_samples # <<<<<<<<<<<<<< @@ -26384,7 +25891,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->n_node_samples = __pyx_v_n_node_samples; - /* "sklearn/tree/_tree.pyx":3897 + /* "sklearn/tree/_tree.pyx":3827 * node.impurity = impurity * node.n_node_samples = n_node_samples * node.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -26393,7 +25900,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":3899 + /* "sklearn/tree/_tree.pyx":3829 * node.weighted_n_node_samples = weighted_n_node_samples * * if parent != _TREE_UNDEFINED: # <<<<<<<<<<<<<< @@ -26403,7 +25910,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = ((__pyx_v_parent != __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3900 + /* "sklearn/tree/_tree.pyx":3830 * * if parent != _TREE_UNDEFINED: * if is_left: # <<<<<<<<<<<<<< @@ -26413,7 +25920,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = (__pyx_v_is_left != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3901 + /* "sklearn/tree/_tree.pyx":3831 * if parent != _TREE_UNDEFINED: * if is_left: * self.nodes[parent].left_child = node_id # <<<<<<<<<<<<<< @@ -26425,7 +25932,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3903 + /* "sklearn/tree/_tree.pyx":3833 * self.nodes[parent].left_child = node_id * else: * self.nodes[parent].right_child = node_id # <<<<<<<<<<<<<< @@ -26439,7 +25946,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":3905 + /* "sklearn/tree/_tree.pyx":3835 * self.nodes[parent].right_child = node_id * * if is_leaf: # <<<<<<<<<<<<<< @@ -26449,7 +25956,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_t_2 = (__pyx_v_is_leaf != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3906 + /* "sklearn/tree/_tree.pyx":3836 * * if is_leaf: * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -26458,7 +25965,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->left_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":3907 + /* "sklearn/tree/_tree.pyx":3837 * if is_leaf: * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -26467,7 +25974,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->right_child = __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; - /* "sklearn/tree/_tree.pyx":3908 + /* "sklearn/tree/_tree.pyx":3838 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -26476,7 +25983,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->feature = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; - /* "sklearn/tree/_tree.pyx":3909 + /* "sklearn/tree/_tree.pyx":3839 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -26488,7 +25995,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3913 + /* "sklearn/tree/_tree.pyx":3843 * else: * # left_child and right_child will be set later * node.feature = feature # <<<<<<<<<<<<<< @@ -26497,7 +26004,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_node->feature = __pyx_v_feature; - /* "sklearn/tree/_tree.pyx":3914 + /* "sklearn/tree/_tree.pyx":3844 * # left_child and right_child will be set later * node.feature = feature * node.threshold = threshold # <<<<<<<<<<<<<< @@ -26508,7 +26015,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":3916 + /* "sklearn/tree/_tree.pyx":3846 * node.threshold = threshold * * self.node_count += 1 # <<<<<<<<<<<<<< @@ -26517,7 +26024,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ */ __pyx_v_self->node_count = (__pyx_v_self->node_count + 1); - /* "sklearn/tree/_tree.pyx":3918 + /* "sklearn/tree/_tree.pyx":3848 * self.node_count += 1 * * return node_id # <<<<<<<<<<<<<< @@ -26527,7 +26034,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ __pyx_r = __pyx_v_node_id; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3879 + /* "sklearn/tree/_tree.pyx":3809 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -26540,7 +26047,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3920 +/* "sklearn/tree/_tree.pyx":3850 * return node_id * * cpdef np.ndarray predict(self, object X): # <<<<<<<<<<<<<< @@ -26569,7 +26076,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_predict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_predict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_4Tree_11predict)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -26585,21 +26092,21 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_X); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26608,30 +26115,30 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3922 + /* "sklearn/tree/_tree.pyx":3852 * cpdef np.ndarray predict(self, object X): * """Predict target for X.""" * out = self._get_value_ndarray().take(self.apply(X), axis=0, # <<<<<<<<<<<<<< * mode='clip') * if self.n_outputs == 1: */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->_get_value_ndarray(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_take); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->apply(__pyx_v_self, __pyx_v_X, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->apply(__pyx_v_self, __pyx_v_X, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mode, __pyx_n_s_clip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mode, __pyx_n_s_clip) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -26639,7 +26146,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_v_out = __pyx_t_5; __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":3924 + /* "sklearn/tree/_tree.pyx":3854 * out = self._get_value_ndarray().take(self.apply(X), axis=0, * mode='clip') * if self.n_outputs == 1: # <<<<<<<<<<<<<< @@ -26649,21 +26156,21 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_t_6 = ((__pyx_v_self->n_outputs == 1) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3925 + /* "sklearn/tree/_tree.pyx":3855 * mode='clip') * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) # <<<<<<<<<<<<<< * return out * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_7 = 0; @@ -26677,7 +26184,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_t_7 = 1; } } - __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -26688,7 +26195,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3925; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26698,7 +26205,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3926 + /* "sklearn/tree/_tree.pyx":3856 * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) * return out # <<<<<<<<<<<<<< @@ -26706,12 +26213,12 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o * cpdef np.ndarray apply(self, object X): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_out) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_out, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_out); __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3920 + /* "sklearn/tree/_tree.pyx":3850 * return node_id * * cpdef np.ndarray predict(self, object X): # <<<<<<<<<<<<<< @@ -26759,7 +26266,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("predict", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26776,7 +26283,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3928 +/* "sklearn/tree/_tree.pyx":3858 * return out * * cpdef np.ndarray apply(self, object X): # <<<<<<<<<<<<<< @@ -26802,7 +26309,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_4Tree_13apply)) { __Pyx_XDECREF(((PyObject *)__pyx_r)); @@ -26818,21 +26325,21 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_X); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_X); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -26841,14 +26348,14 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":3930 + /* "sklearn/tree/_tree.pyx":3860 * cpdef np.ndarray apply(self, object X): * """Finds the terminal region (=leaf node) for each sample in X.""" * if issparse(X): # <<<<<<<<<<<<<< * return self._apply_sparse_csr(X) * else: */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_issparse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -26861,25 +26368,25 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } if (!__pyx_t_3) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_X); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3931 + /* "sklearn/tree/_tree.pyx":3861 * """Finds the terminal region (=leaf node) for each sample in X.""" * if issparse(X): * return self._apply_sparse_csr(X) # <<<<<<<<<<<<<< @@ -26887,7 +26394,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj * return self._apply_dense(X) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -26895,7 +26402,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } /*else*/ { - /* "sklearn/tree/_tree.pyx":3933 + /* "sklearn/tree/_tree.pyx":3863 * return self._apply_sparse_csr(X) * else: * return self._apply_dense(X) # <<<<<<<<<<<<<< @@ -26903,14 +26410,14 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(__pyx_v_self, __pyx_v_X)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3928 + /* "sklearn/tree/_tree.pyx":3858 * return out * * cpdef np.ndarray apply(self, object X): # <<<<<<<<<<<<<< @@ -26956,7 +26463,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(__pyx_v_self, __pyx_v_X, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26973,7 +26480,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3936 +/* "sklearn/tree/_tree.pyx":3866 * * * cdef inline np.ndarray _apply_dense(self, object X): # <<<<<<<<<<<<<< @@ -27015,7 +26522,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_pybuffernd_out.data = NULL; __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; - /* "sklearn/tree/_tree.pyx":3940 + /* "sklearn/tree/_tree.pyx":3870 * * # Check input * if not isinstance(X, np.ndarray): # <<<<<<<<<<<<<< @@ -27026,93 +26533,93 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3942 + /* "sklearn/tree/_tree.pyx":3872 * if not isinstance(X, np.ndarray): * raise ValueError("X should be in np.ndarray format, got %s" * % type(X)) # <<<<<<<<<<<<<< * * if X.dtype != DTYPE: */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_np_ndarray_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_np_ndarray_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3941 + /* "sklearn/tree/_tree.pyx":3871 * # Check input * if not isinstance(X, np.ndarray): * raise ValueError("X should be in np.ndarray format, got %s" # <<<<<<<<<<<<<< * % type(X)) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3944 + /* "sklearn/tree/_tree.pyx":3874 * % type(X)) * * if X.dtype != DTYPE: # <<<<<<<<<<<<<< * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3945 + /* "sklearn/tree/_tree.pyx":3875 * * if X.dtype != DTYPE: * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) # <<<<<<<<<<<<<< * * # Extract input */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3948 + /* "sklearn/tree/_tree.pyx":3878 * * # Extract input * cdef np.ndarray X_ndarray = X # <<<<<<<<<<<<<< * cdef DTYPE_t* X_ptr = X_ndarray.data * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize */ - if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_X) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_X, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __pyx_v_X; __Pyx_INCREF(__pyx_t_4); __pyx_v_X_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3949 + /* "sklearn/tree/_tree.pyx":3879 * # Extract input * cdef np.ndarray X_ndarray = X * cdef DTYPE_t* X_ptr = X_ndarray.data # <<<<<<<<<<<<<< @@ -27121,107 +26628,107 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_X_ptr = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_ndarray->data); - /* "sklearn/tree/_tree.pyx":3950 + /* "sklearn/tree/_tree.pyx":3880 * cdef np.ndarray X_ndarray = X * cdef DTYPE_t* X_ptr = X_ndarray.data * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize # <<<<<<<<<<<<<< * cdef SIZE_t X_fx_stride = X.strides[1] / X.itemsize * cdef SIZE_t n_samples = X.shape[0] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_X_sample_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_6) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_7)); - /* "sklearn/tree/_tree.pyx":3951 + /* "sklearn/tree/_tree.pyx":3881 * cdef DTYPE_t* X_ptr = X_ndarray.data * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize * cdef SIZE_t X_fx_stride = X.strides[1] / X.itemsize # <<<<<<<<<<<<<< * cdef SIZE_t n_samples = X.shape[0] * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_strides); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_7 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_X_fx_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_7) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_6)); - /* "sklearn/tree/_tree.pyx":3952 + /* "sklearn/tree/_tree.pyx":3882 * cdef SIZE_t X_sample_stride = X.strides[0] / X.itemsize * cdef SIZE_t X_fx_stride = X.strides[1] / X.itemsize * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< * * # Initialize output */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3882; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_n_samples = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":3955 + /* "sklearn/tree/_tree.pyx":3885 * * # Initialize output * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) # <<<<<<<<<<<<<< * cdef SIZE_t* out_ptr = out.data * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_intp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_intp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_9); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; } } @@ -27229,7 +26736,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_v_out = ((PyArrayObject *)__pyx_t_9); __pyx_t_9 = 0; - /* "sklearn/tree/_tree.pyx":3956 + /* "sklearn/tree/_tree.pyx":3886 * # Initialize output * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) * cdef SIZE_t* out_ptr = out.data # <<<<<<<<<<<<<< @@ -27238,7 +26745,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_out_ptr = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_out->data); - /* "sklearn/tree/_tree.pyx":3959 + /* "sklearn/tree/_tree.pyx":3889 * * # Initialize auxiliary data-structure * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -27247,7 +26754,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":3960 + /* "sklearn/tree/_tree.pyx":3890 * # Initialize auxiliary data-structure * cdef Node* node = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -27256,7 +26763,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":3962 + /* "sklearn/tree/_tree.pyx":3892 * cdef SIZE_t i = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -27270,7 +26777,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3963 + /* "sklearn/tree/_tree.pyx":3893 * * with nogil: * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -27281,7 +26788,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":3964 + /* "sklearn/tree/_tree.pyx":3894 * with nogil: * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -27291,7 +26798,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_11 = __pyx_v_self->nodes; __pyx_v_node = __pyx_t_11; - /* "sklearn/tree/_tree.pyx":3966 + /* "sklearn/tree/_tree.pyx":3896 * node = self.nodes * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -27302,7 +26809,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_2 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (!__pyx_t_2) break; - /* "sklearn/tree/_tree.pyx":3969 + /* "sklearn/tree/_tree.pyx":3899 * # ... and node.right_child != _TREE_LEAF: * if X_ptr[X_sample_stride * i + * X_fx_stride * node.feature] <= node.threshold: # <<<<<<<<<<<<<< @@ -27312,7 +26819,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_t_2 = (((__pyx_v_X_ptr[((__pyx_v_X_sample_stride * __pyx_v_i) + (__pyx_v_X_fx_stride * __pyx_v_node->feature))]) <= __pyx_v_node->threshold) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3970 + /* "sklearn/tree/_tree.pyx":3900 * if X_ptr[X_sample_stride * i + * X_fx_stride * node.feature] <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -27324,7 +26831,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3972 + /* "sklearn/tree/_tree.pyx":3902 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -27336,7 +26843,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_L12:; } - /* "sklearn/tree/_tree.pyx":3974 + /* "sklearn/tree/_tree.pyx":3904 * node = &self.nodes[node.right_child] * * out_ptr[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -27347,7 +26854,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } } - /* "sklearn/tree/_tree.pyx":3962 + /* "sklearn/tree/_tree.pyx":3892 * cdef SIZE_t i = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -27365,7 +26872,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } } - /* "sklearn/tree/_tree.pyx":3976 + /* "sklearn/tree/_tree.pyx":3906 * out_ptr[i] = (node - self.nodes) # node offset * * return out # <<<<<<<<<<<<<< @@ -27377,7 +26884,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3936 + /* "sklearn/tree/_tree.pyx":3866 * * * cdef inline np.ndarray _apply_dense(self, object X): # <<<<<<<<<<<<<< @@ -27409,7 +26916,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3978 +/* "sklearn/tree/_tree.pyx":3908 * return out * * cdef inline np.ndarray _apply_sparse_csr(self, object X): # <<<<<<<<<<<<<< @@ -27481,109 +26988,109 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_pybuffernd_out.data = NULL; __pyx_pybuffernd_out.rcbuffer = &__pyx_pybuffer_out; - /* "sklearn/tree/_tree.pyx":3983 + /* "sklearn/tree/_tree.pyx":3913 * """ * # Check input * if not isinstance(X, csr_matrix): # <<<<<<<<<<<<<< * raise ValueError("X should be in csr_matrix format, got %s" * % type(X)) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_IsInstance(__pyx_v_X, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3985 + /* "sklearn/tree/_tree.pyx":3915 * if not isinstance(X, csr_matrix): * raise ValueError("X should be in csr_matrix format, got %s" * % type(X)) # <<<<<<<<<<<<<< * * if X.dtype != DTYPE: */ - __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_csr_matrix_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_X_should_be_in_csr_matrix_format, ((PyObject *)Py_TYPE(__pyx_v_X))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3984 + /* "sklearn/tree/_tree.pyx":3914 * # Check input * if not isinstance(X, csr_matrix): * raise ValueError("X should be in csr_matrix format, got %s" # <<<<<<<<<<<<<< * % type(X)) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3987 + /* "sklearn/tree/_tree.pyx":3917 * % type(X)) * * if X.dtype != DTYPE: # <<<<<<<<<<<<<< * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3988 + /* "sklearn/tree/_tree.pyx":3918 * * if X.dtype != DTYPE: * raise ValueError("X.dtype should be np.float32, got %s" % X.dtype) # <<<<<<<<<<<<<< * * # Extract input */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_X_dtype_should_be_np_float32_got, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3991 + /* "sklearn/tree/_tree.pyx":3921 * * # Extract input * cdef np.ndarray[ndim=1, dtype=DTYPE_t] X_data_ndarray = X.data # <<<<<<<<<<<<<< * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indices_ndarray = X.indices * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_X_data_ndarray = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_X_data_ndarray.diminfo[0].strides = __pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X_data_ndarray.diminfo[0].shape = __pyx_pybuffernd_X_data_ndarray.rcbuffer->pybuffer.shape[0]; } } @@ -27591,22 +27098,22 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_X_data_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3992 + /* "sklearn/tree/_tree.pyx":3922 * # Extract input * cdef np.ndarray[ndim=1, dtype=DTYPE_t] X_data_ndarray = X.data * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indices_ndarray = X.indices # <<<<<<<<<<<<<< * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_X_indices_ndarray = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_X_indices_ndarray.diminfo[0].strides = __pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X_indices_ndarray.diminfo[0].shape = __pyx_pybuffernd_X_indices_ndarray.rcbuffer->pybuffer.shape[0]; } } @@ -27614,22 +27121,22 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_X_indices_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3993 + /* "sklearn/tree/_tree.pyx":3923 * cdef np.ndarray[ndim=1, dtype=DTYPE_t] X_data_ndarray = X.data * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indices_ndarray = X.indices * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr # <<<<<<<<<<<<<< * * cdef DTYPE_t* X_data = X_data_ndarray.data */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_indptr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_INT32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_X_indptr_ndarray = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_X_indptr_ndarray.diminfo[0].strides = __pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X_indptr_ndarray.diminfo[0].shape = __pyx_pybuffernd_X_indptr_ndarray.rcbuffer->pybuffer.shape[0]; } } @@ -27637,7 +27144,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_X_indptr_ndarray = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":3995 + /* "sklearn/tree/_tree.pyx":3925 * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr * * cdef DTYPE_t* X_data = X_data_ndarray.data # <<<<<<<<<<<<<< @@ -27646,7 +27153,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_data = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X_data_ndarray->data); - /* "sklearn/tree/_tree.pyx":3996 + /* "sklearn/tree/_tree.pyx":3926 * * cdef DTYPE_t* X_data = X_data_ndarray.data * cdef INT32_t* X_indices = X_indices_ndarray.data # <<<<<<<<<<<<<< @@ -27655,7 +27162,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_indices = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_X_indices_ndarray->data); - /* "sklearn/tree/_tree.pyx":3997 + /* "sklearn/tree/_tree.pyx":3927 * cdef DTYPE_t* X_data = X_data_ndarray.data * cdef INT32_t* X_indices = X_indices_ndarray.data * cdef INT32_t* X_indptr = X_indptr_ndarray.data # <<<<<<<<<<<<<< @@ -27664,99 +27171,99 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_indptr = ((__pyx_t_7sklearn_4tree_5_tree_INT32_t *)__pyx_v_X_indptr_ndarray->data); - /* "sklearn/tree/_tree.pyx":3999 + /* "sklearn/tree/_tree.pyx":3929 * cdef INT32_t* X_indptr = X_indptr_ndarray.data * * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< * cdef SIZE_t n_features = X.shape[1] * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_n_samples = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":4000 + /* "sklearn/tree/_tree.pyx":3930 * * cdef SIZE_t n_samples = X.shape[0] * cdef SIZE_t n_features = X.shape[1] # <<<<<<<<<<<<<< * * # Initialize output */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_X, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_9 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_n_features = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":4003 + /* "sklearn/tree/_tree.pyx":3933 * * # Initialize output * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), # <<<<<<<<<<<<<< * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":4004 + /* "sklearn/tree/_tree.pyx":3934 * # Initialize output * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), * dtype=np.intp) # <<<<<<<<<<<<<< * cdef SIZE_t* out_ptr = out.data * */ - __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_intp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_intp); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "sklearn/tree/_tree.pyx":4003 + /* "sklearn/tree/_tree.pyx":3933 * * # Initialize output * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), # <<<<<<<<<<<<<< * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data */ - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_12 = ((PyArrayObject *)__pyx_t_11); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_SIZE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_out.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_out.diminfo[0].strides = __pyx_pybuffernd_out.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_out.diminfo[0].shape = __pyx_pybuffernd_out.rcbuffer->pybuffer.shape[0]; } } @@ -27764,7 +27271,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_v_out = ((PyArrayObject *)__pyx_t_11); __pyx_t_11 = 0; - /* "sklearn/tree/_tree.pyx":4005 + /* "sklearn/tree/_tree.pyx":3935 * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data # <<<<<<<<<<<<<< @@ -27773,7 +27280,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_out_ptr = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_out->data); - /* "sklearn/tree/_tree.pyx":4008 + /* "sklearn/tree/_tree.pyx":3938 * * # Initialize auxiliary data-structure * cdef DTYPE_t feature_value = 0. # <<<<<<<<<<<<<< @@ -27782,7 +27289,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_feature_value = 0.; - /* "sklearn/tree/_tree.pyx":4009 + /* "sklearn/tree/_tree.pyx":3939 * # Initialize auxiliary data-structure * cdef DTYPE_t feature_value = 0. * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -27791,7 +27298,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":4010 + /* "sklearn/tree/_tree.pyx":3940 * cdef DTYPE_t feature_value = 0. * cdef Node* node = NULL * cdef DTYPE_t* X_sample = NULL # <<<<<<<<<<<<<< @@ -27800,7 +27307,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_sample = NULL; - /* "sklearn/tree/_tree.pyx":4011 + /* "sklearn/tree/_tree.pyx":3941 * cdef Node* node = NULL * cdef DTYPE_t* X_sample = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -27809,7 +27316,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":4012 + /* "sklearn/tree/_tree.pyx":3942 * cdef DTYPE_t* X_sample = NULL * cdef SIZE_t i = 0 * cdef INT32_t k = 0 # <<<<<<<<<<<<<< @@ -27818,7 +27325,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":4017 + /* "sklearn/tree/_tree.pyx":3947 * # for each feature; functionally, it is an efficient way to identify * # which features are nonzero in the present sample. * cdef SIZE_t* feature_to_sample = NULL # <<<<<<<<<<<<<< @@ -27827,25 +27334,25 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_feature_to_sample = NULL; - /* "sklearn/tree/_tree.pyx":4019 + /* "sklearn/tree/_tree.pyx":3949 * cdef SIZE_t* feature_to_sample = NULL * * safe_realloc(&X_sample, n_features * sizeof(DTYPE_t)) # <<<<<<<<<<<<<< * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * */ - __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_X_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_0__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_X_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":4020 + /* "sklearn/tree/_tree.pyx":3950 * * safe_realloc(&X_sample, n_features * sizeof(DTYPE_t)) * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_feature_to_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_feature_to_sample), (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":4022 + /* "sklearn/tree/_tree.pyx":3952 * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * * with nogil: # <<<<<<<<<<<<<< @@ -27859,7 +27366,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":4023 + /* "sklearn/tree/_tree.pyx":3953 * * with nogil: * memset(feature_to_sample, -1, n_features * sizeof(SIZE_t)) # <<<<<<<<<<<<<< @@ -27868,7 +27375,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ memset(__pyx_v_feature_to_sample, -1, (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t)))); - /* "sklearn/tree/_tree.pyx":4025 + /* "sklearn/tree/_tree.pyx":3955 * memset(feature_to_sample, -1, n_features * sizeof(SIZE_t)) * * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -27879,7 +27386,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_9; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; - /* "sklearn/tree/_tree.pyx":4026 + /* "sklearn/tree/_tree.pyx":3956 * * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -27889,7 +27396,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_14 = __pyx_v_self->nodes; __pyx_v_node = __pyx_t_14; - /* "sklearn/tree/_tree.pyx":4028 + /* "sklearn/tree/_tree.pyx":3958 * node = self.nodes * * for k in range(X_indptr[i], X_indptr[i + 1]): # <<<<<<<<<<<<<< @@ -27900,7 +27407,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru for (__pyx_t_16 = (__pyx_v_X_indptr[__pyx_v_i]); __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_k = __pyx_t_16; - /* "sklearn/tree/_tree.pyx":4029 + /* "sklearn/tree/_tree.pyx":3959 * * for k in range(X_indptr[i], X_indptr[i + 1]): * feature_to_sample[X_indices[k]] = i # <<<<<<<<<<<<<< @@ -27909,7 +27416,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ (__pyx_v_feature_to_sample[(__pyx_v_X_indices[__pyx_v_k])]) = __pyx_v_i; - /* "sklearn/tree/_tree.pyx":4030 + /* "sklearn/tree/_tree.pyx":3960 * for k in range(X_indptr[i], X_indptr[i + 1]): * feature_to_sample[X_indices[k]] = i * X_sample[X_indices[k]] = X_data[k] # <<<<<<<<<<<<<< @@ -27919,7 +27426,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru (__pyx_v_X_sample[(__pyx_v_X_indices[__pyx_v_k])]) = (__pyx_v_X_data[__pyx_v_k]); } - /* "sklearn/tree/_tree.pyx":4033 + /* "sklearn/tree/_tree.pyx":3963 * * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -27930,7 +27437,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_3 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (!__pyx_t_3) break; - /* "sklearn/tree/_tree.pyx":4035 + /* "sklearn/tree/_tree.pyx":3965 * while node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * if feature_to_sample[node.feature] == i: # <<<<<<<<<<<<<< @@ -27940,7 +27447,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_3 = (((__pyx_v_feature_to_sample[__pyx_v_node->feature]) == __pyx_v_i) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":4036 + /* "sklearn/tree/_tree.pyx":3966 * # ... and node.right_child != _TREE_LEAF: * if feature_to_sample[node.feature] == i: * feature_value = X_sample[node.feature] # <<<<<<<<<<<<<< @@ -27952,7 +27459,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":4039 + /* "sklearn/tree/_tree.pyx":3969 * * else: * feature_value = 0. # <<<<<<<<<<<<<< @@ -27963,7 +27470,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } __pyx_L14:; - /* "sklearn/tree/_tree.pyx":4041 + /* "sklearn/tree/_tree.pyx":3971 * feature_value = 0. * * if feature_value <= node.threshold: # <<<<<<<<<<<<<< @@ -27973,7 +27480,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_t_3 = ((__pyx_v_feature_value <= __pyx_v_node->threshold) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":4042 + /* "sklearn/tree/_tree.pyx":3972 * * if feature_value <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -27985,7 +27492,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":4044 + /* "sklearn/tree/_tree.pyx":3974 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -27997,7 +27504,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_L15:; } - /* "sklearn/tree/_tree.pyx":4046 + /* "sklearn/tree/_tree.pyx":3976 * node = &self.nodes[node.right_child] * * out_ptr[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -28007,7 +27514,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru (__pyx_v_out_ptr[__pyx_v_i]) = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_node - __pyx_v_self->nodes)); } - /* "sklearn/tree/_tree.pyx":4049 + /* "sklearn/tree/_tree.pyx":3979 * * # Free auxiliary arrays * free(X_sample) # <<<<<<<<<<<<<< @@ -28016,7 +27523,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ free(__pyx_v_X_sample); - /* "sklearn/tree/_tree.pyx":4050 + /* "sklearn/tree/_tree.pyx":3980 * # Free auxiliary arrays * free(X_sample) * free(feature_to_sample) # <<<<<<<<<<<<<< @@ -28026,7 +27533,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru free(__pyx_v_feature_to_sample); } - /* "sklearn/tree/_tree.pyx":4022 + /* "sklearn/tree/_tree.pyx":3952 * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * * with nogil: # <<<<<<<<<<<<<< @@ -28044,7 +27551,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } } - /* "sklearn/tree/_tree.pyx":4052 + /* "sklearn/tree/_tree.pyx":3982 * free(feature_to_sample) * * return out # <<<<<<<<<<<<<< @@ -28056,7 +27563,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3978 + /* "sklearn/tree/_tree.pyx":3908 * return out * * cdef inline np.ndarray _apply_sparse_csr(self, object X): # <<<<<<<<<<<<<< @@ -28096,7 +27603,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4054 +/* "sklearn/tree/_tree.pyx":3984 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -28150,7 +27657,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compute_feature_importances); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compute_feature_importances); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_4Tree_15compute_feature_importances)) { __Pyx_XDECREF(__pyx_r); @@ -28166,16 +27673,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } if (!__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_normalize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_normalize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL; __Pyx_INCREF(__pyx_v_normalize); __Pyx_GIVEREF(__pyx_v_normalize); PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_normalize); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -28188,7 +27695,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":4058 + /* "sklearn/tree/_tree.pyx":3988 * cdef Node* left * cdef Node* right * cdef Node* nodes = self.nodes # <<<<<<<<<<<<<< @@ -28198,7 +27705,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_6 = __pyx_v_self->nodes; __pyx_v_nodes = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":4059 + /* "sklearn/tree/_tree.pyx":3989 * cdef Node* right * cdef Node* nodes = self.nodes * cdef Node* node = nodes # <<<<<<<<<<<<<< @@ -28207,7 +27714,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_node = __pyx_v_nodes; - /* "sklearn/tree/_tree.pyx":4060 + /* "sklearn/tree/_tree.pyx":3990 * cdef Node* nodes = self.nodes * cdef Node* node = nodes * cdef Node* end_node = node + self.node_count # <<<<<<<<<<<<<< @@ -28216,7 +27723,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_end_node = (__pyx_v_node + __pyx_v_self->node_count); - /* "sklearn/tree/_tree.pyx":4062 + /* "sklearn/tree/_tree.pyx":3992 * cdef Node* end_node = node + self.node_count * * cdef double normalizer = 0. # <<<<<<<<<<<<<< @@ -28225,21 +27732,21 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_normalizer = 0.; - /* "sklearn/tree/_tree.pyx":4065 + /* "sklearn/tree/_tree.pyx":3995 * * cdef np.ndarray[np.float64_t, ndim=1] importances * importances = np.zeros((self.n_features,)) # <<<<<<<<<<<<<< * cdef DOUBLE_t* importance_data = importances.data * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_features); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); @@ -28255,22 +27762,22 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } if (!__pyx_t_2) { - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); } else { - __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL; __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -28286,13 +27793,13 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } __pyx_pybuffernd_importances.diminfo[0].strides = __pyx_pybuffernd_importances.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_importances.diminfo[0].shape = __pyx_pybuffernd_importances.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __pyx_v_importances = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":4066 + /* "sklearn/tree/_tree.pyx":3996 * cdef np.ndarray[np.float64_t, ndim=1] importances * importances = np.zeros((self.n_features,)) * cdef DOUBLE_t* importance_data = importances.data # <<<<<<<<<<<<<< @@ -28301,7 +27808,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_importance_data = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_importances->data); - /* "sklearn/tree/_tree.pyx":4068 + /* "sklearn/tree/_tree.pyx":3998 * cdef DOUBLE_t* importance_data = importances.data * * with nogil: # <<<<<<<<<<<<<< @@ -28315,7 +27822,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":4069 + /* "sklearn/tree/_tree.pyx":3999 * * with nogil: * while node != end_node: # <<<<<<<<<<<<<< @@ -28326,7 +27833,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_12 = ((__pyx_v_node != __pyx_v_end_node) != 0); if (!__pyx_t_12) break; - /* "sklearn/tree/_tree.pyx":4070 + /* "sklearn/tree/_tree.pyx":4000 * with nogil: * while node != end_node: * if node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -28336,7 +27843,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_12 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":4072 + /* "sklearn/tree/_tree.pyx":4002 * if node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] # <<<<<<<<<<<<<< @@ -28345,7 +27852,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_left = (&(__pyx_v_nodes[__pyx_v_node->left_child])); - /* "sklearn/tree/_tree.pyx":4073 + /* "sklearn/tree/_tree.pyx":4003 * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] * right = &nodes[node.right_child] # <<<<<<<<<<<<<< @@ -28354,7 +27861,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_right = (&(__pyx_v_nodes[__pyx_v_node->right_child])); - /* "sklearn/tree/_tree.pyx":4075 + /* "sklearn/tree/_tree.pyx":4005 * right = &nodes[node.right_child] * * importance_data[node.feature] += ( # <<<<<<<<<<<<<< @@ -28363,7 +27870,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_t_13 = __pyx_v_node->feature; - /* "sklearn/tree/_tree.pyx":4077 + /* "sklearn/tree/_tree.pyx":4007 * importance_data[node.feature] += ( * node.weighted_n_node_samples * node.impurity - * left.weighted_n_node_samples * left.impurity - # <<<<<<<<<<<<<< @@ -28375,7 +27882,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":4079 + /* "sklearn/tree/_tree.pyx":4009 * left.weighted_n_node_samples * left.impurity - * right.weighted_n_node_samples * right.impurity) * node += 1 # <<<<<<<<<<<<<< @@ -28386,7 +27893,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } - /* "sklearn/tree/_tree.pyx":4068 + /* "sklearn/tree/_tree.pyx":3998 * cdef DOUBLE_t* importance_data = importances.data * * with nogil: # <<<<<<<<<<<<<< @@ -28404,19 +27911,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } - /* "sklearn/tree/_tree.pyx":4081 + /* "sklearn/tree/_tree.pyx":4011 * node += 1 * * importances /= nodes[0].weighted_n_node_samples # <<<<<<<<<<<<<< * * if normalize: */ - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_node_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_node_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -28432,32 +27939,32 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } __pyx_pybuffernd_importances.diminfo[0].strides = __pyx_pybuffernd_importances.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_importances.diminfo[0].shape = __pyx_pybuffernd_importances.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4081; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":4083 + /* "sklearn/tree/_tree.pyx":4013 * importances /= nodes[0].weighted_n_node_samples * * if normalize: # <<<<<<<<<<<<<< * normalizer = np.sum(importances) * */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_normalize); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_normalize); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":4084 + /* "sklearn/tree/_tree.pyx":4014 * * if normalize: * normalizer = np.sum(importances) # <<<<<<<<<<<<<< * * if normalizer > 0.0: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -28471,25 +27978,25 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } if (!__pyx_t_1) { - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_importances)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_importances)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } else { - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_INCREF(((PyObject *)__pyx_v_importances)); __Pyx_GIVEREF(((PyObject *)__pyx_v_importances)); PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_importances)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4084; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_normalizer = __pyx_t_14; - /* "sklearn/tree/_tree.pyx":4086 + /* "sklearn/tree/_tree.pyx":4016 * normalizer = np.sum(importances) * * if normalizer > 0.0: # <<<<<<<<<<<<<< @@ -28499,19 +28006,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_12 = ((__pyx_v_normalizer > 0.0) != 0); if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":4088 + /* "sklearn/tree/_tree.pyx":4018 * if normalizer > 0.0: * # Avoid dividing by zero (e.g., when root is pure) * importances /= normalizer # <<<<<<<<<<<<<< * * return importances */ - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_normalizer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_normalizer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -28527,7 +28034,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } __pyx_pybuffernd_importances.diminfo[0].strides = __pyx_pybuffernd_importances.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_importances.diminfo[0].shape = __pyx_pybuffernd_importances.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_4)); @@ -28539,7 +28046,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":4090 + /* "sklearn/tree/_tree.pyx":4020 * importances /= normalizer * * return importances # <<<<<<<<<<<<<< @@ -28551,7 +28058,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_r = ((PyObject *)__pyx_v_importances); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4054 + /* "sklearn/tree/_tree.pyx":3984 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -28614,7 +28121,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_4Tree_15compute_feature_importan } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_feature_importances") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_feature_importances") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -28627,7 +28134,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_4Tree_15compute_feature_importan } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compute_feature_importances", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("compute_feature_importances", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._tree.Tree.compute_feature_importances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -28652,7 +28159,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.normalize = __pyx_v_normalize; - __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_Tree->compute_feature_importances(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_vtabptr_7sklearn_4tree_5_tree_Tree->compute_feature_importances(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -28669,7 +28176,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4092 +/* "sklearn/tree/_tree.pyx":4022 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -28688,7 +28195,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_value_ndarray", 0); - /* "sklearn/tree/_tree.pyx":4099 + /* "sklearn/tree/_tree.pyx":4029 * """ * cdef np.npy_intp shape[3] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -28697,7 +28204,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ (__pyx_v_shape[0]) = ((npy_intp)__pyx_v_self->node_count); - /* "sklearn/tree/_tree.pyx":4100 + /* "sklearn/tree/_tree.pyx":4030 * cdef np.npy_intp shape[3] * shape[0] = self.node_count * shape[1] = self.n_outputs # <<<<<<<<<<<<<< @@ -28706,7 +28213,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ (__pyx_v_shape[1]) = ((npy_intp)__pyx_v_self->n_outputs); - /* "sklearn/tree/_tree.pyx":4101 + /* "sklearn/tree/_tree.pyx":4031 * shape[0] = self.node_count * shape[1] = self.n_outputs * shape[2] = self.max_n_classes # <<<<<<<<<<<<<< @@ -28715,20 +28222,20 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ (__pyx_v_shape[2]) = ((npy_intp)__pyx_v_self->max_n_classes); - /* "sklearn/tree/_tree.pyx":4103 + /* "sklearn/tree/_tree.pyx":4033 * shape[2] = self.max_n_classes * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) # <<<<<<<<<<<<<< * Py_INCREF(self) * arr.base = self */ - __pyx_t_1 = PyArray_SimpleNewFromData(3, __pyx_v_shape, NPY_DOUBLE, __pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_SimpleNewFromData(3, __pyx_v_shape, NPY_DOUBLE, __pyx_v_self->value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4033; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":4104 + /* "sklearn/tree/_tree.pyx":4034 * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -28737,7 +28244,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":4105 + /* "sklearn/tree/_tree.pyx":4035 * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -28746,7 +28253,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ __pyx_v_arr->base = ((PyObject *)__pyx_v_self); - /* "sklearn/tree/_tree.pyx":4106 + /* "sklearn/tree/_tree.pyx":4036 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -28758,7 +28265,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4092 + /* "sklearn/tree/_tree.pyx":4022 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -28778,7 +28285,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4108 +/* "sklearn/tree/_tree.pyx":4038 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -28799,7 +28306,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_get_node_ndarray", 0); - /* "sklearn/tree/_tree.pyx":4116 + /* "sklearn/tree/_tree.pyx":4046 * """ * cdef np.npy_intp shape[1] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -28808,7 +28315,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ (__pyx_v_shape[0]) = ((npy_intp)__pyx_v_self->node_count); - /* "sklearn/tree/_tree.pyx":4118 + /* "sklearn/tree/_tree.pyx":4048 * shape[0] = self.node_count * cdef np.npy_intp strides[1] * strides[0] = sizeof(Node) # <<<<<<<<<<<<<< @@ -28817,51 +28324,51 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ (__pyx_v_strides[0]) = (sizeof(struct __pyx_t_7sklearn_4tree_5_tree_Node)); - /* "sklearn/tree/_tree.pyx":4120 + /* "sklearn/tree/_tree.pyx":4050 * strides[0] = sizeof(Node) * cdef np.ndarray arr * Py_INCREF(NODE_DTYPE) # <<<<<<<<<<<<<< * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, * strides, self.nodes, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); Py_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":4121 + /* "sklearn/tree/_tree.pyx":4051 * cdef np.ndarray arr * Py_INCREF(NODE_DTYPE) * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, # <<<<<<<<<<<<<< * strides, self.nodes, * np.NPY_DEFAULT, None) */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_NODE_DTYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":4123 + /* "sklearn/tree/_tree.pyx":4053 * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, * strides, self.nodes, * np.NPY_DEFAULT, None) # <<<<<<<<<<<<<< * Py_INCREF(self) * arr.base = self */ - __pyx_t_2 = PyArray_NewFromDescr(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->nodes), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyArray_NewFromDescr(((PyObject *)((PyObject*)__pyx_ptype_5numpy_ndarray)), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->nodes), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":4121 + /* "sklearn/tree/_tree.pyx":4051 * cdef np.ndarray arr * Py_INCREF(NODE_DTYPE) * arr = PyArray_NewFromDescr(np.ndarray, NODE_DTYPE, 1, shape, # <<<<<<<<<<<<<< * strides, self.nodes, * np.NPY_DEFAULT, None) */ - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":4124 + /* "sklearn/tree/_tree.pyx":4054 * strides, self.nodes, * np.NPY_DEFAULT, None) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -28870,7 +28377,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":4125 + /* "sklearn/tree/_tree.pyx":4055 * np.NPY_DEFAULT, None) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -28879,7 +28386,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ __pyx_v_arr->base = ((PyObject *)__pyx_v_self); - /* "sklearn/tree/_tree.pyx":4126 + /* "sklearn/tree/_tree.pyx":4056 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -28891,7 +28398,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4108 + /* "sklearn/tree/_tree.pyx":4038 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -29404,7 +28911,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4143 +/* "sklearn/tree/_tree.pyx":4073 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -29426,7 +28933,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_fuse_0safe_realloc", 0); - /* "sklearn/tree/_tree.pyx":4146 + /* "sklearn/tree/_tree.pyx":4076 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -29435,7 +28942,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ __pyx_v_nbytes = (__pyx_v_nelems * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":4147 + /* "sklearn/tree/_tree.pyx":4077 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -29445,18 +28952,18 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree __pyx_t_1 = (((__pyx_v_nbytes / (sizeof(((__pyx_v_p[0])[0])))) != __pyx_v_nelems) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4150 + /* "sklearn/tree/_tree.pyx":4080 * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) # <<<<<<<<<<<<<< * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -29464,31 +28971,31 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":4149 + /* "sklearn/tree/_tree.pyx":4079 * if nbytes / sizeof(p[0][0]) != nelems: * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" # <<<<<<<<<<<<<< * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":4151 + /* "sklearn/tree/_tree.pyx":4081 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -29497,7 +29004,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ __pyx_v_tmp = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)realloc((__pyx_v_p[0]), __pyx_v_nbytes)); - /* "sklearn/tree/_tree.pyx":4152 + /* "sklearn/tree/_tree.pyx":4082 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -29507,32 +29014,32 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4153 + /* "sklearn/tree/_tree.pyx":4083 * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":4155 + /* "sklearn/tree/_tree.pyx":4085 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -29541,7 +29048,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ (__pyx_v_p[0]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":4156 + /* "sklearn/tree/_tree.pyx":4086 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -29551,7 +29058,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree __pyx_r = __pyx_v_tmp; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4143 + /* "sklearn/tree/_tree.pyx":4073 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -29585,7 +29092,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_fuse_1safe_realloc", 0); - /* "sklearn/tree/_tree.pyx":4146 + /* "sklearn/tree/_tree.pyx":4076 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -29594,7 +29101,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ __pyx_v_nbytes = (__pyx_v_nelems * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":4147 + /* "sklearn/tree/_tree.pyx":4077 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -29604,18 +29111,18 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ __pyx_t_1 = (((__pyx_v_nbytes / (sizeof(((__pyx_v_p[0])[0])))) != __pyx_v_nelems) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4150 + /* "sklearn/tree/_tree.pyx":4080 * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) # <<<<<<<<<<<<<< * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -29623,31 +29130,31 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":4149 + /* "sklearn/tree/_tree.pyx":4079 * if nbytes / sizeof(p[0][0]) != nelems: * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" # <<<<<<<<<<<<<< * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":4151 + /* "sklearn/tree/_tree.pyx":4081 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -29656,7 +29163,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ __pyx_v_tmp = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)realloc((__pyx_v_p[0]), __pyx_v_nbytes)); - /* "sklearn/tree/_tree.pyx":4152 + /* "sklearn/tree/_tree.pyx":4082 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -29666,32 +29173,32 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4153 + /* "sklearn/tree/_tree.pyx":4083 * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":4155 + /* "sklearn/tree/_tree.pyx":4085 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -29700,7 +29207,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ (__pyx_v_p[0]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":4156 + /* "sklearn/tree/_tree.pyx":4086 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -29710,7 +29217,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ __pyx_r = __pyx_v_tmp; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4143 + /* "sklearn/tree/_tree.pyx":4073 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -29744,7 +29251,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_fuse_2safe_realloc", 0); - /* "sklearn/tree/_tree.pyx":4146 + /* "sklearn/tree/_tree.pyx":4076 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -29753,7 +29260,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ __pyx_v_nbytes = (__pyx_v_nelems * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":4147 + /* "sklearn/tree/_tree.pyx":4077 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -29763,18 +29270,18 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns __pyx_t_1 = (((__pyx_v_nbytes / (sizeof(((__pyx_v_p[0])[0])))) != __pyx_v_nelems) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4150 + /* "sklearn/tree/_tree.pyx":4080 * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) # <<<<<<<<<<<<<< * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nelems); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t((sizeof(((__pyx_v_p[0])[0])))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -29782,31 +29289,31 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4080; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":4149 + /* "sklearn/tree/_tree.pyx":4079 * if nbytes / sizeof(p[0][0]) != nelems: * # Overflow in the multiplication * raise MemoryError("could not allocate (%d * %d) bytes" # <<<<<<<<<<<<<< * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":4151 + /* "sklearn/tree/_tree.pyx":4081 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -29815,7 +29322,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ __pyx_v_tmp = ((unsigned char *)realloc((__pyx_v_p[0]), __pyx_v_nbytes)); - /* "sklearn/tree/_tree.pyx":4152 + /* "sklearn/tree/_tree.pyx":4082 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -29825,32 +29332,32 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4153 + /* "sklearn/tree/_tree.pyx":4083 * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":4155 + /* "sklearn/tree/_tree.pyx":4085 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -29859,7 +29366,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ (__pyx_v_p[0]) = __pyx_v_tmp; - /* "sklearn/tree/_tree.pyx":4156 + /* "sklearn/tree/_tree.pyx":4086 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -29869,7 +29376,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns __pyx_r = __pyx_v_tmp; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4143 + /* "sklearn/tree/_tree.pyx":4073 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -29889,7 +29396,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4159 +/* "sklearn/tree/_tree.pyx":4089 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -29921,7 +29428,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_realloc_test", 0); - /* "sklearn/tree/_tree.pyx":4162 + /* "sklearn/tree/_tree.pyx":4092 * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. * cdef SIZE_t* p = NULL # <<<<<<<<<<<<<< @@ -29930,16 +29437,16 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ __pyx_v_p = NULL; - /* "sklearn/tree/_tree.pyx":4163 + /* "sklearn/tree/_tree.pyx":4093 * # bytes, which will always overflow. * cdef SIZE_t* p = NULL * safe_realloc(&p, (-1) / 2) # <<<<<<<<<<<<<< * if p != NULL: * free(p) */ - __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_p), (((size_t)-1) / 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_fuse_1__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_p), (((size_t)-1) / 2)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":4164 + /* "sklearn/tree/_tree.pyx":4094 * cdef SIZE_t* p = NULL * safe_realloc(&p, (-1) / 2) * if p != NULL: # <<<<<<<<<<<<<< @@ -29949,7 +29456,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb __pyx_t_1 = ((__pyx_v_p != NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":4165 + /* "sklearn/tree/_tree.pyx":4095 * safe_realloc(&p, (-1) / 2) * if p != NULL: * free(p) # <<<<<<<<<<<<<< @@ -29958,7 +29465,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ free(__pyx_v_p); - /* "sklearn/tree/_tree.pyx":4166 + /* "sklearn/tree/_tree.pyx":4096 * if p != NULL: * free(p) * assert False # <<<<<<<<<<<<<< @@ -29969,7 +29476,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!0)) { PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif @@ -29977,7 +29484,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":4159 + /* "sklearn/tree/_tree.pyx":4089 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -29997,7 +29504,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4171 +/* "sklearn/tree/_tree.pyx":4101 * # rand_r replacement using a 32bit XorShift generator * # See http://www.jstatsoft.org/v08/i14/paper for details * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: # <<<<<<<<<<<<<< @@ -30009,7 +29516,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_r; long __pyx_t_1; - /* "sklearn/tree/_tree.pyx":4172 + /* "sklearn/tree/_tree.pyx":4102 * # See http://www.jstatsoft.org/v08/i14/paper for details * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) # <<<<<<<<<<<<<< @@ -30019,7 +29526,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_1 = 0; (__pyx_v_seed[__pyx_t_1]) = ((__pyx_v_seed[__pyx_t_1]) ^ ((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)((__pyx_v_seed[0]) << 13))); - /* "sklearn/tree/_tree.pyx":4173 + /* "sklearn/tree/_tree.pyx":4103 * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) # <<<<<<<<<<<<<< @@ -30029,7 +29536,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_1 = 0; (__pyx_v_seed[__pyx_t_1]) = ((__pyx_v_seed[__pyx_t_1]) ^ ((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)((__pyx_v_seed[0]) >> 17))); - /* "sklearn/tree/_tree.pyx":4174 + /* "sklearn/tree/_tree.pyx":4104 * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) * seed[0] ^= (seed[0] << 5) # <<<<<<<<<<<<<< @@ -30039,7 +29546,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_t_1 = 0; (__pyx_v_seed[__pyx_t_1]) = ((__pyx_v_seed[__pyx_t_1]) ^ ((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)((__pyx_v_seed[0]) << 5))); - /* "sklearn/tree/_tree.pyx":4176 + /* "sklearn/tree/_tree.pyx":4106 * seed[0] ^= (seed[0] << 5) * * return seed[0] % (RAND_R_MAX + 1) # <<<<<<<<<<<<<< @@ -30049,7 +29556,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr __pyx_r = ((__pyx_v_seed[0]) % (((__pyx_t_7sklearn_4tree_5_tree_UINT32_t)__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX) + 1)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4171 + /* "sklearn/tree/_tree.pyx":4101 * # rand_r replacement using a 32bit XorShift generator * # See http://www.jstatsoft.org/v08/i14/paper for details * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: # <<<<<<<<<<<<<< @@ -30062,7 +29569,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4178 +/* "sklearn/tree/_tree.pyx":4108 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -30080,7 +29587,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sizet_ptr_to_ndarray", 0); - /* "sklearn/tree/_tree.pyx":4181 + /* "sklearn/tree/_tree.pyx":4111 * """Encapsulate data into a 1D numpy array of intp's.""" * cdef np.npy_intp shape[1] * shape[0] = size # <<<<<<<<<<<<<< @@ -30089,7 +29596,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n */ (__pyx_v_shape[0]) = ((npy_intp)__pyx_v_size); - /* "sklearn/tree/_tree.pyx":4182 + /* "sklearn/tree/_tree.pyx":4112 * cdef np.npy_intp shape[1] * shape[0] = size * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) # <<<<<<<<<<<<<< @@ -30097,14 +29604,14 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, */ __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_shape, NPY_INTP, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyArray_SimpleNewFromData(1, __pyx_v_shape, NPY_INTP, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4178 + /* "sklearn/tree/_tree.pyx":4108 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -30123,7 +29630,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4184 +/* "sklearn/tree/_tree.pyx":4114 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, # <<<<<<<<<<<<<< @@ -30134,7 +29641,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_rand_int(__pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_low, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_high, __pyx_t_7sklearn_4tree_5_tree_UINT32_t *__pyx_v_random_state) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_r; - /* "sklearn/tree/_tree.pyx":4187 + /* "sklearn/tree/_tree.pyx":4117 * UINT32_t* random_state) nogil: * """Generate a random integer in [0; end).""" * return low + our_rand_r(random_state) % (high - low) # <<<<<<<<<<<<<< @@ -30144,7 +29651,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_r = (__pyx_v_low + (__pyx_f_7sklearn_4tree_5_tree_our_rand_r(__pyx_v_random_state) % (__pyx_v_high - __pyx_v_low))); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4184 + /* "sklearn/tree/_tree.pyx":4114 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, # <<<<<<<<<<<<<< @@ -30157,7 +29664,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4189 +/* "sklearn/tree/_tree.pyx":4119 * return low + our_rand_r(random_state) % (high - low) * * cdef inline double rand_uniform(double low, double high, # <<<<<<<<<<<<<< @@ -30168,7 +29675,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __pyx_v_low, double __pyx_v_high, __pyx_t_7sklearn_4tree_5_tree_UINT32_t *__pyx_v_random_state) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":4193 + /* "sklearn/tree/_tree.pyx":4123 * """Generate a random double in [low; high).""" * return ((high - low) * our_rand_r(random_state) / * RAND_R_MAX) + low # <<<<<<<<<<<<<< @@ -30178,7 +29685,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ __pyx_r = ((((__pyx_v_high - __pyx_v_low) * ((double)__pyx_f_7sklearn_4tree_5_tree_our_rand_r(__pyx_v_random_state))) / ((double)__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX)) + __pyx_v_low); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4189 + /* "sklearn/tree/_tree.pyx":4119 * return low + our_rand_r(random_state) % (high - low) * * cdef inline double rand_uniform(double low, double high, # <<<<<<<<<<<<<< @@ -30191,7 +29698,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":4195 +/* "sklearn/tree/_tree.pyx":4125 * RAND_R_MAX) + low * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -30201,7 +29708,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":4196 + /* "sklearn/tree/_tree.pyx":4126 * * cdef inline double log(double x) nogil: * return ln(x) / ln(2.0) # <<<<<<<<<<<<<< @@ -30209,7 +29716,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) __pyx_r = (log(__pyx_v_x) / log(2.0)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":4195 + /* "sklearn/tree/_tree.pyx":4125 * RAND_R_MAX) + low * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -33635,73 +33142,65 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter = { 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_SpeedSplitter __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSESplitter __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSESplitter; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_SpeedSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p; - PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_BaseDenseSplitter(t, a, k); +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_FriedmanMSESplitter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *)o); + p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSESplitter; p->X_idx_sorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_1__cinit__(o, a, k) < 0)) { + if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_19FriedmanMSESplitter_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_SpeedSplitter(PyObject *o) { - struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o; +static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_FriedmanMSESplitter(PyObject *o) { + struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *)o; #if PY_VERSION_HEX >= 0x030400a1 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } Py_CLEAR(p->X_idx_sorted); PyObject_GC_Track(o); - __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter(o); + __pyx_tp_dealloc_7sklearn_4tree_5_tree_PresortBestSplitter(o); } -static int __pyx_tp_traverse_7sklearn_4tree_5_tree_SpeedSplitter(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_7sklearn_4tree_5_tree_FriedmanMSESplitter(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o; - e = __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter(o, v, a); if (e) return e; + struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *)o; + e = __pyx_tp_traverse_7sklearn_4tree_5_tree_PresortBestSplitter(o, v, a); if (e) return e; if (p->X_idx_sorted) { e = (*v)(((PyObject*)p->X_idx_sorted), a); if (e) return e; } return 0; } -static int __pyx_tp_clear_7sklearn_4tree_5_tree_SpeedSplitter(PyObject *o) { +static int __pyx_tp_clear_7sklearn_4tree_5_tree_FriedmanMSESplitter(PyObject *o) { PyObject* tmp; - struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter *)o; - __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter(o); + struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter *)o; + __pyx_tp_clear_7sklearn_4tree_5_tree_PresortBestSplitter(o); tmp = ((PyObject*)p->X_idx_sorted); p->X_idx_sorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } -static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_SpeedSplitter[] = { - {"__reduce", (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_13SpeedSplitter_5__reduce, METH_NOARGS, 0}, +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_FriedmanMSESplitter[] = { + {"__reduce", (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_19FriedmanMSESplitter_3__reduce, METH_NOARGS, 0}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter = { +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter = { PyVarObject_HEAD_INIT(0, 0) - "sklearn.tree._tree.SpeedSplitter", /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_SpeedSplitter), /*tp_basicsize*/ + "sklearn.tree._tree.FriedmanMSESplitter", /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSESplitter), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_FriedmanMSESplitter, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -33722,13 +33221,13 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n This object is a splitter which performs more caching in order to try to\n find splits faster.\n ", /*tp_doc*/ - __pyx_tp_traverse_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_traverse*/ - __pyx_tp_clear_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_clear*/ + __pyx_tp_traverse_7sklearn_4tree_5_tree_FriedmanMSESplitter, /*tp_traverse*/ + __pyx_tp_clear_7sklearn_4tree_5_tree_FriedmanMSESplitter, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_methods*/ + __pyx_methods_7sklearn_4tree_5_tree_FriedmanMSESplitter, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -33738,7 +33237,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_SpeedSplitter, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_FriedmanMSESplitter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -34277,7 +33776,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; @@ -34288,47 +33787,47 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/tree/_tree.pyx":2560 + /* "sklearn/tree/_tree.pyx":2488 * * if not isinstance(X, csc_matrix): * raise ValueError("X should be in csc format") # <<<<<<<<<<<<<< * * cdef SIZE_t* samples = self.samples */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_X_should_be_in_csc_format); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_X_should_be_in_csc_format); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "sklearn/tree/_tree.pyx":3294 + /* "sklearn/tree/_tree.pyx":3222 * * if X.indices.dtype != np.int32 or X.indptr.dtype != np.int32: * raise ValueError("No support for np.int64 index based " # <<<<<<<<<<<<<< * "sparse matrices") * */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_No_support_for_np_int64_index_ba); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_No_support_for_np_int64_index_ba); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "sklearn/tree/_tree.pyx":3812 + /* "sklearn/tree/_tree.pyx":3742 * * if 'nodes' not in d: * raise ValueError('You have loaded Tree version which ' # <<<<<<<<<<<<<< * 'cannot be imported') * */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_You_have_loaded_Tree_version_whi); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_You_have_loaded_Tree_version_whi); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "sklearn/tree/_tree.pyx":3826 + /* "sklearn/tree/_tree.pyx":3756 * not value_ndarray.flags.c_contiguous or * value_ndarray.dtype != np.float64): * raise ValueError('Did not recognise loaded array layout') # <<<<<<<<<<<<<< * * self.capacity = node_ndarray.shape[0] */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Did_not_recognise_loaded_array_l); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Did_not_recognise_loaded_array_l); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3756; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); @@ -34398,17 +33897,17 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "sklearn/tree/_tree.pyx":4159 + /* "sklearn/tree/_tree.pyx":4089 * * * def _realloc_test(): # <<<<<<<<<<<<<< * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. */ - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_n_s_realloc_test, 4159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_jmschrei_Bureau_scikit, __pyx_n_s_realloc_test, 4089, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -34552,18 +34051,18 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_Tree._apply_dense = (PyArrayObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *))__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense; __pyx_vtable_7sklearn_4tree_5_tree_Tree._apply_sparse_csr = (PyArrayObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *))__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr; __pyx_vtable_7sklearn_4tree_5_tree_Tree.compute_feature_importances = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_Tree.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Tree.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "Tree", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Tree.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "Tree", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Tree = &__pyx_type_7sklearn_4tree_5_tree_Tree; __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build; __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder._check_input = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, PyObject *, PyArrayObject *, PyArrayObject *))__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_TreeBuilder.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_TreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_TreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; @@ -34669,64 +34168,64 @@ PyMODINIT_FUNC PyInit__tree(void) if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyObject_SetAttrString(__pyx_m, "PresortBestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter = &__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter; - __pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter; - __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseDenseSplitter; - __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_init; - __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_split; - __pyx_vtable_7sklearn_4tree_5_tree_SpeedSplitter.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *))__pyx_f_7sklearn_4tree_5_tree_13SpeedSplitter_node_impurity; - __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseDenseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_type_7sklearn_4tree_5_tree_SpeedSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_SpeedSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "SpeedSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_5_tree_SpeedSplitter = &__pyx_type_7sklearn_4tree_5_tree_SpeedSplitter; + __pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSESplitter = &__pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSESplitter; + __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSESplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter; + __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSESplitter.__pyx_base.__pyx_base.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_init; + __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSESplitter.__pyx_base.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_node_split; + __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSESplitter.__pyx_base.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *))__pyx_f_7sklearn_4tree_5_tree_19FriedmanMSESplitter_node_impurity; + __pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter; + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter.tp_print = 0; + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSESplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "FriedmanMSESplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSESplitter = &__pyx_type_7sklearn_4tree_5_tree_FriedmanMSESplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter._partition = (__pyx_t_7sklearn_4tree_5_tree_SIZE_t (*)(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *, double, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.extract_nnz = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, int *))__pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_extract_nnz; __pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_Splitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BaseSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BaseSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter = &__pyx_type_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BestSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BestSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BestSparseSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BestSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BestSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestSparseSplitter = &__pyx_type_7sklearn_4tree_5_tree_BestSparseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_RandomSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_RandomSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_RandomSparseSplitter.__pyx_base.__pyx_base.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *))__pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split; __pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_BaseSparseSplitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "RandomSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3057; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "RandomSparseSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_RandomSparseSplitter = &__pyx_type_7sklearn_4tree_5_tree_RandomSparseSplitter; __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.__pyx_base.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build; __pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "DepthFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "DepthFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder.__pyx_base.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args))__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build; __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder._add_split_node = (int (*)(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double, int, int, struct __pyx_t_7sklearn_4tree_5_tree_Node *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *))__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node; __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (PyObject_SetAttrString(__pyx_m, "BestFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttrString(__pyx_m, "BestFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestFirstTreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -35229,7 +34728,7 @@ PyMODINIT_FUNC PyInit__tree(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_NODE_DTYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3844 + /* "sklearn/tree/_tree.pyx":3774 * # XXX using (size_t)(-1) is ugly, but SIZE_MAX is not available in C89 * # (i.e., older MSVC). * cdef int _resize_c(self, SIZE_t capacity=(-1)) nogil: # <<<<<<<<<<<<<< @@ -35238,16 +34737,16 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_k__5 = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1); - /* "sklearn/tree/_tree.pyx":4159 + /* "sklearn/tree/_tree.pyx":4089 * * * def _realloc_test(): # <<<<<<<<<<<<<< * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_4tree_5_tree_1_realloc_test, NULL, __pyx_n_s_sklearn_tree__tree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_4tree_5_tree_1_realloc_test, NULL, __pyx_n_s_sklearn_tree__tree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_realloc_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_realloc_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4089; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/tree/_tree.pyx":1 diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index fa4c27f90428a..3ec7ba2e23d5b 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -2150,43 +2150,25 @@ cdef class PresortBestSplitter(BaseDenseSplitter): split[0] = best n_constant_features[0] = n_total_constants -cdef class SpeedSplitter( BaseDenseSplitter ): +cdef class FriedmanMSESplitter(PresortBestSplitter): """ This object is a splitter which performs more caching in order to try to find splits faster. """ - cdef DTYPE_t* X_old - cdef np.ndarray X_idx_sorted - cdef SIZE_t X_idx_sorted_stride - cdef INT32_t* X_idx_sorted_ptr - - cdef unsigned char* sample_mask - cdef SIZE_t X_feature_stride cdef double impurity + cdef DOUBLE_t [:] cumulative_weights def __cinit__(self, Criterion criterion, SIZE_t max_features, SIZE_t mn_samples_leaf, double min_weight_leaf, object random_state): - # Initialize the points to point at appropriate objects - self.X_old = NULL - self.X_idx_sorted_stride = 0 - self.X_idx_sorted_ptr = NULL - self.sample_mask = NULL - self.X_feature_stride = 0 self.impurity = 0. - - def __dealloc__(self): - """ - Free the memory associated with this object. - """ - - free(self.sample_mask) + self.cumulative_weights = NULL def __reduce(self): - return (SpeedSplitter, (self.criterion, + return (FriedmanMSESplitter, (self.criterion, self.max_features, self.min_samples_leaf, self.min_weight_leaf, @@ -2199,73 +2181,8 @@ cdef class SpeedSplitter( BaseDenseSplitter ): Initialize the values in this object. """ - # Unpack X and expose its memory buffer - self.n_samples = X.shape[0] - self.n_features = X.shape[1] - cdef np.ndarray X_ndarray = X - self.X = X_ndarray.data - self.X_sample_stride = X.strides[0] / X.itemsize - self.X_feature_stride = X.strides[1] / X.itemsize - self.impurity = 1.e2 - - cdef void* sample_mask = NULL - - # Get the random state - self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) - - cdef SIZE_t i, j = 0 - self.weighted_n_samples = 0.0 - - cdef SIZE_t* samples = safe_realloc(&self.samples, self.n_samples) - - # In order to only use positively weighted samples, we must go through - # each sample and check its associated weight, if given. If no weights - # are given, we assume the weight on each point is equal to 1. - for i in range(self.n_samples): - # If no sample weights are passed in, or the associated sample - # weight is greater than 0, add that sample to the growing array, - # and increment the count - if sample_weight == NULL or sample_weight[i] != 0.0: - samples[j] = i - j += 1 - - # Add the sample weight, or 1.0 if no sample weights are given. - # If the sample weight is 0.0, then it does not matter if added - # to the weight sum - if sample_weight != NULL: - self.weighted_n_samples += sample_weight[i] - else: - self.weighted_n_samples += 1 - - self.n_samples = j - - cdef SIZE_t* features = safe_realloc(&self.features, self.n_features) - for i in range(self.n_features): - features[i] = i - - safe_realloc(&self.feature_values, self.n_samples) - safe_realloc(&self.constant_features, self.n_features) - - # Save y as a reference to a buffer for memory efficient access - self.y = y.data - self.y_stride = y.strides[0] / y.itemsize - - # Store the weight of each sample - self.sample_weight = sample_weight - - # Pre-sort X so that we can access sorted columns easier; in essence - # caching the sort. - if self.X_old != self.X: - self.X_old = self.X - - self.X_idx_sorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), - dtype=np.int32) - self.X_idx_sorted_ptr = self.X_idx_sorted.data - self.X_idx_sorted_stride = ( self.X_idx_sorted.strides[1] / - self.X_idx_sorted.itemsize) - - sample_mask = safe_realloc(&self.sample_mask, self.n_samples) - memset(sample_mask, 0, self.n_samples) + PresortBestSplitter.init(self, X, y, sample_weight) + self.impurity = 100 cdef void node_split(self, double impurity, SplitRecord* split, SIZE_t* n_constant_features) nogil: @@ -2292,9 +2209,9 @@ cdef class SpeedSplitter( BaseDenseSplitter ): cdef DTYPE_t* X = self.X cdef DTYPE_t* X_i = self.feature_values cdef SIZE_t X_sample_stride = self.X_sample_stride - cdef SIZE_t X_feature_stride = self.X_feature_stride - cdef INT32_t* X_idx_sorted = self.X_idx_sorted_ptr - cdef SIZE_t X_idx_sorted_stride = self.X_idx_sorted_stride + cdef SIZE_t X_feature_stride = self.X_fx_stride + cdef INT32_t* X_idx_sorted = self.X_argsorted_ptr + cdef SIZE_t X_idx_sorted_stride = self.X_argsorted_stride # Unpack y cdef DOUBLE_t* y = self.y @@ -2456,6 +2373,7 @@ cdef class SpeedSplitter( BaseDenseSplitter ): current.threshold = X_i[p-1] best = current + self.cumulative_weights = w # Constants pulling out the sum, to make the next equations simpler to # understand @@ -2518,6 +2436,14 @@ cdef class SpeedSplitter( BaseDenseSplitter ): return self.impurity + cdef double node_reset(start, end, weighted_node_samples): + """ + Return the weight of the used samples. + """ + + weighted_node_samples[0] = (self.cumulative_weights[end] - + self.cumulative_weights[start]) + cdef class BaseSparseSplitter(Splitter): # The sparse splitter works only with csc sparse matrix format cdef DTYPE_t* X_data @@ -3327,7 +3253,6 @@ cdef class DepthFirstTreeBuilder(TreeBuilder): cpdef build(self, Tree tree, object X, np.ndarray y, np.ndarray sample_weight=None): """Build a decision tree from the training set (X, y).""" - # check input X, y, sample_weight = self._check_input(X, y, sample_weight) @@ -3403,16 +3328,18 @@ cdef class DepthFirstTreeBuilder(TreeBuilder): (n_node_samples < 2 * min_samples_leaf) or (weighted_n_node_samples < min_weight_leaf)) - if not is_leaf: - splitter.node_split(impurity, &split, &n_constant_features) - is_leaf = is_leaf or (split.pos >= end) - if first: impurity = splitter.node_impurity() first = 0 - + is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) + if not is_leaf: + splitter.node_split(impurity, &split, &n_constant_features) + is_leaf = is_leaf or (split.pos >= end) + + if impurity == 100: + impurity = splitter.node_impurity() node_id = tree._add_node(parent, is_left, is_leaf, split.feature, split.threshold, impurity, n_node_samples, @@ -3447,10 +3374,10 @@ cdef class DepthFirstTreeBuilder(TreeBuilder): if rc >= 0: tree.max_depth = max_depth_seen + if rc == -1: raise MemoryError() - # Best first builder ---------------------------------------------------------- cdef inline int _add_to_frontier(PriorityHeapRecord* rec,