From d39716e8179de2a8cd165087ab84a69216274068 Mon Sep 17 00:00:00 2001 From: Arnaud Joly Date: Tue, 1 Sep 2015 14:20:46 +0200 Subject: [PATCH] Optimize MSE criterion By avoiding computing constant terms during split optimization. --- doc/whats_new.rst | 11 +- sklearn/tree/_tree.c | 8507 +++++++++++++++++++++------------------- sklearn/tree/_tree.pxd | 1 + sklearn/tree/_tree.pyx | 412 +- 4 files changed, 4631 insertions(+), 4300 deletions(-) diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 7ba8e03378b11..4c970d4b64326 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -127,15 +127,22 @@ Enhancements - Allow :func:`datasets.make_multilabel_classification` to output a sparse ``y``. By Kashif Rasul. - + - :class:`cluster.DBSCAN` now accepts a sparse matrix of precomputed distances, allowing memory-efficient distance precomputation. By `Joel Nothman`_. - + - :class:`tree.DecisionTreeClassifier` now exposes an ``apply`` method for retrieving the leaf indices samples are predicted as. By `Daniel Galvez`_ and `Gilles Louppe`_. + - Speed up decision tree regressors, random forest regressors, extra trees + regressors and gradient boosting estimators by computing a proxy + of the impurity improvement during the tree growth. The proxy quantity is + such that the split that maximizes this value also maximizes the impurity + improvement. By `Arnaud Joly`_, `Jacob Schreiber`_ and `Gilles Louppe`_ + + Bug fixes ......... diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index fe399fa621b42..5a86b45856db4 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -512,7 +512,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767 +/* "../../../anaconda/lib/python3.4/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; -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":769 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -880,7 +880,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build; struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build; struct __pyx_opt_args_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build; -/* "sklearn/tree/_tree.pxd":67 +/* "sklearn/tree/_tree.pxd":68 * # ============================================================================= * * cdef struct SplitRecord: # <<<<<<<<<<<<<< @@ -896,7 +896,7 @@ struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord { double impurity_right; }; -/* "sklearn/tree/_tree.pxd":146 +/* "sklearn/tree/_tree.pxd":147 * # ============================================================================= * * cdef struct Node: # <<<<<<<<<<<<<< @@ -913,7 +913,7 @@ struct __pyx_t_7sklearn_4tree_5_tree_Node { __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t weighted_n_node_samples; }; -/* "sklearn/tree/_tree.pxd":184 +/* "sklearn/tree/_tree.pxd":185 * double weighted_n_samples) nogil * cdef void _resize(self, SIZE_t capacity) except * * cdef int _resize_c(self, SIZE_t capacity=*) nogil # <<<<<<<<<<<<<< @@ -925,7 +925,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree__resize_c { __pyx_t_7sklearn_4tree_5_tree_SIZE_t capacity; }; -/* "sklearn/tree/_tree.pxd":194 +/* "sklearn/tree/_tree.pxd":195 * cdef np.ndarray _apply_sparse_csr(self, object X) * * cpdef compute_feature_importances(self, normalize=*) # <<<<<<<<<<<<<< @@ -937,7 +937,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances { PyObject *normalize; }; -/* "sklearn/tree/_tree.pxd":216 +/* "sklearn/tree/_tree.pxd":217 * cdef SIZE_t max_depth # Maximal tree depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -960,7 +960,7 @@ enum { __pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX = 0x7FFFFFFF }; -/* "sklearn/tree/_tree.pyx":2869 +/* "sklearn/tree/_tree.pyx":2926 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -972,7 +972,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":3026 +/* "sklearn/tree/_tree.pyx":3083 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1042,7 +1042,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Criterion { }; -/* "sklearn/tree/_tree.pxd":79 +/* "sklearn/tree/_tree.pxd":80 * * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1073,7 +1073,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { }; -/* "sklearn/tree/_tree.pxd":158 +/* "sklearn/tree/_tree.pxd":159 * * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1096,7 +1096,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Tree { }; -/* "sklearn/tree/_tree.pxd":201 +/* "sklearn/tree/_tree.pxd":202 * # ============================================================================= * * cdef class TreeBuilder: # <<<<<<<<<<<<<< @@ -1114,7 +1114,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder { }; -/* "sklearn/tree/_tree.pyx":232 +/* "sklearn/tree/_tree.pyx":252 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1131,11 +1131,11 @@ struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion { }; -/* "sklearn/tree/_tree.pyx":509 +/* "sklearn/tree/_tree.pyx":516 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< - * """A class representing the Cross Entropy impurity criteria. + * """Cross Entropy impurity criterion. * */ struct __pyx_obj_7sklearn_4tree_5_tree_Entropy { @@ -1143,11 +1143,11 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Entropy { }; -/* "sklearn/tree/_tree.pyx":615 +/* "sklearn/tree/_tree.pyx":620 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< - * """The Gini Index impurity criteria. + * """Gini Index impurity criterion. * */ struct __pyx_obj_7sklearn_4tree_5_tree_Gini { @@ -1155,30 +1155,24 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Gini { }; -/* "sklearn/tree/_tree.pyx":730 +/* "sklearn/tree/_tree.pyx":729 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< - * """A regression criteria. + * """Abstract regression criterion. * */ struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion { struct __pyx_obj_7sklearn_4tree_5_tree_Criterion __pyx_base; - double *mean_left; - double *mean_right; - double *mean_total; - double *sq_sum_left; - double *sq_sum_right; + double *sq_sum_tmp; double *sq_sum_total; - double *var_left; - double *var_right; double *sum_left; double *sum_right; double *sum_total; }; -/* "sklearn/tree/_tree.pyx":1026 +/* "sklearn/tree/_tree.pyx":931 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1190,7 +1184,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_MSE { }; -/* "sklearn/tree/_tree.pyx":1067 +/* "sklearn/tree/_tree.pyx":1047 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1202,7 +1196,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE { }; -/* "sklearn/tree/_tree.pyx":1285 +/* "sklearn/tree/_tree.pyx":1299 * * * cdef class BaseDenseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1217,7 +1211,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseDenseSplitter { }; -/* "sklearn/tree/_tree.pyx":1315 +/* "sklearn/tree/_tree.pyx":1329 * * * cdef class BestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1229,7 +1223,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter { }; -/* "sklearn/tree/_tree.pyx":1614 +/* "sklearn/tree/_tree.pyx":1635 * * * cdef class RandomSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1241,7 +1235,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter { }; -/* "sklearn/tree/_tree.pyx":1816 +/* "sklearn/tree/_tree.pyx":1846 * * * cdef class PresortBestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1259,7 +1253,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter { }; -/* "sklearn/tree/_tree.pyx":2063 +/* "sklearn/tree/_tree.pyx":2100 * n_constant_features[0] = n_total_constants * * cdef class BaseSparseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1277,7 +1271,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2382 +/* "sklearn/tree/_tree.pyx":2419 * * * cdef class BestSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1289,7 +1283,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2600 +/* "sklearn/tree/_tree.pyx":2645 * * * cdef class RandomSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1301,7 +1295,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSparseSplitter { }; -/* "sklearn/tree/_tree.pyx":2857 +/* "sklearn/tree/_tree.pyx":2914 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1313,7 +1307,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { }; -/* "sklearn/tree/_tree.pyx":3006 +/* "sklearn/tree/_tree.pyx":3063 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1375,11 +1369,12 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion { void (*children_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *); void (*node_value)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *); double (*impurity_improvement)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double); + double (*proxy_impurity_improvement)(struct __pyx_obj_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":1112 +/* "sklearn/tree/_tree.pyx":1123 * * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1397,7 +1392,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":3210 +/* "sklearn/tree/_tree.pyx":3267 * # ============================================================================= * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1422,11 +1417,11 @@ 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":2818 +/* "sklearn/tree/_tree.pyx":2875 * # Tree builders * # ============================================================================= * cdef class TreeBuilder: # <<<<<<<<<<<<<< - * """Interface for different tree building strategies. """ + * """Interface for different tree building strategies.""" * */ @@ -1438,7 +1433,7 @@ 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":232 +/* "sklearn/tree/_tree.pyx":252 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1452,11 +1447,11 @@ 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":509 +/* "sklearn/tree/_tree.pyx":516 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< - * """A class representing the Cross Entropy impurity criteria. + * """Cross Entropy impurity criterion. * */ @@ -1466,11 +1461,11 @@ 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":615 +/* "sklearn/tree/_tree.pyx":620 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< - * """The Gini Index impurity criteria. + * """Gini Index impurity criterion. * */ @@ -1480,11 +1475,11 @@ 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":730 +/* "sklearn/tree/_tree.pyx":729 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< - * """A regression criteria. + * """Abstract regression criterion. * */ @@ -1494,7 +1489,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":1026 +/* "sklearn/tree/_tree.pyx":931 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1508,7 +1503,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":1067 +/* "sklearn/tree/_tree.pyx":1047 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1522,7 +1517,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":1285 +/* "sklearn/tree/_tree.pyx":1299 * * * cdef class BaseDenseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1536,7 +1531,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":1315 +/* "sklearn/tree/_tree.pyx":1329 * * * cdef class BestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1550,7 +1545,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":1614 +/* "sklearn/tree/_tree.pyx":1635 * * * cdef class RandomSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1564,7 +1559,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":1816 +/* "sklearn/tree/_tree.pyx":1846 * * * cdef class PresortBestSplitter(BaseDenseSplitter): # <<<<<<<<<<<<<< @@ -1578,7 +1573,7 @@ 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":2063 +/* "sklearn/tree/_tree.pyx":2100 * n_constant_features[0] = n_total_constants * * cdef class BaseSparseSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1596,7 +1591,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":2382 +/* "sklearn/tree/_tree.pyx":2419 * * * cdef class BestSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1610,7 +1605,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":2600 +/* "sklearn/tree/_tree.pyx":2645 * * * cdef class RandomSparseSplitter(BaseSparseSplitter): # <<<<<<<<<<<<<< @@ -1624,7 +1619,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":2857 +/* "sklearn/tree/_tree.pyx":2914 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1638,7 +1633,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":3006 +/* "sklearn/tree/_tree.pyx":3063 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -2051,6 +2046,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_update(CYTHON_UNUSED struct static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self); /* proto*/ 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); /* proto*/ 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); /* proto*/ +static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self); /* proto*/ 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); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, __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_DOUBLE_t *__pyx_v_sample_weight, double __pyx_v_weighted_n_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self); /* proto*/ @@ -2069,7 +2065,9 @@ static double __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_impurity( static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurity(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, CYTHON_UNUSED double *__pyx_v_impurity_left, CYTHON_UNUSED double *__pyx_v_impurity_right); /* proto*/ 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); /* proto*/ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self); /* proto*/ +static double __pyx_f_7sklearn_4tree_5_tree_3MSE_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right); /* proto*/ +static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_v_self); /* proto*/ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity); /* proto*/ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *__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_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); /* proto*/ @@ -2470,8 +2468,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,6 +2493,7 @@ 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; @@ -2586,7 +2585,6 @@ 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; @@ -2625,8 +2623,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_init(CYTHON_UNUSED struct _ * pass * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< - * """Placeholder for a method which will reset the criterion at - * pos=start. + * """Reset the criterion at pos=start. + * */ 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 +2632,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_reset(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":140 +/* "sklearn/tree/_tree.pyx":141 * pass * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< - * """ - * This is a placeholder for a method which will update the collected + * """Updated statistics by moving samples[pos:new_pos] to the left child. + * */ 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,7 +2645,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_update(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":154 +/* "sklearn/tree/_tree.pyx":156 * pass * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -2663,7 +2661,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity(CYTHON_UNUS return __pyx_r; } -/* "sklearn/tree/_tree.pyx":164 +/* "sklearn/tree/_tree.pyx":166 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -2676,7 +2674,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity(CYTHON_UN /* function exit code */ } -/* "sklearn/tree/_tree.pyx":184 +/* "sklearn/tree/_tree.pyx":186 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -2689,9 +2687,54 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value(CYTHON_UNUSED st /* function exit code */ } -/* "sklearn/tree/_tree.pyx":198 +/* "sklearn/tree/_tree.pyx":200 + * pass + * + * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< + * """Compute a proxy of the impurity reduction + * + */ + +static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self) { + double __pyx_v_impurity_left; + double __pyx_v_impurity_right; + double __pyx_r; + + /* "sklearn/tree/_tree.pyx":213 + * cdef double impurity_left + * cdef double impurity_right + * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< + * + * return (- self.weighted_n_right * impurity_right + */ + ((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":216 + * + * return (- self.weighted_n_right * impurity_right + * - self.weighted_n_left * impurity_left) # <<<<<<<<<<<<<< + * + * cdef double impurity_improvement(self, double impurity) nogil: + */ + __pyx_r = (((-__pyx_v_self->weighted_n_right) * __pyx_v_impurity_right) - (__pyx_v_self->weighted_n_left * __pyx_v_impurity_left)); + goto __pyx_L0; + + /* "sklearn/tree/_tree.pyx":200 * pass * + * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< + * """Compute a proxy of the impurity reduction + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "sklearn/tree/_tree.pyx":218 + * - self.weighted_n_left * impurity_left) + * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< * """Placeholder for improvement in impurity after a split. * @@ -2702,7 +2745,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":225 + /* "sklearn/tree/_tree.pyx":245 * cdef double impurity_right * * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< @@ -2711,7 +2754,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":227 + /* "sklearn/tree/_tree.pyx":247 * self.children_impurity(&impurity_left, &impurity_right) * * return ((self.weighted_n_node_samples / self.weighted_n_samples) * # <<<<<<<<<<<<<< @@ -2721,8 +2764,8 @@ 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":198 - * pass + /* "sklearn/tree/_tree.pyx":218 + * - self.weighted_n_left * impurity_left) * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< * """Placeholder for improvement in impurity after a split. @@ -2734,7 +2777,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":241 +/* "sklearn/tree/_tree.pyx":261 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< @@ -2773,11 +2816,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 = 241; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __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 = 241; __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 = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2785,18 +2828,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 = 241; __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 = 261; __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 = 241; __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 = 261; __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 = 242; __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 = 262; __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,11 +2876,11 @@ 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 = 241; __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 = 261; __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":253 + /* "sklearn/tree/_tree.pyx":273 * """ * * self.y = NULL # <<<<<<<<<<<<<< @@ -2846,7 +2889,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":254 + /* "sklearn/tree/_tree.pyx":274 * * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -2855,7 +2898,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":255 + /* "sklearn/tree/_tree.pyx":275 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -2864,7 +2907,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":257 + /* "sklearn/tree/_tree.pyx":277 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -2873,7 +2916,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":258 + /* "sklearn/tree/_tree.pyx":278 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -2882,7 +2925,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":259 + /* "sklearn/tree/_tree.pyx":279 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -2891,7 +2934,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":260 + /* "sklearn/tree/_tree.pyx":280 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -2900,7 +2943,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":262 + /* "sklearn/tree/_tree.pyx":282 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -2909,7 +2952,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":263 + /* "sklearn/tree/_tree.pyx":283 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -2918,7 +2961,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":264 + /* "sklearn/tree/_tree.pyx":284 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -2927,7 +2970,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":265 + /* "sklearn/tree/_tree.pyx":285 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -2936,26 +2979,26 @@ 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":266 + /* "sklearn/tree/_tree.pyx":286 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< * - * # Count labs for each output + * # Count labels for each output */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_tree.pyx":269 + /* "sklearn/tree/_tree.pyx":289 * - * # Count labs for each output + * # Count labels for each output * self.label_count_left = NULL # <<<<<<<<<<<<<< * self.label_count_right = NULL * self.label_count_total = NULL */ __pyx_v_self->label_count_left = NULL; - /* "sklearn/tree/_tree.pyx":270 - * # Count labs for each output + /* "sklearn/tree/_tree.pyx":290 + * # Count labels for each output * self.label_count_left = NULL * self.label_count_right = NULL # <<<<<<<<<<<<<< * self.label_count_total = NULL @@ -2963,7 +3006,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_right = NULL; - /* "sklearn/tree/_tree.pyx":271 + /* "sklearn/tree/_tree.pyx":291 * self.label_count_left = NULL * self.label_count_right = NULL * self.label_count_total = NULL # <<<<<<<<<<<<<< @@ -2972,7 +3015,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_total = NULL; - /* "sklearn/tree/_tree.pyx":272 + /* "sklearn/tree/_tree.pyx":292 * self.label_count_right = NULL * self.label_count_total = NULL * self.n_classes = NULL # <<<<<<<<<<<<<< @@ -2981,16 +3024,16 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_tree.pyx":274 + /* "sklearn/tree/_tree.pyx":294 * self.n_classes = NULL * * 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 = 274; __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 = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":276 + /* "sklearn/tree/_tree.pyx":296 * safe_realloc(&self.n_classes, n_outputs) * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -2999,7 +3042,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":277 + /* "sklearn/tree/_tree.pyx":297 * * cdef SIZE_t k = 0 * cdef SIZE_t label_count_stride = 0 # <<<<<<<<<<<<<< @@ -3008,9 +3051,9 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_label_count_stride = 0; - /* "sklearn/tree/_tree.pyx":281 + /* "sklearn/tree/_tree.pyx":301 * # For each target, set the number of unique classes in that target, - * # and also set the stride for that target + * # and also compute the maximal stride of all targets * for k in range(n_outputs): # <<<<<<<<<<<<<< * self.n_classes[k] = n_classes[k] * @@ -3019,8 +3062,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":282 - * # and also set the stride for that target + /* "sklearn/tree/_tree.pyx":302 + * # and also compute the maximal stride of all targets * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< * @@ -3029,7 +3072,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":284 + /* "sklearn/tree/_tree.pyx":304 * self.n_classes[k] = n_classes[k] * * if n_classes[k] > label_count_stride: # <<<<<<<<<<<<<< @@ -3040,7 +3083,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":285 + /* "sklearn/tree/_tree.pyx":305 * * if n_classes[k] > label_count_stride: * label_count_stride = n_classes[k] # <<<<<<<<<<<<<< @@ -3054,7 +3097,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":287 + /* "sklearn/tree/_tree.pyx":307 * label_count_stride = n_classes[k] * * self.label_count_stride = label_count_stride # <<<<<<<<<<<<<< @@ -3063,7 +3106,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":289 + /* "sklearn/tree/_tree.pyx":309 * self.label_count_stride = label_count_stride * * cdef SIZE_t n_elements = n_outputs * label_count_stride # <<<<<<<<<<<<<< @@ -3072,7 +3115,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":290 + /* "sklearn/tree/_tree.pyx":310 * * cdef SIZE_t n_elements = n_outputs * label_count_stride * self.label_count_left = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< @@ -3081,7 +3124,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":291 + /* "sklearn/tree/_tree.pyx":311 * 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 +3133,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":292 + /* "sklearn/tree/_tree.pyx":312 * 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 +3142,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":294 + /* "sklearn/tree/_tree.pyx":314 * self.label_count_total = calloc(n_elements, sizeof(double)) * * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< @@ -3113,7 +3156,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":295 + /* "sklearn/tree/_tree.pyx":315 * * if (self.label_count_left == NULL or * self.label_count_right == NULL or # <<<<<<<<<<<<<< @@ -3127,7 +3170,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":296 + /* "sklearn/tree/_tree.pyx":316 * if (self.label_count_left == NULL or * self.label_count_right == NULL or * self.label_count_total == NULL): # <<<<<<<<<<<<<< @@ -3139,17 +3182,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_L7_bool_binop_done:; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":297 + /* "sklearn/tree/_tree.pyx":317 * 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 = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":241 + /* "sklearn/tree/_tree.pyx":261 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< @@ -3175,7 +3218,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":299 +/* "sklearn/tree/_tree.pyx":319 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3198,7 +3241,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":302 + /* "sklearn/tree/_tree.pyx":322 * """Destructor.""" * * free(self.n_classes) # <<<<<<<<<<<<<< @@ -3207,7 +3250,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->n_classes); - /* "sklearn/tree/_tree.pyx":303 + /* "sklearn/tree/_tree.pyx":323 * * free(self.n_classes) * free(self.label_count_left) # <<<<<<<<<<<<<< @@ -3216,7 +3259,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_left); - /* "sklearn/tree/_tree.pyx":304 + /* "sklearn/tree/_tree.pyx":324 * free(self.n_classes) * free(self.label_count_left) * free(self.label_count_right) # <<<<<<<<<<<<<< @@ -3225,7 +3268,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_right); - /* "sklearn/tree/_tree.pyx":305 + /* "sklearn/tree/_tree.pyx":325 * free(self.label_count_left) * free(self.label_count_right) * free(self.label_count_total) # <<<<<<<<<<<<<< @@ -3234,7 +3277,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_total); - /* "sklearn/tree/_tree.pyx":299 + /* "sklearn/tree/_tree.pyx":319 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3246,7 +3289,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":307 +/* "sklearn/tree/_tree.pyx":327 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3279,7 +3322,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":308 + /* "sklearn/tree/_tree.pyx":328 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< @@ -3288,34 +3331,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":309 + /* "sklearn/tree/_tree.pyx":329 * 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 = 309; __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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":310 + /* "sklearn/tree/_tree.pyx":330 * 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 = 310; __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":309 + /* "sklearn/tree/_tree.pyx":329 * 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 = 309; __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 = 329; __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 +3367,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":311 + /* "sklearn/tree/_tree.pyx":331 * (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 = 311; __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 = 331; __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 +3387,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 = 311; __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 = 331; __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 = 311; __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 = 331; __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":308 + /* "sklearn/tree/_tree.pyx":328 * * 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 = 308; __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 = 328; __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 +3417,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":307 + /* "sklearn/tree/_tree.pyx":327 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3396,7 +3439,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red return __pyx_r; } -/* "sklearn/tree/_tree.pyx":313 +/* "sklearn/tree/_tree.pyx":333 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3426,7 +3469,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":314 + /* "sklearn/tree/_tree.pyx":334 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -3434,13 +3477,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 = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __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":313 + /* "sklearn/tree/_tree.pyx":333 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3459,7 +3502,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get return __pyx_r; } -/* "sklearn/tree/_tree.pyx":316 +/* "sklearn/tree/_tree.pyx":336 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -3492,7 +3535,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_8__set return __pyx_r; } -/* "sklearn/tree/_tree.pyx":319 +/* "sklearn/tree/_tree.pyx":339 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< @@ -3521,7 +3564,7 @@ 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":344 + /* "sklearn/tree/_tree.pyx":364 * """ * * self.y = y # <<<<<<<<<<<<<< @@ -3530,7 +3573,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":345 + /* "sklearn/tree/_tree.pyx":365 * * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -3539,7 +3582,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":346 + /* "sklearn/tree/_tree.pyx":366 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -3548,7 +3591,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":347 + /* "sklearn/tree/_tree.pyx":367 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -3557,7 +3600,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":348 + /* "sklearn/tree/_tree.pyx":368 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -3566,7 +3609,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":349 + /* "sklearn/tree/_tree.pyx":369 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -3575,7 +3618,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":350 + /* "sklearn/tree/_tree.pyx":370 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< @@ -3584,7 +3627,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":351 + /* "sklearn/tree/_tree.pyx":371 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -3593,7 +3636,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":352 + /* "sklearn/tree/_tree.pyx":372 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -3602,7 +3645,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_weighted_n_node_samples = 0.0; - /* "sklearn/tree/_tree.pyx":354 + /* "sklearn/tree/_tree.pyx":374 * cdef double weighted_n_node_samples = 0.0 * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3612,7 +3655,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":355 + /* "sklearn/tree/_tree.pyx":375 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3622,7 +3665,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":356 + /* "sklearn/tree/_tree.pyx":376 * 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 +3675,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":357 + /* "sklearn/tree/_tree.pyx":377 * 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 +3685,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":359 + /* "sklearn/tree/_tree.pyx":379 * cdef double* label_count_total = self.label_count_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -3651,7 +3694,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":360 + /* "sklearn/tree/_tree.pyx":380 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -3660,7 +3703,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":361 + /* "sklearn/tree/_tree.pyx":381 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3669,7 +3712,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":362 + /* "sklearn/tree/_tree.pyx":382 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 # <<<<<<<<<<<<<< @@ -3678,7 +3721,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_c = 0; - /* "sklearn/tree/_tree.pyx":363 + /* "sklearn/tree/_tree.pyx":383 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -3687,7 +3730,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":364 + /* "sklearn/tree/_tree.pyx":384 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 * cdef SIZE_t offset = 0 # <<<<<<<<<<<<<< @@ -3696,7 +3739,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_offset = 0; - /* "sklearn/tree/_tree.pyx":366 + /* "sklearn/tree/_tree.pyx":386 * cdef SIZE_t offset = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3707,7 +3750,7 @@ 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":367 + /* "sklearn/tree/_tree.pyx":387 * * for k in range(n_outputs): * memset(label_count_total + offset, 0, # <<<<<<<<<<<<<< @@ -3716,19 +3759,19 @@ 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":369 + /* "sklearn/tree/_tree.pyx":389 * 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 + * for p in range(start, end): */ __pyx_v_offset = (__pyx_v_offset + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":373 - * # Now go through and record the number of samples for each class for - * # each target + /* "sklearn/tree/_tree.pyx":391 + * offset += label_count_stride + * * for p in range(start, end): # <<<<<<<<<<<<<< * i = samples[p] * @@ -3737,8 +3780,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct 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":374 - * # each target + /* "sklearn/tree/_tree.pyx":392 + * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< * @@ -3746,7 +3789,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":378 + /* "sklearn/tree/_tree.pyx":396 * # 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: # <<<<<<<<<<<<<< @@ -3756,21 +3799,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":379 + /* "sklearn/tree/_tree.pyx":397 * # are given, the default weight of each sample is 1.0 * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< * - * # Go through each target and add this sample's class in to the + * # Count weighted class frequency for each target */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); goto __pyx_L7; } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":383 - * # Go through each target and add this sample's class in to the - * # appropriate bin + /* "sklearn/tree/_tree.pyx":400 + * + * # Count weighted class frequency for each target * for k in range(n_outputs): # <<<<<<<<<<<<<< * c = y[i * y_stride + k] * label_count_total[k * label_count_stride + c] += w @@ -3779,8 +3822,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":384 - * # appropriate bin + /* "sklearn/tree/_tree.pyx":401 + * # Count weighted class frequency for each target * for k in range(n_outputs): * c = y[i * y_stride + k] # <<<<<<<<<<<<<< * label_count_total[k * label_count_stride + c] += w @@ -3788,7 +3831,7 @@ 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":385 + /* "sklearn/tree/_tree.pyx":402 * for k in range(n_outputs): * c = y[i * y_stride + k] * label_count_total[k * label_count_stride + c] += w # <<<<<<<<<<<<<< @@ -3799,7 +3842,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct (__pyx_v_label_count_total[__pyx_t_8]) = ((__pyx_v_label_count_total[__pyx_t_8]) + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":387 + /* "sklearn/tree/_tree.pyx":404 * label_count_total[k * label_count_stride + c] += w * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -3809,7 +3852,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_v_weighted_n_node_samples = (__pyx_v_weighted_n_node_samples + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":389 + /* "sklearn/tree/_tree.pyx":406 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3818,7 +3861,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":392 + /* "sklearn/tree/_tree.pyx":409 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -3827,7 +3870,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":319 + /* "sklearn/tree/_tree.pyx":339 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< @@ -3838,7 +3881,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":394 +/* "sklearn/tree/_tree.pyx":411 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3860,7 +3903,7 @@ 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":397 + /* "sklearn/tree/_tree.pyx":414 * """Reset the criterion at pos=start.""" * * self.pos = self.start # <<<<<<<<<<<<<< @@ -3870,7 +3913,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":399 + /* "sklearn/tree/_tree.pyx":416 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -3879,7 +3922,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":400 + /* "sklearn/tree/_tree.pyx":417 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3889,7 +3932,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":402 + /* "sklearn/tree/_tree.pyx":419 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3899,7 +3942,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":403 + /* "sklearn/tree/_tree.pyx":420 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3909,7 +3952,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":404 + /* "sklearn/tree/_tree.pyx":421 * 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 +3962,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":405 + /* "sklearn/tree/_tree.pyx":422 * 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 +3972,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":406 + /* "sklearn/tree/_tree.pyx":423 * 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 +3982,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":407 + /* "sklearn/tree/_tree.pyx":424 * 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 +3992,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":409 + /* "sklearn/tree/_tree.pyx":426 * cdef double* label_count_right = self.label_count_right * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3958,7 +4001,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":411 + /* "sklearn/tree/_tree.pyx":428 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3969,7 +4012,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":412 + /* "sklearn/tree/_tree.pyx":429 * * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -3978,7 +4021,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":413 + /* "sklearn/tree/_tree.pyx":430 * 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 +4030,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":416 + /* "sklearn/tree/_tree.pyx":433 * n_classes[k] * sizeof(double)) * * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -3996,7 +4039,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":417 + /* "sklearn/tree/_tree.pyx":434 * * label_count_total += label_count_stride * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -4005,7 +4048,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":418 + /* "sklearn/tree/_tree.pyx":435 * label_count_total += label_count_stride * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -4015,7 +4058,7 @@ 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":394 + /* "sklearn/tree/_tree.pyx":411 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -4026,12 +4069,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":420 +/* "sklearn/tree/_tree.pyx":437 * 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. + * """Updated statistics by moving samples[pos:new_pos] to the left child. + * */ 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) { @@ -4043,7 +4086,6 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_classes; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_label_count_stride; - CYTHON_UNUSED double *__pyx_v_label_count_total; double *__pyx_v_label_count_left; double *__pyx_v_label_count_right; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; @@ -4062,7 +4104,7 @@ 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":431 + /* "sklearn/tree/_tree.pyx":447 * """ * * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< @@ -4072,7 +4114,7 @@ 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":432 + /* "sklearn/tree/_tree.pyx":448 * * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< @@ -4082,7 +4124,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":433 + /* "sklearn/tree/_tree.pyx":449 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -4092,7 +4134,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":435 + /* "sklearn/tree/_tree.pyx":451 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -4102,7 +4144,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":436 + /* "sklearn/tree/_tree.pyx":452 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -4112,7 +4154,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":438 + /* "sklearn/tree/_tree.pyx":454 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4122,39 +4164,29 @@ 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":439 + /* "sklearn/tree/_tree.pyx":455 * * 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 - * cdef double* label_count_total = self.label_count_total + * cdef double* label_count_left = self.label_count_left */ __pyx_t_3 = __pyx_v_self->n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":440 + /* "sklearn/tree/_tree.pyx":456 * 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 # <<<<<<<<<<<<<< - * 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 */ __pyx_t_2 = __pyx_v_self->label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":441 + /* "sklearn/tree/_tree.pyx":457 * 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 # <<<<<<<<<<<<<< - * cdef double* label_count_left = self.label_count_left - * cdef double* label_count_right = self.label_count_right - */ - __pyx_t_4 = __pyx_v_self->label_count_total; - __pyx_v_label_count_total = __pyx_t_4; - - /* "sklearn/tree/_tree.pyx":442 - * 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 # <<<<<<<<<<<<<< * cdef double* label_count_right = self.label_count_right * @@ -4162,8 +4194,8 @@ 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":443 - * cdef double* label_count_total = self.label_count_total + /* "sklearn/tree/_tree.pyx":458 + * 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 # <<<<<<<<<<<<<< * @@ -4172,7 +4204,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":449 + /* "sklearn/tree/_tree.pyx":464 * cdef SIZE_t k * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -4181,7 +4213,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":450 + /* "sklearn/tree/_tree.pyx":465 * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -4190,29 +4222,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":454 + /* "sklearn/tree/_tree.pyx":469 * # 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":456 + /* "sklearn/tree/_tree.pyx":470 + * # 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 + * if sample_weight != NULL: */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":460 - * # 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 + /* "sklearn/tree/_tree.pyx":472 + * i = samples[p] + * * if sample_weight != NULL: # <<<<<<<<<<<<<< * w = sample_weight[i] * @@ -4220,21 +4252,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":461 - * # are given, the default weight of each sample is 1.0 + /* "sklearn/tree/_tree.pyx":473 + * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< * - * # If the child has changed nodes, then we need to change the weight + * for k in range(n_outputs): */ __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); goto __pyx_L5; } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":465 - * # If the child has changed nodes, then we need to change the weight - * # in the nodes. + /* "sklearn/tree/_tree.pyx":475 + * w = sample_weight[i] + * * for k in range(n_outputs): # <<<<<<<<<<<<<< * label_index = (k * label_count_stride + * y[i * y_stride + k]) @@ -4243,8 +4275,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":466 - * # in the nodes. + /* "sklearn/tree/_tree.pyx":476 + * * for k in range(n_outputs): * label_index = (k * label_count_stride + # <<<<<<<<<<<<<< * y[i * y_stride + k]) @@ -4252,7 +4284,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":468 + /* "sklearn/tree/_tree.pyx":478 * label_index = (k * label_count_stride + * y[i * y_stride + k]) * label_count_left[label_index] += w # <<<<<<<<<<<<<< @@ -4262,66 +4294,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":469 + /* "sklearn/tree/_tree.pyx":479 * 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 */ __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":472 + /* "sklearn/tree/_tree.pyx":481 + * 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 */ __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":475 + /* "sklearn/tree/_tree.pyx":483 + * 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 * */ __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":476 - * # Adjust the left and right node weights by the difference determined before + /* "sklearn/tree/_tree.pyx":484 + * * self.weighted_n_left += diff_w * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< * - * # Change the position to the new position + * self.pos = new_pos */ __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":479 + /* "sklearn/tree/_tree.pyx":486 + * self.weighted_n_right -= diff_w * - * # 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":420 + /* "sklearn/tree/_tree.pyx":437 * 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. + * """Updated statistics by moving samples[pos:new_pos] to the left child. + * */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":481 +/* "sklearn/tree/_tree.pyx":488 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4337,7 +4369,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_impur return __pyx_r; } -/* "sklearn/tree/_tree.pyx":484 +/* "sklearn/tree/_tree.pyx":491 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4350,7 +4382,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_children_imp /* function exit code */ } -/* "sklearn/tree/_tree.pyx":488 +/* "sklearn/tree/_tree.pyx":495 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4369,7 +4401,7 @@ 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":497 + /* "sklearn/tree/_tree.pyx":504 * """ * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4379,7 +4411,7 @@ 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":498 + /* "sklearn/tree/_tree.pyx":505 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4389,7 +4421,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":499 + /* "sklearn/tree/_tree.pyx":506 * 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 +4431,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":500 + /* "sklearn/tree/_tree.pyx":507 * 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 +4441,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":503 + /* "sklearn/tree/_tree.pyx":510 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4420,7 +4452,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":504 + /* "sklearn/tree/_tree.pyx":511 * * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -4429,7 +4461,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":505 + /* "sklearn/tree/_tree.pyx":512 * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride # <<<<<<<<<<<<<< @@ -4438,7 +4470,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":506 + /* "sklearn/tree/_tree.pyx":513 * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4448,7 +4480,7 @@ 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":488 + /* "sklearn/tree/_tree.pyx":495 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4459,7 +4491,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s /* function exit code */ } -/* "sklearn/tree/_tree.pyx":525 +/* "sklearn/tree/_tree.pyx":532 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4488,7 +4520,7 @@ 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":529 + /* "sklearn/tree/_tree.pyx":536 * samples[start:end], using the cross-entropy criterion.""" * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4498,7 +4530,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":531 + /* "sklearn/tree/_tree.pyx":538 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4508,7 +4540,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":532 + /* "sklearn/tree/_tree.pyx":539 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4518,7 +4550,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":533 + /* "sklearn/tree/_tree.pyx":540 * 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 +4560,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":534 + /* "sklearn/tree/_tree.pyx":541 * 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,7 +4570,7 @@ 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":536 + /* "sklearn/tree/_tree.pyx":543 * cdef double* label_count_total = self.label_count_total * * cdef double entropy = 0.0 # <<<<<<<<<<<<<< @@ -4547,7 +4579,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":537 + /* "sklearn/tree/_tree.pyx":544 * * cdef double entropy = 0.0 * cdef double total_entropy = 0.0 # <<<<<<<<<<<<<< @@ -4556,7 +4588,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_total_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":542 + /* "sklearn/tree/_tree.pyx":549 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4567,7 +4599,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ 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":543 + /* "sklearn/tree/_tree.pyx":550 * * for k in range(n_outputs): * entropy = 0.0 # <<<<<<<<<<<<<< @@ -4576,7 +4608,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":545 + /* "sklearn/tree/_tree.pyx":552 * entropy = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -4587,7 +4619,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ 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":546 + /* "sklearn/tree/_tree.pyx":553 * * for c in range(n_classes[k]): * count_k = label_count_total[c] # <<<<<<<<<<<<<< @@ -4596,7 +4628,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_count_k = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":547 + /* "sklearn/tree/_tree.pyx":554 * for c in range(n_classes[k]): * count_k = label_count_total[c] * if count_k > 0.0: # <<<<<<<<<<<<<< @@ -4606,7 +4638,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_8 = ((__pyx_v_count_k > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":548 + /* "sklearn/tree/_tree.pyx":555 * count_k = label_count_total[c] * if count_k > 0.0: * count_k /= weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4615,7 +4647,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":549 + /* "sklearn/tree/_tree.pyx":556 * if count_k > 0.0: * count_k /= weighted_n_node_samples * entropy -= count_k * log(count_k) # <<<<<<<<<<<<<< @@ -4628,7 +4660,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_L7:; } - /* "sklearn/tree/_tree.pyx":551 + /* "sklearn/tree/_tree.pyx":558 * entropy -= count_k * log(count_k) * * total_entropy += entropy # <<<<<<<<<<<<<< @@ -4637,7 +4669,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_total_entropy = (__pyx_v_total_entropy + __pyx_v_entropy); - /* "sklearn/tree/_tree.pyx":552 + /* "sklearn/tree/_tree.pyx":559 * * total_entropy += entropy * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4647,7 +4679,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":554 + /* "sklearn/tree/_tree.pyx":561 * label_count_total += label_count_stride * * return total_entropy / n_outputs # <<<<<<<<<<<<<< @@ -4657,7 +4689,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_r = (__pyx_v_total_entropy / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":525 + /* "sklearn/tree/_tree.pyx":532 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4670,7 +4702,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":556 +/* "sklearn/tree/_tree.pyx":563 * return total_entropy / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4703,7 +4735,7 @@ 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":571 + /* "sklearn/tree/_tree.pyx":578 * """ * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4713,7 +4745,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_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":572 + /* "sklearn/tree/_tree.pyx":579 * * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -4723,7 +4755,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":573 + /* "sklearn/tree/_tree.pyx":580 * 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 +4765,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":575 + /* "sklearn/tree/_tree.pyx":582 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4743,7 +4775,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":576 + /* "sklearn/tree/_tree.pyx":583 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4753,7 +4785,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":577 + /* "sklearn/tree/_tree.pyx":584 * 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 +4795,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":578 + /* "sklearn/tree/_tree.pyx":585 * 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 +4805,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":579 + /* "sklearn/tree/_tree.pyx":586 * 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 +4815,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":581 + /* "sklearn/tree/_tree.pyx":588 * cdef double* label_count_right = self.label_count_right * * cdef double entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4792,7 +4824,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":582 + /* "sklearn/tree/_tree.pyx":589 * * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4801,7 +4833,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":583 + /* "sklearn/tree/_tree.pyx":590 * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -4810,7 +4842,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":584 + /* "sklearn/tree/_tree.pyx":591 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -4819,7 +4851,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":589 + /* "sklearn/tree/_tree.pyx":596 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4830,7 +4862,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py 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":590 + /* "sklearn/tree/_tree.pyx":597 * * for k in range(n_outputs): * entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4839,7 +4871,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":591 + /* "sklearn/tree/_tree.pyx":598 * for k in range(n_outputs): * entropy_left = 0.0 * entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4848,28 +4880,28 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":593 + /* "sklearn/tree/_tree.pyx":600 * entropy_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * # Calculate this classes entropy on the left node * count_k = label_count_left[c] + * if count_k > 0.0: */ __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":595 + /* "sklearn/tree/_tree.pyx":601 + * * for c in range(n_classes[k]): - * # Calculate this classes entropy on the left node * count_k = label_count_left[c] # <<<<<<<<<<<<<< * if count_k > 0.0: * count_k /= weighted_n_left */ __pyx_v_count_k = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":596 - * # Calculate this classes entropy on the left node + /* "sklearn/tree/_tree.pyx":602 + * for c in range(n_classes[k]): * count_k = label_count_left[c] * if count_k > 0.0: # <<<<<<<<<<<<<< * count_k /= weighted_n_left @@ -4878,7 +4910,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_8 = ((__pyx_v_count_k > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":597 + /* "sklearn/tree/_tree.pyx":603 * count_k = label_count_left[c] * if count_k > 0.0: * count_k /= weighted_n_left # <<<<<<<<<<<<<< @@ -4887,29 +4919,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_weighted_n_left); - /* "sklearn/tree/_tree.pyx":598 + /* "sklearn/tree/_tree.pyx":604 * if count_k > 0.0: * count_k /= weighted_n_left * entropy_left -= count_k * log(count_k) # <<<<<<<<<<<<<< * - * # Calculate this classes entropy on the right node + * count_k = label_count_right[c] */ __pyx_v_entropy_left = (__pyx_v_entropy_left - (__pyx_v_count_k * __pyx_f_7sklearn_4tree_5_tree_log(__pyx_v_count_k))); goto __pyx_L7; } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":601 + /* "sklearn/tree/_tree.pyx":606 + * entropy_left -= count_k * log(count_k) * - * # Calculate this classes entropy on the right node * count_k = label_count_right[c] # <<<<<<<<<<<<<< * if count_k > 0.0: * count_k /= weighted_n_right */ __pyx_v_count_k = (__pyx_v_label_count_right[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":602 - * # Calculate this classes entropy on the right node + /* "sklearn/tree/_tree.pyx":607 + * * count_k = label_count_right[c] * if count_k > 0.0: # <<<<<<<<<<<<<< * count_k /= weighted_n_right @@ -4918,7 +4950,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_8 = ((__pyx_v_count_k > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":603 + /* "sklearn/tree/_tree.pyx":608 * count_k = label_count_right[c] * if count_k > 0.0: * count_k /= weighted_n_right # <<<<<<<<<<<<<< @@ -4927,7 +4959,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_count_k = (__pyx_v_count_k / __pyx_v_weighted_n_right); - /* "sklearn/tree/_tree.pyx":604 + /* "sklearn/tree/_tree.pyx":609 * if count_k > 0.0: * count_k /= weighted_n_right * entropy_right -= count_k * log(count_k) # <<<<<<<<<<<<<< @@ -4940,7 +4972,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":606 + /* "sklearn/tree/_tree.pyx":611 * entropy_right -= count_k * log(count_k) * * total_left += entropy_left # <<<<<<<<<<<<<< @@ -4949,7 +4981,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_left = (__pyx_v_total_left + __pyx_v_entropy_left); - /* "sklearn/tree/_tree.pyx":607 + /* "sklearn/tree/_tree.pyx":612 * * total_left += entropy_left * total_right += entropy_right # <<<<<<<<<<<<<< @@ -4958,7 +4990,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":608 + /* "sklearn/tree/_tree.pyx":613 * total_left += entropy_left * total_right += entropy_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -4967,7 +4999,7 @@ 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":609 + /* "sklearn/tree/_tree.pyx":614 * total_right += entropy_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -4977,7 +5009,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":611 + /* "sklearn/tree/_tree.pyx":616 * label_count_right += label_count_stride * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -4986,7 +5018,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":612 + /* "sklearn/tree/_tree.pyx":617 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -4995,7 +5027,7 @@ 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":556 + /* "sklearn/tree/_tree.pyx":563 * return total_entropy / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -5006,7 +5038,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":632 +/* "sklearn/tree/_tree.pyx":637 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -5034,7 +5066,7 @@ 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":636 + /* "sklearn/tree/_tree.pyx":641 * samples[start:end] using the Gini criterion.""" * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -5044,7 +5076,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":638 + /* "sklearn/tree/_tree.pyx":643 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -5054,7 +5086,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":639 + /* "sklearn/tree/_tree.pyx":644 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -5064,7 +5096,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":640 + /* "sklearn/tree/_tree.pyx":645 * 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 +5106,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":641 + /* "sklearn/tree/_tree.pyx":646 * 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,7 +5116,7 @@ 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":643 + /* "sklearn/tree/_tree.pyx":648 * cdef double* label_count_total = self.label_count_total * * cdef double gini = 0.0 # <<<<<<<<<<<<<< @@ -5093,7 +5125,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":644 + /* "sklearn/tree/_tree.pyx":649 * * cdef double gini = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -5102,7 +5134,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":649 + /* "sklearn/tree/_tree.pyx":654 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -5113,7 +5145,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj 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":650 + /* "sklearn/tree/_tree.pyx":655 * * for k in range(n_outputs): * gini = 0.0 # <<<<<<<<<<<<<< @@ -5122,7 +5154,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":652 + /* "sklearn/tree/_tree.pyx":657 * gini = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -5133,7 +5165,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj 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":653 + /* "sklearn/tree/_tree.pyx":658 * * for c in range(n_classes[k]): * count_k = label_count_total[c] # <<<<<<<<<<<<<< @@ -5142,26 +5174,26 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_count_k = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":654 + /* "sklearn/tree/_tree.pyx":659 * for c in range(n_classes[k]): * count_k = label_count_total[c] * gini += count_k * count_k # <<<<<<<<<<<<<< * - * # Calculate the Gini index by normalizing against the squared + * gini = 1.0 - gini / (weighted_n_node_samples * */ __pyx_v_gini = (__pyx_v_gini + (__pyx_v_count_k * __pyx_v_count_k)); } - /* "sklearn/tree/_tree.pyx":658 - * # Calculate the Gini index by normalizing against the squared - * # total weight of all samples + /* "sklearn/tree/_tree.pyx":661 + * gini += count_k * count_k + * * 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":661 + /* "sklearn/tree/_tree.pyx":664 * weighted_n_node_samples) * * total += gini # <<<<<<<<<<<<<< @@ -5170,7 +5202,7 @@ 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":662 + /* "sklearn/tree/_tree.pyx":665 * * total += gini * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -5180,7 +5212,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_v_label_count_total = (__pyx_v_label_count_total + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":664 + /* "sklearn/tree/_tree.pyx":667 * label_count_total += label_count_stride * * return total / n_outputs # <<<<<<<<<<<<<< @@ -5190,7 +5222,7 @@ 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":632 + /* "sklearn/tree/_tree.pyx":637 * """ * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -5203,7 +5235,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":666 +/* "sklearn/tree/_tree.pyx":669 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -5236,7 +5268,7 @@ 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":681 + /* "sklearn/tree/_tree.pyx":684 * """ * * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -5246,7 +5278,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_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":682 + /* "sklearn/tree/_tree.pyx":685 * * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -5256,7 +5288,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":683 + /* "sklearn/tree/_tree.pyx":686 * 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 +5298,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":685 + /* "sklearn/tree/_tree.pyx":688 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -5276,7 +5308,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":686 + /* "sklearn/tree/_tree.pyx":689 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -5286,7 +5318,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":687 + /* "sklearn/tree/_tree.pyx":690 * 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 +5328,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":688 + /* "sklearn/tree/_tree.pyx":691 * 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 +5338,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":689 + /* "sklearn/tree/_tree.pyx":692 * 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 +5348,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":691 + /* "sklearn/tree/_tree.pyx":694 * cdef double* label_count_right = self.label_count_right * * cdef double gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5325,7 +5357,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":692 + /* "sklearn/tree/_tree.pyx":695 * * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5334,7 +5366,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":693 + /* "sklearn/tree/_tree.pyx":696 * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -5343,7 +5375,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":694 + /* "sklearn/tree/_tree.pyx":697 * cdef double gini_right = 0.0 * cdef double total = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -5352,7 +5384,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":695 + /* "sklearn/tree/_tree.pyx":698 * cdef double total = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -5361,7 +5393,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":700 + /* "sklearn/tree/_tree.pyx":703 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -5372,7 +5404,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o 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":701 + /* "sklearn/tree/_tree.pyx":704 * * for k in range(n_outputs): * gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5381,7 +5413,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":702 + /* "sklearn/tree/_tree.pyx":705 * for k in range(n_outputs): * gini_left = 0.0 * gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5390,73 +5422,73 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_right = 0.0; - /* "sklearn/tree/_tree.pyx":704 + /* "sklearn/tree/_tree.pyx":707 * gini_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * # Add to the Gini index of the left node * count_k = label_count_left[c] + * gini_left += count_k * count_k */ __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":706 + /* "sklearn/tree/_tree.pyx":708 + * * for c in range(n_classes[k]): - * # Add to the Gini index of the left node * count_k = label_count_left[c] # <<<<<<<<<<<<<< * gini_left += count_k * count_k * */ __pyx_v_count_k = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":707 - * # Add to the Gini index of the left node + /* "sklearn/tree/_tree.pyx":709 + * for c in range(n_classes[k]): * count_k = label_count_left[c] * gini_left += count_k * count_k # <<<<<<<<<<<<<< * - * # Add to the Gini index of the right node + * count_k = label_count_right[c] */ __pyx_v_gini_left = (__pyx_v_gini_left + (__pyx_v_count_k * __pyx_v_count_k)); - /* "sklearn/tree/_tree.pyx":710 + /* "sklearn/tree/_tree.pyx":711 + * gini_left += count_k * count_k * - * # Add to the Gini index of the right node * count_k = label_count_right[c] # <<<<<<<<<<<<<< * gini_right += count_k * count_k * */ __pyx_v_count_k = (__pyx_v_label_count_right[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":711 - * # Add to the Gini index of the right node + /* "sklearn/tree/_tree.pyx":712 + * * count_k = label_count_right[c] * gini_right += count_k * count_k # <<<<<<<<<<<<<< * - * # Normalize the Gini index of the left node + * gini_left = 1.0 - gini_left / (weighted_n_left * */ __pyx_v_gini_right = (__pyx_v_gini_right + (__pyx_v_count_k * __pyx_v_count_k)); } /* "sklearn/tree/_tree.pyx":714 + * gini_right += count_k * count_k * - * # Normalize the Gini index of the left node * gini_left = 1.0 - gini_left / (weighted_n_left * # <<<<<<<<<<<<<< * weighted_n_left) * */ __pyx_v_gini_left = (1.0 - (__pyx_v_gini_left / (__pyx_v_weighted_n_left * __pyx_v_weighted_n_left))); - /* "sklearn/tree/_tree.pyx":718 + /* "sklearn/tree/_tree.pyx":717 + * weighted_n_left) * - * # 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":721 + /* "sklearn/tree/_tree.pyx":720 * weighted_n_right) * * total_left += gini_left # <<<<<<<<<<<<<< @@ -5465,7 +5497,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":722 + /* "sklearn/tree/_tree.pyx":721 * * total_left += gini_left * total_right += gini_right # <<<<<<<<<<<<<< @@ -5474,7 +5506,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":723 + /* "sklearn/tree/_tree.pyx":722 * total_left += gini_left * total_right += gini_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -5483,7 +5515,7 @@ 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":724 + /* "sklearn/tree/_tree.pyx":723 * total_right += gini_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -5493,7 +5525,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_v_label_count_right = (__pyx_v_label_count_right + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":726 + /* "sklearn/tree/_tree.pyx":725 * label_count_right += label_count_stride * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -5502,7 +5534,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ (__pyx_v_impurity_left[0]) = (__pyx_v_total_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":727 + /* "sklearn/tree/_tree.pyx":726 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -5511,7 +5543,7 @@ 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":666 + /* "sklearn/tree/_tree.pyx":669 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -5522,7 +5554,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o /* function exit code */ } -/* "sklearn/tree/_tree.pyx":754 +/* "sklearn/tree/_tree.pyx":747 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< @@ -5558,18 +5590,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 = 754; __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 = 747; __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 = 754; __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 = 747; __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 = 754; __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 = 747; __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,7 +5624,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":764 + /* "sklearn/tree/_tree.pyx":757 * * # Default values * self.y = NULL # <<<<<<<<<<<<<< @@ -5601,7 +5633,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":765 + /* "sklearn/tree/_tree.pyx":758 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -5610,7 +5642,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":766 + /* "sklearn/tree/_tree.pyx":759 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -5619,7 +5651,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":768 + /* "sklearn/tree/_tree.pyx":761 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -5628,7 +5660,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":769 + /* "sklearn/tree/_tree.pyx":762 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -5637,7 +5669,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":770 + /* "sklearn/tree/_tree.pyx":763 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -5646,7 +5678,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":771 + /* "sklearn/tree/_tree.pyx":764 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -5655,7 +5687,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":773 + /* "sklearn/tree/_tree.pyx":766 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -5664,7 +5696,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":774 + /* "sklearn/tree/_tree.pyx":767 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -5673,7 +5705,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":775 + /* "sklearn/tree/_tree.pyx":768 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -5682,7 +5714,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":776 + /* "sklearn/tree/_tree.pyx":769 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -5691,7 +5723,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":777 + /* "sklearn/tree/_tree.pyx":770 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -5700,89 +5732,35 @@ 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":781 + /* "sklearn/tree/_tree.pyx":774 * # Allocate accumulators. Make sure they are NULL, not uninitialized, * # before an exception can be raised (which triggers __dealloc__). - * self.mean_left = NULL # <<<<<<<<<<<<<< - * self.mean_right = NULL - * self.mean_total = NULL - */ - __pyx_v_self->mean_left = NULL; - - /* "sklearn/tree/_tree.pyx":782 - * # before an exception can be raised (which triggers __dealloc__). - * self.mean_left = NULL - * self.mean_right = NULL # <<<<<<<<<<<<<< - * self.mean_total = NULL - * self.sq_sum_left = NULL - */ - __pyx_v_self->mean_right = NULL; - - /* "sklearn/tree/_tree.pyx":783 - * self.mean_left = NULL - * self.mean_right = NULL - * self.mean_total = NULL # <<<<<<<<<<<<<< - * self.sq_sum_left = NULL - * self.sq_sum_right = NULL - */ - __pyx_v_self->mean_total = NULL; - - /* "sklearn/tree/_tree.pyx":784 - * self.mean_right = NULL - * self.mean_total = NULL - * self.sq_sum_left = NULL # <<<<<<<<<<<<<< - * self.sq_sum_right = NULL - * self.sq_sum_total = NULL - */ - __pyx_v_self->sq_sum_left = NULL; - - /* "sklearn/tree/_tree.pyx":785 - * self.mean_total = NULL - * self.sq_sum_left = NULL - * self.sq_sum_right = NULL # <<<<<<<<<<<<<< + * self.sq_sum_tmp = NULL # <<<<<<<<<<<<<< * self.sq_sum_total = NULL - * self.var_left = NULL + * self.sum_left = NULL */ - __pyx_v_self->sq_sum_right = NULL; + __pyx_v_self->sq_sum_tmp = NULL; - /* "sklearn/tree/_tree.pyx":786 - * self.sq_sum_left = NULL - * self.sq_sum_right = NULL + /* "sklearn/tree/_tree.pyx":775 + * # before an exception can be raised (which triggers __dealloc__). + * self.sq_sum_tmp = NULL * self.sq_sum_total = NULL # <<<<<<<<<<<<<< - * self.var_left = NULL - * self.var_right = NULL + * self.sum_left = NULL + * self.sum_right = NULL */ __pyx_v_self->sq_sum_total = NULL; - /* "sklearn/tree/_tree.pyx":787 - * self.sq_sum_right = NULL + /* "sklearn/tree/_tree.pyx":776 + * self.sq_sum_tmp = NULL * self.sq_sum_total = NULL - * self.var_left = NULL # <<<<<<<<<<<<<< - * self.var_right = NULL - * self.sum_left = NULL + * self.sum_left = NULL # <<<<<<<<<<<<<< + * self.sum_right = NULL + * self.sum_total = NULL */ - __pyx_v_self->var_left = NULL; + __pyx_v_self->sum_left = NULL; - /* "sklearn/tree/_tree.pyx":788 + /* "sklearn/tree/_tree.pyx":777 * self.sq_sum_total = NULL - * self.var_left = NULL - * self.var_right = NULL # <<<<<<<<<<<<<< - * self.sum_left = NULL - * self.sum_right = NULL - */ - __pyx_v_self->var_right = NULL; - - /* "sklearn/tree/_tree.pyx":789 - * self.var_left = NULL - * self.var_right = NULL - * self.sum_left = NULL # <<<<<<<<<<<<<< - * self.sum_right = NULL - * self.sum_total = NULL - */ - __pyx_v_self->sum_left = NULL; - - /* "sklearn/tree/_tree.pyx":790 - * self.var_right = NULL * self.sum_left = NULL * self.sum_right = NULL # <<<<<<<<<<<<<< * self.sum_total = NULL @@ -5790,7 +5768,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_right = NULL; - /* "sklearn/tree/_tree.pyx":791 + /* "sklearn/tree/_tree.pyx":778 * self.sum_left = NULL * self.sum_right = NULL * self.sum_total = NULL # <<<<<<<<<<<<<< @@ -5799,89 +5777,35 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_total = NULL; - /* "sklearn/tree/_tree.pyx":794 + /* "sklearn/tree/_tree.pyx":781 * * # 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":795 - * # 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)) - * self.sq_sum_left = calloc(n_outputs, sizeof(double)) - */ - __pyx_v_self->mean_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - - /* "sklearn/tree/_tree.pyx":796 - * self.mean_left = calloc(n_outputs, sizeof(double)) - * 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)) - * self.sq_sum_right = calloc(n_outputs, sizeof(double)) - */ - __pyx_v_self->mean_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - - /* "sklearn/tree/_tree.pyx":797 - * 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)) # <<<<<<<<<<<<<< - * self.sq_sum_right = calloc(n_outputs, sizeof(double)) - * self.sq_sum_total = calloc(n_outputs, sizeof(double)) - */ - __pyx_v_self->sq_sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - - /* "sklearn/tree/_tree.pyx":798 - * 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)) # <<<<<<<<<<<<<< - * self.sq_sum_total = calloc(n_outputs, sizeof(double)) - * self.var_left = calloc(n_outputs, sizeof(double)) - */ - __pyx_v_self->sq_sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - - /* "sklearn/tree/_tree.pyx":799 - * 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)) # <<<<<<<<<<<<<< - * self.var_left = calloc(n_outputs, sizeof(double)) - * self.var_right = calloc(n_outputs, sizeof(double)) - */ - __pyx_v_self->sq_sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - - /* "sklearn/tree/_tree.pyx":800 - * self.sq_sum_right = calloc(n_outputs, sizeof(double)) + * self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * 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)) * self.sum_left = calloc(n_outputs, sizeof(double)) */ - __pyx_v_self->var_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); + __pyx_v_self->sq_sum_tmp = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":801 - * 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)) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":782 + * # Allocate memory for the accumulators + * self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) + * self.sq_sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) */ - __pyx_v_self->var_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); + __pyx_v_self->sq_sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":802 - * self.var_left = calloc(n_outputs, sizeof(double)) - * self.var_right = calloc(n_outputs, sizeof(double)) + /* "sklearn/tree/_tree.pyx":783 + * self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) + * self.sq_sum_total = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * self.sum_right = calloc(n_outputs, sizeof(double)) * self.sum_total = calloc(n_outputs, sizeof(double)) */ __pyx_v_self->sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":803 - * self.var_right = calloc(n_outputs, sizeof(double)) + /* "sklearn/tree/_tree.pyx":784 + * self.sq_sum_total = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * self.sum_total = calloc(n_outputs, sizeof(double)) @@ -5889,130 +5813,46 @@ 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":804 + /* "sklearn/tree/_tree.pyx":785 * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) * self.sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< * - * if (self.mean_left == NULL or + * if (self.sq_sum_tmp == NULL or */ __pyx_v_self->sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":806 + /* "sklearn/tree/_tree.pyx":787 * self.sum_total = calloc(n_outputs, sizeof(double)) * - * if (self.mean_left == NULL or # <<<<<<<<<<<<<< - * self.mean_right == NULL or - * self.mean_total == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->mean_left == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_tree.pyx":807 - * - * if (self.mean_left == NULL or - * self.mean_right == NULL or # <<<<<<<<<<<<<< - * self.mean_total == NULL or - * self.sq_sum_left == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->mean_right == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_tree.pyx":808 - * if (self.mean_left == NULL or - * self.mean_right == NULL or - * self.mean_total == NULL or # <<<<<<<<<<<<<< - * self.sq_sum_left == NULL or - * self.sq_sum_right == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->mean_total == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_tree.pyx":809 - * self.mean_right == NULL or - * self.mean_total == NULL or - * self.sq_sum_left == NULL or # <<<<<<<<<<<<<< - * self.sq_sum_right == NULL or - * self.sq_sum_total == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->sq_sum_left == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_tree.pyx":810 - * self.mean_total == NULL or - * self.sq_sum_left == NULL or - * self.sq_sum_right == NULL or # <<<<<<<<<<<<<< - * self.sq_sum_total == NULL or - * self.var_left == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->sq_sum_right == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_tree.pyx":811 - * self.sq_sum_left == NULL or - * self.sq_sum_right == NULL or - * self.sq_sum_total == NULL or # <<<<<<<<<<<<<< - * self.var_left == NULL or - * self.var_right == NULL or - */ - __pyx_t_2 = ((__pyx_v_self->sq_sum_total == NULL) != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L4_bool_binop_done; - } - - /* "sklearn/tree/_tree.pyx":812 - * self.sq_sum_right == NULL or + * if (self.sq_sum_tmp == NULL or # <<<<<<<<<<<<<< * self.sq_sum_total == NULL or - * self.var_left == NULL or # <<<<<<<<<<<<<< - * self.var_right == NULL or * self.sum_left == NULL or */ - __pyx_t_2 = ((__pyx_v_self->var_left == NULL) != 0); + __pyx_t_2 = ((__pyx_v_self->sq_sum_tmp == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":813 - * self.sq_sum_total == NULL or - * self.var_left == NULL or - * self.var_right == NULL or # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":788 + * + * if (self.sq_sum_tmp == NULL or + * self.sq_sum_total == NULL or # <<<<<<<<<<<<<< * self.sum_left == NULL or * self.sum_right == NULL or */ - __pyx_t_2 = ((__pyx_v_self->var_right == NULL) != 0); + __pyx_t_2 = ((__pyx_v_self->sq_sum_total == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":814 - * self.var_left == NULL or - * self.var_right == NULL or + /* "sklearn/tree/_tree.pyx":789 + * if (self.sq_sum_tmp == NULL or + * self.sq_sum_total == NULL or * self.sum_left == NULL or # <<<<<<<<<<<<<< * self.sum_right == NULL or * self.sum_total == NULL): @@ -6024,8 +5864,8 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":815 - * self.var_right == NULL or + /* "sklearn/tree/_tree.pyx":790 + * self.sq_sum_total == NULL or * self.sum_left == NULL or * self.sum_right == NULL or # <<<<<<<<<<<<<< * self.sum_total == NULL): @@ -6038,7 +5878,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":816 + /* "sklearn/tree/_tree.pyx":791 * self.sum_left == NULL or * self.sum_right == NULL or * self.sum_total == NULL): # <<<<<<<<<<<<<< @@ -6050,17 +5890,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":817 + /* "sklearn/tree/_tree.pyx":792 * self.sum_right == NULL or * self.sum_total == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":754 + /* "sklearn/tree/_tree.pyx":747 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< @@ -6079,12 +5919,12 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":819 +/* "sklearn/tree/_tree.pyx":794 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< * """Destructor""" - * + * free(self.sq_sum_tmp) */ /* Python wrapper */ @@ -6102,89 +5942,35 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":822 + /* "sklearn/tree/_tree.pyx":796 + * def __dealloc__(self): * """Destructor""" - * - * free(self.mean_left) # <<<<<<<<<<<<<< - * free(self.mean_right) - * free(self.mean_total) - */ - free(__pyx_v_self->mean_left); - - /* "sklearn/tree/_tree.pyx":823 - * - * free(self.mean_left) - * free(self.mean_right) # <<<<<<<<<<<<<< - * free(self.mean_total) - * free(self.sq_sum_left) - */ - free(__pyx_v_self->mean_right); - - /* "sklearn/tree/_tree.pyx":824 - * free(self.mean_left) - * free(self.mean_right) - * free(self.mean_total) # <<<<<<<<<<<<<< - * free(self.sq_sum_left) - * free(self.sq_sum_right) - */ - free(__pyx_v_self->mean_total); - - /* "sklearn/tree/_tree.pyx":825 - * free(self.mean_right) - * free(self.mean_total) - * free(self.sq_sum_left) # <<<<<<<<<<<<<< - * free(self.sq_sum_right) - * free(self.sq_sum_total) - */ - free(__pyx_v_self->sq_sum_left); - - /* "sklearn/tree/_tree.pyx":826 - * free(self.mean_total) - * free(self.sq_sum_left) - * free(self.sq_sum_right) # <<<<<<<<<<<<<< - * free(self.sq_sum_total) - * free(self.var_left) - */ - free(__pyx_v_self->sq_sum_right); - - /* "sklearn/tree/_tree.pyx":827 - * free(self.sq_sum_left) - * free(self.sq_sum_right) - * free(self.sq_sum_total) # <<<<<<<<<<<<<< - * free(self.var_left) - * free(self.var_right) - */ - free(__pyx_v_self->sq_sum_total); - - /* "sklearn/tree/_tree.pyx":828 - * free(self.sq_sum_right) + * free(self.sq_sum_tmp) # <<<<<<<<<<<<<< * free(self.sq_sum_total) - * free(self.var_left) # <<<<<<<<<<<<<< - * free(self.var_right) * free(self.sum_left) */ - free(__pyx_v_self->var_left); + free(__pyx_v_self->sq_sum_tmp); - /* "sklearn/tree/_tree.pyx":829 - * free(self.sq_sum_total) - * free(self.var_left) - * free(self.var_right) # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":797 + * """Destructor""" + * free(self.sq_sum_tmp) + * free(self.sq_sum_total) # <<<<<<<<<<<<<< * free(self.sum_left) * free(self.sum_right) */ - free(__pyx_v_self->var_right); + free(__pyx_v_self->sq_sum_total); - /* "sklearn/tree/_tree.pyx":830 - * free(self.var_left) - * free(self.var_right) + /* "sklearn/tree/_tree.pyx":798 + * free(self.sq_sum_tmp) + * free(self.sq_sum_total) * free(self.sum_left) # <<<<<<<<<<<<<< * free(self.sum_right) * free(self.sum_total) */ free(__pyx_v_self->sum_left); - /* "sklearn/tree/_tree.pyx":831 - * free(self.var_right) + /* "sklearn/tree/_tree.pyx":799 + * free(self.sq_sum_total) * free(self.sum_left) * free(self.sum_right) # <<<<<<<<<<<<<< * free(self.sum_total) @@ -6192,7 +5978,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_right); - /* "sklearn/tree/_tree.pyx":832 + /* "sklearn/tree/_tree.pyx":800 * free(self.sum_left) * free(self.sum_right) * free(self.sum_total) # <<<<<<<<<<<<<< @@ -6201,19 +5987,19 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_total); - /* "sklearn/tree/_tree.pyx":819 + /* "sklearn/tree/_tree.pyx":794 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< * """Destructor""" - * + * free(self.sq_sum_tmp) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":834 +/* "sklearn/tree/_tree.pyx":802 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6246,7 +6032,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":835 + /* "sklearn/tree/_tree.pyx":803 * * def __reduce__(self): * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) # <<<<<<<<<<<<<< @@ -6254,14 +6040,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 = 835; __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 = 803; __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 = 835; __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 = 803; __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 = 835; __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 = 803; __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 +6060,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 = 835; __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 = 803; __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 = 835; __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 = 803; __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 = 835; __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 = 803; __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 +6082,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":834 + /* "sklearn/tree/_tree.pyx":802 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6318,7 +6104,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":837 +/* "sklearn/tree/_tree.pyx":805 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6348,7 +6134,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":838 + /* "sklearn/tree/_tree.pyx":806 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -6356,13 +6142,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 = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __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":837 + /* "sklearn/tree/_tree.pyx":805 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6381,7 +6167,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":840 +/* "sklearn/tree/_tree.pyx":808 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -6414,7 +6200,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_8__setstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":843 +/* "sklearn/tree/_tree.pyx":811 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -6425,16 +6211,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_8__setstat static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, __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_DOUBLE_t *__pyx_v_sample_weight, double __pyx_v_weighted_n_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __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; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_mean_left; - double *__pyx_v_mean_right; - double *__pyx_v_mean_total; - double *__pyx_v_sq_sum_left; - double *__pyx_v_sq_sum_right; double *__pyx_v_sq_sum_total; - double *__pyx_v_var_left; - double *__pyx_v_var_right; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; double *__pyx_v_sum_total; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; @@ -6451,7 +6228,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":849 + /* "sklearn/tree/_tree.pyx":817 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -6460,7 +6237,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":850 + /* "sklearn/tree/_tree.pyx":818 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -6469,7 +6246,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":851 + /* "sklearn/tree/_tree.pyx":819 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -6478,7 +6255,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":852 + /* "sklearn/tree/_tree.pyx":820 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -6487,7 +6264,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":853 + /* "sklearn/tree/_tree.pyx":821 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -6496,7 +6273,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":854 + /* "sklearn/tree/_tree.pyx":822 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -6505,7 +6282,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":855 + /* "sklearn/tree/_tree.pyx":823 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< @@ -6514,7 +6291,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":856 + /* "sklearn/tree/_tree.pyx":824 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -6523,7 +6300,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":857 + /* "sklearn/tree/_tree.pyx":825 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0. # <<<<<<<<<<<<<< @@ -6532,119 +6309,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_weighted_n_node_samples = 0.; - /* "sklearn/tree/_tree.pyx":860 + /* "sklearn/tree/_tree.pyx":828 * * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right + * cdef double* sq_sum_total = self.sq_sum_total + * cdef double* sum_total = self.sum_total */ __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":861 + /* "sklearn/tree/_tree.pyx":829 * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< - * cdef double* mean_right = self.mean_right - * cdef double* mean_total = self.mean_total - */ - __pyx_t_2 = __pyx_v_self->mean_left; - __pyx_v_mean_left = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":862 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< - * cdef double* mean_total = self.mean_total - * cdef double* sq_sum_left = self.sq_sum_left - */ - __pyx_t_2 = __pyx_v_self->mean_right; - __pyx_v_mean_right = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":863 - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right - * 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 - */ - __pyx_t_2 = __pyx_v_self->mean_total; - __pyx_v_mean_total = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":864 - * cdef double* mean_right = self.mean_right - * 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 - * cdef double* sq_sum_total = self.sq_sum_total - */ - __pyx_t_2 = __pyx_v_self->sq_sum_left; - __pyx_v_sq_sum_left = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":865 - * 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 # <<<<<<<<<<<<<< - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* var_left = self.var_left - */ - __pyx_t_2 = __pyx_v_self->sq_sum_right; - __pyx_v_sq_sum_right = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":866 - * 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 # <<<<<<<<<<<<<< - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right + * cdef double* sum_total = self.sum_total + * */ __pyx_t_2 = __pyx_v_self->sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":867 - * 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 # <<<<<<<<<<<<<< - * cdef double* var_right = self.var_right - * cdef double* sum_left = self.sum_left - */ - __pyx_t_2 = __pyx_v_self->var_left; - __pyx_v_var_left = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":868 + /* "sklearn/tree/_tree.pyx":830 + * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - */ - __pyx_t_2 = __pyx_v_self->var_right; - __pyx_v_var_right = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":869 - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * cdef double* sum_total = self.sum_total - */ - __pyx_t_2 = __pyx_v_self->sum_left; - __pyx_v_sum_left = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":870 - * cdef double* var_right = self.var_right - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< - * cdef double* sum_total = self.sum_total - * - */ - __pyx_t_2 = __pyx_v_self->sum_right; - __pyx_v_sum_right = __pyx_t_2; - - /* "sklearn/tree/_tree.pyx":871 - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< * * cdef SIZE_t i = 0 @@ -6652,7 +6339,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":873 + /* "sklearn/tree/_tree.pyx":832 * cdef double* sum_total = self.sum_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -6661,7 +6348,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":874 + /* "sklearn/tree/_tree.pyx":833 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -6670,7 +6357,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":875 + /* "sklearn/tree/_tree.pyx":834 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -6679,7 +6366,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":876 + /* "sklearn/tree/_tree.pyx":835 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6688,7 +6375,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":877 + /* "sklearn/tree/_tree.pyx":836 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6697,7 +6384,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":878 + /* "sklearn/tree/_tree.pyx":837 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -6706,135 +6393,54 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":880 + /* "sklearn/tree/_tree.pyx":839 * cdef DOUBLE_t w = 1.0 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< - * memset(mean_left, 0, n_bytes) - * memset(mean_right, 0, n_bytes) + * memset(sq_sum_total, 0, n_bytes) + * memset(sum_total, 0, n_bytes) */ __pyx_v_n_bytes = (__pyx_v_n_outputs * (sizeof(double))); - /* "sklearn/tree/_tree.pyx":881 + /* "sklearn/tree/_tree.pyx":840 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) - * memset(mean_left, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(mean_right, 0, n_bytes) - * memset(mean_total, 0, n_bytes) + * memset(sq_sum_total, 0, n_bytes) # <<<<<<<<<<<<<< + * memset(sum_total, 0, n_bytes) + * */ - memset(__pyx_v_mean_left, 0, __pyx_v_n_bytes); + memset(__pyx_v_sq_sum_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":882 + /* "sklearn/tree/_tree.pyx":841 * cdef SIZE_t n_bytes = n_outputs * sizeof(double) - * memset(mean_left, 0, n_bytes) - * memset(mean_right, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(mean_total, 0, n_bytes) - * memset(sq_sum_left, 0, n_bytes) + * memset(sq_sum_total, 0, n_bytes) + * memset(sum_total, 0, n_bytes) # <<<<<<<<<<<<<< + * + * for p in range(start, end): */ - memset(__pyx_v_mean_right, 0, __pyx_v_n_bytes); + memset(__pyx_v_sum_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":883 - * memset(mean_left, 0, n_bytes) - * memset(mean_right, 0, n_bytes) - * memset(mean_total, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sq_sum_left, 0, n_bytes) - * memset(sq_sum_right, 0, n_bytes) + /* "sklearn/tree/_tree.pyx":843 + * memset(sum_total, 0, n_bytes) + * + * for p in range(start, end): # <<<<<<<<<<<<<< + * i = samples[p] + * */ - memset(__pyx_v_mean_total, 0, __pyx_v_n_bytes); + __pyx_t_1 = __pyx_v_end; + 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":884 - * memset(mean_right, 0, n_bytes) - * memset(mean_total, 0, n_bytes) - * memset(sq_sum_left, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sq_sum_right, 0, n_bytes) - * memset(sq_sum_total, 0, n_bytes) + /* "sklearn/tree/_tree.pyx":844 + * + * for p in range(start, end): + * i = samples[p] # <<<<<<<<<<<<<< + * + * if sample_weight != NULL: */ - memset(__pyx_v_sq_sum_left, 0, __pyx_v_n_bytes); + __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":885 - * memset(mean_total, 0, n_bytes) - * memset(sq_sum_left, 0, n_bytes) - * memset(sq_sum_right, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sq_sum_total, 0, n_bytes) - * memset(var_left, 0, n_bytes) - */ - memset(__pyx_v_sq_sum_right, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":886 - * memset(sq_sum_left, 0, n_bytes) - * memset(sq_sum_right, 0, n_bytes) - * memset(sq_sum_total, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(var_left, 0, n_bytes) - * memset(var_right, 0, n_bytes) - */ - memset(__pyx_v_sq_sum_total, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":887 - * memset(sq_sum_right, 0, n_bytes) - * memset(sq_sum_total, 0, n_bytes) - * memset(var_left, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(var_right, 0, n_bytes) - * memset(sum_left, 0, n_bytes) - */ - memset(__pyx_v_var_left, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":888 - * memset(sq_sum_total, 0, n_bytes) - * memset(var_left, 0, n_bytes) - * memset(var_right, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sum_left, 0, n_bytes) - * memset(sum_right, 0, n_bytes) - */ - memset(__pyx_v_var_right, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":889 - * memset(var_left, 0, n_bytes) - * memset(var_right, 0, n_bytes) - * memset(sum_left, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sum_right, 0, n_bytes) - * memset(sum_total, 0, n_bytes) - */ - memset(__pyx_v_sum_left, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":890 - * memset(var_right, 0, n_bytes) - * memset(sum_left, 0, n_bytes) - * memset(sum_right, 0, n_bytes) # <<<<<<<<<<<<<< - * memset(sum_total, 0, n_bytes) - * - */ - memset(__pyx_v_sum_right, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":891 - * memset(sum_left, 0, n_bytes) - * memset(sum_right, 0, n_bytes) - * memset(sum_total, 0, n_bytes) # <<<<<<<<<<<<<< - * - * for p in range(start, end): - */ - memset(__pyx_v_sum_total, 0, __pyx_v_n_bytes); - - /* "sklearn/tree/_tree.pyx":893 - * memset(sum_total, 0, n_bytes) - * - * for p in range(start, end): # <<<<<<<<<<<<<< - * i = samples[p] - * - */ - __pyx_t_1 = __pyx_v_end; - 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":894 - * - * for p in range(start, end): - * i = samples[p] # <<<<<<<<<<<<<< - * - * if sample_weight != NULL: - */ - __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - - /* "sklearn/tree/_tree.pyx":896 + /* "sklearn/tree/_tree.pyx":846 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -6844,7 +6450,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":897 + /* "sklearn/tree/_tree.pyx":847 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -6856,7 +6462,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":899 + /* "sklearn/tree/_tree.pyx":849 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6867,7 +6473,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":900 + /* "sklearn/tree/_tree.pyx":850 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -6876,7 +6482,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":901 + /* "sklearn/tree/_tree.pyx":851 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -6885,7 +6491,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":902 + /* "sklearn/tree/_tree.pyx":852 * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik * sum_total[k] += w_y_ik # <<<<<<<<<<<<<< @@ -6895,7 +6501,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":903 + /* "sklearn/tree/_tree.pyx":853 * w_y_ik = w * y_ik * sum_total[k] += w_y_ik * sq_sum_total[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -6906,7 +6512,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":905 + /* "sklearn/tree/_tree.pyx":855 * sq_sum_total[k] += w_y_ik * y_ik * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -6916,37 +6522,16 @@ 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":907 + /* "sklearn/tree/_tree.pyx":857 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< * - * for k in range(n_outputs): - */ - __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - - /* "sklearn/tree/_tree.pyx":909 - * self.weighted_n_node_samples = weighted_n_node_samples - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * mean_total[k] = sum_total[k] / weighted_n_node_samples - * - */ - __pyx_t_1 = __pyx_v_n_outputs; - 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":910 - * - * for k in range(n_outputs): - * mean_total[k] = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< - * * # Reset to pos=start */ - (__pyx_v_mean_total[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); - } + __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":913 + /* "sklearn/tree/_tree.pyx":860 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -6955,7 +6540,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":843 + /* "sklearn/tree/_tree.pyx":811 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -6966,303 +6551,92 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":915 +/* "sklearn/tree/_tree.pyx":862 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< * """Reset the criterion at pos=start.""" - * self.pos = self.start + * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) */ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self) { - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_mean_left; - double *__pyx_v_mean_right; - double *__pyx_v_mean_total; - double *__pyx_v_sq_sum_left; - double *__pyx_v_sq_sum_right; - double *__pyx_v_sq_sum_total; - double *__pyx_v_var_left; - double *__pyx_v_var_right; - double __pyx_v_weighted_n_node_samples; - double *__pyx_v_sum_left; - double *__pyx_v_sum_right; - double *__pyx_v_sum_total; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; - __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; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_bytes; + double __pyx_t_1; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_2; - /* "sklearn/tree/_tree.pyx":917 + /* "sklearn/tree/_tree.pyx":864 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" - * self.pos = self.start # <<<<<<<<<<<<<< + * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) # <<<<<<<<<<<<<< + * memset(self.sum_left, 0, n_bytes) + * memcpy(self.sum_right, self.sum_total, n_bytes) + */ + __pyx_v_n_bytes = (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double))); + + /* "sklearn/tree/_tree.pyx":865 + * """Reset the criterion at pos=start.""" + * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) + * memset(self.sum_left, 0, n_bytes) # <<<<<<<<<<<<<< + * memcpy(self.sum_right, self.sum_total, n_bytes) + * + */ + memset(__pyx_v_self->sum_left, 0, __pyx_v_n_bytes); + + /* "sklearn/tree/_tree.pyx":866 + * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) + * memset(self.sum_left, 0, n_bytes) + * memcpy(self.sum_right, self.sum_total, n_bytes) # <<<<<<<<<<<<<< * * self.weighted_n_left = 0.0 */ - __pyx_t_1 = __pyx_v_self->__pyx_base.start; - __pyx_v_self->__pyx_base.pos = __pyx_t_1; + memcpy(__pyx_v_self->sum_right, __pyx_v_self->sum_total, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":919 - * self.pos = self.start + /* "sklearn/tree/_tree.pyx":868 + * memcpy(self.sum_right, self.sum_total, n_bytes) * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< * self.weighted_n_right = self.weighted_n_node_samples - * + * self.pos = self.start */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":920 + /* "sklearn/tree/_tree.pyx":869 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< + * self.pos = self.start * - * cdef SIZE_t n_outputs = self.n_outputs */ - __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; - __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_2; + __pyx_t_1 = __pyx_v_self->__pyx_base.weighted_n_node_samples; + __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":922 + /* "sklearn/tree/_tree.pyx":870 + * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples - * - * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; - - /* "sklearn/tree/_tree.pyx":923 - * - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< - * cdef double* mean_right = self.mean_right - * cdef double* mean_total = self.mean_total - */ - __pyx_t_3 = __pyx_v_self->mean_left; - __pyx_v_mean_left = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":924 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< - * cdef double* mean_total = self.mean_total - * cdef double* sq_sum_left = self.sq_sum_left - */ - __pyx_t_3 = __pyx_v_self->mean_right; - __pyx_v_mean_right = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":925 - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right - * 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 - */ - __pyx_t_3 = __pyx_v_self->mean_total; - __pyx_v_mean_total = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":926 - * cdef double* mean_right = self.mean_right - * 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 - * cdef double* sq_sum_total = self.sq_sum_total - */ - __pyx_t_3 = __pyx_v_self->sq_sum_left; - __pyx_v_sq_sum_left = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":927 - * 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 # <<<<<<<<<<<<<< - * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* var_left = self.var_left - */ - __pyx_t_3 = __pyx_v_self->sq_sum_right; - __pyx_v_sq_sum_right = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":928 - * 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 # <<<<<<<<<<<<<< - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right - */ - __pyx_t_3 = __pyx_v_self->sq_sum_total; - __pyx_v_sq_sum_total = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":929 - * 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 # <<<<<<<<<<<<<< - * cdef double* var_right = self.var_right - * cdef double weighted_n_node_samples = self.weighted_n_node_samples - */ - __pyx_t_3 = __pyx_v_self->var_left; - __pyx_v_var_left = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":930 - * cdef double* sq_sum_total = self.sq_sum_total - * 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 - * cdef double* sum_left = self.sum_left - */ - __pyx_t_3 = __pyx_v_self->var_right; - __pyx_v_var_right = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":931 - * 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 # <<<<<<<<<<<<<< - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - */ - __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":932 - * 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 # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * cdef double* sum_total = self.sum_total - */ - __pyx_t_3 = __pyx_v_self->sum_left; - __pyx_v_sum_left = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":933 - * 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 # <<<<<<<<<<<<<< - * cdef double* sum_total = self.sum_total - * - */ - __pyx_t_3 = __pyx_v_self->sum_right; - __pyx_v_sum_right = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":934 - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right - * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< - * - * cdef SIZE_t k = 0 - */ - __pyx_t_3 = __pyx_v_self->sum_total; - __pyx_v_sum_total = __pyx_t_3; - - /* "sklearn/tree/_tree.pyx":936 - * cdef double* sum_total = self.sum_total - * - * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< - * - * for k in range(n_outputs): - */ - __pyx_v_k = 0; - - /* "sklearn/tree/_tree.pyx":938 - * cdef SIZE_t k = 0 - * - * for k in range(n_outputs): # <<<<<<<<<<<<<< - * mean_right[k] = mean_total[k] - * mean_left[k] = 0.0 - */ - __pyx_t_1 = __pyx_v_n_outputs; - 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":939 - * - * for k in range(n_outputs): - * mean_right[k] = mean_total[k] # <<<<<<<<<<<<<< - * mean_left[k] = 0.0 - * sq_sum_right[k] = sq_sum_total[k] - */ - (__pyx_v_mean_right[__pyx_v_k]) = (__pyx_v_mean_total[__pyx_v_k]); - - /* "sklearn/tree/_tree.pyx":940 - * for k in range(n_outputs): - * mean_right[k] = mean_total[k] - * mean_left[k] = 0.0 # <<<<<<<<<<<<<< - * sq_sum_right[k] = sq_sum_total[k] - * sq_sum_left[k] = 0.0 - */ - (__pyx_v_mean_left[__pyx_v_k]) = 0.0; - - /* "sklearn/tree/_tree.pyx":941 - * mean_right[k] = mean_total[k] - * mean_left[k] = 0.0 - * 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 - - */ - (__pyx_v_sq_sum_right[__pyx_v_k]) = (__pyx_v_sq_sum_total[__pyx_v_k]); - - /* "sklearn/tree/_tree.pyx":942 - * mean_left[k] = 0.0 - * 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 - - * mean_right[k] * mean_right[k]) - */ - (__pyx_v_sq_sum_left[__pyx_v_k]) = 0.0; - - /* "sklearn/tree/_tree.pyx":943 - * 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 - # <<<<<<<<<<<<<< - * mean_right[k] * mean_right[k]) - * var_left[k] = 0.0 - */ - (__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":945 - * var_right[k] = (sq_sum_right[k] / weighted_n_node_samples - - * mean_right[k] * mean_right[k]) - * var_left[k] = 0.0 # <<<<<<<<<<<<<< - * sum_right[k] = sum_total[k] - * sum_left[k] = 0.0 - */ - (__pyx_v_var_left[__pyx_v_k]) = 0.0; - - /* "sklearn/tree/_tree.pyx":946 - * mean_right[k] * mean_right[k]) - * var_left[k] = 0.0 - * sum_right[k] = sum_total[k] # <<<<<<<<<<<<<< - * sum_left[k] = 0.0 - * - */ - (__pyx_v_sum_right[__pyx_v_k]) = (__pyx_v_sum_total[__pyx_v_k]); - - /* "sklearn/tree/_tree.pyx":947 - * var_left[k] = 0.0 - * sum_right[k] = sum_total[k] - * sum_left[k] = 0.0 # <<<<<<<<<<<<<< + * self.pos = self.start # <<<<<<<<<<<<<< * * cdef void update(self, SIZE_t new_pos) nogil: */ - (__pyx_v_sum_left[__pyx_v_k]) = 0.0; - } + __pyx_t_2 = __pyx_v_self->__pyx_base.start; + __pyx_v_self->__pyx_base.pos = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":915 + /* "sklearn/tree/_tree.pyx":862 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< * """Reset the criterion at pos=start.""" - * self.pos = self.start + * cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":949 - * sum_left[k] = 0.0 +/* "sklearn/tree/_tree.pyx":872 + * self.pos = self.start * * 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.""" + * """Updated statistics by moving samples[pos:new_pos] to the left.""" + * */ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_new_pos) { @@ -7272,37 +6646,27 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_pos; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_mean_left; - double *__pyx_v_mean_right; - double *__pyx_v_sq_sum_left; - double *__pyx_v_sq_sum_right; - double *__pyx_v_var_left; - double *__pyx_v_var_right; double *__pyx_v_sum_left; double *__pyx_v_sum_right; - double __pyx_v_weighted_n_left; - double __pyx_v_weighted_n_right; + double *__pyx_v_sum_total; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_w; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_diff_w; - __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_y_ik; - __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_w_y_ik; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_t_1; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_2; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_t_3; double *__pyx_t_4; - double __pyx_t_5; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_6; - int __pyx_t_7; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_5; + int __pyx_t_6; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; __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":952 - * """Update the collected statistics by moving samples[pos:new_pos] from - * the right child to the left child.""" + /* "sklearn/tree/_tree.pyx":875 + * """Updated statistics by moving samples[pos:new_pos] to the left.""" + * * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight @@ -7310,8 +6674,8 @@ 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":953 - * the right child to the left child.""" + /* "sklearn/tree/_tree.pyx":876 + * * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< * cdef DOUBLE_t* sample_weight = self.sample_weight @@ -7320,7 +6684,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":954 + /* "sklearn/tree/_tree.pyx":877 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -7330,7 +6694,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":956 + /* "sklearn/tree/_tree.pyx":879 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -7340,7 +6704,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":957 + /* "sklearn/tree/_tree.pyx":880 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -7350,135 +6714,92 @@ 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":959 + /* "sklearn/tree/_tree.pyx":882 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* mean_left = self.mean_left - * cdef double* mean_right = self.mean_right + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right */ __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":960 + /* "sklearn/tree/_tree.pyx":883 * * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< - * cdef double* mean_right = self.mean_right - * cdef double* sq_sum_left = self.sq_sum_left + * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< + * cdef double* sum_right = self.sum_right + * cdef double* sum_total = self.sum_total */ - __pyx_t_4 = __pyx_v_self->mean_left; - __pyx_v_mean_left = __pyx_t_4; + __pyx_t_4 = __pyx_v_self->sum_left; + __pyx_v_sum_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":961 + /* "sklearn/tree/_tree.pyx":884 * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* mean_left = self.mean_left - * 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 - */ - __pyx_t_4 = __pyx_v_self->mean_right; - __pyx_v_mean_right = __pyx_t_4; - - /* "sklearn/tree/_tree.pyx":962 - * cdef double* mean_left = self.mean_left - * 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 - * cdef double* var_left = self.var_left - */ - __pyx_t_4 = __pyx_v_self->sq_sum_left; - __pyx_v_sq_sum_left = __pyx_t_4; - - /* "sklearn/tree/_tree.pyx":963 - * 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 # <<<<<<<<<<<<<< - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right - */ - __pyx_t_4 = __pyx_v_self->sq_sum_right; - __pyx_v_sq_sum_right = __pyx_t_4; - - /* "sklearn/tree/_tree.pyx":964 - * 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 # <<<<<<<<<<<<<< - * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< + * cdef double* sum_total = self.sum_total + * */ - __pyx_t_4 = __pyx_v_self->var_left; - __pyx_v_var_left = __pyx_t_4; + __pyx_t_4 = __pyx_v_self->sum_right; + __pyx_v_sum_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":965 - * cdef double* sq_sum_right = self.sq_sum_right - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":885 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right + * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< + * + * cdef SIZE_t i = 0 */ - __pyx_t_4 = __pyx_v_self->var_right; - __pyx_v_var_right = __pyx_t_4; + __pyx_t_4 = __pyx_v_self->sum_total; + __pyx_v_sum_total = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":966 - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right - * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< - * cdef double* sum_right = self.sum_right - * - */ - __pyx_t_4 = __pyx_v_self->sum_left; - __pyx_v_sum_left = __pyx_t_4; - - /* "sklearn/tree/_tree.pyx":967 - * cdef double* var_right = self.var_right - * cdef double* sum_left = self.sum_left - * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":887 + * cdef double* sum_total = self.sum_total * - * cdef double weighted_n_left = self.weighted_n_left + * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< + * cdef SIZE_t p = 0 + * cdef SIZE_t k = 0 */ - __pyx_t_4 = __pyx_v_self->sum_right; - __pyx_v_sum_right = __pyx_t_4; + __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":969 - * cdef double* sum_right = self.sum_right - * - * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< - * cdef double weighted_n_right = self.weighted_n_right + /* "sklearn/tree/_tree.pyx":888 * + * cdef SIZE_t i = 0 + * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< + * cdef SIZE_t k = 0 + * cdef DOUBLE_t w = 1.0 */ - __pyx_t_5 = __pyx_v_self->__pyx_base.weighted_n_left; - __pyx_v_weighted_n_left = __pyx_t_5; + __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":970 - * - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< - * - * cdef SIZE_t i + /* "sklearn/tree/_tree.pyx":889 + * cdef SIZE_t i = 0 + * cdef SIZE_t p = 0 + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + * cdef DOUBLE_t w = 1.0 + * cdef DOUBLE_t diff_w = 0.0 */ - __pyx_t_5 = __pyx_v_self->__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_5; + __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":975 - * cdef SIZE_t p - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":890 + * cdef SIZE_t p = 0 + * cdef SIZE_t k = 0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< * cdef DOUBLE_t diff_w = 0.0 - * cdef DOUBLE_t y_ik, w_y_ik + * */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":976 - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":891 + * cdef SIZE_t k = 0 * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< - * cdef DOUBLE_t y_ik, w_y_ik * + * # Note: We assume start <= pos < new_pos <= end */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":980 + /* "sklearn/tree/_tree.pyx":894 * * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -7486,10 +6807,10 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ * */ __pyx_t_2 = __pyx_v_new_pos; - for (__pyx_t_6 = __pyx_v_pos; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { - __pyx_v_p = __pyx_t_6; + 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":981 + /* "sklearn/tree/_tree.pyx":895 * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -7498,17 +6819,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":983 + /* "sklearn/tree/_tree.pyx":897 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< * w = sample_weight[i] * */ - __pyx_t_7 = ((__pyx_v_sample_weight != NULL) != 0); - if (__pyx_t_7) { + __pyx_t_6 = ((__pyx_v_sample_weight != NULL) != 0); + if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":984 + /* "sklearn/tree/_tree.pyx":898 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -7520,172 +6841,79 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":986 + /* "sklearn/tree/_tree.pyx":900 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< - * y_ik = y[i * y_stride + k] - * w_y_ik = w * y_ik - */ - __pyx_t_8 = __pyx_v_n_outputs; - 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":987 - * - * for k in range(n_outputs): - * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< - * w_y_ik = w * y_ik - * - */ - __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); - - /* "sklearn/tree/_tree.pyx":988 - * for k in range(n_outputs): - * y_ik = y[i * y_stride + k] - * w_y_ik = w * y_ik # <<<<<<<<<<<<<< - * - * sum_left[k] += w_y_ik - */ - __pyx_v_w_y_ik = (__pyx_v_w * __pyx_v_y_ik); - - /* "sklearn/tree/_tree.pyx":990 - * w_y_ik = w * y_ik - * - * sum_left[k] += w_y_ik # <<<<<<<<<<<<<< - * sum_right[k] -= w_y_ik - * - */ - __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":991 - * - * sum_left[k] += w_y_ik - * sum_right[k] -= w_y_ik # <<<<<<<<<<<<<< - * - * sq_sum_left[k] += w_y_ik * y_ik - */ - __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":993 - * sum_right[k] -= w_y_ik - * - * sq_sum_left[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< - * sq_sum_right[k] -= w_y_ik * y_ik + * sum_left[k] += w * y[i * y_stride + k] * */ - __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)); + __pyx_t_7 = __pyx_v_n_outputs; + 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":994 + /* "sklearn/tree/_tree.pyx":901 * - * sq_sum_left[k] += w_y_ik * y_ik - * sq_sum_right[k] -= w_y_ik * y_ik # <<<<<<<<<<<<<< + * for k in range(n_outputs): + * sum_left[k] += w * y[i * y_stride + k] # <<<<<<<<<<<<<< * * diff_w += w */ - __pyx_t_10 = __pyx_v_k; - (__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)); + __pyx_t_9 = __pyx_v_k; + (__pyx_v_sum_left[__pyx_t_9]) = ((__pyx_v_sum_left[__pyx_t_9]) + (__pyx_v_w * (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]))); } - /* "sklearn/tree/_tree.pyx":996 - * sq_sum_right[k] -= w_y_ik * y_ik + /* "sklearn/tree/_tree.pyx":903 + * sum_left[k] += w * y[i * y_stride + k] * * diff_w += w # <<<<<<<<<<<<<< * - * weighted_n_left += diff_w + * for k in range(n_outputs): */ __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":998 + /* "sklearn/tree/_tree.pyx":905 * diff_w += w * - * weighted_n_left += diff_w # <<<<<<<<<<<<<< - * weighted_n_right -= diff_w - * - */ - __pyx_v_weighted_n_left = (__pyx_v_weighted_n_left + __pyx_v_diff_w); - - /* "sklearn/tree/_tree.pyx":999 - * - * weighted_n_left += diff_w - * weighted_n_right -= diff_w # <<<<<<<<<<<<<< - * - * for k in range(n_outputs): - */ - __pyx_v_weighted_n_right = (__pyx_v_weighted_n_right - __pyx_v_diff_w); - - /* "sklearn/tree/_tree.pyx":1001 - * weighted_n_right -= diff_w - * * for k in range(n_outputs): # <<<<<<<<<<<<<< - * mean_left[k] = sum_left[k] / weighted_n_left - * mean_right[k] = sum_right[k] / weighted_n_right + * sum_right[k] = sum_total[k] - sum_left[k] + * */ __pyx_t_2 = __pyx_v_n_outputs; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { - __pyx_v_k = __pyx_t_6; + 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":1002 + /* "sklearn/tree/_tree.pyx":906 * * for k in range(n_outputs): - * 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 - - */ - (__pyx_v_mean_left[__pyx_v_k]) = ((__pyx_v_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left); - - /* "sklearn/tree/_tree.pyx":1003 - * for k in range(n_outputs): - * 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 - - * mean_left[k] * mean_left[k]) - */ - (__pyx_v_mean_right[__pyx_v_k]) = ((__pyx_v_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right); - - /* "sklearn/tree/_tree.pyx":1004 - * 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 - # <<<<<<<<<<<<<< - * mean_left[k] * mean_left[k]) - * var_right[k] = (sq_sum_right[k] / weighted_n_right - - */ - (__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":1006 - * 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 - # <<<<<<<<<<<<<< - * mean_right[k] * mean_right[k]) + * sum_right[k] = sum_total[k] - sum_left[k] # <<<<<<<<<<<<<< * + * self.weighted_n_left += diff_w */ - (__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]))); + (__pyx_v_sum_right[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) - (__pyx_v_sum_left[__pyx_v_k])); } - /* "sklearn/tree/_tree.pyx":1009 - * mean_right[k] * mean_right[k]) + /* "sklearn/tree/_tree.pyx":908 + * sum_right[k] = sum_total[k] - sum_left[k] * - * self.weighted_n_left = weighted_n_left # <<<<<<<<<<<<<< - * self.weighted_n_right = weighted_n_right + * self.weighted_n_left += diff_w # <<<<<<<<<<<<<< + * self.weighted_n_right -= diff_w * */ - __pyx_v_self->__pyx_base.weighted_n_left = __pyx_v_weighted_n_left; + __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":1010 + /* "sklearn/tree/_tree.pyx":909 * - * self.weighted_n_left = weighted_n_left - * self.weighted_n_right = weighted_n_right # <<<<<<<<<<<<<< + * self.weighted_n_left += diff_w + * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< * * self.pos = new_pos */ - __pyx_v_self->__pyx_base.weighted_n_right = __pyx_v_weighted_n_right; + __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":1012 - * self.weighted_n_right = weighted_n_right + /* "sklearn/tree/_tree.pyx":911 + * self.weighted_n_right -= diff_w * * self.pos = new_pos # <<<<<<<<<<<<<< * @@ -7693,18 +6921,18 @@ 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":949 - * sum_left[k] = 0.0 + /* "sklearn/tree/_tree.pyx":872 + * self.pos = self.start * * 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.""" + * """Updated statistics by moving samples[pos:new_pos] to the left.""" + * */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1014 +/* "sklearn/tree/_tree.pyx":913 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7720,7 +6948,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_impurity( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1017 +/* "sklearn/tree/_tree.pyx":916 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7733,37 +6961,96 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurit /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1021 +/* "sklearn/tree/_tree.pyx":920 * pass * * 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)) + * cdef SIZE_t n_outputs = self.n_outputs */ 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) { + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; + double *__pyx_v_sum_total; + double __pyx_v_weighted_n_node_samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; + __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":1023 + /* "sklearn/tree/_tree.pyx":922 * 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)) # <<<<<<<<<<<<<< + * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< + * cdef double* sum_total = self.sum_total + * cdef double weighted_n_node_samples = self.weighted_n_node_samples + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; + __pyx_v_n_outputs = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":923 + * """Compute the node value of samples[start:end] into dest.""" + * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< + * cdef double weighted_n_node_samples = self.weighted_n_node_samples + * cdef SIZE_t k = 0 + */ + __pyx_t_2 = __pyx_v_self->sum_total; + __pyx_v_sum_total = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":924 + * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* sum_total = self.sum_total + * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< + * cdef SIZE_t k = 0 * + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.weighted_n_node_samples; + __pyx_v_weighted_n_node_samples = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":925 + * cdef double* sum_total = self.sum_total + * cdef double weighted_n_node_samples = self.weighted_n_node_samples + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< * + * for k in range(n_outputs): */ - memcpy(__pyx_v_dest, __pyx_v_self->mean_total, (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double)))); + __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":1021 + /* "sklearn/tree/_tree.pyx":927 + * cdef SIZE_t k = 0 + * + * for k in range(n_outputs): # <<<<<<<<<<<<<< + * dest[k] = sum_total[k] / weighted_n_node_samples + * + */ + __pyx_t_1 = __pyx_v_n_outputs; + 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":928 + * + * for k in range(n_outputs): + * dest[k] = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< + * + * + */ + (__pyx_v_dest[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); + } + + /* "sklearn/tree/_tree.pyx":920 * pass * * 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)) + * cdef SIZE_t n_outputs = self.n_outputs */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1031 +/* "sklearn/tree/_tree.pyx":936 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7774,8 +7061,9 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struc static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; double *__pyx_v_sq_sum_total; - double *__pyx_v_mean_total; + double *__pyx_v_sum_total; double __pyx_v_weighted_n_node_samples; + double __pyx_v_mean_total_k; double __pyx_v_total; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; double __pyx_r; @@ -7784,87 +7072,114 @@ 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":1034 + /* "sklearn/tree/_tree.pyx":939 * """Evaluate the impurity of the current node, i.e. the impurity of * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* mean_total = self.mean_total + * cdef double* sum_total = self.sum_total */ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1035 + /* "sklearn/tree/_tree.pyx":940 * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< - * cdef double* mean_total = self.mean_total + * cdef double* sum_total = self.sum_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples */ __pyx_t_2 = __pyx_v_self->__pyx_base.sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1036 + /* "sklearn/tree/_tree.pyx":941 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< + * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< * cdef double weighted_n_node_samples = self.weighted_n_node_samples - * cdef double total = 0.0 + * cdef double mean_total_k = 0. */ - __pyx_t_2 = __pyx_v_self->__pyx_base.mean_total; - __pyx_v_mean_total = __pyx_t_2; + __pyx_t_2 = __pyx_v_self->__pyx_base.sum_total; + __pyx_v_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1037 + /* "sklearn/tree/_tree.pyx":942 * cdef double* sq_sum_total = self.sq_sum_total - * cdef double* mean_total = self.mean_total + * cdef double* sum_total = self.sum_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< + * cdef double mean_total_k = 0. * cdef double total = 0.0 - * cdef SIZE_t k */ __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":1038 - * cdef double* mean_total = self.mean_total + /* "sklearn/tree/_tree.pyx":943 + * cdef double* sum_total = self.sum_total + * cdef double weighted_n_node_samples = self.weighted_n_node_samples + * cdef double mean_total_k = 0. # <<<<<<<<<<<<<< + * cdef double total = 0.0 + * cdef SIZE_t k = 0 + */ + __pyx_v_mean_total_k = 0.; + + /* "sklearn/tree/_tree.pyx":944 * cdef double weighted_n_node_samples = self.weighted_n_node_samples + * cdef double mean_total_k = 0. * cdef double total = 0.0 # <<<<<<<<<<<<<< - * cdef SIZE_t k + * cdef SIZE_t k = 0 * */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":1041 - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":945 + * cdef double mean_total_k = 0. + * cdef double total = 0.0 + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + * + * for k in range(n_outputs): + */ + __pyx_v_k = 0; + + /* "sklearn/tree/_tree.pyx":947 + * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< + * mean_total_k = sum_total[k] / weighted_n_node_samples * total += (sq_sum_total[k] / weighted_n_node_samples - - * mean_total[k] * mean_total[k]) */ __pyx_t_1 = __pyx_v_n_outputs; 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":1042 + /* "sklearn/tree/_tree.pyx":948 * * for k in range(n_outputs): + * mean_total_k = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< + * total += (sq_sum_total[k] / weighted_n_node_samples - + * mean_total_k * mean_total_k) + */ + __pyx_v_mean_total_k = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); + + /* "sklearn/tree/_tree.pyx":949 + * for k in range(n_outputs): + * mean_total_k = sum_total[k] / weighted_n_node_samples * total += (sq_sum_total[k] / weighted_n_node_samples - # <<<<<<<<<<<<<< - * mean_total[k] * mean_total[k]) + * mean_total_k * mean_total_k) * */ - __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])))); + __pyx_v_total = (__pyx_v_total + (((__pyx_v_sq_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples) - (__pyx_v_mean_total_k * __pyx_v_mean_total_k))); } - /* "sklearn/tree/_tree.pyx":1045 - * mean_total[k] * mean_total[k]) + /* "sklearn/tree/_tree.pyx":952 + * mean_total_k * mean_total_k) * * return total / n_outputs # <<<<<<<<<<<<<< * - * cdef void children_impurity(self, double* impurity_left, + * cdef double proxy_impurity_improvement(self) nogil: */ __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1031 + /* "sklearn/tree/_tree.pyx":936 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7877,105 +7192,556 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1047 +/* "sklearn/tree/_tree.pyx":954 * 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 + * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< + * """Compute a proxy of the impurity reduction + * */ -static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { +static double __pyx_f_7sklearn_4tree_5_tree_3MSE_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; - double *__pyx_v_var_left; - double *__pyx_v_var_right; - double __pyx_v_total_left; - double __pyx_v_total_right; + double __pyx_v_weighted_n_left; + double __pyx_v_weighted_n_right; + double *__pyx_v_sum_left; + double *__pyx_v_sum_right; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; + double __pyx_v_proxy_impurity_left; + double __pyx_v_proxy_impurity_right; + double __pyx_r; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; - double *__pyx_t_2; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_3; + double __pyx_t_2; + double *__pyx_t_3; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1052 - * left child (samples[start:pos]) and the impurity the right child - * (samples[pos:end]).""" + /* "sklearn/tree/_tree.pyx":965 + * impurity_improvement method once the best split has been found. + * """ * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right + * + * cdef double weighted_n_left = self.weighted_n_left + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + __pyx_v_n_outputs = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":967 + * cdef SIZE_t n_outputs = self.n_outputs + * + * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< + * cdef double weighted_n_right = self.weighted_n_right + * + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; + __pyx_v_weighted_n_left = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":968 + * + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< + * + * cdef double* sum_left = self.sum_left + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; + __pyx_v_weighted_n_right = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":970 + * cdef double weighted_n_right = self.weighted_n_right + * + * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< + * cdef double* sum_right = self.sum_right + * + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.sum_left; + __pyx_v_sum_left = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":971 + * + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< + * + * cdef SIZE_t k = 0 + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.sum_right; + __pyx_v_sum_right = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":973 + * cdef double* sum_right = self.sum_right + * + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + * cdef double proxy_impurity_left = 0. + * cdef double proxy_impurity_right = 0. + */ + __pyx_v_k = 0; + + /* "sklearn/tree/_tree.pyx":974 + * + * cdef SIZE_t k = 0 + * cdef double proxy_impurity_left = 0. # <<<<<<<<<<<<<< + * cdef double proxy_impurity_right = 0. + * + */ + __pyx_v_proxy_impurity_left = 0.; + + /* "sklearn/tree/_tree.pyx":975 + * cdef SIZE_t k = 0 + * cdef double proxy_impurity_left = 0. + * cdef double proxy_impurity_right = 0. # <<<<<<<<<<<<<< + * + * for k in range(n_outputs): + */ + __pyx_v_proxy_impurity_right = 0.; + + /* "sklearn/tree/_tree.pyx":977 + * cdef double proxy_impurity_right = 0. + * + * for k in range(n_outputs): # <<<<<<<<<<<<<< + * proxy_impurity_left += sum_left[k] * sum_left[k] + * proxy_impurity_right += sum_right[k] * sum_right[k] + */ + __pyx_t_1 = __pyx_v_n_outputs; + 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":978 + * + * for k in range(n_outputs): + * proxy_impurity_left += sum_left[k] * sum_left[k] # <<<<<<<<<<<<<< + * proxy_impurity_right += sum_right[k] * sum_right[k] + * + */ + __pyx_v_proxy_impurity_left = (__pyx_v_proxy_impurity_left + ((__pyx_v_sum_left[__pyx_v_k]) * (__pyx_v_sum_left[__pyx_v_k]))); + + /* "sklearn/tree/_tree.pyx":979 + * for k in range(n_outputs): + * proxy_impurity_left += sum_left[k] * sum_left[k] + * proxy_impurity_right += sum_right[k] * sum_right[k] # <<<<<<<<<<<<<< + * + * return (proxy_impurity_left / weighted_n_left + + */ + __pyx_v_proxy_impurity_right = (__pyx_v_proxy_impurity_right + ((__pyx_v_sum_right[__pyx_v_k]) * (__pyx_v_sum_right[__pyx_v_k]))); + } + + /* "sklearn/tree/_tree.pyx":981 + * proxy_impurity_right += sum_right[k] * sum_right[k] + * + * return (proxy_impurity_left / weighted_n_left + # <<<<<<<<<<<<<< + * proxy_impurity_right / weighted_n_right) + * + */ + __pyx_r = ((__pyx_v_proxy_impurity_left / __pyx_v_weighted_n_left) + (__pyx_v_proxy_impurity_right / __pyx_v_weighted_n_right)); + goto __pyx_L0; + + /* "sklearn/tree/_tree.pyx":954 + * return total / n_outputs + * + * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< + * """Compute a proxy of the impurity reduction + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "sklearn/tree/_tree.pyx":984 + * proxy_impurity_right / weighted_n_right) + * + * 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_3MSE_children_impurity(struct __pyx_obj_7sklearn_4tree_5_tree_MSE *__pyx_v_self, double *__pyx_v_impurity_left, double *__pyx_v_impurity_right) { + __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_DOUBLE_t *__pyx_v_sample_weight; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_pos; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; + double *__pyx_v_sum_left; + double *__pyx_v_sum_right; + double *__pyx_v_sq_sum_tmp; + double *__pyx_v_sq_sum_total; + double __pyx_v_weighted_n_left; + double __pyx_v_weighted_n_right; + double __pyx_v_total_left; + double __pyx_v_total_right; + double __pyx_v_mean_left_k; + double __pyx_v_mean_right_k; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_w; + CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_diff_w; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t __pyx_v_y_ik; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_bytes; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_t_1; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_2; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_t_3; + double *__pyx_t_4; + double __pyx_t_5; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_6; + int __pyx_t_7; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; + __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":990 + * (samples[pos:end]).""" + * + * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< + * cdef SIZE_t y_stride = self.y_stride + * cdef DOUBLE_t* sample_weight = self.sample_weight + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.y; + __pyx_v_y = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":991 + * + * cdef DOUBLE_t* y = self.y + * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< + * cdef DOUBLE_t* sample_weight = self.sample_weight + * + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.y_stride; + __pyx_v_y_stride = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":992 + * cdef DOUBLE_t* y = self.y + * cdef SIZE_t y_stride = self.y_stride + * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< + * + * cdef SIZE_t* samples = self.samples + */ + __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.sample_weight; + __pyx_v_sample_weight = __pyx_t_1; + + /* "sklearn/tree/_tree.pyx":994 + * cdef DOUBLE_t* sample_weight = self.sample_weight + * + * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< + * cdef SIZE_t pos = self.pos + * cdef SIZE_t start = self.start + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.samples; + __pyx_v_samples = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":995 + * + * cdef SIZE_t* samples = self.samples + * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< + * cdef SIZE_t start = self.start + * + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.pos; + __pyx_v_pos = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":996 + * cdef SIZE_t* samples = self.samples + * cdef SIZE_t pos = self.pos + * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< + * + * cdef SIZE_t n_outputs = self.n_outputs + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.start; + __pyx_v_start = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":998 + * cdef SIZE_t start = self.start + * + * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< + * + * cdef double* sum_left = self.sum_left + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; + __pyx_v_n_outputs = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1000 + * cdef SIZE_t n_outputs = self.n_outputs + * + * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< + * cdef double* sum_right = self.sum_right + * cdef double* sq_sum_tmp = self.sq_sum_tmp + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.sum_left; + __pyx_v_sum_left = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1001 + * + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< + * cdef double* sq_sum_tmp = self.sq_sum_tmp + * cdef double* sq_sum_total = self.sq_sum_total + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.sum_right; + __pyx_v_sum_right = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1002 + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right + * cdef double* sq_sum_tmp = self.sq_sum_tmp # <<<<<<<<<<<<<< + * cdef double* sq_sum_total = self.sq_sum_total + * cdef double weighted_n_left = self.weighted_n_left + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.sq_sum_tmp; + __pyx_v_sq_sum_tmp = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1003 + * cdef double* sum_right = self.sum_right + * cdef double* sq_sum_tmp = self.sq_sum_tmp + * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right + */ + __pyx_t_4 = __pyx_v_self->__pyx_base.sq_sum_total; + __pyx_v_sq_sum_total = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1004 + * cdef double* sq_sum_tmp = self.sq_sum_tmp + * cdef double* sq_sum_total = self.sq_sum_total + * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< + * cdef double weighted_n_right = self.weighted_n_right + * + */ + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_left; + __pyx_v_weighted_n_left = __pyx_t_5; + + /* "sklearn/tree/_tree.pyx":1005 + * cdef double* sq_sum_total = self.sq_sum_total + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< + * + * cdef double total_left = 0.0 + */ + __pyx_t_5 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_right; + __pyx_v_weighted_n_right = __pyx_t_5; + + /* "sklearn/tree/_tree.pyx":1007 + * cdef double weighted_n_right = self.weighted_n_right + * + * cdef double total_left = 0.0 # <<<<<<<<<<<<<< + * cdef double total_right = 0.0 + * cdef double mean_left_k = 0.0 + */ + __pyx_v_total_left = 0.0; + + /* "sklearn/tree/_tree.pyx":1008 + * + * cdef double total_left = 0.0 + * cdef double total_right = 0.0 # <<<<<<<<<<<<<< + * cdef double mean_left_k = 0.0 + * cdef double mean_right_k = 0.0 + */ + __pyx_v_total_right = 0.0; + + /* "sklearn/tree/_tree.pyx":1009 + * cdef double total_left = 0.0 + * cdef double total_right = 0.0 + * cdef double mean_left_k = 0.0 # <<<<<<<<<<<<<< + * cdef double mean_right_k = 0.0 + * + */ + __pyx_v_mean_left_k = 0.0; + + /* "sklearn/tree/_tree.pyx":1010 + * cdef double total_right = 0.0 + * cdef double mean_left_k = 0.0 + * cdef double mean_right_k = 0.0 # <<<<<<<<<<<<<< + * + * cdef SIZE_t i = 0 + */ + __pyx_v_mean_right_k = 0.0; + + /* "sklearn/tree/_tree.pyx":1012 + * cdef double mean_right_k = 0.0 + * + * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< + * cdef SIZE_t p = 0 + * cdef SIZE_t k = 0 + */ + __pyx_v_i = 0; + + /* "sklearn/tree/_tree.pyx":1013 + * + * cdef SIZE_t i = 0 + * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< + * cdef SIZE_t k = 0 + * cdef DOUBLE_t w = 1.0 + */ + __pyx_v_p = 0; + + /* "sklearn/tree/_tree.pyx":1014 + * cdef SIZE_t i = 0 + * cdef SIZE_t p = 0 + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + * cdef DOUBLE_t w = 1.0 + * cdef DOUBLE_t diff_w = 0.0 + */ + __pyx_v_k = 0; + + /* "sklearn/tree/_tree.pyx":1015 + * cdef SIZE_t p = 0 + * cdef SIZE_t k = 0 + * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< + * cdef DOUBLE_t diff_w = 0.0 + * cdef DOUBLE_t y_ik + */ + __pyx_v_w = 1.0; + + /* "sklearn/tree/_tree.pyx":1016 + * cdef SIZE_t k = 0 + * cdef DOUBLE_t w = 1.0 + * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< + * cdef DOUBLE_t y_ik + * + */ + __pyx_v_diff_w = 0.0; + + /* "sklearn/tree/_tree.pyx":1020 + * + * # Compute squared sum + * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< + * memset(sq_sum_tmp, 0, n_bytes) + * + */ + __pyx_v_n_bytes = (__pyx_v_n_outputs * (sizeof(double))); + + /* "sklearn/tree/_tree.pyx":1021 + * # Compute squared sum + * cdef SIZE_t n_bytes = n_outputs * sizeof(double) + * memset(sq_sum_tmp, 0, n_bytes) # <<<<<<<<<<<<<< + * + * for p in range(start, pos): + */ + memset(__pyx_v_sq_sum_tmp, 0, __pyx_v_n_bytes); + + /* "sklearn/tree/_tree.pyx":1023 + * memset(sq_sum_tmp, 0, n_bytes) + * + * for p in range(start, pos): # <<<<<<<<<<<<<< + * i = samples[p] + * + */ + __pyx_t_2 = __pyx_v_pos; + for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { + __pyx_v_p = __pyx_t_6; + + /* "sklearn/tree/_tree.pyx":1024 + * + * for p in range(start, pos): + * i = samples[p] # <<<<<<<<<<<<<< + * + * if sample_weight != NULL: + */ + __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); + + /* "sklearn/tree/_tree.pyx":1026 + * i = samples[p] + * + * if sample_weight != NULL: # <<<<<<<<<<<<<< + * w = sample_weight[i] + * */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; - __pyx_v_n_outputs = __pyx_t_1; + __pyx_t_7 = ((__pyx_v_sample_weight != NULL) != 0); + if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1053 - * (samples[pos:end]).""" - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< - * cdef double* var_right = self.var_right - * cdef double total_left = 0.0 + /* "sklearn/tree/_tree.pyx":1027 + * + * if sample_weight != NULL: + * w = sample_weight[i] # <<<<<<<<<<<<<< + * + * for k in range(n_outputs): */ - __pyx_t_2 = __pyx_v_self->__pyx_base.var_left; - __pyx_v_var_left = __pyx_t_2; + __pyx_v_w = (__pyx_v_sample_weight[__pyx_v_i]); + goto __pyx_L5; + } + __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1054 - * cdef SIZE_t n_outputs = self.n_outputs - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 + /* "sklearn/tree/_tree.pyx":1029 + * w = sample_weight[i] + * + * for k in range(n_outputs): # <<<<<<<<<<<<<< + * y_ik = y[i * y_stride + k] + * sq_sum_tmp[k] += w * y_ik * y_ik */ - __pyx_t_2 = __pyx_v_self->__pyx_base.var_right; - __pyx_v_var_right = __pyx_t_2; + __pyx_t_8 = __pyx_v_n_outputs; + 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":1055 - * cdef double* var_left = self.var_left - * cdef double* var_right = self.var_right - * cdef double total_left = 0.0 # <<<<<<<<<<<<<< - * cdef double total_right = 0.0 - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":1030 + * + * for k in range(n_outputs): + * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< + * sq_sum_tmp[k] += w * y_ik * y_ik + * */ - __pyx_v_total_left = 0.0; + __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_tree.pyx":1056 - * cdef double* var_right = self.var_right - * cdef double total_left = 0.0 - * cdef double total_right = 0.0 # <<<<<<<<<<<<<< - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":1031 + * for k in range(n_outputs): + * y_ik = y[i * y_stride + k] + * sq_sum_tmp[k] += w * y_ik * y_ik # <<<<<<<<<<<<<< * + * # Compute impurity */ - __pyx_v_total_right = 0.0; + __pyx_t_10 = __pyx_v_k; + (__pyx_v_sq_sum_tmp[__pyx_t_10]) = ((__pyx_v_sq_sum_tmp[__pyx_t_10]) + ((__pyx_v_w * __pyx_v_y_ik) * __pyx_v_y_ik)); + } + } - /* "sklearn/tree/_tree.pyx":1059 - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":1034 * + * # Compute impurity * for k in range(n_outputs): # <<<<<<<<<<<<<< - * total_left += var_left[k] - * total_right += var_right[k] + * mean_left_k = sum_left[k] / weighted_n_left + * total_left += (sq_sum_tmp[k] / weighted_n_left - */ - __pyx_t_1 = __pyx_v_n_outputs; - for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { - __pyx_v_k = __pyx_t_3; + __pyx_t_2 = __pyx_v_n_outputs; + 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":1060 - * + /* "sklearn/tree/_tree.pyx":1035 + * # Compute impurity * for k in range(n_outputs): - * total_left += var_left[k] # <<<<<<<<<<<<<< - * total_right += var_right[k] - * + * mean_left_k = sum_left[k] / weighted_n_left # <<<<<<<<<<<<<< + * total_left += (sq_sum_tmp[k] / weighted_n_left - + * mean_left_k * mean_left_k) */ - __pyx_v_total_left = (__pyx_v_total_left + (__pyx_v_var_left[__pyx_v_k])); + __pyx_v_mean_left_k = ((__pyx_v_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left); - /* "sklearn/tree/_tree.pyx":1061 + /* "sklearn/tree/_tree.pyx":1036 * for k in range(n_outputs): - * total_left += var_left[k] - * total_right += var_right[k] # <<<<<<<<<<<<<< + * mean_left_k = sum_left[k] / weighted_n_left + * total_left += (sq_sum_tmp[k] / weighted_n_left - # <<<<<<<<<<<<<< + * mean_left_k * mean_left_k) + * + */ + __pyx_v_total_left = (__pyx_v_total_left + (((__pyx_v_sq_sum_tmp[__pyx_v_k]) / __pyx_v_weighted_n_left) - (__pyx_v_mean_left_k * __pyx_v_mean_left_k))); + + /* "sklearn/tree/_tree.pyx":1039 + * mean_left_k * mean_left_k) + * + * mean_right_k = sum_right[k] / weighted_n_right # <<<<<<<<<<<<<< + * total_right += ((sq_sum_total[k] - sq_sum_tmp[k]) / weighted_n_right - + * mean_right_k * mean_right_k) + */ + __pyx_v_mean_right_k = ((__pyx_v_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right); + + /* "sklearn/tree/_tree.pyx":1040 + * + * mean_right_k = sum_right[k] / weighted_n_right + * total_right += ((sq_sum_total[k] - sq_sum_tmp[k]) / weighted_n_right - # <<<<<<<<<<<<<< + * mean_right_k * mean_right_k) * - * impurity_left[0] = total_left / n_outputs */ - __pyx_v_total_right = (__pyx_v_total_right + (__pyx_v_var_right[__pyx_v_k])); + __pyx_v_total_right = (__pyx_v_total_right + ((((__pyx_v_sq_sum_total[__pyx_v_k]) - (__pyx_v_sq_sum_tmp[__pyx_v_k])) / __pyx_v_weighted_n_right) - (__pyx_v_mean_right_k * __pyx_v_mean_right_k))); } - /* "sklearn/tree/_tree.pyx":1063 - * total_right += var_right[k] + /* "sklearn/tree/_tree.pyx":1043 + * mean_right_k * mean_right_k) * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< * impurity_right[0] = total_right / n_outputs @@ -7983,7 +7749,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":1064 + /* "sklearn/tree/_tree.pyx":1044 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -7992,8 +7758,8 @@ 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":1047 - * return total / n_outputs + /* "sklearn/tree/_tree.pyx":984 + * proxy_impurity_right / weighted_n_right) * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< * double* impurity_right) nogil: @@ -8003,23 +7769,196 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1076 +/* "sklearn/tree/_tree.pyx":1056 + * """ + * + * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< + * """Compute a proxy of the impurity reduction + * + */ + +static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_proxy_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_v_self) { + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; + double *__pyx_v_sum_left; + double *__pyx_v_sum_right; + double __pyx_v_weighted_n_left; + double __pyx_v_weighted_n_right; + double __pyx_v_total_sum_left; + double __pyx_v_total_sum_right; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; + double __pyx_v_diff; + double __pyx_r; + __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":1067 + * impurity_improvement method once the best split has been found. + * """ + * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right + */ + __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":1068 + * """ + * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< + * cdef double* sum_right = self.sum_right + * cdef double weighted_n_left = self.weighted_n_left + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_left; + __pyx_v_sum_left = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1069 + * cdef SIZE_t n_outputs = self.n_outputs + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right + */ + __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_right; + __pyx_v_sum_right = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1070 + * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right + * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< + * cdef double weighted_n_right = self.weighted_n_right + * cdef double total_sum_left = 0.0 + */ + __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":1071 + * cdef double* sum_right = self.sum_right + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< + * cdef double total_sum_left = 0.0 + * cdef double total_sum_right = 0.0 + */ + __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":1072 + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right + * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< + * cdef double total_sum_right = 0.0 + * + */ + __pyx_v_total_sum_left = 0.0; + + /* "sklearn/tree/_tree.pyx":1073 + * cdef double weighted_n_right = self.weighted_n_right + * cdef double total_sum_left = 0.0 + * cdef double total_sum_right = 0.0 # <<<<<<<<<<<<<< + * + * cdef SIZE_t k = 0 + */ + __pyx_v_total_sum_right = 0.0; + + /* "sklearn/tree/_tree.pyx":1075 + * cdef double total_sum_right = 0.0 + * + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< + * cdef double diff = 0.0 + * + */ + __pyx_v_k = 0; + + /* "sklearn/tree/_tree.pyx":1076 + * + * cdef SIZE_t k = 0 + * cdef double diff = 0.0 # <<<<<<<<<<<<<< + * + * for k in range(n_outputs): + */ + __pyx_v_diff = 0.0; + + /* "sklearn/tree/_tree.pyx":1078 + * cdef double diff = 0.0 + * + * 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_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { + __pyx_v_k = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1079 + * + * 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":1080 + * for k in range(n_outputs): + * total_sum_left += sum_left[k] + * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< + * + * diff = (weighted_n_right * total_sum_left - + */ + __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_sum_right[__pyx_v_k])); + } + + /* "sklearn/tree/_tree.pyx":1082 + * total_sum_right += sum_right[k] + * + * diff = (weighted_n_right * total_sum_left - # <<<<<<<<<<<<<< + * weighted_n_left * total_sum_right) + * + */ + __pyx_v_diff = ((__pyx_v_weighted_n_right * __pyx_v_total_sum_left) - (__pyx_v_weighted_n_left * __pyx_v_total_sum_right)); + + /* "sklearn/tree/_tree.pyx":1085 + * weighted_n_left * total_sum_right) + * + * return diff * diff / (weighted_n_left * weighted_n_right) # <<<<<<<<<<<<<< + * + * cdef double impurity_improvement(self, double impurity) nogil: + */ + __pyx_r = ((__pyx_v_diff * __pyx_v_diff) / (__pyx_v_weighted_n_left * __pyx_v_weighted_n_right)); + goto __pyx_L0; + + /* "sklearn/tree/_tree.pyx":1056 * """ * + * cdef double proxy_impurity_improvement(self) nogil: # <<<<<<<<<<<<<< + * """Compute a proxy of the impurity reduction + * + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "sklearn/tree/_tree.pyx":1087 + * return diff * diff / (weighted_n_left * weighted_n_right) + * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t k + * cdef double* sum_left = self.sum_left */ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_v_self, CYTHON_UNUSED double __pyx_v_impurity) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; double *__pyx_v_sum_left; double *__pyx_v_sum_right; - double __pyx_v_total_sum_left; - double __pyx_v_total_sum_right; double __pyx_v_weighted_n_left; double __pyx_v_weighted_n_right; + double __pyx_v_weighted_n_node_samples; + double __pyx_v_total_sum_left; + double __pyx_v_total_sum_right; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_k; double __pyx_v_diff; double __pyx_r; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; @@ -8027,84 +7966,103 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s double __pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1077 + /* "sklearn/tree/_tree.pyx":1088 * * cdef double impurity_improvement(self, double impurity) nogil: * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< - * cdef SIZE_t k * cdef double* sum_left = self.sum_left + * cdef double* sum_right = self.sum_right */ __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":1079 + /* "sklearn/tree/_tree.pyx":1089 + * cdef double impurity_improvement(self, double impurity) nogil: * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t k * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< * cdef double* sum_right = self.sum_right - * cdef double total_sum_left = 0.0 + * cdef double weighted_n_left = self.weighted_n_left */ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_left; __pyx_v_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1080 - * cdef SIZE_t k + /* "sklearn/tree/_tree.pyx":1090 + * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< - * cdef double total_sum_left = 0.0 - * 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 */ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_right; __pyx_v_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1081 + /* "sklearn/tree/_tree.pyx":1091 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right + * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< + * cdef double weighted_n_right = self.weighted_n_right + * cdef double weighted_n_node_samples = self.weighted_n_node_samples + */ + __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":1092 + * cdef double* sum_right = self.sum_right + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< + * cdef double weighted_n_node_samples = self.weighted_n_node_samples + * cdef double total_sum_left = 0.0 + */ + __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":1093 + * cdef double weighted_n_left = self.weighted_n_left + * cdef double weighted_n_right = self.weighted_n_right + * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< + * cdef double total_sum_left = 0.0 + * cdef double total_sum_right = 0.0 + */ + __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_node_samples; + __pyx_v_weighted_n_node_samples = __pyx_t_3; + + /* "sklearn/tree/_tree.pyx":1094 + * cdef double weighted_n_right = self.weighted_n_right + * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< * cdef double total_sum_right = 0.0 - * cdef double weighted_n_left = self.weighted_n_left + * */ __pyx_v_total_sum_left = 0.0; - /* "sklearn/tree/_tree.pyx":1082 - * cdef double* sum_right = self.sum_right + /* "sklearn/tree/_tree.pyx":1095 + * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double total_sum_left = 0.0 * 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 + * + * cdef SIZE_t k = 0 */ __pyx_v_total_sum_right = 0.0; - /* "sklearn/tree/_tree.pyx":1083 - * cdef double total_sum_left = 0.0 - * 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 - * cdef double diff = 0.0 - */ - __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":1084 + /* "sklearn/tree/_tree.pyx":1097 * 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 # <<<<<<<<<<<<<< + * + * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< * cdef double diff = 0.0 * */ - __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right; - __pyx_v_weighted_n_right = __pyx_t_3; + __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":1085 - * cdef double weighted_n_left = self.weighted_n_left - * cdef double weighted_n_right = self.weighted_n_right + /* "sklearn/tree/_tree.pyx":1098 + * + * cdef SIZE_t k = 0 * cdef double diff = 0.0 # <<<<<<<<<<<<<< * * for k in range(n_outputs): */ __pyx_v_diff = 0.0; - /* "sklearn/tree/_tree.pyx":1087 + /* "sklearn/tree/_tree.pyx":1100 * cdef double diff = 0.0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -8115,7 +8073,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(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":1088 + /* "sklearn/tree/_tree.pyx":1101 * * for k in range(n_outputs): * total_sum_left += sum_left[k] # <<<<<<<<<<<<<< @@ -8124,59 +8082,41 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_sum_left[__pyx_v_k])); - /* "sklearn/tree/_tree.pyx":1089 + /* "sklearn/tree/_tree.pyx":1102 * for k in range(n_outputs): * total_sum_left += sum_left[k] * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< * - * total_sum_left = total_sum_left / n_outputs + * diff = (weighted_n_right * total_sum_left - */ __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_sum_right[__pyx_v_k])); } - /* "sklearn/tree/_tree.pyx":1091 - * total_sum_right += sum_right[k] - * - * total_sum_left = total_sum_left / n_outputs # <<<<<<<<<<<<<< - * total_sum_right = total_sum_right / n_outputs - * diff = ((total_sum_left / weighted_n_left) - - */ - __pyx_v_total_sum_left = (__pyx_v_total_sum_left / __pyx_v_n_outputs); - - /* "sklearn/tree/_tree.pyx":1092 + /* "sklearn/tree/_tree.pyx":1105 * - * total_sum_left = total_sum_left / n_outputs - * total_sum_right = total_sum_right / n_outputs # <<<<<<<<<<<<<< - * diff = ((total_sum_left / weighted_n_left) - - * (total_sum_right / weighted_n_right)) - */ - __pyx_v_total_sum_right = (__pyx_v_total_sum_right / __pyx_v_n_outputs); - - /* "sklearn/tree/_tree.pyx":1093 - * total_sum_left = total_sum_left / n_outputs - * total_sum_right = total_sum_right / n_outputs - * diff = ((total_sum_left / weighted_n_left) - # <<<<<<<<<<<<<< - * (total_sum_right / weighted_n_right)) + * diff = (weighted_n_right * total_sum_left - + * weighted_n_left * total_sum_right) / n_outputs # <<<<<<<<<<<<<< * + * return (diff * diff / */ - __pyx_v_diff = ((__pyx_v_total_sum_left / __pyx_v_weighted_n_left) - (__pyx_v_total_sum_right / __pyx_v_weighted_n_right)); + __pyx_v_diff = (((__pyx_v_weighted_n_right * __pyx_v_total_sum_left) - (__pyx_v_weighted_n_left * __pyx_v_total_sum_right)) / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":1096 - * (total_sum_right / weighted_n_right)) + /* "sklearn/tree/_tree.pyx":1107 + * weighted_n_left * total_sum_right) / n_outputs * - * return (weighted_n_left * weighted_n_right * diff * diff / # <<<<<<<<<<<<<< - * (weighted_n_left + weighted_n_right)) + * return (diff * diff / # <<<<<<<<<<<<<< + * (weighted_n_left * weighted_n_right * weighted_n_node_samples)) * */ - __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)); + __pyx_r = ((__pyx_v_diff * __pyx_v_diff) / ((__pyx_v_weighted_n_left * __pyx_v_weighted_n_right) * __pyx_v_weighted_n_node_samples)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1076 - * """ + /* "sklearn/tree/_tree.pyx":1087 + * return diff * diff / (weighted_n_left * weighted_n_right) * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< * cdef SIZE_t n_outputs = self.n_outputs - * cdef SIZE_t k + * cdef double* sum_left = self.sum_left */ /* function exit code */ @@ -8184,7 +8124,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1103 +/* "sklearn/tree/_tree.pyx":1114 * # ============================================================================= * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: # <<<<<<<<<<<<<< @@ -8194,7 +8134,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":1104 + /* "sklearn/tree/_tree.pyx":1115 * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: * self.impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -8203,7 +8143,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":1105 + /* "sklearn/tree/_tree.pyx":1116 * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: * self.impurity_left = INFINITY * self.impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -8212,7 +8152,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":1106 + /* "sklearn/tree/_tree.pyx":1117 * self.impurity_left = INFINITY * self.impurity_right = INFINITY * self.pos = start_pos # <<<<<<<<<<<<<< @@ -8221,7 +8161,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":1107 + /* "sklearn/tree/_tree.pyx":1118 * self.impurity_right = INFINITY * self.pos = start_pos * self.feature = 0 # <<<<<<<<<<<<<< @@ -8230,7 +8170,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->feature = 0; - /* "sklearn/tree/_tree.pyx":1108 + /* "sklearn/tree/_tree.pyx":1119 * self.pos = start_pos * self.feature = 0 * self.threshold = 0. # <<<<<<<<<<<<<< @@ -8239,7 +8179,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->threshold = 0.; - /* "sklearn/tree/_tree.pyx":1109 + /* "sklearn/tree/_tree.pyx":1120 * self.feature = 0 * self.threshold = 0. * self.improvement = -INFINITY # <<<<<<<<<<<<<< @@ -8248,7 +8188,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":1103 + /* "sklearn/tree/_tree.pyx":1114 * # ============================================================================= * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: # <<<<<<<<<<<<<< @@ -8259,7 +8199,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1119 +/* "sklearn/tree/_tree.pyx":1130 * """ * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -8304,26 +8244,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 = 1119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __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 = 1119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __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 = 1119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __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 = 1119; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __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 = 1119; __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 = 1130; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -8335,20 +8275,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 = 1119; __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 = 1120; __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 = 1120; __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 = 1130; __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 = 1131; __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 = 1131; __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 = 1119; __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 = 1130; __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 = 1119; __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 = 1130; __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 */ @@ -8365,7 +8305,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1143 + /* "sklearn/tree/_tree.pyx":1156 * """ * * self.criterion = criterion # <<<<<<<<<<<<<< @@ -8378,7 +8318,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":1145 + /* "sklearn/tree/_tree.pyx":1158 * self.criterion = criterion * * self.samples = NULL # <<<<<<<<<<<<<< @@ -8387,7 +8327,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->samples = NULL; - /* "sklearn/tree/_tree.pyx":1146 + /* "sklearn/tree/_tree.pyx":1159 * * self.samples = NULL * self.n_samples = 0 # <<<<<<<<<<<<<< @@ -8396,7 +8336,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":1147 + /* "sklearn/tree/_tree.pyx":1160 * self.samples = NULL * self.n_samples = 0 * self.features = NULL # <<<<<<<<<<<<<< @@ -8405,7 +8345,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->features = NULL; - /* "sklearn/tree/_tree.pyx":1148 + /* "sklearn/tree/_tree.pyx":1161 * self.n_samples = 0 * self.features = NULL * self.n_features = 0 # <<<<<<<<<<<<<< @@ -8414,7 +8354,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":1149 + /* "sklearn/tree/_tree.pyx":1162 * self.features = NULL * self.n_features = 0 * self.feature_values = NULL # <<<<<<<<<<<<<< @@ -8423,7 +8363,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":1151 + /* "sklearn/tree/_tree.pyx":1164 * self.feature_values = NULL * * self.y = NULL # <<<<<<<<<<<<<< @@ -8432,7 +8372,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->y = NULL; - /* "sklearn/tree/_tree.pyx":1152 + /* "sklearn/tree/_tree.pyx":1165 * * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -8441,7 +8381,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":1153 + /* "sklearn/tree/_tree.pyx":1166 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -8450,7 +8390,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":1155 + /* "sklearn/tree/_tree.pyx":1168 * self.sample_weight = NULL * * self.max_features = max_features # <<<<<<<<<<<<<< @@ -8459,7 +8399,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":1156 + /* "sklearn/tree/_tree.pyx":1169 * * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -8468,7 +8408,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":1157 + /* "sklearn/tree/_tree.pyx":1170 * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -8477,7 +8417,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":1158 + /* "sklearn/tree/_tree.pyx":1171 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.random_state = random_state # <<<<<<<<<<<<<< @@ -8490,7 +8430,7 @@ 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":1119 + /* "sklearn/tree/_tree.pyx":1130 * """ * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -8504,7 +8444,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1160 +/* "sklearn/tree/_tree.pyx":1173 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8527,7 +8467,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":1163 + /* "sklearn/tree/_tree.pyx":1176 * """Destructor.""" * * free(self.samples) # <<<<<<<<<<<<<< @@ -8536,7 +8476,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->samples); - /* "sklearn/tree/_tree.pyx":1164 + /* "sklearn/tree/_tree.pyx":1177 * * free(self.samples) * free(self.features) # <<<<<<<<<<<<<< @@ -8545,7 +8485,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->features); - /* "sklearn/tree/_tree.pyx":1165 + /* "sklearn/tree/_tree.pyx":1178 * free(self.samples) * free(self.features) * free(self.constant_features) # <<<<<<<<<<<<<< @@ -8554,7 +8494,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":1166 + /* "sklearn/tree/_tree.pyx":1179 * free(self.features) * free(self.constant_features) * free(self.feature_values) # <<<<<<<<<<<<<< @@ -8563,7 +8503,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->feature_values); - /* "sklearn/tree/_tree.pyx":1160 + /* "sklearn/tree/_tree.pyx":1173 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8575,7 +8515,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1168 +/* "sklearn/tree/_tree.pyx":1181 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8605,7 +8545,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":1169 + /* "sklearn/tree/_tree.pyx":1182 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -8613,13 +8553,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 = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __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":1168 + /* "sklearn/tree/_tree.pyx":1181 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8638,7 +8578,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_4__getstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1171 +/* "sklearn/tree/_tree.pyx":1184 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -8671,7 +8611,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_6__setstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1174 +/* "sklearn/tree/_tree.pyx":1187 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -8712,20 +8652,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 = 1174; __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 = 1187; __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":1195 + /* "sklearn/tree/_tree.pyx":1209 * """ * * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) # <<<<<<<<<<<<<< * cdef SIZE_t n_samples = X.shape[0] * */ - __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 = 1195; __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 = 1209; __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 = 1195; __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 = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -8739,7 +8679,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 = 1195; __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 = 1209; __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; @@ -8750,41 +8690,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 = 1195; __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 = 1209; __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 = 1195; __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 = 1209; __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":1196 + /* "sklearn/tree/_tree.pyx":1210 * * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< * * # 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 = 1196; __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 = 1210; __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 = 1196; __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 = 1210; __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 = 1196; __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 = 1210; __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":1200 + /* "sklearn/tree/_tree.pyx":1214 * # 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 = 1200; __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 = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_samples = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1203 + /* "sklearn/tree/_tree.pyx":1217 * * cdef SIZE_t i, j * cdef double weighted_n_samples = 0.0 # <<<<<<<<<<<<<< @@ -8793,7 +8733,7 @@ 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":1204 + /* "sklearn/tree/_tree.pyx":1218 * cdef SIZE_t i, j * cdef double weighted_n_samples = 0.0 * j = 0 # <<<<<<<<<<<<<< @@ -8802,7 +8742,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_j = 0; - /* "sklearn/tree/_tree.pyx":1206 + /* "sklearn/tree/_tree.pyx":1220 * j = 0 * * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -8813,7 +8753,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":1208 + /* "sklearn/tree/_tree.pyx":1222 * for i in range(n_samples): * # Only work with positively weighted samples * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< @@ -8831,7 +8771,7 @@ 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":1209 + /* "sklearn/tree/_tree.pyx":1223 * # Only work with positively weighted samples * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i # <<<<<<<<<<<<<< @@ -8840,7 +8780,7 @@ 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":1210 + /* "sklearn/tree/_tree.pyx":1224 * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i * j += 1 # <<<<<<<<<<<<<< @@ -8852,7 +8792,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1212 + /* "sklearn/tree/_tree.pyx":1226 * j += 1 * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -8862,7 +8802,7 @@ 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":1213 + /* "sklearn/tree/_tree.pyx":1227 * * if sample_weight != NULL: * weighted_n_samples += sample_weight[i] # <<<<<<<<<<<<<< @@ -8874,7 +8814,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":1215 + /* "sklearn/tree/_tree.pyx":1229 * weighted_n_samples += sample_weight[i] * else: * weighted_n_samples += 1.0 # <<<<<<<<<<<<<< @@ -8886,7 +8826,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1218 + /* "sklearn/tree/_tree.pyx":1232 * * # Number of samples is number of positively weighted samples * self.n_samples = j # <<<<<<<<<<<<<< @@ -8895,7 +8835,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->n_samples = __pyx_v_j; - /* "sklearn/tree/_tree.pyx":1219 + /* "sklearn/tree/_tree.pyx":1233 * # Number of samples is number of positively weighted samples * self.n_samples = j * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -8904,33 +8844,33 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->weighted_n_samples = __pyx_v_weighted_n_samples; - /* "sklearn/tree/_tree.pyx":1221 + /* "sklearn/tree/_tree.pyx":1235 * self.weighted_n_samples = weighted_n_samples * * 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 = 1221; __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 = 1235; __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 = 1221; __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 = 1235; __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 = 1221; __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 = 1235; __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":1222 + /* "sklearn/tree/_tree.pyx":1236 * * 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 = 1222; __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 = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_features = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1224 + /* "sklearn/tree/_tree.pyx":1238 * cdef SIZE_t* features = safe_realloc(&self.features, n_features) * * for i in range(n_features): # <<<<<<<<<<<<<< @@ -8941,7 +8881,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":1225 + /* "sklearn/tree/_tree.pyx":1239 * * for i in range(n_features): * features[i] = i # <<<<<<<<<<<<<< @@ -8951,7 +8891,7 @@ 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":1227 + /* "sklearn/tree/_tree.pyx":1241 * features[i] = i * * self.n_features = n_features # <<<<<<<<<<<<<< @@ -8960,25 +8900,25 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->n_features = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":1229 + /* "sklearn/tree/_tree.pyx":1243 * self.n_features = n_features * * 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 = 1229; __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 = 1243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1230 + /* "sklearn/tree/_tree.pyx":1244 * * safe_realloc(&self.feature_values, n_samples) * safe_realloc(&self.constant_features, n_features) # <<<<<<<<<<<<<< * * self.y = y.data */ - __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 = 1230; __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 = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1232 + /* "sklearn/tree/_tree.pyx":1246 * safe_realloc(&self.constant_features, n_features) * * self.y = y.data # <<<<<<<<<<<<<< @@ -8987,20 +8927,20 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->y = ((__pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *)__pyx_v_y->data); - /* "sklearn/tree/_tree.pyx":1233 + /* "sklearn/tree/_tree.pyx":1247 * * self.y = y.data * self.y_stride = y.strides[0] / y.itemsize # <<<<<<<<<<<<<< * * self.sample_weight = sample_weight */ - __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 = 1233; __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 = 1247; __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 = 1233; __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 = 1247; __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":1235 + /* "sklearn/tree/_tree.pyx":1249 * self.y_stride = y.strides[0] / y.itemsize * * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -9009,7 +8949,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->sample_weight = __pyx_v_sample_weight; - /* "sklearn/tree/_tree.pyx":1174 + /* "sklearn/tree/_tree.pyx":1187 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -9037,18 +8977,18 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1237 +/* "sklearn/tree/_tree.pyx":1251 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< * double* weighted_n_node_samples) nogil: - * """Reset the splitter object to consider samples between start and end. + * """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":1251 + /* "sklearn/tree/_tree.pyx":1265 * """ * * self.start = start # <<<<<<<<<<<<<< @@ -9057,7 +8997,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ */ __pyx_v_self->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1252 + /* "sklearn/tree/_tree.pyx":1266 * * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -9066,7 +9006,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":1254 + /* "sklearn/tree/_tree.pyx":1268 * self.end = end * * self.criterion.init(self.y, # <<<<<<<<<<<<<< @@ -9075,7 +9015,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":1262 + /* "sklearn/tree/_tree.pyx":1276 * end) * * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -9085,23 +9025,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":1237 + /* "sklearn/tree/_tree.pyx":1251 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< * double* weighted_n_node_samples) nogil: - * """Reset the splitter object to consider samples between start and end. + * """Reset splitter on node samples[start:end]. */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1264 +/* "sklearn/tree/_tree.pyx":1278 * 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 the best split on node samples[start:end] + * """Find the best 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) { @@ -9109,7 +9049,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split(CYTHON_UNUSED str /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1274 +/* "sklearn/tree/_tree.pyx":1288 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -9119,7 +9059,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split(CYTHON_UNUSED str 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":1277 + /* "sklearn/tree/_tree.pyx":1291 * """Copy the value of node samples[start:end] into dest.""" * * self.criterion.node_value(dest) # <<<<<<<<<<<<<< @@ -9128,7 +9068,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value(struct __pyx_obj_ */ ((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":1274 + /* "sklearn/tree/_tree.pyx":1288 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -9139,7 +9079,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value(struct __pyx_obj_ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1279 +/* "sklearn/tree/_tree.pyx":1293 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -9150,7 +9090,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value(struct __pyx_obj_ 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":1282 + /* "sklearn/tree/_tree.pyx":1296 * """Return the impurity of the current node.""" * * return self.criterion.node_impurity() # <<<<<<<<<<<<<< @@ -9160,7 +9100,7 @@ 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":1279 + /* "sklearn/tree/_tree.pyx":1293 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -9173,7 +9113,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_impurity(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pxd":86 +/* "sklearn/tree/_tree.pxd":87 * * # Internal structures * cdef public Criterion criterion # Impurity criterion # <<<<<<<<<<<<<< @@ -9231,7 +9171,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_9criterion_2__set__(struct _ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7sklearn_4tree_5_tree_Criterion))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7sklearn_4tree_5_tree_Criterion))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -9281,7 +9221,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_9criterion_4__del__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pxd":87 +/* "sklearn/tree/_tree.pxd":88 * # Internal structures * cdef public Criterion criterion # Impurity criterion * cdef public SIZE_t max_features # Number of features to test # <<<<<<<<<<<<<< @@ -9311,7 +9251,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_12max_features___get__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9349,7 +9289,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_12max_features_2__set__(stru const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_features = __pyx_t_1; /* function exit code */ @@ -9363,7 +9303,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_12max_features_2__set__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pxd":88 +/* "sklearn/tree/_tree.pxd":89 * cdef public Criterion criterion # Impurity criterion * cdef public SIZE_t max_features # Number of features to test * cdef public SIZE_t min_samples_leaf # Min samples in a leaf # <<<<<<<<<<<<<< @@ -9393,7 +9333,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_16min_samples_leaf___g int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->min_samples_leaf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->min_samples_leaf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9431,7 +9371,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_16min_samples_leaf_2__set__( const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->min_samples_leaf = __pyx_t_1; /* function exit code */ @@ -9445,7 +9385,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_16min_samples_leaf_2__set__( return __pyx_r; } -/* "sklearn/tree/_tree.pxd":89 +/* "sklearn/tree/_tree.pxd":90 * cdef public SIZE_t max_features # Number of features to test * cdef public SIZE_t min_samples_leaf # Min samples in a leaf * cdef public double min_weight_leaf # Minimum weight in a leaf # <<<<<<<<<<<<<< @@ -9475,7 +9415,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_15min_weight_leaf___ge int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->min_weight_leaf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->min_weight_leaf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9513,7 +9453,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_15min_weight_leaf_2__set__(s const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->min_weight_leaf = __pyx_t_1; /* function exit code */ @@ -9527,7 +9467,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_15min_weight_leaf_2__set__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1290 +/* "sklearn/tree/_tree.pyx":1304 * cdef SIZE_t X_fx_stride * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -9572,26 +9512,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 = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __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 = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __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 = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __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 = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __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 = 1290; __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 = 1304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -9603,20 +9543,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 = 1290; __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 = 1291; __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 = 1291; __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 = 1304; __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 = 1305; __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 = 1305; __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 = 1290; __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 = 1304; __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 = 1290; __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 = 1304; __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 */ @@ -9633,7 +9573,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1294 + /* "sklearn/tree/_tree.pyx":1308 * object random_state): * * self.X = NULL # <<<<<<<<<<<<<< @@ -9642,7 +9582,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ */ __pyx_v_self->X = NULL; - /* "sklearn/tree/_tree.pyx":1295 + /* "sklearn/tree/_tree.pyx":1309 * * self.X = NULL * self.X_sample_stride = 0 # <<<<<<<<<<<<<< @@ -9651,7 +9591,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ */ __pyx_v_self->X_sample_stride = 0; - /* "sklearn/tree/_tree.pyx":1296 + /* "sklearn/tree/_tree.pyx":1310 * self.X = NULL * self.X_sample_stride = 0 * self.X_fx_stride = 0 # <<<<<<<<<<<<<< @@ -9660,7 +9600,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ */ __pyx_v_self->X_fx_stride = 0; - /* "sklearn/tree/_tree.pyx":1290 + /* "sklearn/tree/_tree.pyx":1304 * cdef SIZE_t X_fx_stride * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -9674,7 +9614,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_17BaseDenseSplitter___cinit__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1298 +/* "sklearn/tree/_tree.pyx":1312 * self.X_fx_stride = 0 * * cdef void init(self, # <<<<<<<<<<<<<< @@ -9701,33 +9641,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 = 1298; __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 = 1312; __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":1305 + /* "sklearn/tree/_tree.pyx":1319 * * # 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 = 1305; __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 = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1308 + /* "sklearn/tree/_tree.pyx":1322 * * # 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 = 1308; __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 = 1322; __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":1310 + /* "sklearn/tree/_tree.pyx":1324 * cdef np.ndarray X_ndarray = X * * self.X = X_ndarray.data # <<<<<<<<<<<<<< @@ -9736,47 +9676,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":1311 + /* "sklearn/tree/_tree.pyx":1325 * * 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 = 1311; __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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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 = 1325; __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":1312 + /* "sklearn/tree/_tree.pyx":1326 * 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 = 1312; __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 = 1326; __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 = 1312; __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 = 1326; __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 = 1312; __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 = 1326; __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 = 1312; __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 = 1326; __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 = 1312; __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 = 1326; __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":1298 + /* "sklearn/tree/_tree.pyx":1312 * self.X_fx_stride = 0 * * cdef void init(self, # <<<<<<<<<<<<<< @@ -9802,7 +9742,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_17BaseDenseSplitter_init(struct __pyx_ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1317 +/* "sklearn/tree/_tree.pyx":1331 * cdef class BestSplitter(BaseDenseSplitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9835,7 +9775,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1318 + /* "sklearn/tree/_tree.pyx":1332 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -9844,44 +9784,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1319 + /* "sklearn/tree/_tree.pyx":1333 * 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 = 1319; __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 = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1320 + /* "sklearn/tree/_tree.pyx":1334 * 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 = 1320; __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 = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1321 + /* "sklearn/tree/_tree.pyx":1335 * 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 = 1321; __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 = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1318 + /* "sklearn/tree/_tree.pyx":1332 * """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 = 1318; __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 = 1332; __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)); @@ -9899,14 +9839,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1322 + /* "sklearn/tree/_tree.pyx":1336 * 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 = 1322; __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 = 1336; __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))) { @@ -9919,22 +9859,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 = 1322; __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 = 1336; __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 = 1322; __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 = 1336; __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":1318 + /* "sklearn/tree/_tree.pyx":1332 * """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 = 1318; __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 = 1332; __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))); @@ -9949,7 +9889,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1317 + /* "sklearn/tree/_tree.pyx":1331 * cdef class BestSplitter(BaseDenseSplitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9971,7 +9911,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1324 +/* "sklearn/tree/_tree.pyx":1338 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -9996,6 +9936,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __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; + double __pyx_v_current_proxy_improvement; + double __pyx_v_best_proxy_improvement; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; @@ -10014,7 +9956,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":1328 + /* "sklearn/tree/_tree.pyx":1342 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -10024,7 +9966,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":1329 + /* "sklearn/tree/_tree.pyx":1343 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -10034,7 +9976,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":1330 + /* "sklearn/tree/_tree.pyx":1344 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -10044,7 +9986,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":1332 + /* "sklearn/tree/_tree.pyx":1346 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -10054,7 +9996,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":1333 + /* "sklearn/tree/_tree.pyx":1347 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -10064,7 +10006,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":1334 + /* "sklearn/tree/_tree.pyx":1348 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -10074,7 +10016,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":1336 + /* "sklearn/tree/_tree.pyx":1350 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -10084,7 +10026,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":1337 + /* "sklearn/tree/_tree.pyx":1351 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -10094,7 +10036,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":1338 + /* "sklearn/tree/_tree.pyx":1352 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -10104,7 +10046,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":1339 + /* "sklearn/tree/_tree.pyx":1353 * 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 # <<<<<<<<<<<<<< @@ -10114,7 +10056,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":1340 + /* "sklearn/tree/_tree.pyx":1354 * 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 # <<<<<<<<<<<<<< @@ -10124,7 +10066,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":1341 + /* "sklearn/tree/_tree.pyx":1355 * 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 # <<<<<<<<<<<<<< @@ -10134,7 +10076,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":1342 + /* "sklearn/tree/_tree.pyx":1356 * 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 # <<<<<<<<<<<<<< @@ -10144,7 +10086,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":1343 + /* "sklearn/tree/_tree.pyx":1357 * 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 # <<<<<<<<<<<<<< @@ -10153,8 +10095,26 @@ 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":1347 + /* "sklearn/tree/_tree.pyx":1360 + * + * cdef SplitRecord best, current + * cdef double current_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * cdef double best_proxy_improvement = - INFINITY + * + */ + __pyx_v_current_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":1361 * cdef SplitRecord best, current + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * + * cdef SIZE_t f_i = n_features + */ + __pyx_v_best_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":1363 + * cdef double best_proxy_improvement = - INFINITY * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< * cdef SIZE_t f_j, p, tmp @@ -10162,7 +10122,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":1349 + /* "sklearn/tree/_tree.pyx":1365 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -10171,7 +10131,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1351 + /* "sklearn/tree/_tree.pyx":1367 * 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 # <<<<<<<<<<<<<< @@ -10180,7 +10140,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1353 + /* "sklearn/tree/_tree.pyx":1369 * 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 # <<<<<<<<<<<<<< @@ -10189,7 +10149,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1354 + /* "sklearn/tree/_tree.pyx":1370 * # 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] # <<<<<<<<<<<<<< @@ -10198,7 +10158,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":1356 + /* "sklearn/tree/_tree.pyx":1372 * 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 # <<<<<<<<<<<<<< @@ -10207,7 +10167,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":1360 + /* "sklearn/tree/_tree.pyx":1376 * cdef SIZE_t partition_end * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -10216,7 +10176,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":1371 + /* "sklearn/tree/_tree.pyx":1387 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -10231,7 +10191,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1373 + /* "sklearn/tree/_tree.pyx":1389 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -10245,7 +10205,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1375 + /* "sklearn/tree/_tree.pyx":1391 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -10257,7 +10217,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":1377 + /* "sklearn/tree/_tree.pyx":1393 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -10266,7 +10226,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":1391 + /* "sklearn/tree/_tree.pyx":1407 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -10275,7 +10235,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":1394 + /* "sklearn/tree/_tree.pyx":1410 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -10285,7 +10245,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":1396 + /* "sklearn/tree/_tree.pyx":1412 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -10294,7 +10254,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":1397 + /* "sklearn/tree/_tree.pyx":1413 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -10303,7 +10263,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":1398 + /* "sklearn/tree/_tree.pyx":1414 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -10312,7 +10272,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":1400 + /* "sklearn/tree/_tree.pyx":1416 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -10324,7 +10284,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1404 + /* "sklearn/tree/_tree.pyx":1420 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -10333,7 +10293,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":1407 + /* "sklearn/tree/_tree.pyx":1423 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -10342,7 +10302,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":1413 + /* "sklearn/tree/_tree.pyx":1429 * # Xf[i] == X[samples[i], j], so the sort uses the cache more * # effectively. * for p in range(start, end): # <<<<<<<<<<<<<< @@ -10353,7 +10313,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":1414 + /* "sklearn/tree/_tree.pyx":1430 * # effectively. * for p in range(start, end): * Xf[p] = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -10363,7 +10323,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":1417 + /* "sklearn/tree/_tree.pyx":1433 * X_fx_stride * current.feature] * * sort(Xf + start, samples + start, end - start) # <<<<<<<<<<<<<< @@ -10372,7 +10332,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":1419 + /* "sklearn/tree/_tree.pyx":1435 * sort(Xf + start, samples + start, end - start) * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -10382,7 +10342,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":1420 + /* "sklearn/tree/_tree.pyx":1436 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -10391,7 +10351,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":1421 + /* "sklearn/tree/_tree.pyx":1437 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -10401,7 +10361,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":1423 + /* "sklearn/tree/_tree.pyx":1439 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -10410,7 +10370,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":1424 + /* "sklearn/tree/_tree.pyx":1440 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -10422,7 +10382,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1427 + /* "sklearn/tree/_tree.pyx":1443 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -10431,7 +10391,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":1428 + /* "sklearn/tree/_tree.pyx":1444 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -10443,7 +10403,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":1431 + /* "sklearn/tree/_tree.pyx":1447 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -10452,7 +10412,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":1432 + /* "sklearn/tree/_tree.pyx":1448 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -10461,7 +10421,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1434 + /* "sklearn/tree/_tree.pyx":1450 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -10472,7 +10432,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":1435 + /* "sklearn/tree/_tree.pyx":1451 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -10487,7 +10447,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L16_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1436 + /* "sklearn/tree/_tree.pyx":1452 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -10499,7 +10459,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":1437 + /* "sklearn/tree/_tree.pyx":1453 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -10509,16 +10469,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":1441 + /* "sklearn/tree/_tree.pyx":1457 * # (p + 1 >= end) or (X[samples[p + 1], current.feature] > * # X[samples[p], current.feature]) * p += 1 # <<<<<<<<<<<<<< - * # (p >= end) or (X[samples[p], current.fe + 1 ature] > + * # (p >= end) or (X[samples[p], current.feature] > * # X[samples[p - 1], current.feature]) */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":1445 + /* "sklearn/tree/_tree.pyx":1461 * # X[samples[p - 1], current.feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -10528,7 +10488,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":1446 + /* "sklearn/tree/_tree.pyx":1462 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -10537,7 +10497,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":1449 + /* "sklearn/tree/_tree.pyx":1465 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -10551,7 +10511,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L20_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1450 + /* "sklearn/tree/_tree.pyx":1466 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -10563,7 +10523,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":1451 + /* "sklearn/tree/_tree.pyx":1467 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -10573,7 +10533,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1453 + /* "sklearn/tree/_tree.pyx":1469 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -10582,7 +10542,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":1456 + /* "sklearn/tree/_tree.pyx":1472 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -10596,7 +10556,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1457 + /* "sklearn/tree/_tree.pyx":1473 * # 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)): # <<<<<<<<<<<<<< @@ -10608,54 +10568,54 @@ 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":1458 + /* "sklearn/tree/_tree.pyx":1474 * 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) + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1460 + /* "sklearn/tree/_tree.pyx":1476 * continue * - * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() # <<<<<<<<<<<<<< * - * if current.improvement > best.improvement: + * if current_proxy_improvement > best_proxy_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); + __pyx_v_current_proxy_improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->proxy_impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1462 - * current.improvement = self.criterion.impurity_improvement(impurity) + /* "sklearn/tree/_tree.pyx":1478 + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() * - * if current.improvement > best.improvement: # <<<<<<<<<<<<<< - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) + * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< + * best_proxy_improvement = current_proxy_improvement + * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 */ - __pyx_t_5 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + __pyx_t_5 = ((__pyx_v_current_proxy_improvement > __pyx_v_best_proxy_improvement) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1463 + /* "sklearn/tree/_tree.pyx":1479 * - * if current.improvement > best.improvement: - * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< - * ¤t.impurity_right) + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement # <<<<<<<<<<<<<< * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 + * */ - ((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_best_proxy_improvement = __pyx_v_current_proxy_improvement; - /* "sklearn/tree/_tree.pyx":1465 - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":1480 + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< * * if current.threshold == Xf[p]: */ __pyx_v_current.threshold = (((__pyx_v_Xf[(__pyx_v_p - 1)]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); - /* "sklearn/tree/_tree.pyx":1467 + /* "sklearn/tree/_tree.pyx":1482 * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -10665,7 +10625,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":1468 + /* "sklearn/tree/_tree.pyx":1483 * * if current.threshold == Xf[p]: * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -10677,7 +10637,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } __pyx_L26:; - /* "sklearn/tree/_tree.pyx":1470 + /* "sklearn/tree/_tree.pyx":1485 * current.threshold = Xf[p - 1] * * best = current # copy # <<<<<<<<<<<<<< @@ -10699,7 +10659,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1473 + /* "sklearn/tree/_tree.pyx":1488 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -10709,7 +10669,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":1474 + /* "sklearn/tree/_tree.pyx":1489 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -10718,7 +10678,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":1475 + /* "sklearn/tree/_tree.pyx":1490 * if best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -10727,7 +10687,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1477 + /* "sklearn/tree/_tree.pyx":1492 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -10738,7 +10698,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":1479 + /* "sklearn/tree/_tree.pyx":1494 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -10748,7 +10708,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":1480 + /* "sklearn/tree/_tree.pyx":1495 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -10760,7 +10720,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1483 + /* "sklearn/tree/_tree.pyx":1498 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -10769,7 +10729,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":1485 + /* "sklearn/tree/_tree.pyx":1500 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -10778,7 +10738,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":1486 + /* "sklearn/tree/_tree.pyx":1501 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -10787,22 +10747,58 @@ 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":1487 + /* "sklearn/tree/_tree.pyx":1502 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< * - * # Respect invariant for constant features: the original order of + * self.criterion.reset() */ (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; } __pyx_L30:; } + + /* "sklearn/tree/_tree.pyx":1504 + * samples[p] = tmp + * + * self.criterion.reset() # <<<<<<<<<<<<<< + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + */ + ((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":1505 + * + * self.criterion.reset() + * self.criterion.update(best.pos) # <<<<<<<<<<<<<< + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, + */ + ((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_best.pos); + + /* "sklearn/tree/_tree.pyx":1506 + * self.criterion.reset() + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * self.criterion.children_impurity(&best.impurity_left, + * &best.impurity_right) + */ + __pyx_v_best.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":1507 + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, # <<<<<<<<<<<<<< + * &best.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_best.impurity_left), (&__pyx_v_best.impurity_right)); goto __pyx_L27; } __pyx_L27:; - /* "sklearn/tree/_tree.pyx":1492 + /* "sklearn/tree/_tree.pyx":1513 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -10811,7 +10807,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":1495 + /* "sklearn/tree/_tree.pyx":1516 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -10820,7 +10816,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":1500 + /* "sklearn/tree/_tree.pyx":1521 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -10829,7 +10825,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":1501 + /* "sklearn/tree/_tree.pyx":1522 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -10838,7 +10834,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":1324 + /* "sklearn/tree/_tree.pyx":1338 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -10849,7 +10845,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1506 +/* "sklearn/tree/_tree.pyx":1527 * # 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: # <<<<<<<<<<<<<< @@ -10860,7 +10856,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":1507 + /* "sklearn/tree/_tree.pyx":1528 * # 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) # <<<<<<<<<<<<<< @@ -10869,7 +10865,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":1508 + /* "sklearn/tree/_tree.pyx":1529 * 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) # <<<<<<<<<<<<<< @@ -10878,7 +10874,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":1506 + /* "sklearn/tree/_tree.pyx":1527 * # 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: # <<<<<<<<<<<<<< @@ -10889,7 +10885,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1511 +/* "sklearn/tree/_tree.pyx":1532 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10903,7 +10899,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":1513 + /* "sklearn/tree/_tree.pyx":1534 * 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] # <<<<<<<<<<<<<< @@ -10915,7 +10911,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":1514 + /* "sklearn/tree/_tree.pyx":1535 * # Helper for sort * Xf[i], Xf[j] = Xf[j], Xf[i] * samples[i], samples[j] = samples[j], samples[i] # <<<<<<<<<<<<<< @@ -10927,7 +10923,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":1511 + /* "sklearn/tree/_tree.pyx":1532 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10938,7 +10934,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1517 +/* "sklearn/tree/_tree.pyx":1538 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10953,7 +10949,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":1520 + /* "sklearn/tree/_tree.pyx":1541 * # 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] # <<<<<<<<<<<<<< @@ -10964,7 +10960,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":1521 + /* "sklearn/tree/_tree.pyx":1542 * # 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: # <<<<<<<<<<<<<< @@ -10974,7 +10970,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":1522 + /* "sklearn/tree/_tree.pyx":1543 * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] * if a < b: * if b < c: # <<<<<<<<<<<<<< @@ -10984,7 +10980,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":1523 + /* "sklearn/tree/_tree.pyx":1544 * if a < b: * if b < c: * return b # <<<<<<<<<<<<<< @@ -10995,7 +10991,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1524 + /* "sklearn/tree/_tree.pyx":1545 * if b < c: * return b * elif a < c: # <<<<<<<<<<<<<< @@ -11005,7 +11001,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":1525 + /* "sklearn/tree/_tree.pyx":1546 * return b * elif a < c: * return c # <<<<<<<<<<<<<< @@ -11017,7 +11013,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1527 + /* "sklearn/tree/_tree.pyx":1548 * return c * else: * return a # <<<<<<<<<<<<<< @@ -11029,7 +11025,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } } - /* "sklearn/tree/_tree.pyx":1528 + /* "sklearn/tree/_tree.pyx":1549 * else: * return a * elif b < c: # <<<<<<<<<<<<<< @@ -11039,7 +11035,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":1529 + /* "sklearn/tree/_tree.pyx":1550 * return a * elif b < c: * if a < c: # <<<<<<<<<<<<<< @@ -11049,7 +11045,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":1530 + /* "sklearn/tree/_tree.pyx":1551 * elif b < c: * if a < c: * return a # <<<<<<<<<<<<<< @@ -11061,7 +11057,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1532 + /* "sklearn/tree/_tree.pyx":1553 * return a * else: * return c # <<<<<<<<<<<<<< @@ -11074,7 +11070,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1534 + /* "sklearn/tree/_tree.pyx":1555 * return c * else: * return b # <<<<<<<<<<<<<< @@ -11085,7 +11081,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1517 + /* "sklearn/tree/_tree.pyx":1538 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11098,7 +11094,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1539 +/* "sklearn/tree/_tree.pyx":1560 * # 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: # <<<<<<<<<<<<<< @@ -11113,7 +11109,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":1543 + /* "sklearn/tree/_tree.pyx":1564 * cdef SIZE_t i, l, r * * while n > 1: # <<<<<<<<<<<<<< @@ -11124,7 +11120,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":1544 + /* "sklearn/tree/_tree.pyx":1565 * * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") # <<<<<<<<<<<<<< @@ -11134,7 +11130,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":1545 + /* "sklearn/tree/_tree.pyx":1566 * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) # <<<<<<<<<<<<<< @@ -11143,7 +11139,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":1546 + /* "sklearn/tree/_tree.pyx":1567 * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) * return # <<<<<<<<<<<<<< @@ -11153,7 +11149,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1547 + /* "sklearn/tree/_tree.pyx":1568 * heapsort(Xf, samples, n) * return * maxd -= 1 # <<<<<<<<<<<<<< @@ -11162,7 +11158,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":1549 + /* "sklearn/tree/_tree.pyx":1570 * maxd -= 1 * * pivot = median3(Xf, n) # <<<<<<<<<<<<<< @@ -11171,7 +11167,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":1552 + /* "sklearn/tree/_tree.pyx":1573 * * # Three-way partition. * i = l = 0 # <<<<<<<<<<<<<< @@ -11181,7 +11177,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":1553 + /* "sklearn/tree/_tree.pyx":1574 * # Three-way partition. * i = l = 0 * r = n # <<<<<<<<<<<<<< @@ -11190,7 +11186,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":1554 + /* "sklearn/tree/_tree.pyx":1575 * i = l = 0 * r = n * while i < r: # <<<<<<<<<<<<<< @@ -11201,7 +11197,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":1555 + /* "sklearn/tree/_tree.pyx":1576 * r = n * while i < r: * if Xf[i] < pivot: # <<<<<<<<<<<<<< @@ -11211,7 +11207,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":1556 + /* "sklearn/tree/_tree.pyx":1577 * while i < r: * if Xf[i] < pivot: * swap(Xf, samples, i, l) # <<<<<<<<<<<<<< @@ -11220,7 +11216,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":1557 + /* "sklearn/tree/_tree.pyx":1578 * if Xf[i] < pivot: * swap(Xf, samples, i, l) * i += 1 # <<<<<<<<<<<<<< @@ -11229,7 +11225,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":1558 + /* "sklearn/tree/_tree.pyx":1579 * swap(Xf, samples, i, l) * i += 1 * l += 1 # <<<<<<<<<<<<<< @@ -11240,7 +11236,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L8; } - /* "sklearn/tree/_tree.pyx":1559 + /* "sklearn/tree/_tree.pyx":1580 * i += 1 * l += 1 * elif Xf[i] > pivot: # <<<<<<<<<<<<<< @@ -11250,7 +11246,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":1560 + /* "sklearn/tree/_tree.pyx":1581 * l += 1 * elif Xf[i] > pivot: * r -= 1 # <<<<<<<<<<<<<< @@ -11259,7 +11255,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":1561 + /* "sklearn/tree/_tree.pyx":1582 * elif Xf[i] > pivot: * r -= 1 * swap(Xf, samples, i, r) # <<<<<<<<<<<<<< @@ -11271,7 +11267,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1563 + /* "sklearn/tree/_tree.pyx":1584 * swap(Xf, samples, i, r) * else: * i += 1 # <<<<<<<<<<<<<< @@ -11283,7 +11279,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1565 + /* "sklearn/tree/_tree.pyx":1586 * i += 1 * * introsort(Xf, samples, l, maxd) # <<<<<<<<<<<<<< @@ -11292,7 +11288,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":1566 + /* "sklearn/tree/_tree.pyx":1587 * * introsort(Xf, samples, l, maxd) * Xf += r # <<<<<<<<<<<<<< @@ -11301,7 +11297,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":1567 + /* "sklearn/tree/_tree.pyx":1588 * introsort(Xf, samples, l, maxd) * Xf += r * samples += r # <<<<<<<<<<<<<< @@ -11310,7 +11306,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":1568 + /* "sklearn/tree/_tree.pyx":1589 * Xf += r * samples += r * n -= r # <<<<<<<<<<<<<< @@ -11320,7 +11316,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":1539 + /* "sklearn/tree/_tree.pyx":1560 * # 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: # <<<<<<<<<<<<<< @@ -11332,7 +11328,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L0:; } -/* "sklearn/tree/_tree.pyx":1571 +/* "sklearn/tree/_tree.pyx":1592 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -11347,7 +11343,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":1576 + /* "sklearn/tree/_tree.pyx":1597 * cdef SIZE_t child, maxind, root * * root = start # <<<<<<<<<<<<<< @@ -11356,7 +11352,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":1577 + /* "sklearn/tree/_tree.pyx":1598 * * root = start * while True: # <<<<<<<<<<<<<< @@ -11365,7 +11361,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ while (1) { - /* "sklearn/tree/_tree.pyx":1578 + /* "sklearn/tree/_tree.pyx":1599 * root = start * while True: * child = root * 2 + 1 # <<<<<<<<<<<<<< @@ -11374,7 +11370,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":1581 + /* "sklearn/tree/_tree.pyx":1602 * * # find max of root, left child, right child * maxind = root # <<<<<<<<<<<<<< @@ -11383,7 +11379,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":1582 + /* "sklearn/tree/_tree.pyx":1603 * # find max of root, left child, right child * maxind = root * if child < end and Xf[maxind] < Xf[child]: # <<<<<<<<<<<<<< @@ -11401,7 +11397,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":1583 + /* "sklearn/tree/_tree.pyx":1604 * maxind = root * if child < end and Xf[maxind] < Xf[child]: * maxind = child # <<<<<<<<<<<<<< @@ -11413,7 +11409,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1584 + /* "sklearn/tree/_tree.pyx":1605 * if child < end and Xf[maxind] < Xf[child]: * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: # <<<<<<<<<<<<<< @@ -11431,7 +11427,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":1585 + /* "sklearn/tree/_tree.pyx":1606 * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: * maxind = child + 1 # <<<<<<<<<<<<<< @@ -11443,7 +11439,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":1587 + /* "sklearn/tree/_tree.pyx":1608 * maxind = child + 1 * * if maxind == root: # <<<<<<<<<<<<<< @@ -11453,7 +11449,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":1588 + /* "sklearn/tree/_tree.pyx":1609 * * if maxind == root: * break # <<<<<<<<<<<<<< @@ -11464,7 +11460,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":1590 + /* "sklearn/tree/_tree.pyx":1611 * break * else: * swap(Xf, samples, root, maxind) # <<<<<<<<<<<<<< @@ -11473,7 +11469,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":1591 + /* "sklearn/tree/_tree.pyx":1612 * else: * swap(Xf, samples, root, maxind) * root = maxind # <<<<<<<<<<<<<< @@ -11485,7 +11481,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1571 + /* "sklearn/tree/_tree.pyx":1592 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -11496,7 +11492,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1594 +/* "sklearn/tree/_tree.pyx":1615 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11509,7 +11505,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":1598 + /* "sklearn/tree/_tree.pyx":1619 * * # heapify * start = (n - 2) / 2 # <<<<<<<<<<<<<< @@ -11518,7 +11514,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":1599 + /* "sklearn/tree/_tree.pyx":1620 * # heapify * start = (n - 2) / 2 * end = n # <<<<<<<<<<<<<< @@ -11527,7 +11523,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":1600 + /* "sklearn/tree/_tree.pyx":1621 * start = (n - 2) / 2 * end = n * while True: # <<<<<<<<<<<<<< @@ -11536,7 +11532,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ while (1) { - /* "sklearn/tree/_tree.pyx":1601 + /* "sklearn/tree/_tree.pyx":1622 * end = n * while True: * sift_down(Xf, samples, start, end) # <<<<<<<<<<<<<< @@ -11545,7 +11541,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":1602 + /* "sklearn/tree/_tree.pyx":1623 * while True: * sift_down(Xf, samples, start, end) * if start == 0: # <<<<<<<<<<<<<< @@ -11555,7 +11551,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":1603 + /* "sklearn/tree/_tree.pyx":1624 * sift_down(Xf, samples, start, end) * if start == 0: * break # <<<<<<<<<<<<<< @@ -11565,7 +11561,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":1604 + /* "sklearn/tree/_tree.pyx":1625 * if start == 0: * break * start -= 1 # <<<<<<<<<<<<<< @@ -11576,7 +11572,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1607 + /* "sklearn/tree/_tree.pyx":1628 * * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 # <<<<<<<<<<<<<< @@ -11585,7 +11581,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":1608 + /* "sklearn/tree/_tree.pyx":1629 * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 * while end > 0: # <<<<<<<<<<<<<< @@ -11596,7 +11592,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":1609 + /* "sklearn/tree/_tree.pyx":1630 * end = n - 1 * while end > 0: * swap(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11605,7 +11601,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":1610 + /* "sklearn/tree/_tree.pyx":1631 * while end > 0: * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11614,7 +11610,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":1611 + /* "sklearn/tree/_tree.pyx":1632 * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) * end = end - 1 # <<<<<<<<<<<<<< @@ -11624,7 +11620,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":1594 + /* "sklearn/tree/_tree.pyx":1615 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11635,7 +11631,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1616 +/* "sklearn/tree/_tree.pyx":1637 * cdef class RandomSplitter(BaseDenseSplitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11668,7 +11664,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1617 + /* "sklearn/tree/_tree.pyx":1638 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -11677,44 +11673,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1618 + /* "sklearn/tree/_tree.pyx":1639 * 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 = 1618; __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 = 1639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1619 + /* "sklearn/tree/_tree.pyx":1640 * 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 = 1619; __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 = 1640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1620 + /* "sklearn/tree/_tree.pyx":1641 * 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 = 1620; __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 = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1617 + /* "sklearn/tree/_tree.pyx":1638 * """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 = 1617; __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 = 1638; __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)); @@ -11732,14 +11728,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1621 + /* "sklearn/tree/_tree.pyx":1642 * 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 = 1621; __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 = 1642; __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))) { @@ -11752,22 +11748,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 = 1621; __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 = 1642; __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 = 1621; __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 = 1642; __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":1617 + /* "sklearn/tree/_tree.pyx":1638 * """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 = 1617; __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 = 1638; __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))); @@ -11782,7 +11778,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1616 + /* "sklearn/tree/_tree.pyx":1637 * cdef class RandomSplitter(BaseDenseSplitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11804,7 +11800,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1623 +/* "sklearn/tree/_tree.pyx":1644 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -11829,6 +11825,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __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; + double __pyx_v_current_proxy_improvement; + double __pyx_v_best_proxy_improvement; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; @@ -11850,7 +11848,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":1627 + /* "sklearn/tree/_tree.pyx":1648 * """Find the best random split on node samples[start:end].""" * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -11860,7 +11858,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":1628 + /* "sklearn/tree/_tree.pyx":1649 * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -11870,7 +11868,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":1629 + /* "sklearn/tree/_tree.pyx":1650 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -11880,7 +11878,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":1631 + /* "sklearn/tree/_tree.pyx":1652 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -11890,7 +11888,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":1632 + /* "sklearn/tree/_tree.pyx":1653 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -11900,7 +11898,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":1633 + /* "sklearn/tree/_tree.pyx":1654 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -11910,7 +11908,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":1635 + /* "sklearn/tree/_tree.pyx":1656 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -11920,7 +11918,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":1636 + /* "sklearn/tree/_tree.pyx":1657 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -11930,7 +11928,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":1637 + /* "sklearn/tree/_tree.pyx":1658 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -11940,7 +11938,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":1638 + /* "sklearn/tree/_tree.pyx":1659 * 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 # <<<<<<<<<<<<<< @@ -11950,7 +11948,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":1639 + /* "sklearn/tree/_tree.pyx":1660 * 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 # <<<<<<<<<<<<<< @@ -11960,7 +11958,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":1640 + /* "sklearn/tree/_tree.pyx":1661 * 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 # <<<<<<<<<<<<<< @@ -11970,7 +11968,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":1641 + /* "sklearn/tree/_tree.pyx":1662 * 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 # <<<<<<<<<<<<<< @@ -11980,7 +11978,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":1642 + /* "sklearn/tree/_tree.pyx":1663 * 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 # <<<<<<<<<<<<<< @@ -11989,8 +11987,26 @@ 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":1646 + /* "sklearn/tree/_tree.pyx":1666 + * + * cdef SplitRecord best, current + * cdef double current_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * cdef double best_proxy_improvement = - INFINITY + * + */ + __pyx_v_current_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":1667 * cdef SplitRecord best, current + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * + * cdef SIZE_t f_i = n_features + */ + __pyx_v_best_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":1669 + * cdef double best_proxy_improvement = - INFINITY * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< * cdef SIZE_t f_j, p, tmp @@ -11998,7 +12014,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":1649 + /* "sklearn/tree/_tree.pyx":1672 * 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 # <<<<<<<<<<<<<< @@ -12007,7 +12023,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1651 + /* "sklearn/tree/_tree.pyx":1674 * 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 # <<<<<<<<<<<<<< @@ -12016,7 +12032,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1652 + /* "sklearn/tree/_tree.pyx":1675 * # 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] # <<<<<<<<<<<<<< @@ -12025,7 +12041,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":1654 + /* "sklearn/tree/_tree.pyx":1677 * 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 # <<<<<<<<<<<<<< @@ -12034,7 +12050,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":1655 + /* "sklearn/tree/_tree.pyx":1678 * # 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 # <<<<<<<<<<<<<< @@ -12043,7 +12059,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1661 + /* "sklearn/tree/_tree.pyx":1684 * cdef SIZE_t partition_end * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -12052,7 +12068,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":1672 + /* "sklearn/tree/_tree.pyx":1695 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -12067,7 +12083,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1674 + /* "sklearn/tree/_tree.pyx":1697 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -12081,7 +12097,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1676 + /* "sklearn/tree/_tree.pyx":1699 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -12093,7 +12109,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":1677 + /* "sklearn/tree/_tree.pyx":1700 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -12102,7 +12118,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":1691 + /* "sklearn/tree/_tree.pyx":1714 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -12111,7 +12127,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":1694 + /* "sklearn/tree/_tree.pyx":1717 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -12121,7 +12137,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":1696 + /* "sklearn/tree/_tree.pyx":1719 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -12130,7 +12146,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":1697 + /* "sklearn/tree/_tree.pyx":1720 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -12139,7 +12155,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":1698 + /* "sklearn/tree/_tree.pyx":1721 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -12148,7 +12164,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":1700 + /* "sklearn/tree/_tree.pyx":1723 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -12160,7 +12176,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1704 + /* "sklearn/tree/_tree.pyx":1727 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -12169,7 +12185,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":1707 + /* "sklearn/tree/_tree.pyx":1730 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -12178,7 +12194,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":1710 + /* "sklearn/tree/_tree.pyx":1733 * * # Find min, max * min_feature_value = X[X_sample_stride * samples[start] + # <<<<<<<<<<<<<< @@ -12187,7 +12203,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":1712 + /* "sklearn/tree/_tree.pyx":1735 * min_feature_value = X[X_sample_stride * samples[start] + * X_fx_stride * current.feature] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -12196,7 +12212,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":1713 + /* "sklearn/tree/_tree.pyx":1736 * X_fx_stride * current.feature] * max_feature_value = min_feature_value * Xf[start] = min_feature_value # <<<<<<<<<<<<<< @@ -12205,7 +12221,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":1715 + /* "sklearn/tree/_tree.pyx":1738 * Xf[start] = min_feature_value * * for p in range(start + 1, end): # <<<<<<<<<<<<<< @@ -12216,7 +12232,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":1716 + /* "sklearn/tree/_tree.pyx":1739 * * for p in range(start + 1, end): * current_feature_value = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -12225,7 +12241,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":1718 + /* "sklearn/tree/_tree.pyx":1741 * current_feature_value = X[X_sample_stride * samples[p] + * X_fx_stride * current.feature] * Xf[p] = current_feature_value # <<<<<<<<<<<<<< @@ -12234,7 +12250,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":1720 + /* "sklearn/tree/_tree.pyx":1743 * Xf[p] = current_feature_value * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -12244,7 +12260,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":1721 + /* "sklearn/tree/_tree.pyx":1744 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -12255,7 +12271,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L11; } - /* "sklearn/tree/_tree.pyx":1722 + /* "sklearn/tree/_tree.pyx":1745 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -12265,7 +12281,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":1723 + /* "sklearn/tree/_tree.pyx":1746 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -12278,7 +12294,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L11:; } - /* "sklearn/tree/_tree.pyx":1725 + /* "sklearn/tree/_tree.pyx":1748 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -12288,7 +12304,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":1726 + /* "sklearn/tree/_tree.pyx":1749 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -12297,7 +12313,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":1727 + /* "sklearn/tree/_tree.pyx":1750 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -12307,7 +12323,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":1729 + /* "sklearn/tree/_tree.pyx":1752 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -12316,7 +12332,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":1730 + /* "sklearn/tree/_tree.pyx":1753 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -12328,7 +12344,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1733 + /* "sklearn/tree/_tree.pyx":1756 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -12337,7 +12353,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":1734 + /* "sklearn/tree/_tree.pyx":1757 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -12349,7 +12365,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":1737 + /* "sklearn/tree/_tree.pyx":1760 * * # Draw a random threshold * current.threshold = rand_uniform(min_feature_value, # <<<<<<<<<<<<<< @@ -12358,7 +12374,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":1741 + /* "sklearn/tree/_tree.pyx":1764 * random_state) * * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -12368,7 +12384,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":1742 + /* "sklearn/tree/_tree.pyx":1765 * * if current.threshold == max_feature_value: * current.threshold = min_feature_value # <<<<<<<<<<<<<< @@ -12380,7 +12396,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":1745 + /* "sklearn/tree/_tree.pyx":1768 * * # Partition * partition_end = end # <<<<<<<<<<<<<< @@ -12389,7 +12405,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":1746 + /* "sklearn/tree/_tree.pyx":1769 * # Partition * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -12398,7 +12414,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1747 + /* "sklearn/tree/_tree.pyx":1770 * partition_end = end * p = start * while p < partition_end: # <<<<<<<<<<<<<< @@ -12409,7 +12425,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":1748 + /* "sklearn/tree/_tree.pyx":1771 * p = start * while p < partition_end: * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -12418,7 +12434,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":1749 + /* "sklearn/tree/_tree.pyx":1772 * while p < partition_end: * current_feature_value = Xf[p] * if current_feature_value <= current.threshold: # <<<<<<<<<<<<<< @@ -12428,7 +12444,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":1750 + /* "sklearn/tree/_tree.pyx":1773 * current_feature_value = Xf[p] * if current_feature_value <= current.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -12440,7 +12456,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1752 + /* "sklearn/tree/_tree.pyx":1775 * p += 1 * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -12449,7 +12465,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":1754 + /* "sklearn/tree/_tree.pyx":1777 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -12458,7 +12474,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":1755 + /* "sklearn/tree/_tree.pyx":1778 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = current_feature_value # <<<<<<<<<<<<<< @@ -12467,7 +12483,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":1757 + /* "sklearn/tree/_tree.pyx":1780 * Xf[partition_end] = current_feature_value * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -12476,7 +12492,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":1758 + /* "sklearn/tree/_tree.pyx":1781 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -12485,7 +12501,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":1759 + /* "sklearn/tree/_tree.pyx":1782 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -12497,7 +12513,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L16:; } - /* "sklearn/tree/_tree.pyx":1761 + /* "sklearn/tree/_tree.pyx":1784 * samples[p] = tmp * * current.pos = partition_end # <<<<<<<<<<<<<< @@ -12506,7 +12522,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":1764 + /* "sklearn/tree/_tree.pyx":1787 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -12520,7 +12536,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L18_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1765 + /* "sklearn/tree/_tree.pyx":1788 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -12532,7 +12548,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":1766 + /* "sklearn/tree/_tree.pyx":1789 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -12542,7 +12558,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1769 + /* "sklearn/tree/_tree.pyx":1792 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -12551,7 +12567,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":1770 + /* "sklearn/tree/_tree.pyx":1793 * # Evaluate split * self.criterion.reset() * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -12560,7 +12576,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":1773 + /* "sklearn/tree/_tree.pyx":1796 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -12574,7 +12590,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L21_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1774 + /* "sklearn/tree/_tree.pyx":1797 * # 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)): # <<<<<<<<<<<<<< @@ -12586,47 +12602,47 @@ 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":1775 + /* "sklearn/tree/_tree.pyx":1798 * 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) + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1777 + /* "sklearn/tree/_tree.pyx":1800 * continue * - * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() # <<<<<<<<<<<<<< * - * if current.improvement > best.improvement: + * if current_proxy_improvement > best_proxy_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); + __pyx_v_current_proxy_improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->proxy_impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1779 - * current.improvement = self.criterion.impurity_improvement(impurity) + /* "sklearn/tree/_tree.pyx":1802 + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() * - * if current.improvement > best.improvement: # <<<<<<<<<<<<<< - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) + * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< + * best_proxy_improvement = current_proxy_improvement + * best = current # copy */ - __pyx_t_5 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + __pyx_t_5 = ((__pyx_v_current_proxy_improvement > __pyx_v_best_proxy_improvement) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1780 + /* "sklearn/tree/_tree.pyx":1803 * - * if current.improvement > best.improvement: - * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< - * ¤t.impurity_right) + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement # <<<<<<<<<<<<<< * best = current # copy + * */ - ((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_best_proxy_improvement = __pyx_v_current_proxy_improvement; - /* "sklearn/tree/_tree.pyx":1782 - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":1804 + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement * best = current # copy # <<<<<<<<<<<<<< * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] @@ -12642,118 +12658,159 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":1785 + /* "sklearn/tree/_tree.pyx":1807 * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end and current.feature != best.feature: # <<<<<<<<<<<<<< - * partition_end = end - * p = start - */ - __pyx_t_6 = ((__pyx_v_best.pos < __pyx_v_end) != 0); - if (__pyx_t_6) { - } else { - __pyx_t_5 = __pyx_t_6; - goto __pyx_L25_bool_binop_done; - } - __pyx_t_6 = ((__pyx_v_current.feature != __pyx_v_best.feature) != 0); - __pyx_t_5 = __pyx_t_6; - __pyx_L25_bool_binop_done:; + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + * if best.pos < end: # <<<<<<<<<<<<<< + * if current.feature != best.feature: + * partition_end = end + */ + __pyx_t_5 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1786 + /* "sklearn/tree/_tree.pyx":1808 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end and current.feature != best.feature: - * partition_end = end # <<<<<<<<<<<<<< - * p = start + * if best.pos < end: + * if current.feature != best.feature: # <<<<<<<<<<<<<< + * partition_end = end + * p = start + */ + __pyx_t_5 = ((__pyx_v_current.feature != __pyx_v_best.feature) != 0); + if (__pyx_t_5) { + + /* "sklearn/tree/_tree.pyx":1809 + * if best.pos < end: + * if current.feature != best.feature: + * partition_end = end # <<<<<<<<<<<<<< + * p = start * */ - __pyx_v_partition_end = __pyx_v_end; + __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1787 - * if best.pos < end and current.feature != best.feature: - * partition_end = end - * p = start # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":1810 + * if current.feature != best.feature: + * partition_end = end + * p = start # <<<<<<<<<<<<<< * - * while p < partition_end: + * while p < partition_end: */ - __pyx_v_p = __pyx_v_start; + __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1789 - * p = start + /* "sklearn/tree/_tree.pyx":1812 + * p = start * - * while p < partition_end: # <<<<<<<<<<<<<< - * if X[X_sample_stride * samples[p] + - * X_fx_stride * best.feature] <= best.threshold: + * while p < partition_end: # <<<<<<<<<<<<<< + * if X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature] <= best.threshold: */ - while (1) { - __pyx_t_5 = ((__pyx_v_p < __pyx_v_partition_end) != 0); - if (!__pyx_t_5) break; + while (1) { + __pyx_t_5 = ((__pyx_v_p < __pyx_v_partition_end) != 0); + if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1791 - * while p < partition_end: - * if X[X_sample_stride * samples[p] + - * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< - * p += 1 + /* "sklearn/tree/_tree.pyx":1814 + * while p < partition_end: + * if X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< + * p += 1 * */ - __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) { + __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":1792 - * if X[X_sample_stride * samples[p] + - * X_fx_stride * best.feature] <= best.threshold: - * p += 1 # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":1815 + * if X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature] <= best.threshold: + * p += 1 # <<<<<<<<<<<<<< * - * else: + * else: */ - __pyx_v_p = (__pyx_v_p + 1); - goto __pyx_L29; - } - /*else*/ { + __pyx_v_p = (__pyx_v_p + 1); + goto __pyx_L28; + } + /*else*/ { - /* "sklearn/tree/_tree.pyx":1795 + /* "sklearn/tree/_tree.pyx":1818 * - * else: - * partition_end -= 1 # <<<<<<<<<<<<<< + * else: + * partition_end -= 1 # <<<<<<<<<<<<<< * - * tmp = samples[partition_end] + * tmp = samples[partition_end] */ - __pyx_v_partition_end = (__pyx_v_partition_end - 1); + __pyx_v_partition_end = (__pyx_v_partition_end - 1); - /* "sklearn/tree/_tree.pyx":1797 - * partition_end -= 1 + /* "sklearn/tree/_tree.pyx":1820 + * partition_end -= 1 * - * tmp = samples[partition_end] # <<<<<<<<<<<<<< - * samples[partition_end] = samples[p] - * samples[p] = tmp + * tmp = samples[partition_end] # <<<<<<<<<<<<<< + * samples[partition_end] = samples[p] + * samples[p] = tmp */ - __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); + __pyx_v_tmp = (__pyx_v_samples[__pyx_v_partition_end]); - /* "sklearn/tree/_tree.pyx":1798 + /* "sklearn/tree/_tree.pyx":1821 * - * tmp = samples[partition_end] - * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< - * samples[p] = tmp + * 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]); + (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1799 - * tmp = samples[partition_end] - * samples[partition_end] = samples[p] - * samples[p] = tmp # <<<<<<<<<<<<<< + /* "sklearn/tree/_tree.pyx":1822 + * tmp = samples[partition_end] + * samples[partition_end] = samples[p] + * samples[p] = tmp # <<<<<<<<<<<<<< + * * - * # Respect invariant for constant features: the original order of */ - (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; + (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; + } + __pyx_L28:; } - __pyx_L29:; + goto __pyx_L25; } + __pyx_L25:; + + /* "sklearn/tree/_tree.pyx":1825 + * + * + * self.criterion.reset() # <<<<<<<<<<<<<< + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + */ + ((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":1826 + * + * self.criterion.reset() + * self.criterion.update(best.pos) # <<<<<<<<<<<<<< + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, + */ + ((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_best.pos); + + /* "sklearn/tree/_tree.pyx":1827 + * self.criterion.reset() + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * self.criterion.children_impurity(&best.impurity_left, + * &best.impurity_right) + */ + __pyx_v_best.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":1828 + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, # <<<<<<<<<<<<<< + * &best.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_best.impurity_left), (&__pyx_v_best.impurity_right)); goto __pyx_L24; } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":1804 + /* "sklearn/tree/_tree.pyx":1834 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -12762,7 +12819,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":1807 + /* "sklearn/tree/_tree.pyx":1837 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -12771,7 +12828,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":1812 + /* "sklearn/tree/_tree.pyx":1842 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -12780,7 +12837,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":1813 + /* "sklearn/tree/_tree.pyx":1843 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -12789,7 +12846,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":1623 + /* "sklearn/tree/_tree.pyx":1644 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -12800,7 +12857,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1826 +/* "sklearn/tree/_tree.pyx":1856 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12845,26 +12902,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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; __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 = 1826; __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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -12876,20 +12933,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 = 1826; __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 = 1827; __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 = 1828; __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 = 1856; __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 = 1857; __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 = 1858; __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 = 1826; __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 = 1856; __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 = 1826; __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 = 1856; __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 */ @@ -12906,7 +12963,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1831 + /* "sklearn/tree/_tree.pyx":1861 * object random_state): * # Initialize pointers * self.X_old = NULL # <<<<<<<<<<<<<< @@ -12915,7 +12972,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_old = NULL; - /* "sklearn/tree/_tree.pyx":1832 + /* "sklearn/tree/_tree.pyx":1862 * # Initialize pointers * self.X_old = NULL * self.X_argsorted_ptr = NULL # <<<<<<<<<<<<<< @@ -12924,7 +12981,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1833 + /* "sklearn/tree/_tree.pyx":1863 * self.X_old = NULL * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 # <<<<<<<<<<<<<< @@ -12933,7 +12990,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_stride = 0; - /* "sklearn/tree/_tree.pyx":1834 + /* "sklearn/tree/_tree.pyx":1864 * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 * self.sample_mask = NULL # <<<<<<<<<<<<<< @@ -12942,7 +12999,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1826 + /* "sklearn/tree/_tree.pyx":1856 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12956,7 +13013,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1836 +/* "sklearn/tree/_tree.pyx":1866 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12979,7 +13036,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":1838 + /* "sklearn/tree/_tree.pyx":1868 * def __dealloc__(self): * """Destructor.""" * free(self.sample_mask) # <<<<<<<<<<<<<< @@ -12988,7 +13045,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st */ free(__pyx_v_self->sample_mask); - /* "sklearn/tree/_tree.pyx":1836 + /* "sklearn/tree/_tree.pyx":1866 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -13000,7 +13057,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1840 +/* "sklearn/tree/_tree.pyx":1870 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -13033,7 +13090,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1841 + /* "sklearn/tree/_tree.pyx":1871 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -13042,44 +13099,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1842 + /* "sklearn/tree/_tree.pyx":1872 * 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 = 1842; __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 = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1843 + /* "sklearn/tree/_tree.pyx":1873 * 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 = 1843; __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 = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1844 + /* "sklearn/tree/_tree.pyx":1874 * 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 = 1844; __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 = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1841 + /* "sklearn/tree/_tree.pyx":1871 * * 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 = 1841; __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 = 1871; __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)); @@ -13097,14 +13154,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1845 + /* "sklearn/tree/_tree.pyx":1875 * 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 = 1845; __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 = 1875; __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))) { @@ -13117,22 +13174,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 = 1845; __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 = 1875; __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 = 1845; __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 = 1875; __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":1841 + /* "sklearn/tree/_tree.pyx":1871 * * 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 = 1841; __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 = 1871; __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))); @@ -13147,7 +13204,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1840 + /* "sklearn/tree/_tree.pyx":1870 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -13169,7 +13226,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1847 +/* "sklearn/tree/_tree.pyx":1877 * self.random_state), self.__getstate__()) * * cdef void init(self, object X, # <<<<<<<<<<<<<< @@ -13202,11 +13259,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 = 1847; __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 = 1877; __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":1851 + /* "sklearn/tree/_tree.pyx":1881 * DOUBLE_t* sample_weight) except *: * * cdef void* sample_mask = NULL # <<<<<<<<<<<<<< @@ -13215,29 +13272,29 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1854 + /* "sklearn/tree/_tree.pyx":1884 * * # 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 = 1854; __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 = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1856 + /* "sklearn/tree/_tree.pyx":1886 * 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 = 1856; __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 = 1886; __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":1859 + /* "sklearn/tree/_tree.pyx":1889 * * # Pre-sort X * if self.X_old != self.X: # <<<<<<<<<<<<<< @@ -13247,7 +13304,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":1860 + /* "sklearn/tree/_tree.pyx":1890 * # Pre-sort X * if self.X_old != self.X: * self.X_old = self.X # <<<<<<<<<<<<<< @@ -13257,79 +13314,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":1861 + /* "sklearn/tree/_tree.pyx":1891 * 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 = 1861; __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 = 1891; __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 = 1861; __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 = 1891; __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 = 1861; __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 = 1891; __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 = 1861; __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 = 1891; __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 = 1861; __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 = 1891; __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 = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __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 = 1861; __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 = 1861; __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 = 1891; __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 = 1891; __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 = 1861; __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 = 1891; __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 = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "sklearn/tree/_tree.pyx":1862 + /* "sklearn/tree/_tree.pyx":1892 * 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 = 1862; __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 = 1892; __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 = 1862; __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 = 1892; __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 = 1861; __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 = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1861 + /* "sklearn/tree/_tree.pyx":1891 * 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 = 1861; __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 = 1891; __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 = 1861; __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 = 1891; __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":1863 + /* "sklearn/tree/_tree.pyx":1893 * self.X_argsorted = np.asfortranarray(np.argsort(X_ndarray, axis=0), * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data # <<<<<<<<<<<<<< @@ -13338,19 +13395,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":1865 + /* "sklearn/tree/_tree.pyx":1895 * 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 = 1865; __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 = 1895; __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 = 1865; __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 = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1864 + /* "sklearn/tree/_tree.pyx":1894 * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / # <<<<<<<<<<<<<< @@ -13359,33 +13416,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":1867 + /* "sklearn/tree/_tree.pyx":1897 * 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 = 1867; __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 = 1897; __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 = 1867; __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 = 1897; __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 = 1867; __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 = 1897; __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":1868 + /* "sklearn/tree/_tree.pyx":1898 * * 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 = 1868; __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sample_mask = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1869 + /* "sklearn/tree/_tree.pyx":1899 * 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) # <<<<<<<<<<<<<< @@ -13397,7 +13454,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1847 + /* "sklearn/tree/_tree.pyx":1877 * self.random_state), self.__getstate__()) * * cdef void init(self, object X, # <<<<<<<<<<<<<< @@ -13426,7 +13483,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1871 +/* "sklearn/tree/_tree.pyx":1901 * memset(sample_mask, 0, self.n_total_samples) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -13455,6 +13512,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __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; + double __pyx_v_current_proxy_improvement; + double __pyx_v_best_proxy_improvement; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; @@ -13477,7 +13536,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":1875 + /* "sklearn/tree/_tree.pyx":1905 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -13487,7 +13546,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":1876 + /* "sklearn/tree/_tree.pyx":1906 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -13497,7 +13556,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":1877 + /* "sklearn/tree/_tree.pyx":1907 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -13507,7 +13566,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":1879 + /* "sklearn/tree/_tree.pyx":1909 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -13517,7 +13576,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":1880 + /* "sklearn/tree/_tree.pyx":1910 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -13527,7 +13586,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":1881 + /* "sklearn/tree/_tree.pyx":1911 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -13537,7 +13596,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":1883 + /* "sklearn/tree/_tree.pyx":1913 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -13547,7 +13606,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":1884 + /* "sklearn/tree/_tree.pyx":1914 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -13557,7 +13616,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":1885 + /* "sklearn/tree/_tree.pyx":1915 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -13567,7 +13626,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":1886 + /* "sklearn/tree/_tree.pyx":1916 * 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 # <<<<<<<<<<<<<< @@ -13577,7 +13636,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":1887 + /* "sklearn/tree/_tree.pyx":1917 * 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 # <<<<<<<<<<<<<< @@ -13587,7 +13646,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":1888 + /* "sklearn/tree/_tree.pyx":1918 * 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 # <<<<<<<<<<<<<< @@ -13597,7 +13656,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":1889 + /* "sklearn/tree/_tree.pyx":1919 * 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 # <<<<<<<<<<<<<< @@ -13607,7 +13666,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":1890 + /* "sklearn/tree/_tree.pyx":1920 * 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 # <<<<<<<<<<<<<< @@ -13617,7 +13676,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":1892 + /* "sklearn/tree/_tree.pyx":1922 * cdef unsigned char* sample_mask = self.sample_mask * * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -13627,7 +13686,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":1893 + /* "sklearn/tree/_tree.pyx":1923 * * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -13637,7 +13696,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":1894 + /* "sklearn/tree/_tree.pyx":1924 * 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 # <<<<<<<<<<<<<< @@ -13647,7 +13706,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":1895 + /* "sklearn/tree/_tree.pyx":1925 * 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 # <<<<<<<<<<<<<< @@ -13656,8 +13715,26 @@ 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":1899 + /* "sklearn/tree/_tree.pyx":1928 + * + * cdef SplitRecord best, current + * cdef double current_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * cdef double best_proxy_improvement = - INFINITY + * + */ + __pyx_v_current_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":1929 * cdef SplitRecord best, current + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * + * cdef SIZE_t f_i = n_features + */ + __pyx_v_best_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":1931 + * cdef double best_proxy_improvement = - INFINITY * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< * cdef SIZE_t f_j, p @@ -13665,7 +13742,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":1902 + /* "sklearn/tree/_tree.pyx":1934 * cdef SIZE_t f_j, p * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -13674,7 +13751,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1904 + /* "sklearn/tree/_tree.pyx":1936 * 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 # <<<<<<<<<<<<<< @@ -13683,7 +13760,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1905 + /* "sklearn/tree/_tree.pyx":1937 * # 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] # <<<<<<<<<<<<<< @@ -13692,7 +13769,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":1907 + /* "sklearn/tree/_tree.pyx":1939 * 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 # <<<<<<<<<<<<<< @@ -13701,7 +13778,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":1908 + /* "sklearn/tree/_tree.pyx":1940 * # 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 # <<<<<<<<<<<<<< @@ -13710,7 +13787,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1912 + /* "sklearn/tree/_tree.pyx":1944 * cdef SIZE_t i, j * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -13719,7 +13796,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":1915 + /* "sklearn/tree/_tree.pyx":1947 * * # Set sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -13730,7 +13807,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":1916 + /* "sklearn/tree/_tree.pyx":1948 * # Set sample mask * for p in range(start, end): * sample_mask[samples[p]] = 1 # <<<<<<<<<<<<<< @@ -13740,7 +13817,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":1927 + /* "sklearn/tree/_tree.pyx":1959 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -13755,7 +13832,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1929 + /* "sklearn/tree/_tree.pyx":1961 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -13769,7 +13846,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L7_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1931 + /* "sklearn/tree/_tree.pyx":1963 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -13781,7 +13858,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":1932 + /* "sklearn/tree/_tree.pyx":1964 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -13790,7 +13867,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":1946 + /* "sklearn/tree/_tree.pyx":1978 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -13799,7 +13876,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":1949 + /* "sklearn/tree/_tree.pyx":1981 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -13809,7 +13886,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":1951 + /* "sklearn/tree/_tree.pyx":1983 * if f_j < n_known_constants: * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -13818,7 +13895,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":1952 + /* "sklearn/tree/_tree.pyx":1984 * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -13827,7 +13904,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":1953 + /* "sklearn/tree/_tree.pyx":1985 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -13836,7 +13913,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":1955 + /* "sklearn/tree/_tree.pyx":1987 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -13848,7 +13925,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1959 + /* "sklearn/tree/_tree.pyx":1991 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -13857,7 +13934,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":1962 + /* "sklearn/tree/_tree.pyx":1994 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -13866,7 +13943,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":1965 + /* "sklearn/tree/_tree.pyx":1997 * * # Extract ordering from X_argsorted * p = start # <<<<<<<<<<<<<< @@ -13875,7 +13952,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1967 + /* "sklearn/tree/_tree.pyx":1999 * p = start * * for i in range(n_total_samples): # <<<<<<<<<<<<<< @@ -13886,7 +13963,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":1968 + /* "sklearn/tree/_tree.pyx":2000 * * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current.feature + i] # <<<<<<<<<<<<<< @@ -13895,7 +13972,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":1969 + /* "sklearn/tree/_tree.pyx":2001 * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current.feature + i] * if sample_mask[j] == 1: # <<<<<<<<<<<<<< @@ -13905,7 +13982,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":1970 + /* "sklearn/tree/_tree.pyx":2002 * j = X_argsorted[X_argsorted_stride * current.feature + i] * if sample_mask[j] == 1: * samples[p] = j # <<<<<<<<<<<<<< @@ -13914,7 +13991,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":1971 + /* "sklearn/tree/_tree.pyx":2003 * if sample_mask[j] == 1: * samples[p] = j * Xf[p] = X[X_sample_stride * j + # <<<<<<<<<<<<<< @@ -13923,7 +14000,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":1973 + /* "sklearn/tree/_tree.pyx":2005 * Xf[p] = X[X_sample_stride * j + * X_fx_stride * current.feature] * p += 1 # <<<<<<<<<<<<<< @@ -13936,7 +14013,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":1976 + /* "sklearn/tree/_tree.pyx":2008 * * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -13946,7 +14023,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":1977 + /* "sklearn/tree/_tree.pyx":2009 * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -13955,7 +14032,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":1978 + /* "sklearn/tree/_tree.pyx":2010 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -13965,7 +14042,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":1980 + /* "sklearn/tree/_tree.pyx":2012 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -13974,7 +14051,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":1981 + /* "sklearn/tree/_tree.pyx":2013 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -13986,7 +14063,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1984 + /* "sklearn/tree/_tree.pyx":2016 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -13995,7 +14072,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":1985 + /* "sklearn/tree/_tree.pyx":2017 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -14007,7 +14084,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":1987 + /* "sklearn/tree/_tree.pyx":2019 * features[f_i], features[f_j] = features[f_j], features[f_i] * * self.criterion.reset() # <<<<<<<<<<<<<< @@ -14016,7 +14093,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":1988 + /* "sklearn/tree/_tree.pyx":2020 * * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -14025,7 +14102,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1990 + /* "sklearn/tree/_tree.pyx":2022 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -14036,7 +14113,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":1991 + /* "sklearn/tree/_tree.pyx":2023 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -14051,7 +14128,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L19_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":1992 + /* "sklearn/tree/_tree.pyx":2024 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -14063,7 +14140,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":1993 + /* "sklearn/tree/_tree.pyx":2025 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -14073,7 +14150,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":1997 + /* "sklearn/tree/_tree.pyx":2029 * # (p + 1 >= end) or (X[samples[p + 1], current.feature] > * # X[samples[p], current.feature]) * p += 1 # <<<<<<<<<<<<<< @@ -14082,7 +14159,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":2001 + /* "sklearn/tree/_tree.pyx":2033 * # X[samples[p - 1], current.feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -14092,7 +14169,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":2002 + /* "sklearn/tree/_tree.pyx":2034 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -14101,7 +14178,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":2005 + /* "sklearn/tree/_tree.pyx":2037 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -14115,7 +14192,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2006 + /* "sklearn/tree/_tree.pyx":2038 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -14127,7 +14204,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":2007 + /* "sklearn/tree/_tree.pyx":2039 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -14137,7 +14214,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L15_continue; } - /* "sklearn/tree/_tree.pyx":2009 + /* "sklearn/tree/_tree.pyx":2041 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -14146,7 +14223,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)->update(__pyx_v_self->__pyx_base.__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":2012 + /* "sklearn/tree/_tree.pyx":2044 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -14160,7 +14237,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L26_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2013 + /* "sklearn/tree/_tree.pyx":2045 * # 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)): # <<<<<<<<<<<<<< @@ -14172,46 +14249,46 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L26_bool_binop_done:; if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":2014 + /* "sklearn/tree/_tree.pyx":2046 * 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) + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L15_continue; } - /* "sklearn/tree/_tree.pyx":2016 + /* "sklearn/tree/_tree.pyx":2048 * continue * - * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() # <<<<<<<<<<<<<< * - * if current.improvement > best.improvement: + * if current_proxy_improvement > best_proxy_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); + __pyx_v_current_proxy_improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->proxy_impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":2018 - * current.improvement = self.criterion.impurity_improvement(impurity) + /* "sklearn/tree/_tree.pyx":2050 + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() + * + * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< + * best_proxy_improvement = current_proxy_improvement * - * 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); + __pyx_t_8 = ((__pyx_v_current_proxy_improvement > __pyx_v_best_proxy_improvement) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":2019 + /* "sklearn/tree/_tree.pyx":2051 * - * if current.improvement > best.improvement: - * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< - * ¤t.impurity_right) + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement # <<<<<<<<<<<<<< * + * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 */ - ((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_best_proxy_improvement = __pyx_v_current_proxy_improvement; - /* "sklearn/tree/_tree.pyx":2022 - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":2053 + * best_proxy_improvement = current_proxy_improvement * * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< * if current.threshold == Xf[p]: @@ -14219,7 +14296,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current.threshold = (((__pyx_v_Xf[(__pyx_v_p - 1)]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); - /* "sklearn/tree/_tree.pyx":2023 + /* "sklearn/tree/_tree.pyx":2054 * * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -14229,7 +14306,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":2024 + /* "sklearn/tree/_tree.pyx":2055 * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -14241,7 +14318,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } __pyx_L29:; - /* "sklearn/tree/_tree.pyx":2026 + /* "sklearn/tree/_tree.pyx":2057 * current.threshold = Xf[p - 1] * * best = current # copy # <<<<<<<<<<<<<< @@ -14263,7 +14340,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":2029 + /* "sklearn/tree/_tree.pyx":2060 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -14273,7 +14350,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":2030 + /* "sklearn/tree/_tree.pyx":2061 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -14282,7 +14359,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2031 + /* "sklearn/tree/_tree.pyx":2062 * if best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -14291,7 +14368,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2033 + /* "sklearn/tree/_tree.pyx":2064 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -14302,7 +14379,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":2035 + /* "sklearn/tree/_tree.pyx":2066 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -14312,7 +14389,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __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":2036 + /* "sklearn/tree/_tree.pyx":2067 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -14324,7 +14401,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":2039 + /* "sklearn/tree/_tree.pyx":2070 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -14333,7 +14410,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":2041 + /* "sklearn/tree/_tree.pyx":2072 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -14342,7 +14419,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":2042 + /* "sklearn/tree/_tree.pyx":2073 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -14351,22 +14428,58 @@ 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":2043 + /* "sklearn/tree/_tree.pyx":2074 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< * - * # Reset sample mask + * self.criterion.reset() */ (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; } __pyx_L33:; } + + /* "sklearn/tree/_tree.pyx":2076 + * samples[p] = tmp + * + * self.criterion.reset() # <<<<<<<<<<<<<< + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + */ + ((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":2077 + * + * self.criterion.reset() + * self.criterion.update(best.pos) # <<<<<<<<<<<<<< + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, + */ + ((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_best.pos); + + /* "sklearn/tree/_tree.pyx":2078 + * self.criterion.reset() + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * self.criterion.children_impurity(&best.impurity_left, + * &best.impurity_right) + */ + __pyx_v_best.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":2079 + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, # <<<<<<<<<<<<<< + * &best.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_best.impurity_left), (&__pyx_v_best.impurity_right)); goto __pyx_L30; } __pyx_L30:; - /* "sklearn/tree/_tree.pyx":2046 + /* "sklearn/tree/_tree.pyx":2083 * * # Reset sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -14377,7 +14490,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc 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":2047 + /* "sklearn/tree/_tree.pyx":2084 * # Reset sample mask * for p in range(start, end): * sample_mask[samples[p]] = 0 # <<<<<<<<<<<<<< @@ -14387,7 +14500,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":2052 + /* "sklearn/tree/_tree.pyx":2089 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -14396,7 +14509,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":2055 + /* "sklearn/tree/_tree.pyx":2092 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -14405,7 +14518,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":2060 + /* "sklearn/tree/_tree.pyx":2097 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -14414,7 +14527,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":2061 + /* "sklearn/tree/_tree.pyx":2098 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -14423,7 +14536,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_n_constant_features[0]) = __pyx_v_n_total_constants; - /* "sklearn/tree/_tree.pyx":1871 + /* "sklearn/tree/_tree.pyx":1901 * memset(sample_mask, 0, self.n_total_samples) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -14434,7 +14547,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2074 +/* "sklearn/tree/_tree.pyx":2111 * cdef SIZE_t* sorted_samples * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -14479,26 +14592,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 = 2074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __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 = 2074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __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 = 2074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __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 = 2074; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; __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 = 2074; __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 = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -14510,20 +14623,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 = 2074; __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 = 2075; __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 = 2075; __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 = 2111; __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 = 2112; __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 = 2112; __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 = 2074; __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 = 2111; __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 = 2074; __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 = 2111; __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 */ @@ -14540,7 +14653,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2079 + /* "sklearn/tree/_tree.pyx":2116 * # Parent __cinit__ is automatically called * * self.X_data = NULL # <<<<<<<<<<<<<< @@ -14549,7 +14662,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_data = NULL; - /* "sklearn/tree/_tree.pyx":2080 + /* "sklearn/tree/_tree.pyx":2117 * * self.X_data = NULL * self.X_indices = NULL # <<<<<<<<<<<<<< @@ -14558,7 +14671,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_indices = NULL; - /* "sklearn/tree/_tree.pyx":2081 + /* "sklearn/tree/_tree.pyx":2118 * self.X_data = NULL * self.X_indices = NULL * self.X_indptr = NULL # <<<<<<<<<<<<<< @@ -14567,7 +14680,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->X_indptr = NULL; - /* "sklearn/tree/_tree.pyx":2083 + /* "sklearn/tree/_tree.pyx":2120 * self.X_indptr = NULL * * self.n_total_samples = 0 # <<<<<<<<<<<<<< @@ -14576,7 +14689,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->n_total_samples = 0; - /* "sklearn/tree/_tree.pyx":2085 + /* "sklearn/tree/_tree.pyx":2122 * self.n_total_samples = 0 * * self.index_to_samples = NULL # <<<<<<<<<<<<<< @@ -14585,7 +14698,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->index_to_samples = NULL; - /* "sklearn/tree/_tree.pyx":2086 + /* "sklearn/tree/_tree.pyx":2123 * * self.index_to_samples = NULL * self.sorted_samples = NULL # <<<<<<<<<<<<<< @@ -14594,7 +14707,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct */ __pyx_v_self->sorted_samples = NULL; - /* "sklearn/tree/_tree.pyx":2074 + /* "sklearn/tree/_tree.pyx":2111 * cdef SIZE_t* sorted_samples * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -14608,11 +14721,11 @@ static int __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2088 +/* "sklearn/tree/_tree.pyx":2125 * self.sorted_samples = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Deallocate memory""" + * """Deallocate memory.""" * free(self.index_to_samples) */ @@ -14631,17 +14744,17 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":2090 + /* "sklearn/tree/_tree.pyx":2127 * def __dealloc__(self): - * """Deallocate memory""" + * """Deallocate memory.""" * free(self.index_to_samples) # <<<<<<<<<<<<<< * free(self.sorted_samples) * */ free(__pyx_v_self->index_to_samples); - /* "sklearn/tree/_tree.pyx":2091 - * """Deallocate memory""" + /* "sklearn/tree/_tree.pyx":2128 + * """Deallocate memory.""" * free(self.index_to_samples) * free(self.sorted_samples) # <<<<<<<<<<<<<< * @@ -14649,11 +14762,11 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str */ free(__pyx_v_self->sorted_samples); - /* "sklearn/tree/_tree.pyx":2088 + /* "sklearn/tree/_tree.pyx":2125 * self.sorted_samples = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< - * """Deallocate memory""" + * """Deallocate memory.""" * free(self.index_to_samples) */ @@ -14661,7 +14774,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_18BaseSparseSplitter_2__dealloc__(str __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2093 +/* "sklearn/tree/_tree.pyx":2130 * free(self.sorted_samples) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -14719,48 +14832,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 = 2093; __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 = 2130; __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":2100 + /* "sklearn/tree/_tree.pyx":2137 * * # 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 = 2100; __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 = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2102 + /* "sklearn/tree/_tree.pyx":2139 * 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 = 2102; __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 = 2139; __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 = 2102; __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 = 2139; __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":2103 + /* "sklearn/tree/_tree.pyx":2140 * * 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 = 2103; __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 = 2140; __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 = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2105 + /* "sklearn/tree/_tree.pyx":2142 * raise ValueError("X should be in csc format") * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -14770,7 +14883,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":2106 + /* "sklearn/tree/_tree.pyx":2143 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t n_samples = self.n_samples # <<<<<<<<<<<<<< @@ -14780,22 +14893,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":2109 + /* "sklearn/tree/_tree.pyx":2146 * * # 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 = 2109; __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 = 2146; __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 = 2109; __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 = 2146; __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 = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; __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]; } } @@ -14803,22 +14916,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":2110 + /* "sklearn/tree/_tree.pyx":2147 * # 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 = 2110; __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 = 2147; __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 = 2110; __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 = 2147; __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __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]; } } @@ -14826,22 +14939,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":2111 + /* "sklearn/tree/_tree.pyx":2148 * 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 = 2111; __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 = 2148; __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 = 2111; __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 = 2148; __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 = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __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]; } } @@ -14849,23 +14962,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":2112 + /* "sklearn/tree/_tree.pyx":2149 * 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 = 2112; __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 = 2149; __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 = 2112; __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 = 2149; __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 = 2112; __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 = 2149; __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":2114 + /* "sklearn/tree/_tree.pyx":2151 * cdef SIZE_t n_total_samples = X.shape[0] * * self.X_data = data.data # <<<<<<<<<<<<<< @@ -14874,7 +14987,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":2115 + /* "sklearn/tree/_tree.pyx":2152 * * self.X_data = data.data * self.X_indices = indices.data # <<<<<<<<<<<<<< @@ -14883,7 +14996,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":2116 + /* "sklearn/tree/_tree.pyx":2153 * self.X_data = data.data * self.X_indices = indices.data * self.X_indptr = indptr.data # <<<<<<<<<<<<<< @@ -14892,7 +15005,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":2117 + /* "sklearn/tree/_tree.pyx":2154 * self.X_indices = indices.data * self.X_indptr = indptr.data * self.n_total_samples = n_total_samples # <<<<<<<<<<<<<< @@ -14901,25 +15014,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":2120 + /* "sklearn/tree/_tree.pyx":2157 * * # 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 = 2120; __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 = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2121 + /* "sklearn/tree/_tree.pyx":2158 * # 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 = 2121; __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 = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2123 + /* "sklearn/tree/_tree.pyx":2160 * safe_realloc(&self.sorted_samples, n_samples * sizeof(SIZE_t)) * * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -14929,7 +15042,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":2125 + /* "sklearn/tree/_tree.pyx":2162 * cdef SIZE_t* index_to_samples = self.index_to_samples * cdef SIZE_t p * for p in range(n_total_samples): # <<<<<<<<<<<<<< @@ -14940,7 +15053,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":2126 + /* "sklearn/tree/_tree.pyx":2163 * cdef SIZE_t p * for p in range(n_total_samples): * index_to_samples[p] = -1 # <<<<<<<<<<<<<< @@ -14950,7 +15063,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":2128 + /* "sklearn/tree/_tree.pyx":2165 * index_to_samples[p] = -1 * * for p in range(n_samples): # <<<<<<<<<<<<<< @@ -14961,7 +15074,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":2129 + /* "sklearn/tree/_tree.pyx":2166 * * for p in range(n_samples): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -14971,7 +15084,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":2093 + /* "sklearn/tree/_tree.pyx":2130 * free(self.sorted_samples) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -15005,7 +15118,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_init(struct __pyx __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2131 +/* "sklearn/tree/_tree.pyx":2168 * index_to_samples[samples[p]] = p * * cdef inline SIZE_t _partition(self, double threshold, # <<<<<<<<<<<<<< @@ -15026,7 +15139,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":2140 + /* "sklearn/tree/_tree.pyx":2177 * cdef SIZE_t p * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -15036,7 +15149,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":2141 + /* "sklearn/tree/_tree.pyx":2178 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -15046,7 +15159,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":2142 + /* "sklearn/tree/_tree.pyx":2179 * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* samples = self.samples * cdef SIZE_t* index_to_samples = self.index_to_samples # <<<<<<<<<<<<<< @@ -15056,7 +15169,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":2144 + /* "sklearn/tree/_tree.pyx":2181 * cdef SIZE_t* index_to_samples = self.index_to_samples * * if threshold < 0.: # <<<<<<<<<<<<<< @@ -15066,7 +15179,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":2145 + /* "sklearn/tree/_tree.pyx":2182 * * if threshold < 0.: * p = self.start # <<<<<<<<<<<<<< @@ -15076,7 +15189,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":2146 + /* "sklearn/tree/_tree.pyx":2183 * if threshold < 0.: * p = self.start * partition_end = end_negative # <<<<<<<<<<<<<< @@ -15087,7 +15200,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree goto __pyx_L3; } - /* "sklearn/tree/_tree.pyx":2147 + /* "sklearn/tree/_tree.pyx":2184 * p = self.start * partition_end = end_negative * elif threshold > 0.: # <<<<<<<<<<<<<< @@ -15097,7 +15210,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":2148 + /* "sklearn/tree/_tree.pyx":2185 * partition_end = end_negative * elif threshold > 0.: * p = start_positive # <<<<<<<<<<<<<< @@ -15106,7 +15219,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":2149 + /* "sklearn/tree/_tree.pyx":2186 * elif threshold > 0.: * p = start_positive * partition_end = self.end # <<<<<<<<<<<<<< @@ -15119,7 +15232,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } /*else*/ { - /* "sklearn/tree/_tree.pyx":2152 + /* "sklearn/tree/_tree.pyx":2189 * else: * # Data are already split * return zero_pos # <<<<<<<<<<<<<< @@ -15131,7 +15244,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2154 + /* "sklearn/tree/_tree.pyx":2191 * return zero_pos * * while p < partition_end: # <<<<<<<<<<<<<< @@ -15142,7 +15255,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":2155 + /* "sklearn/tree/_tree.pyx":2192 * * while p < partition_end: * value = Xf[p] # <<<<<<<<<<<<<< @@ -15151,7 +15264,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":2157 + /* "sklearn/tree/_tree.pyx":2194 * value = Xf[p] * * if value <= threshold: # <<<<<<<<<<<<<< @@ -15161,7 +15274,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":2158 + /* "sklearn/tree/_tree.pyx":2195 * * if value <= threshold: * p += 1 # <<<<<<<<<<<<<< @@ -15173,7 +15286,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree } /*else*/ { - /* "sklearn/tree/_tree.pyx":2161 + /* "sklearn/tree/_tree.pyx":2198 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -15182,7 +15295,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":2163 + /* "sklearn/tree/_tree.pyx":2200 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -15191,7 +15304,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":2164 + /* "sklearn/tree/_tree.pyx":2201 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = value # <<<<<<<<<<<<<< @@ -15200,7 +15313,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":2165 + /* "sklearn/tree/_tree.pyx":2202 * Xf[p] = Xf[partition_end] * Xf[partition_end] = value * sparse_swap(index_to_samples, samples, p, partition_end) # <<<<<<<<<<<<<< @@ -15212,7 +15325,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_L6:; } - /* "sklearn/tree/_tree.pyx":2167 + /* "sklearn/tree/_tree.pyx":2204 * sparse_swap(index_to_samples, samples, p, partition_end) * * return partition_end # <<<<<<<<<<<<<< @@ -15222,7 +15335,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":2131 + /* "sklearn/tree/_tree.pyx":2168 * index_to_samples[samples[p]] = p * * cdef inline SIZE_t _partition(self, double threshold, # <<<<<<<<<<<<<< @@ -15235,7 +15348,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2169 +/* "sklearn/tree/_tree.pyx":2206 * return partition_end * * cdef inline void extract_nnz(self, SIZE_t feature, # <<<<<<<<<<<<<< @@ -15250,7 +15363,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":2201 + /* "sklearn/tree/_tree.pyx":2238 * * """ * cdef SIZE_t indptr_start = self.X_indptr[feature], # <<<<<<<<<<<<<< @@ -15259,7 +15372,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":2202 + /* "sklearn/tree/_tree.pyx":2239 * """ * cdef SIZE_t indptr_start = self.X_indptr[feature], * cdef SIZE_t indptr_end = self.X_indptr[feature + 1] # <<<<<<<<<<<<<< @@ -15268,7 +15381,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":2203 + /* "sklearn/tree/_tree.pyx":2240 * 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) # <<<<<<<<<<<<<< @@ -15277,7 +15390,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":2204 + /* "sklearn/tree/_tree.pyx":2241 * 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 # <<<<<<<<<<<<<< @@ -15286,7 +15399,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":2212 + /* "sklearn/tree/_tree.pyx":2249 * # approach. * if ((1 - is_samples_sorted[0]) * n_samples * log(n_samples) + * n_samples * log(n_indices) < EXTRACT_NNZ_SWITCH * n_indices): # <<<<<<<<<<<<<< @@ -15296,7 +15409,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":2213 + /* "sklearn/tree/_tree.pyx":2250 * 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, # <<<<<<<<<<<<<< @@ -15308,7 +15421,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext } /*else*/ { - /* "sklearn/tree/_tree.pyx":2224 + /* "sklearn/tree/_tree.pyx":2261 * # index_to_samples is a mapping from X_indices to samples * else: * extract_nnz_index_to_samples(self.X_indices, self.X_data, # <<<<<<<<<<<<<< @@ -15319,7 +15432,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2169 + /* "sklearn/tree/_tree.pyx":2206 * return partition_end * * cdef inline void extract_nnz(self, SIZE_t feature, # <<<<<<<<<<<<<< @@ -15330,20 +15443,20 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter_ext /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2232 +/* "sklearn/tree/_tree.pyx":2269 * * * cdef int compare_SIZE_t(const void* a, const void* b) nogil: # <<<<<<<<<<<<<< - * """Comparison function for sort""" + * """Comparison function for sort.""" * return ((a)[0] - (b)[0]) */ 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":2234 + /* "sklearn/tree/_tree.pyx":2271 * cdef int compare_SIZE_t(const void* a, const void* b) nogil: - * """Comparison function for sort""" + * """Comparison function for sort.""" * return ((a)[0] - (b)[0]) # <<<<<<<<<<<<<< * * @@ -15351,11 +15464,11 @@ 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":2232 + /* "sklearn/tree/_tree.pyx":2269 * * * cdef int compare_SIZE_t(const void* a, const void* b) nogil: # <<<<<<<<<<<<<< - * """Comparison function for sort""" + * """Comparison function for sort.""" * return ((a)[0] - (b)[0]) */ @@ -15364,7 +15477,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":2237 +/* "sklearn/tree/_tree.pyx":2274 * * * cdef inline void binary_search(INT32_t* sorted_array, # <<<<<<<<<<<<<< @@ -15376,7 +15489,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":2246 + /* "sklearn/tree/_tree.pyx":2283 * """ * cdef INT32_t pivot * index[0] = -1 # <<<<<<<<<<<<<< @@ -15385,7 +15498,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":2247 + /* "sklearn/tree/_tree.pyx":2284 * cdef INT32_t pivot * index[0] = -1 * while start < end: # <<<<<<<<<<<<<< @@ -15396,7 +15509,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":2248 + /* "sklearn/tree/_tree.pyx":2285 * index[0] = -1 * while start < end: * pivot = start + (end - start) / 2 # <<<<<<<<<<<<<< @@ -15405,7 +15518,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":2250 + /* "sklearn/tree/_tree.pyx":2287 * pivot = start + (end - start) / 2 * * if sorted_array[pivot] == value: # <<<<<<<<<<<<<< @@ -15415,7 +15528,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":2251 + /* "sklearn/tree/_tree.pyx":2288 * * if sorted_array[pivot] == value: * index[0] = pivot # <<<<<<<<<<<<<< @@ -15424,7 +15537,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":2252 + /* "sklearn/tree/_tree.pyx":2289 * if sorted_array[pivot] == value: * index[0] = pivot * start = pivot + 1 # <<<<<<<<<<<<<< @@ -15433,7 +15546,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":2253 + /* "sklearn/tree/_tree.pyx":2290 * index[0] = pivot * start = pivot + 1 * break # <<<<<<<<<<<<<< @@ -15443,7 +15556,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":2255 + /* "sklearn/tree/_tree.pyx":2292 * break * * if sorted_array[pivot] < value: # <<<<<<<<<<<<<< @@ -15453,7 +15566,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":2256 + /* "sklearn/tree/_tree.pyx":2293 * * if sorted_array[pivot] < value: * start = pivot + 1 # <<<<<<<<<<<<<< @@ -15465,7 +15578,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s } /*else*/ { - /* "sklearn/tree/_tree.pyx":2258 + /* "sklearn/tree/_tree.pyx":2295 * start = pivot + 1 * else: * end = pivot # <<<<<<<<<<<<<< @@ -15478,7 +15591,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":2259 + /* "sklearn/tree/_tree.pyx":2296 * else: * end = pivot * new_start[0] = start # <<<<<<<<<<<<<< @@ -15487,7 +15600,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":2237 + /* "sklearn/tree/_tree.pyx":2274 * * * cdef inline void binary_search(INT32_t* sorted_array, # <<<<<<<<<<<<<< @@ -15498,7 +15611,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_binary_search(__pyx_t_7s /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2262 +/* "sklearn/tree/_tree.pyx":2299 * * * cdef inline void extract_nnz_index_to_samples(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -15516,7 +15629,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":2279 + /* "sklearn/tree/_tree.pyx":2316 * cdef INT32_t k * cdef SIZE_t index * cdef SIZE_t end_negative_ = start # <<<<<<<<<<<<<< @@ -15525,7 +15638,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":2280 + /* "sklearn/tree/_tree.pyx":2317 * cdef SIZE_t index * cdef SIZE_t end_negative_ = start * cdef SIZE_t start_positive_ = end # <<<<<<<<<<<<<< @@ -15534,7 +15647,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":2282 + /* "sklearn/tree/_tree.pyx":2319 * cdef SIZE_t start_positive_ = end * * for k in range(indptr_start, indptr_end): # <<<<<<<<<<<<<< @@ -15545,7 +15658,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":2283 + /* "sklearn/tree/_tree.pyx":2320 * * for k in range(indptr_start, indptr_end): * if start <= index_to_samples[X_indices[k]] < end: # <<<<<<<<<<<<<< @@ -15559,7 +15672,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":2284 + /* "sklearn/tree/_tree.pyx":2321 * for k in range(indptr_start, indptr_end): * if start <= index_to_samples[X_indices[k]] < end: * if X_data[k] > 0: # <<<<<<<<<<<<<< @@ -15569,7 +15682,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":2285 + /* "sklearn/tree/_tree.pyx":2322 * if start <= index_to_samples[X_indices[k]] < end: * if X_data[k] > 0: * start_positive_ -= 1 # <<<<<<<<<<<<<< @@ -15578,7 +15691,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":2286 + /* "sklearn/tree/_tree.pyx":2323 * if X_data[k] > 0: * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] # <<<<<<<<<<<<<< @@ -15587,7 +15700,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":2287 + /* "sklearn/tree/_tree.pyx":2324 * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15596,7 +15709,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":2288 + /* "sklearn/tree/_tree.pyx":2325 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, start_positive_) # <<<<<<<<<<<<<< @@ -15607,7 +15720,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam goto __pyx_L6; } - /* "sklearn/tree/_tree.pyx":2291 + /* "sklearn/tree/_tree.pyx":2328 * * * elif X_data[k] < 0: # <<<<<<<<<<<<<< @@ -15617,7 +15730,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":2292 + /* "sklearn/tree/_tree.pyx":2329 * * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] # <<<<<<<<<<<<<< @@ -15626,7 +15739,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":2293 + /* "sklearn/tree/_tree.pyx":2330 * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15635,7 +15748,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":2294 + /* "sklearn/tree/_tree.pyx":2331 * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) # <<<<<<<<<<<<<< @@ -15644,7 +15757,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":2295 + /* "sklearn/tree/_tree.pyx":2332 * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 # <<<<<<<<<<<<<< @@ -15660,7 +15773,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":2298 + /* "sklearn/tree/_tree.pyx":2335 * * # Returned values * end_negative[0] = end_negative_ # <<<<<<<<<<<<<< @@ -15669,7 +15782,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":2299 + /* "sklearn/tree/_tree.pyx":2336 * # Returned values * end_negative[0] = end_negative_ * start_positive[0] = start_positive_ # <<<<<<<<<<<<<< @@ -15678,7 +15791,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":2262 + /* "sklearn/tree/_tree.pyx":2299 * * * cdef inline void extract_nnz_index_to_samples(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -15689,7 +15802,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_index_to_sam /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2302 +/* "sklearn/tree/_tree.pyx":2339 * * * cdef inline void extract_nnz_binary_search(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -15707,7 +15820,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":2325 + /* "sklearn/tree/_tree.pyx":2362 * cdef SIZE_t n_samples * * if not is_samples_sorted[0]: # <<<<<<<<<<<<<< @@ -15717,7 +15830,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":2326 + /* "sklearn/tree/_tree.pyx":2363 * * if not is_samples_sorted[0]: * n_samples = end - start # <<<<<<<<<<<<<< @@ -15726,7 +15839,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":2327 + /* "sklearn/tree/_tree.pyx":2364 * if not is_samples_sorted[0]: * n_samples = end - start * memcpy(sorted_samples + start, samples + start, # <<<<<<<<<<<<<< @@ -15735,7 +15848,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":2329 + /* "sklearn/tree/_tree.pyx":2366 * memcpy(sorted_samples + start, samples + start, * n_samples * sizeof(SIZE_t)) * qsort(sorted_samples + start, n_samples, sizeof(SIZE_t), # <<<<<<<<<<<<<< @@ -15744,7 +15857,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":2331 + /* "sklearn/tree/_tree.pyx":2368 * qsort(sorted_samples + start, n_samples, sizeof(SIZE_t), * compare_SIZE_t) * is_samples_sorted[0] = 1 # <<<<<<<<<<<<<< @@ -15756,7 +15869,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2333 + /* "sklearn/tree/_tree.pyx":2370 * is_samples_sorted[0] = 1 * * while (indptr_start < indptr_end and # <<<<<<<<<<<<<< @@ -15771,7 +15884,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":2334 + /* "sklearn/tree/_tree.pyx":2371 * * while (indptr_start < indptr_end and * sorted_samples[start] > X_indices[indptr_start]): # <<<<<<<<<<<<<< @@ -15783,7 +15896,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":2335 + /* "sklearn/tree/_tree.pyx":2372 * while (indptr_start < indptr_end and * sorted_samples[start] > X_indices[indptr_start]): * indptr_start += 1 # <<<<<<<<<<<<<< @@ -15793,7 +15906,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":2337 + /* "sklearn/tree/_tree.pyx":2374 * indptr_start += 1 * * while (indptr_start < indptr_end and # <<<<<<<<<<<<<< @@ -15808,7 +15921,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":2338 + /* "sklearn/tree/_tree.pyx":2375 * * while (indptr_start < indptr_end and * sorted_samples[end - 1] < X_indices[indptr_end - 1]): # <<<<<<<<<<<<<< @@ -15820,7 +15933,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":2339 + /* "sklearn/tree/_tree.pyx":2376 * while (indptr_start < indptr_end and * sorted_samples[end - 1] < X_indices[indptr_end - 1]): * indptr_end -= 1 # <<<<<<<<<<<<<< @@ -15830,7 +15943,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":2341 + /* "sklearn/tree/_tree.pyx":2378 * indptr_end -= 1 * * cdef SIZE_t p = start # <<<<<<<<<<<<<< @@ -15839,7 +15952,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":2344 + /* "sklearn/tree/_tree.pyx":2381 * cdef SIZE_t index * cdef SIZE_t k * cdef SIZE_t end_negative_ = start # <<<<<<<<<<<<<< @@ -15848,7 +15961,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":2345 + /* "sklearn/tree/_tree.pyx":2382 * cdef SIZE_t k * cdef SIZE_t end_negative_ = start * cdef SIZE_t start_positive_ = end # <<<<<<<<<<<<<< @@ -15857,7 +15970,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":2347 + /* "sklearn/tree/_tree.pyx":2384 * cdef SIZE_t start_positive_ = end * * while (p < end and indptr_start < indptr_end): # <<<<<<<<<<<<<< @@ -15876,7 +15989,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":2349 + /* "sklearn/tree/_tree.pyx":2386 * 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, # <<<<<<<<<<<<<< @@ -15885,7 +15998,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":2352 + /* "sklearn/tree/_tree.pyx":2389 * sorted_samples[p], &k, &indptr_start) * * if k != -1: # <<<<<<<<<<<<<< @@ -15895,7 +16008,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":2355 + /* "sklearn/tree/_tree.pyx":2392 * # If k != -1, we have found a non zero value * * if X_data[k] > 0: # <<<<<<<<<<<<<< @@ -15905,7 +16018,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":2356 + /* "sklearn/tree/_tree.pyx":2393 * * if X_data[k] > 0: * start_positive_ -= 1 # <<<<<<<<<<<<<< @@ -15914,7 +16027,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":2357 + /* "sklearn/tree/_tree.pyx":2394 * if X_data[k] > 0: * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] # <<<<<<<<<<<<<< @@ -15923,7 +16036,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":2358 + /* "sklearn/tree/_tree.pyx":2395 * start_positive_ -= 1 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15932,7 +16045,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":2359 + /* "sklearn/tree/_tree.pyx":2396 * Xf[start_positive_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, start_positive_) # <<<<<<<<<<<<<< @@ -15943,7 +16056,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc goto __pyx_L17; } - /* "sklearn/tree/_tree.pyx":2362 + /* "sklearn/tree/_tree.pyx":2399 * * * elif X_data[k] < 0: # <<<<<<<<<<<<<< @@ -15953,7 +16066,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":2363 + /* "sklearn/tree/_tree.pyx":2400 * * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] # <<<<<<<<<<<<<< @@ -15962,7 +16075,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":2364 + /* "sklearn/tree/_tree.pyx":2401 * elif X_data[k] < 0: * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] # <<<<<<<<<<<<<< @@ -15971,7 +16084,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":2365 + /* "sklearn/tree/_tree.pyx":2402 * Xf[end_negative_] = X_data[k] * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) # <<<<<<<<<<<<<< @@ -15980,7 +16093,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":2366 + /* "sklearn/tree/_tree.pyx":2403 * index = index_to_samples[X_indices[k]] * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 # <<<<<<<<<<<<<< @@ -15995,7 +16108,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":2367 + /* "sklearn/tree/_tree.pyx":2404 * sparse_swap(index_to_samples, samples, index, end_negative_) * end_negative_ += 1 * p += 1 # <<<<<<<<<<<<<< @@ -16005,7 +16118,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":2370 + /* "sklearn/tree/_tree.pyx":2407 * * # Returned values * end_negative[0] = end_negative_ # <<<<<<<<<<<<<< @@ -16014,7 +16127,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":2371 + /* "sklearn/tree/_tree.pyx":2408 * # Returned values * end_negative[0] = end_negative_ * start_positive[0] = start_positive_ # <<<<<<<<<<<<<< @@ -16023,7 +16136,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":2302 + /* "sklearn/tree/_tree.pyx":2339 * * * cdef inline void extract_nnz_binary_search(INT32_t* X_indices, # <<<<<<<<<<<<<< @@ -16034,21 +16147,21 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_extract_nnz_binary_searc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2374 +/* "sklearn/tree/_tree.pyx":2411 * * * cdef inline void sparse_swap(SIZE_t* index_to_samples, SIZE_t* samples, # <<<<<<<<<<<<<< * SIZE_t pos_1, SIZE_t pos_2) nogil : - * """Swap sample pos_1 and pos_2 preserving sparse invariant""" + * """Swap sample pos_1 and pos_2 preserving sparse invariant.""" */ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sparse_swap(__pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_index_to_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_pos_1, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_pos_2) { __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":2377 + /* "sklearn/tree/_tree.pyx":2414 * SIZE_t pos_1, SIZE_t pos_2) nogil : - * """Swap sample pos_1 and pos_2 preserving sparse invariant""" + * """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 * index_to_samples[samples[pos_2]] = pos_2 @@ -16058,8 +16171,8 @@ 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":2378 - * """Swap sample pos_1 and pos_2 preserving sparse invariant""" + /* "sklearn/tree/_tree.pyx":2415 + * """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 # <<<<<<<<<<<<<< * index_to_samples[samples[pos_2]] = pos_2 @@ -16067,7 +16180,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":2379 + /* "sklearn/tree/_tree.pyx":2416 * 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 # <<<<<<<<<<<<<< @@ -16076,18 +16189,18 @@ 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":2374 + /* "sklearn/tree/_tree.pyx":2411 * * * cdef inline void sparse_swap(SIZE_t* index_to_samples, SIZE_t* samples, # <<<<<<<<<<<<<< * SIZE_t pos_1, SIZE_t pos_2) nogil : - * """Swap sample pos_1 and pos_2 preserving sparse invariant""" + * """Swap sample pos_1 and pos_2 preserving sparse invariant.""" */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2385 +/* "sklearn/tree/_tree.pyx":2422 * """Splitter for finding the best split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -16120,7 +16233,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":2386 + /* "sklearn/tree/_tree.pyx":2423 * * def __reduce__(self): * return (BestSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -16129,44 +16242,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":2387 + /* "sklearn/tree/_tree.pyx":2424 * 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 = 2387; __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 = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2388 + /* "sklearn/tree/_tree.pyx":2425 * 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 = 2388; __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 = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2389 + /* "sklearn/tree/_tree.pyx":2426 * 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 = 2389; __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 = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2386 + /* "sklearn/tree/_tree.pyx":2423 * * 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 = 2386; __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 = 2423; __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)); @@ -16184,14 +16297,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2390 + /* "sklearn/tree/_tree.pyx":2427 * 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 = 2390; __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 = 2427; __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))) { @@ -16204,22 +16317,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 = 2390; __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 = 2427; __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 = 2390; __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 = 2427; __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":2386 + /* "sklearn/tree/_tree.pyx":2423 * * 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 = 2386; __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 = 2423; __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))); @@ -16234,7 +16347,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2385 + /* "sklearn/tree/_tree.pyx":2422 * """Splitter for finding the best split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -16256,7 +16369,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_18BestSparseSplitter___reduce__( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2392 +/* "sklearn/tree/_tree.pyx":2429 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -16283,6 +16396,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __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; + double __pyx_v_current_proxy_improvement; + double __pyx_v_best_proxy_improvement; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; @@ -16306,7 +16421,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":2398 + /* "sklearn/tree/_tree.pyx":2435 * """ * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -16316,7 +16431,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":2399 + /* "sklearn/tree/_tree.pyx":2436 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -16326,7 +16441,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":2400 + /* "sklearn/tree/_tree.pyx":2437 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -16336,7 +16451,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":2402 + /* "sklearn/tree/_tree.pyx":2439 * cdef SIZE_t end = self.end * * cdef INT32_t* X_indices = self.X_indices # <<<<<<<<<<<<<< @@ -16346,7 +16461,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":2403 + /* "sklearn/tree/_tree.pyx":2440 * * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr # <<<<<<<<<<<<<< @@ -16356,7 +16471,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":2404 + /* "sklearn/tree/_tree.pyx":2441 * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr * cdef DTYPE_t* X_data = self.X_data # <<<<<<<<<<<<<< @@ -16366,7 +16481,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":2406 + /* "sklearn/tree/_tree.pyx":2443 * cdef DTYPE_t* X_data = self.X_data * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -16376,7 +16491,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":2407 + /* "sklearn/tree/_tree.pyx":2444 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -16386,7 +16501,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":2408 + /* "sklearn/tree/_tree.pyx":2445 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -16396,7 +16511,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":2410 + /* "sklearn/tree/_tree.pyx":2447 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -16406,7 +16521,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":2411 + /* "sklearn/tree/_tree.pyx":2448 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples # <<<<<<<<<<<<<< @@ -16416,7 +16531,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":2412 + /* "sklearn/tree/_tree.pyx":2449 * 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 # <<<<<<<<<<<<<< @@ -16426,7 +16541,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":2413 + /* "sklearn/tree/_tree.pyx":2450 * 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 # <<<<<<<<<<<<<< @@ -16436,7 +16551,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":2414 + /* "sklearn/tree/_tree.pyx":2451 * 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 # <<<<<<<<<<<<<< @@ -16446,7 +16561,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":2415 + /* "sklearn/tree/_tree.pyx":2452 * 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 # <<<<<<<<<<<<<< @@ -16456,7 +16571,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":2416 + /* "sklearn/tree/_tree.pyx":2453 * 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 # <<<<<<<<<<<<<< @@ -16465,17 +16580,35 @@ 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":2419 + /* "sklearn/tree/_tree.pyx":2456 * * cdef SplitRecord best, current * _init_split(&best, end) # <<<<<<<<<<<<<< - * - * cdef SIZE_t f_i = n_features + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY */ __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); - /* "sklearn/tree/_tree.pyx":2421 + /* "sklearn/tree/_tree.pyx":2457 + * cdef SplitRecord best, current + * _init_split(&best, end) + * cdef double current_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * cdef double best_proxy_improvement = - INFINITY + * + */ + __pyx_v_current_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":2458 * _init_split(&best, end) + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * + * cdef SIZE_t f_i = n_features + */ + __pyx_v_best_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":2460 + * cdef double best_proxy_improvement = - INFINITY * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< * cdef SIZE_t f_j, p, tmp @@ -16483,7 +16616,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":2423 + /* "sklearn/tree/_tree.pyx":2462 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -16492,7 +16625,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":2425 + /* "sklearn/tree/_tree.pyx":2464 * 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 # <<<<<<<<<<<<<< @@ -16501,7 +16634,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":2427 + /* "sklearn/tree/_tree.pyx":2466 * 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 # <<<<<<<<<<<<<< @@ -16510,7 +16643,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":2428 + /* "sklearn/tree/_tree.pyx":2467 * # 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] # <<<<<<<<<<<<<< @@ -16519,7 +16652,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":2430 + /* "sklearn/tree/_tree.pyx":2469 * 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 # <<<<<<<<<<<<<< @@ -16528,7 +16661,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":2435 + /* "sklearn/tree/_tree.pyx":2474 * cdef SIZE_t p_next * cdef SIZE_t p_prev * cdef bint is_samples_sorted = 0 # indicate is sorted_samples is # <<<<<<<<<<<<<< @@ -16537,7 +16670,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_is_samples_sorted = 0; - /* "sklearn/tree/_tree.pyx":2452 + /* "sklearn/tree/_tree.pyx":2491 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -16552,7 +16685,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2454 + /* "sklearn/tree/_tree.pyx":2493 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -16566,7 +16699,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2456 + /* "sklearn/tree/_tree.pyx":2495 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -16578,7 +16711,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":2458 + /* "sklearn/tree/_tree.pyx":2497 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -16587,7 +16720,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":2472 + /* "sklearn/tree/_tree.pyx":2511 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -16596,7 +16729,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":2475 + /* "sklearn/tree/_tree.pyx":2514 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -16606,7 +16739,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":2477 + /* "sklearn/tree/_tree.pyx":2516 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -16615,7 +16748,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":2478 + /* "sklearn/tree/_tree.pyx":2517 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -16624,7 +16757,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":2479 + /* "sklearn/tree/_tree.pyx":2518 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -16633,7 +16766,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":2481 + /* "sklearn/tree/_tree.pyx":2520 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -16645,7 +16778,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2485 + /* "sklearn/tree/_tree.pyx":2524 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -16654,7 +16787,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":2488 + /* "sklearn/tree/_tree.pyx":2527 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -16663,7 +16796,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":2489 + /* "sklearn/tree/_tree.pyx":2528 * * current.feature = features[f_j] * self.extract_nnz(current.feature, # <<<<<<<<<<<<<< @@ -16672,7 +16805,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":2494 + /* "sklearn/tree/_tree.pyx":2533 * * # Sort the positive and negative parts of `Xf` * sort(Xf + start, samples + start, end_negative - start) # <<<<<<<<<<<<<< @@ -16681,7 +16814,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":2495 + /* "sklearn/tree/_tree.pyx":2534 * # Sort the positive and negative parts of `Xf` * sort(Xf + start, samples + start, end_negative - start) * sort(Xf + start_positive, samples + start_positive, # <<<<<<<<<<<<<< @@ -16690,7 +16823,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":2499 + /* "sklearn/tree/_tree.pyx":2538 * * # Update index_to_samples to take into account the sort * for p in range(start, end_negative): # <<<<<<<<<<<<<< @@ -16701,7 +16834,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":2500 + /* "sklearn/tree/_tree.pyx":2539 * # Update index_to_samples to take into account the sort * for p in range(start, end_negative): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -16711,7 +16844,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":2501 + /* "sklearn/tree/_tree.pyx":2540 * for p in range(start, end_negative): * index_to_samples[samples[p]] = p * for p in range(start_positive, end): # <<<<<<<<<<<<<< @@ -16722,7 +16855,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":2502 + /* "sklearn/tree/_tree.pyx":2541 * index_to_samples[samples[p]] = p * for p in range(start_positive, end): * index_to_samples[samples[p]] = p # <<<<<<<<<<<<<< @@ -16732,7 +16865,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":2505 + /* "sklearn/tree/_tree.pyx":2544 * * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: # <<<<<<<<<<<<<< @@ -16742,7 +16875,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":2506 + /* "sklearn/tree/_tree.pyx":2545 * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: * start_positive -= 1 # <<<<<<<<<<<<<< @@ -16751,7 +16884,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":2507 + /* "sklearn/tree/_tree.pyx":2546 * if end_negative < start_positive: * start_positive -= 1 * Xf[start_positive] = 0. # <<<<<<<<<<<<<< @@ -16760,7 +16893,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":2509 + /* "sklearn/tree/_tree.pyx":2548 * Xf[start_positive] = 0. * * if end_negative != start_positive: # <<<<<<<<<<<<<< @@ -16770,7 +16903,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":2510 + /* "sklearn/tree/_tree.pyx":2549 * * if end_negative != start_positive: * Xf[end_negative] = 0. # <<<<<<<<<<<<<< @@ -16779,7 +16912,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":2511 + /* "sklearn/tree/_tree.pyx":2550 * if end_negative != start_positive: * Xf[end_negative] = 0. * end_negative += 1 # <<<<<<<<<<<<<< @@ -16794,7 +16927,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":2513 + /* "sklearn/tree/_tree.pyx":2552 * end_negative += 1 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -16804,7 +16937,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":2514 + /* "sklearn/tree/_tree.pyx":2553 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -16813,7 +16946,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":2515 + /* "sklearn/tree/_tree.pyx":2554 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -16823,7 +16956,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":2517 + /* "sklearn/tree/_tree.pyx":2556 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -16832,7 +16965,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":2518 + /* "sklearn/tree/_tree.pyx":2557 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -16844,7 +16977,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2521 + /* "sklearn/tree/_tree.pyx":2560 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -16853,7 +16986,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":2522 + /* "sklearn/tree/_tree.pyx":2561 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -16865,7 +16998,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":2525 + /* "sklearn/tree/_tree.pyx":2564 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -16874,7 +17007,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":2526 + /* "sklearn/tree/_tree.pyx":2565 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -16883,7 +17016,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2528 + /* "sklearn/tree/_tree.pyx":2567 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -16894,7 +17027,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":2529 + /* "sklearn/tree/_tree.pyx":2568 * * while p < end: * if p + 1 != end_negative: # <<<<<<<<<<<<<< @@ -16904,7 +17037,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":2530 + /* "sklearn/tree/_tree.pyx":2569 * while p < end: * if p + 1 != end_negative: * p_next = p + 1 # <<<<<<<<<<<<<< @@ -16916,7 +17049,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2532 + /* "sklearn/tree/_tree.pyx":2571 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< @@ -16927,7 +17060,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":2534 + /* "sklearn/tree/_tree.pyx":2573 * p_next = start_positive * * while (p_next < end and # <<<<<<<<<<<<<< @@ -16942,7 +17075,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L21_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2535 + /* "sklearn/tree/_tree.pyx":2574 * * while (p_next < end and * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -16954,7 +17087,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":2536 + /* "sklearn/tree/_tree.pyx":2575 * while (p_next < end and * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): * p = p_next # <<<<<<<<<<<<<< @@ -16963,7 +17096,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_p_next; - /* "sklearn/tree/_tree.pyx":2537 + /* "sklearn/tree/_tree.pyx":2576 * Xf[p_next] <= Xf[p] + FEATURE_THRESHOLD): * p = p_next * if p + 1 != end_negative: # <<<<<<<<<<<<<< @@ -16973,7 +17106,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":2538 + /* "sklearn/tree/_tree.pyx":2577 * p = p_next * if p + 1 != end_negative: * p_next = p + 1 # <<<<<<<<<<<<<< @@ -16985,7 +17118,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } /*else*/ { - /* "sklearn/tree/_tree.pyx":2540 + /* "sklearn/tree/_tree.pyx":2579 * p_next = p + 1 * else: * p_next = start_positive # <<<<<<<<<<<<<< @@ -16997,7 +17130,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L23:; } - /* "sklearn/tree/_tree.pyx":2545 + /* "sklearn/tree/_tree.pyx":2584 * # (p_next >= end) or (X[samples[p_next], current.feature] > * # X[samples[p], current.feature]) * p_prev = p # <<<<<<<<<<<<<< @@ -17006,7 +17139,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p_prev = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":2546 + /* "sklearn/tree/_tree.pyx":2585 * # X[samples[p], current.feature]) * p_prev = p * p = p_next # <<<<<<<<<<<<<< @@ -17015,7 +17148,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_p = __pyx_v_p_next; - /* "sklearn/tree/_tree.pyx":2551 + /* "sklearn/tree/_tree.pyx":2590 * * * if p < end: # <<<<<<<<<<<<<< @@ -17025,7 +17158,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":2552 + /* "sklearn/tree/_tree.pyx":2591 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -17034,7 +17167,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":2555 + /* "sklearn/tree/_tree.pyx":2594 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -17048,7 +17181,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L26_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2556 + /* "sklearn/tree/_tree.pyx":2595 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -17060,7 +17193,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":2557 + /* "sklearn/tree/_tree.pyx":2596 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -17070,7 +17203,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L16_continue; } - /* "sklearn/tree/_tree.pyx":2559 + /* "sklearn/tree/_tree.pyx":2598 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -17079,7 +17212,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":2562 + /* "sklearn/tree/_tree.pyx":2601 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -17093,7 +17226,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct goto __pyx_L29_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2563 + /* "sklearn/tree/_tree.pyx":2602 * # 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)): # <<<<<<<<<<<<<< @@ -17105,46 +17238,46 @@ 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":2564 + /* "sklearn/tree/_tree.pyx":2603 * 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) + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L16_continue; } - /* "sklearn/tree/_tree.pyx":2566 + /* "sklearn/tree/_tree.pyx":2605 * continue * - * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< - * if current.improvement > best.improvement: - * self.criterion.children_impurity(¤t.impurity_left, + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() # <<<<<<<<<<<<<< + * + * if current_proxy_improvement > best_proxy_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); + __pyx_v_current_proxy_improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->proxy_impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":2567 + /* "sklearn/tree/_tree.pyx":2607 + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() + * + * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< + * best_proxy_improvement = current_proxy_improvement * - * current.improvement = self.criterion.impurity_improvement(impurity) - * if current.improvement > best.improvement: # <<<<<<<<<<<<<< - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) */ - __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + __pyx_t_6 = ((__pyx_v_current_proxy_improvement > __pyx_v_best_proxy_improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2568 - * 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":2608 + * + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement # <<<<<<<<<<<<<< * + * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 */ - ((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_best_proxy_improvement = __pyx_v_current_proxy_improvement; - /* "sklearn/tree/_tree.pyx":2571 - * ¤t.impurity_right) + /* "sklearn/tree/_tree.pyx":2610 + * best_proxy_improvement = current_proxy_improvement * * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< * if current.threshold == Xf[p]: @@ -17152,7 +17285,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":2572 + /* "sklearn/tree/_tree.pyx":2611 * * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -17162,7 +17295,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":2573 + /* "sklearn/tree/_tree.pyx":2612 * current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: * current.threshold = Xf[p_prev] # <<<<<<<<<<<<<< @@ -17174,7 +17307,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct } __pyx_L32:; - /* "sklearn/tree/_tree.pyx":2575 + /* "sklearn/tree/_tree.pyx":2614 * current.threshold = Xf[p_prev] * * best = current # <<<<<<<<<<<<<< @@ -17196,7 +17329,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":2578 + /* "sklearn/tree/_tree.pyx":2617 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -17206,7 +17339,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":2579 + /* "sklearn/tree/_tree.pyx":2618 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * self.extract_nnz(best.feature, &end_negative, &start_positive, # <<<<<<<<<<<<<< @@ -17215,7 +17348,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":2582 + /* "sklearn/tree/_tree.pyx":2621 * &is_samples_sorted) * * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< @@ -17223,11 +17356,47 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct * */ __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.threshold, __pyx_v_end_negative, __pyx_v_start_positive, __pyx_v_best.pos); + + /* "sklearn/tree/_tree.pyx":2624 + * best.pos) + * + * self.criterion.reset() # <<<<<<<<<<<<<< + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + */ + ((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":2625 + * + * self.criterion.reset() + * self.criterion.update(best.pos) # <<<<<<<<<<<<<< + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, + */ + ((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_best.pos); + + /* "sklearn/tree/_tree.pyx":2626 + * self.criterion.reset() + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * self.criterion.children_impurity(&best.impurity_left, + * &best.impurity_right) + */ + __pyx_v_best.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":2627 + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, # <<<<<<<<<<<<<< + * &best.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_best.impurity_left), (&__pyx_v_best.impurity_right)); goto __pyx_L33; } __pyx_L33:; - /* "sklearn/tree/_tree.pyx":2588 + /* "sklearn/tree/_tree.pyx":2633 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -17236,7 +17405,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":2591 + /* "sklearn/tree/_tree.pyx":2636 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -17245,7 +17414,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":2596 + /* "sklearn/tree/_tree.pyx":2641 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -17254,7 +17423,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":2597 + /* "sklearn/tree/_tree.pyx":2642 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -17263,7 +17432,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":2392 + /* "sklearn/tree/_tree.pyx":2429 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -17274,7 +17443,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_18BestSparseSplitter_node_split(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2603 +/* "sklearn/tree/_tree.pyx":2648 * """Splitter for finding a random split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -17307,7 +17476,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":2604 + /* "sklearn/tree/_tree.pyx":2649 * * def __reduce__(self): * return (RandomSparseSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -17316,44 +17485,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":2605 + /* "sklearn/tree/_tree.pyx":2650 * 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 = 2605; __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 = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2606 + /* "sklearn/tree/_tree.pyx":2651 * 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 = 2606; __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 = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2607 + /* "sklearn/tree/_tree.pyx":2652 * 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 = 2607; __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 = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2604 + /* "sklearn/tree/_tree.pyx":2649 * * 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 = 2604; __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 = 2649; __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)); @@ -17371,14 +17540,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2608 + /* "sklearn/tree/_tree.pyx":2653 * 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 = 2608; __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 = 2653; __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))) { @@ -17391,22 +17560,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 = 2608; __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 = 2653; __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 = 2608; __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 = 2653; __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":2604 + /* "sklearn/tree/_tree.pyx":2649 * * 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 = 2604; __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 = 2649; __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))); @@ -17421,7 +17590,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2603 + /* "sklearn/tree/_tree.pyx":2648 * """Splitter for finding a random split, using the sparse data.""" * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -17443,7 +17612,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20RandomSparseSplitter___reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2610 +/* "sklearn/tree/_tree.pyx":2655 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -17470,6 +17639,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __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; + double __pyx_v_current_proxy_improvement; + double __pyx_v_best_proxy_improvement; __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_v_current_feature_value; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; @@ -17494,7 +17665,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":2616 + /* "sklearn/tree/_tree.pyx":2661 * """ * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -17504,7 +17675,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":2617 + /* "sklearn/tree/_tree.pyx":2662 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -17514,7 +17685,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":2618 + /* "sklearn/tree/_tree.pyx":2663 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -17524,7 +17695,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":2620 + /* "sklearn/tree/_tree.pyx":2665 * cdef SIZE_t end = self.end * * cdef INT32_t* X_indices = self.X_indices # <<<<<<<<<<<<<< @@ -17534,7 +17705,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":2621 + /* "sklearn/tree/_tree.pyx":2666 * * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr # <<<<<<<<<<<<<< @@ -17544,7 +17715,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":2622 + /* "sklearn/tree/_tree.pyx":2667 * cdef INT32_t* X_indices = self.X_indices * cdef INT32_t* X_indptr = self.X_indptr * cdef DTYPE_t* X_data = self.X_data # <<<<<<<<<<<<<< @@ -17554,7 +17725,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":2624 + /* "sklearn/tree/_tree.pyx":2669 * cdef DTYPE_t* X_data = self.X_data * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -17564,7 +17735,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":2625 + /* "sklearn/tree/_tree.pyx":2670 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -17574,7 +17745,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":2626 + /* "sklearn/tree/_tree.pyx":2671 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -17584,7 +17755,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":2628 + /* "sklearn/tree/_tree.pyx":2673 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -17594,7 +17765,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":2629 + /* "sklearn/tree/_tree.pyx":2674 * * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t* sorted_samples = self.sorted_samples # <<<<<<<<<<<<<< @@ -17604,7 +17775,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":2630 + /* "sklearn/tree/_tree.pyx":2675 * 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 # <<<<<<<<<<<<<< @@ -17614,7 +17785,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":2631 + /* "sklearn/tree/_tree.pyx":2676 * 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 # <<<<<<<<<<<<<< @@ -17624,7 +17795,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":2632 + /* "sklearn/tree/_tree.pyx":2677 * 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 # <<<<<<<<<<<<<< @@ -17634,7 +17805,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":2633 + /* "sklearn/tree/_tree.pyx":2678 * 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 # <<<<<<<<<<<<<< @@ -17644,7 +17815,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":2634 + /* "sklearn/tree/_tree.pyx":2679 * 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 # <<<<<<<<<<<<<< @@ -17653,16 +17824,34 @@ 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":2637 + /* "sklearn/tree/_tree.pyx":2682 * * cdef SplitRecord best, current * _init_split(&best, end) # <<<<<<<<<<<<<< + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY + */ + __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); + + /* "sklearn/tree/_tree.pyx":2683 + * cdef SplitRecord best, current + * _init_split(&best, end) + * cdef double current_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< + * cdef double best_proxy_improvement = - INFINITY + * + */ + __pyx_v_current_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); + + /* "sklearn/tree/_tree.pyx":2684 + * _init_split(&best, end) + * cdef double current_proxy_improvement = - INFINITY + * cdef double best_proxy_improvement = - INFINITY # <<<<<<<<<<<<<< * * cdef DTYPE_t current_feature_value */ - __pyx_f_7sklearn_4tree_5_tree__init_split((&__pyx_v_best), __pyx_v_end); + __pyx_v_best_proxy_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); - /* "sklearn/tree/_tree.pyx":2641 + /* "sklearn/tree/_tree.pyx":2688 * cdef DTYPE_t current_feature_value * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -17671,7 +17860,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":2643 + /* "sklearn/tree/_tree.pyx":2690 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -17680,7 +17869,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":2645 + /* "sklearn/tree/_tree.pyx":2692 * 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 # <<<<<<<<<<<<<< @@ -17689,7 +17878,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":2647 + /* "sklearn/tree/_tree.pyx":2694 * 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 # <<<<<<<<<<<<<< @@ -17698,7 +17887,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":2648 + /* "sklearn/tree/_tree.pyx":2695 * # 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] # <<<<<<<<<<<<<< @@ -17707,7 +17896,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":2650 + /* "sklearn/tree/_tree.pyx":2697 * 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 # <<<<<<<<<<<<<< @@ -17716,7 +17905,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":2656 + /* "sklearn/tree/_tree.pyx":2703 * cdef DTYPE_t max_feature_value * * cdef bint is_samples_sorted = 0 # indicate that sorted_samples is # <<<<<<<<<<<<<< @@ -17725,7 +17914,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ __pyx_v_is_samples_sorted = 0; - /* "sklearn/tree/_tree.pyx":2673 + /* "sklearn/tree/_tree.pyx":2720 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -17740,7 +17929,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2675 + /* "sklearn/tree/_tree.pyx":2722 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -17754,7 +17943,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2677 + /* "sklearn/tree/_tree.pyx":2724 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -17766,7 +17955,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":2679 + /* "sklearn/tree/_tree.pyx":2726 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -17775,7 +17964,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":2693 + /* "sklearn/tree/_tree.pyx":2740 * * # Draw a feature at random * f_j = rand_int(n_drawn_constants, f_i - n_found_constants, # <<<<<<<<<<<<<< @@ -17784,7 +17973,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":2696 + /* "sklearn/tree/_tree.pyx":2743 * random_state) * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -17794,7 +17983,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":2698 + /* "sklearn/tree/_tree.pyx":2745 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -17803,7 +17992,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":2699 + /* "sklearn/tree/_tree.pyx":2746 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -17812,7 +18001,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":2700 + /* "sklearn/tree/_tree.pyx":2747 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -17821,7 +18010,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":2702 + /* "sklearn/tree/_tree.pyx":2749 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -17833,7 +18022,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2706 + /* "sklearn/tree/_tree.pyx":2753 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -17842,7 +18031,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":2709 + /* "sklearn/tree/_tree.pyx":2756 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -17851,7 +18040,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":2711 + /* "sklearn/tree/_tree.pyx":2758 * current.feature = features[f_j] * * self.extract_nnz(current.feature, # <<<<<<<<<<<<<< @@ -17860,7 +18049,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":2716 + /* "sklearn/tree/_tree.pyx":2763 * * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: # <<<<<<<<<<<<<< @@ -17870,7 +18059,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":2717 + /* "sklearn/tree/_tree.pyx":2764 * # Add one or two zeros in Xf, if there is any * if end_negative < start_positive: * start_positive -= 1 # <<<<<<<<<<<<<< @@ -17879,7 +18068,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":2718 + /* "sklearn/tree/_tree.pyx":2765 * if end_negative < start_positive: * start_positive -= 1 * Xf[start_positive] = 0. # <<<<<<<<<<<<<< @@ -17888,7 +18077,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":2720 + /* "sklearn/tree/_tree.pyx":2767 * Xf[start_positive] = 0. * * if end_negative != start_positive: # <<<<<<<<<<<<<< @@ -17898,7 +18087,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":2721 + /* "sklearn/tree/_tree.pyx":2768 * * if end_negative != start_positive: * Xf[end_negative] = 0. # <<<<<<<<<<<<<< @@ -17907,7 +18096,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":2722 + /* "sklearn/tree/_tree.pyx":2769 * if end_negative != start_positive: * Xf[end_negative] = 0. * end_negative += 1 # <<<<<<<<<<<<<< @@ -17922,7 +18111,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":2725 + /* "sklearn/tree/_tree.pyx":2772 * * # Find min, max in Xf[start:end_negative] * min_feature_value = Xf[start] # <<<<<<<<<<<<<< @@ -17931,7 +18120,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":2726 + /* "sklearn/tree/_tree.pyx":2773 * # Find min, max in Xf[start:end_negative] * min_feature_value = Xf[start] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -17940,7 +18129,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":2728 + /* "sklearn/tree/_tree.pyx":2775 * max_feature_value = min_feature_value * * for p in range(start, end_negative): # <<<<<<<<<<<<<< @@ -17951,7 +18140,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":2729 + /* "sklearn/tree/_tree.pyx":2776 * * for p in range(start, end_negative): * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -17960,7 +18149,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":2731 + /* "sklearn/tree/_tree.pyx":2778 * current_feature_value = Xf[p] * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -17970,7 +18159,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":2732 + /* "sklearn/tree/_tree.pyx":2779 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -17981,7 +18170,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L13; } - /* "sklearn/tree/_tree.pyx":2733 + /* "sklearn/tree/_tree.pyx":2780 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -17991,7 +18180,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":2734 + /* "sklearn/tree/_tree.pyx":2781 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -18004,7 +18193,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":2737 + /* "sklearn/tree/_tree.pyx":2784 * * # Update min, max given Xf[start_positive:end] * for p in range(start_positive, end): # <<<<<<<<<<<<<< @@ -18015,7 +18204,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":2738 + /* "sklearn/tree/_tree.pyx":2785 * # Update min, max given Xf[start_positive:end] * for p in range(start_positive, end): * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -18024,7 +18213,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":2740 + /* "sklearn/tree/_tree.pyx":2787 * current_feature_value = Xf[p] * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -18034,7 +18223,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":2741 + /* "sklearn/tree/_tree.pyx":2788 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -18045,7 +18234,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L16; } - /* "sklearn/tree/_tree.pyx":2742 + /* "sklearn/tree/_tree.pyx":2789 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -18055,7 +18244,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":2743 + /* "sklearn/tree/_tree.pyx":2790 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -18068,7 +18257,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L16:; } - /* "sklearn/tree/_tree.pyx":2745 + /* "sklearn/tree/_tree.pyx":2792 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -18078,7 +18267,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":2746 + /* "sklearn/tree/_tree.pyx":2793 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -18087,7 +18276,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":2747 + /* "sklearn/tree/_tree.pyx":2794 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -18097,7 +18286,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":2749 + /* "sklearn/tree/_tree.pyx":2796 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -18106,7 +18295,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":2750 + /* "sklearn/tree/_tree.pyx":2797 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -18118,7 +18307,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2753 + /* "sklearn/tree/_tree.pyx":2800 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -18127,7 +18316,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":2754 + /* "sklearn/tree/_tree.pyx":2801 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -18139,7 +18328,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":2757 + /* "sklearn/tree/_tree.pyx":2804 * * # Draw a random threshold * current.threshold = rand_uniform(min_feature_value, # <<<<<<<<<<<<<< @@ -18148,7 +18337,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":2761 + /* "sklearn/tree/_tree.pyx":2808 * random_state) * * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -18158,7 +18347,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":2762 + /* "sklearn/tree/_tree.pyx":2809 * * if current.threshold == max_feature_value: * current.threshold = min_feature_value # <<<<<<<<<<<<<< @@ -18170,7 +18359,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":2765 + /* "sklearn/tree/_tree.pyx":2812 * * # Partition * current.pos = self._partition(current.threshold, # <<<<<<<<<<<<<< @@ -18179,7 +18368,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":2772 + /* "sklearn/tree/_tree.pyx":2819 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -18193,7 +18382,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L20_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2773 + /* "sklearn/tree/_tree.pyx":2820 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -18205,7 +18394,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":2774 + /* "sklearn/tree/_tree.pyx":2821 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -18215,7 +18404,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":2777 + /* "sklearn/tree/_tree.pyx":2824 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -18224,7 +18413,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":2778 + /* "sklearn/tree/_tree.pyx":2825 * # Evaluate split * self.criterion.reset() * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -18233,7 +18422,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":2781 + /* "sklearn/tree/_tree.pyx":2828 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -18247,7 +18436,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru goto __pyx_L23_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2782 + /* "sklearn/tree/_tree.pyx":2829 * # 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)): # <<<<<<<<<<<<<< @@ -18259,45 +18448,63 @@ 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":2783 + /* "sklearn/tree/_tree.pyx":2830 * 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) + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() */ goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":2785 + /* "sklearn/tree/_tree.pyx":2832 * continue * - * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() # <<<<<<<<<<<<<< * - * if current.improvement > best.improvement: + * if current_proxy_improvement > best_proxy_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); + __pyx_v_current_proxy_improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.__pyx_base.criterion->__pyx_vtab)->proxy_impurity_improvement(__pyx_v_self->__pyx_base.__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":2787 - * current.improvement = self.criterion.impurity_improvement(impurity) + /* "sklearn/tree/_tree.pyx":2834 + * current_proxy_improvement = self.criterion.proxy_impurity_improvement() * - * if current.improvement > best.improvement: # <<<<<<<<<<<<<< - * self.criterion.children_impurity(¤t.impurity_left, - * ¤t.impurity_right) + * if current_proxy_improvement > best_proxy_improvement: # <<<<<<<<<<<<<< + * best_proxy_improvement = current_proxy_improvement + * current.improvement = self.criterion.impurity_improvement(impurity) */ - __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + __pyx_t_6 = ((__pyx_v_current_proxy_improvement > __pyx_v_best_proxy_improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2788 + /* "sklearn/tree/_tree.pyx":2835 + * + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement # <<<<<<<<<<<<<< + * current.improvement = self.criterion.impurity_improvement(impurity) + * + */ + __pyx_v_best_proxy_improvement = __pyx_v_current_proxy_improvement; + + /* "sklearn/tree/_tree.pyx":2836 + * if current_proxy_improvement > best_proxy_improvement: + * best_proxy_improvement = current_proxy_improvement + * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * + * self.criterion.children_impurity(¤t.impurity_left, + */ + __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":2838 + * current.improvement = self.criterion.impurity_improvement(impurity) * - * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< * ¤t.impurity_right) * best = current */ ((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":2790 + /* "sklearn/tree/_tree.pyx":2840 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) * best = current # <<<<<<<<<<<<<< @@ -18315,46 +18522,87 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":2793 + /* "sklearn/tree/_tree.pyx":2843 * * # 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, - * &is_samples_sorted) + * if best.pos < end: # <<<<<<<<<<<<<< + * if current.feature != best.feature: + * self.extract_nnz(best.feature, &end_negative, &start_positive, */ - __pyx_t_7 = ((__pyx_v_best.pos < __pyx_v_end) != 0); - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L27_bool_binop_done; - } - __pyx_t_7 = ((__pyx_v_current.feature != __pyx_v_best.feature) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L27_bool_binop_done:; + __pyx_t_6 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2794 + /* "sklearn/tree/_tree.pyx":2844 * # 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, # <<<<<<<<<<<<<< - * &is_samples_sorted) + * if best.pos < end: + * if current.feature != best.feature: # <<<<<<<<<<<<<< + * self.extract_nnz(best.feature, &end_negative, &start_positive, + * &is_samples_sorted) + */ + __pyx_t_6 = ((__pyx_v_current.feature != __pyx_v_best.feature) != 0); + if (__pyx_t_6) { + + /* "sklearn/tree/_tree.pyx":2845 + * if best.pos < end: + * if current.feature != best.feature: + * self.extract_nnz(best.feature, &end_negative, &start_positive, # <<<<<<<<<<<<<< + * &is_samples_sorted) * */ - __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)); + __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":2797 - * &is_samples_sorted) + /* "sklearn/tree/_tree.pyx":2848 + * &is_samples_sorted) * - * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< - * best.pos) + * self._partition(best.threshold, end_negative, start_positive, # <<<<<<<<<<<<<< + * best.pos) * */ - __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.threshold, __pyx_v_end_negative, __pyx_v_start_positive, __pyx_v_best.pos); + __pyx_f_7sklearn_4tree_5_tree_18BaseSparseSplitter__partition(((struct __pyx_obj_7sklearn_4tree_5_tree_BaseSparseSplitter *)__pyx_v_self), __pyx_v_best.threshold, __pyx_v_end_negative, __pyx_v_start_positive, __pyx_v_best.pos); + goto __pyx_L27; + } + __pyx_L27:; + + /* "sklearn/tree/_tree.pyx":2851 + * best.pos) + * + * self.criterion.reset() # <<<<<<<<<<<<<< + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + */ + ((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":2852 + * + * self.criterion.reset() + * self.criterion.update(best.pos) # <<<<<<<<<<<<<< + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, + */ + ((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_best.pos); + + /* "sklearn/tree/_tree.pyx":2853 + * self.criterion.reset() + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< + * self.criterion.children_impurity(&best.impurity_left, + * &best.impurity_right) + */ + __pyx_v_best.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":2854 + * self.criterion.update(best.pos) + * best.improvement = self.criterion.impurity_improvement(impurity) + * self.criterion.children_impurity(&best.impurity_left, # <<<<<<<<<<<<<< + * &best.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_best.impurity_left), (&__pyx_v_best.impurity_right)); goto __pyx_L26; } __pyx_L26:; - /* "sklearn/tree/_tree.pyx":2803 + /* "sklearn/tree/_tree.pyx":2860 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -18363,7 +18611,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":2806 + /* "sklearn/tree/_tree.pyx":2863 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -18372,7 +18620,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":2811 + /* "sklearn/tree/_tree.pyx":2868 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -18381,7 +18629,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":2812 + /* "sklearn/tree/_tree.pyx":2869 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -18390,7 +18638,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":2610 + /* "sklearn/tree/_tree.pyx":2655 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -18401,8 +18649,8 @@ static void __pyx_f_7sklearn_4tree_5_tree_20RandomSparseSplitter_node_split(stru /* function exit code */ } -/* "sklearn/tree/_tree.pyx":2821 - * """Interface for different tree building strategies. """ +/* "sklearn/tree/_tree.pyx":2878 + * """Interface for different tree building strategies.""" * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< * np.ndarray sample_weight=None): @@ -18412,7 +18660,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":2822 + /* "sklearn/tree/_tree.pyx":2879 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -18438,8 +18686,8 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED } } - /* "sklearn/tree/_tree.pyx":2821 - * """Interface for different tree building strategies. """ + /* "sklearn/tree/_tree.pyx":2878 + * """Interface for different tree building strategies.""" * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< * np.ndarray sample_weight=None): @@ -18449,7 +18697,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 = 2821; __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 = 2878; __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); @@ -18466,7 +18714,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 = 2821; __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 = 2878; __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; @@ -18483,7 +18731,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 = 2821; __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 = 2878; __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; @@ -18495,7 +18743,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":2823 + /* "sklearn/tree/_tree.pyx":2880 * 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).""" # <<<<<<<<<<<<<< @@ -18520,8 +18768,8 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2821 - * """Interface for different tree building strategies. """ +/* "sklearn/tree/_tree.pyx":2878 + * """Interface for different tree building strategies.""" * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< * np.ndarray sample_weight=None): @@ -18546,7 +18794,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":2822 + /* "sklearn/tree/_tree.pyx":2879 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -18573,12 +18821,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 = 2821; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; __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 = 2821; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -18587,7 +18835,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 = 2821; __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 = 2878; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -18606,19 +18854,19 @@ 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 = 2821; __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 = 2878; __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 = 2821; __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 = 2821; __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 = 2822; __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 = 2878; __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 = 2878; __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 = 2879; __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":2821 - * """Interface for different tree building strategies. """ + /* "sklearn/tree/_tree.pyx":2878 + * """Interface for different tree building strategies.""" * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< * np.ndarray sample_weight=None): @@ -18646,7 +18894,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 = 2821; __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 = 2878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -18663,7 +18911,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2826 +/* "sklearn/tree/_tree.pyx":2883 * pass * * cdef inline _check_input(self, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -18689,14 +18937,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":2829 + /* "sklearn/tree/_tree.pyx":2886 * 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 = 2829; __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 = 2886; __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))) { @@ -18709,32 +18957,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 = 2829; __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 = 2886; __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 = 2829; __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 = 2886; __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 = 2829; __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 = 2886; __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 = 2829; __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 = 2886; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2830 + /* "sklearn/tree/_tree.pyx":2887 * """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 = 2830; __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 = 2887; __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))) { @@ -18747,24 +18995,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 = 2830; __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 = 2887; __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 = 2830; __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 = 2887; __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":2831 + /* "sklearn/tree/_tree.pyx":2888 * 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 = 2831; __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 = 2888; __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))) { @@ -18777,176 +19025,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 = 2831; __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 = 2888; __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 = 2831; __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 = 2888; __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":2833 + /* "sklearn/tree/_tree.pyx":2890 * 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 = 2833; __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 = 2890; __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 = 2833; __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 = 2890; __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 = 2833; __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 = 2890; __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 = 2833; __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 = 2890; __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 = 2833; __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 = 2890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2834 + /* "sklearn/tree/_tree.pyx":2891 * * 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 = 2834; __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 = 2891; __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 = 2834; __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 = 2891; __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 = 2834; __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 = 2891; __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 = 2834; __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 = 2891; __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 = 2834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2891; __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 = 2834; __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 = 2891; __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 = 2834; __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 = 2891; __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 = 2834; __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 = 2891; __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 = 2834; __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 = 2891; __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":2836 + /* "sklearn/tree/_tree.pyx":2893 * 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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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 = 2836; __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 = 2893; __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":2837 + /* "sklearn/tree/_tree.pyx":2894 * * 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 = 2837; __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 = 2894; __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 = 2837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } goto __pyx_L3; } - /* "sklearn/tree/_tree.pyx":2840 + /* "sklearn/tree/_tree.pyx":2897 * "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 = 2840; __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 = 2897; __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 = 2840; __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 = 2897; __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 = 2840; __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 = 2897; __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 = 2840; __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 = 2897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2842 + /* "sklearn/tree/_tree.pyx":2899 * 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 = 2842; __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 = 2899; __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 = 2842; __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 = 2899; __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 = 2842; __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 = 2899; __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 = 2842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2899; __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 = 2842; __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 = 2899; __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 = 2842; __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 = 2899; __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 = 2842; __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 = 2899; __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; @@ -18957,75 +19205,75 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2844 + /* "sklearn/tree/_tree.pyx":2901 * 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 = 2844; __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 = 2901; __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 = 2844; __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 = 2901; __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 = 2844; __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 = 2901; __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 = 2844; __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 = 2901; __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 = 2844; __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 = 2901; __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 = 2844; __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 = 2901; __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 = 2844; __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 = 2901; __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":2845 + /* "sklearn/tree/_tree.pyx":2902 * * 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 = 2845; __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 = 2902; __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 = 2845; __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 = 2902; __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 = 2845; __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 = 2902; __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 = 2845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2902; __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 = 2845; __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 = 2902; __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 = 2845; __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 = 2902; __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 = 2845; __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 = 2902; __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 = 2845; __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 = 2902; __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":2847 + /* "sklearn/tree/_tree.pyx":2904 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * if (sample_weight is not None and # <<<<<<<<<<<<<< @@ -19040,21 +19288,21 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON goto __pyx_L12_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2848 + /* "sklearn/tree/_tree.pyx":2905 * * 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 = 2848; __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 = 2905; __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 = 2848; __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 = 2905; __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 = 2848; __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 = 2905; __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 = 2848; __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 = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_6) { } else { @@ -19062,62 +19310,62 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON goto __pyx_L12_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2849 + /* "sklearn/tree/_tree.pyx":2906 * 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 = 2849; __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 = 2906; __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 = 2849; __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 = 2906; __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 = 2849; __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 = 2906; __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":2850 + /* "sklearn/tree/_tree.pyx":2907 * (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 = 2850; __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 = 2907; __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 = 2850; __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 = 2907; __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 = 2850; __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 = 2907; __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 = 2850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2907; __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 = 2850; __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 = 2907; __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 = 2850; __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 = 2907; __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 = 2850; __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 = 2850; __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 = 2907; __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 = 2907; __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 = 2850; __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 = 2907; __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":2853 + /* "sklearn/tree/_tree.pyx":2910 * order="C") * * return X, y, sample_weight # <<<<<<<<<<<<<< @@ -19125,7 +19373,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 = 2853; __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 = 2910; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); @@ -19140,7 +19388,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2826 + /* "sklearn/tree/_tree.pyx":2883 * pass * * cdef inline _check_input(self, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -19165,7 +19413,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder__check_input(CYTHON return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2860 +/* "sklearn/tree/_tree.pyx":2917 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -19210,26 +19458,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 = 2860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __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 = 2860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __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 = 2860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __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 = 2860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2917; __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 = 2860; __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 = 2917; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -19241,20 +19489,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 = 2860; __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 = 2861; __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 = 2861; __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 = 2862; __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 = 2917; __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 = 2918; __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 = 2918; __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 = 2919; __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 = 2860; __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 = 2917; __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 = 2860; __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 = 2917; __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 */ @@ -19271,7 +19519,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2863 + /* "sklearn/tree/_tree.pyx":2920 * SIZE_t min_samples_leaf, double min_weight_leaf, * SIZE_t max_depth): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -19284,7 +19532,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":2864 + /* "sklearn/tree/_tree.pyx":2921 * SIZE_t max_depth): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -19293,7 +19541,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":2865 + /* "sklearn/tree/_tree.pyx":2922 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -19302,7 +19550,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":2866 + /* "sklearn/tree/_tree.pyx":2923 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -19311,7 +19559,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":2867 + /* "sklearn/tree/_tree.pyx":2924 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -19320,7 +19568,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":2860 + /* "sklearn/tree/_tree.pyx":2917 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -19334,7 +19582,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2869 +/* "sklearn/tree/_tree.pyx":2926 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -19345,7 +19593,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":2870 + /* "sklearn/tree/_tree.pyx":2927 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -19407,7 +19655,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":2869 + /* "sklearn/tree/_tree.pyx":2926 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -19418,7 +19666,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 = 2869; __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 = 2926; __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); @@ -19435,7 +19683,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 = 2869; __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 = 2926; __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; @@ -19452,7 +19700,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 = 2869; __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 = 2926; __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; @@ -19464,14 +19712,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":2874 + /* "sklearn/tree/_tree.pyx":2931 * * # 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 = 2874; __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 = 2931; __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; @@ -19483,7 +19731,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 = 2874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -19499,17 +19747,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 = 2874; __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 = 2931; __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 = 2874; __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 = 2931; __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 = 2874; __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 = 2931; __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 = 2874; __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 = 2931; __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; @@ -19519,7 +19767,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 = 2874; __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 = 2931; __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; @@ -19527,11 +19775,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 = 2874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2931; __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 = 2874; __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 = 2874; __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 = 2931; __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 = 2931; __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)); @@ -19539,7 +19787,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":2876 + /* "sklearn/tree/_tree.pyx":2933 * X, y, sample_weight = self._check_input(X, y, sample_weight) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -19548,7 +19796,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":2877 + /* "sklearn/tree/_tree.pyx":2934 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -19559,7 +19807,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":2878 + /* "sklearn/tree/_tree.pyx":2935 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -19571,7 +19819,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2883 + /* "sklearn/tree/_tree.pyx":2940 * cdef int init_capacity * * if tree.max_depth <= 10: # <<<<<<<<<<<<<< @@ -19581,7 +19829,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":2884 + /* "sklearn/tree/_tree.pyx":2941 * * if tree.max_depth <= 10: * init_capacity = (2 ** (tree.max_depth + 1)) - 1 # <<<<<<<<<<<<<< @@ -19593,7 +19841,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":2886 + /* "sklearn/tree/_tree.pyx":2943 * init_capacity = (2 ** (tree.max_depth + 1)) - 1 * else: * init_capacity = 2047 # <<<<<<<<<<<<<< @@ -19604,16 +19852,16 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":2888 + /* "sklearn/tree/_tree.pyx":2945 * 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 = 2888; __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 = 2945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2891 + /* "sklearn/tree/_tree.pyx":2948 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -19625,7 +19873,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":2892 + /* "sklearn/tree/_tree.pyx":2949 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth # <<<<<<<<<<<<<< @@ -19635,7 +19883,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":2893 + /* "sklearn/tree/_tree.pyx":2950 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -19645,7 +19893,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":2894 + /* "sklearn/tree/_tree.pyx":2951 * 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 # <<<<<<<<<<<<<< @@ -19655,7 +19903,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":2895 + /* "sklearn/tree/_tree.pyx":2952 * 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 # <<<<<<<<<<<<<< @@ -19665,16 +19913,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":2898 + /* "sklearn/tree/_tree.pyx":2955 * * # 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 = 2898; __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 = 2955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2905 + /* "sklearn/tree/_tree.pyx":2962 * cdef SIZE_t parent * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -19684,7 +19932,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":2906 + /* "sklearn/tree/_tree.pyx":2963 * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -19694,7 +19942,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":2912 + /* "sklearn/tree/_tree.pyx":2969 * * cdef double threshold * cdef double impurity = INFINITY # <<<<<<<<<<<<<< @@ -19703,7 +19951,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":2915 + /* "sklearn/tree/_tree.pyx":2972 * cdef SIZE_t n_constant_features * cdef bint is_leaf * cdef bint first = 1 # <<<<<<<<<<<<<< @@ -19712,7 +19960,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_first = 1; - /* "sklearn/tree/_tree.pyx":2916 + /* "sklearn/tree/_tree.pyx":2973 * cdef bint is_leaf * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -19721,7 +19969,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":2917 + /* "sklearn/tree/_tree.pyx":2974 * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -19730,27 +19978,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":2919 + /* "sklearn/tree/_tree.pyx":2976 * 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 = 2919; __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 = 2976; __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 = 2919; __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 = 2976; __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 = 2919; __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 = 2976; __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":2923 + /* "sklearn/tree/_tree.pyx":2980 * * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) # <<<<<<<<<<<<<< @@ -19759,7 +20007,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":2924 + /* "sklearn/tree/_tree.pyx":2981 * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) * if rc == -1: # <<<<<<<<<<<<<< @@ -19769,17 +20017,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":2926 + /* "sklearn/tree/_tree.pyx":2983 * if rc == -1: * # got return code -1 - out-of-memory * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2928 + /* "sklearn/tree/_tree.pyx":2985 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -19793,7 +20041,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2929 + /* "sklearn/tree/_tree.pyx":2986 * * with nogil: * while not stack.is_empty(): # <<<<<<<<<<<<<< @@ -19804,7 +20052,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":2930 + /* "sklearn/tree/_tree.pyx":2987 * with nogil: * while not stack.is_empty(): * stack.pop(&stack_record) # <<<<<<<<<<<<<< @@ -19813,7 +20061,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":2932 + /* "sklearn/tree/_tree.pyx":2989 * stack.pop(&stack_record) * * start = stack_record.start # <<<<<<<<<<<<<< @@ -19823,7 +20071,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":2933 + /* "sklearn/tree/_tree.pyx":2990 * * start = stack_record.start * end = stack_record.end # <<<<<<<<<<<<<< @@ -19833,7 +20081,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":2934 + /* "sklearn/tree/_tree.pyx":2991 * start = stack_record.start * end = stack_record.end * depth = stack_record.depth # <<<<<<<<<<<<<< @@ -19843,7 +20091,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":2935 + /* "sklearn/tree/_tree.pyx":2992 * end = stack_record.end * depth = stack_record.depth * parent = stack_record.parent # <<<<<<<<<<<<<< @@ -19853,7 +20101,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":2936 + /* "sklearn/tree/_tree.pyx":2993 * depth = stack_record.depth * parent = stack_record.parent * is_left = stack_record.is_left # <<<<<<<<<<<<<< @@ -19863,7 +20111,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":2937 + /* "sklearn/tree/_tree.pyx":2994 * parent = stack_record.parent * is_left = stack_record.is_left * impurity = stack_record.impurity # <<<<<<<<<<<<<< @@ -19873,7 +20121,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":2938 + /* "sklearn/tree/_tree.pyx":2995 * is_left = stack_record.is_left * impurity = stack_record.impurity * n_constant_features = stack_record.n_constant_features # <<<<<<<<<<<<<< @@ -19883,7 +20131,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":2940 + /* "sklearn/tree/_tree.pyx":2997 * n_constant_features = stack_record.n_constant_features * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -19892,7 +20140,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":2941 + /* "sklearn/tree/_tree.pyx":2998 * * n_node_samples = end - start * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -19901,7 +20149,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":2943 + /* "sklearn/tree/_tree.pyx":3000 * splitter.node_reset(start, end, &weighted_n_node_samples) * * is_leaf = ((depth >= max_depth) or # <<<<<<<<<<<<<< @@ -19915,7 +20163,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2944 + /* "sklearn/tree/_tree.pyx":3001 * * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or # <<<<<<<<<<<<<< @@ -19929,7 +20177,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2945 + /* "sklearn/tree/_tree.pyx":3002 * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf) or # <<<<<<<<<<<<<< @@ -19943,7 +20191,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":2946 + /* "sklearn/tree/_tree.pyx":3003 * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf) or * (weighted_n_node_samples < min_weight_leaf)) # <<<<<<<<<<<<<< @@ -19955,7 +20203,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_L13_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2948 + /* "sklearn/tree/_tree.pyx":3005 * (weighted_n_node_samples < min_weight_leaf)) * * if first: # <<<<<<<<<<<<<< @@ -19965,7 +20213,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":2949 + /* "sklearn/tree/_tree.pyx":3006 * * if first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -19974,7 +20222,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":2950 + /* "sklearn/tree/_tree.pyx":3007 * if first: * impurity = splitter.node_impurity() * first = 0 # <<<<<<<<<<<<<< @@ -19986,7 +20234,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L17:; - /* "sklearn/tree/_tree.pyx":2952 + /* "sklearn/tree/_tree.pyx":3009 * first = 0 * * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) # <<<<<<<<<<<<<< @@ -20004,7 +20252,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_L18_bool_binop_done:; __pyx_v_is_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2954 + /* "sklearn/tree/_tree.pyx":3011 * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -20014,7 +20262,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":2955 + /* "sklearn/tree/_tree.pyx":3012 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -20023,7 +20271,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_split(__pyx_v_splitter, __pyx_v_impurity, (&__pyx_v_split), (&__pyx_v_n_constant_features)); - /* "sklearn/tree/_tree.pyx":2956 + /* "sklearn/tree/_tree.pyx":3013 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< @@ -20044,7 +20292,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L20:; - /* "sklearn/tree/_tree.pyx":2958 + /* "sklearn/tree/_tree.pyx":3015 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent, is_left, is_leaf, split.feature, # <<<<<<<<<<<<<< @@ -20053,7 +20301,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":2962 + /* "sklearn/tree/_tree.pyx":3019 * weighted_n_node_samples) * * if node_id == (-1): # <<<<<<<<<<<<<< @@ -20063,7 +20311,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":2963 + /* "sklearn/tree/_tree.pyx":3020 * * if node_id == (-1): * rc = -1 # <<<<<<<<<<<<<< @@ -20072,7 +20320,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = -1; - /* "sklearn/tree/_tree.pyx":2964 + /* "sklearn/tree/_tree.pyx":3021 * if node_id == (-1): * rc = -1 * break # <<<<<<<<<<<<<< @@ -20082,7 +20330,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L12_break; } - /* "sklearn/tree/_tree.pyx":2968 + /* "sklearn/tree/_tree.pyx":3025 * # Store value for all nodes, to facilitate tree/model * # inspection and interpretation * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -20091,7 +20339,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":2970 + /* "sklearn/tree/_tree.pyx":3027 * splitter.node_value(tree.value + node_id * tree.value_stride) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -20101,7 +20349,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":2972 + /* "sklearn/tree/_tree.pyx":3029 * if not is_leaf: * # Push right child on stack * rc = stack.push(split.pos, end, depth + 1, node_id, 0, # <<<<<<<<<<<<<< @@ -20110,7 +20358,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":2974 + /* "sklearn/tree/_tree.pyx":3031 * rc = stack.push(split.pos, end, depth + 1, node_id, 0, * split.impurity_right, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -20120,7 +20368,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":2975 + /* "sklearn/tree/_tree.pyx":3032 * split.impurity_right, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -20130,7 +20378,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L12_break; } - /* "sklearn/tree/_tree.pyx":2978 + /* "sklearn/tree/_tree.pyx":3035 * * # Push left child on stack * rc = stack.push(start, split.pos, depth + 1, node_id, 1, # <<<<<<<<<<<<<< @@ -20139,7 +20387,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":2980 + /* "sklearn/tree/_tree.pyx":3037 * rc = stack.push(start, split.pos, depth + 1, node_id, 1, * split.impurity_left, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -20149,7 +20397,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":2981 + /* "sklearn/tree/_tree.pyx":3038 * split.impurity_left, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -20162,7 +20410,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":2983 + /* "sklearn/tree/_tree.pyx":3040 * break * * if depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -20172,7 +20420,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":2984 + /* "sklearn/tree/_tree.pyx":3041 * * if depth > max_depth_seen: * max_depth_seen = depth # <<<<<<<<<<<<<< @@ -20186,7 +20434,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L12_break:; - /* "sklearn/tree/_tree.pyx":2986 + /* "sklearn/tree/_tree.pyx":3043 * max_depth_seen = depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -20196,7 +20444,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":2987 + /* "sklearn/tree/_tree.pyx":3044 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -20211,7 +20459,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L28:; - /* "sklearn/tree/_tree.pyx":2989 + /* "sklearn/tree/_tree.pyx":3046 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -20221,7 +20469,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":2990 + /* "sklearn/tree/_tree.pyx":3047 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -20234,7 +20482,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_L29:; } - /* "sklearn/tree/_tree.pyx":2928 + /* "sklearn/tree/_tree.pyx":2985 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -20252,7 +20500,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } } - /* "sklearn/tree/_tree.pyx":2991 + /* "sklearn/tree/_tree.pyx":3048 * if rc >= 0: * tree.max_depth = max_depth_seen * if rc == -1: # <<<<<<<<<<<<<< @@ -20262,17 +20510,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":2992 + /* "sklearn/tree/_tree.pyx":3049 * tree.max_depth = max_depth_seen * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3049; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2869 + /* "sklearn/tree/_tree.pyx":2926 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20320,7 +20568,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":2870 + /* "sklearn/tree/_tree.pyx":2927 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -20347,12 +20595,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 = 2869; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __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 = 2869; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -20361,7 +20609,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 = 2869; __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 = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20380,18 +20628,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 = 2869; __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 = 2926; __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 = 2869; __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 = 2869; __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 = 2870; __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 = 2926; __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 = 2926; __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 = 2927; __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":2869 + /* "sklearn/tree/_tree.pyx":2926 * self.max_depth = max_depth * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20420,7 +20668,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 = 2869; __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 = 2926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20437,7 +20685,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2997 +/* "sklearn/tree/_tree.pyx":3054 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -20448,7 +20696,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":3001 + /* "sklearn/tree/_tree.pyx":3058 * """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, # <<<<<<<<<<<<<< @@ -20458,7 +20706,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":2997 + /* "sklearn/tree/_tree.pyx":3054 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -20471,7 +20719,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3016 +/* "sklearn/tree/_tree.pyx":3073 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -20518,31 +20766,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 = 3016; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __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 = 3016; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __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 = 3016; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __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 = 3016; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __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 = 3016; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3073; __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 = 3016; __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 = 3073; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -20555,21 +20803,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 = 3016; __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 = 3017; __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 = 3073; __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 = 3074; __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 = 3018; __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 = 3018; __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 = 3075; __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 = 3075; __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 = 3016; __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 = 3073; __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 = 3016; __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 = 3073; __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 */ @@ -20590,7 +20838,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":3019 + /* "sklearn/tree/_tree.pyx":3076 * SIZE_t min_samples_leaf, min_weight_leaf, * SIZE_t max_depth, SIZE_t max_leaf_nodes): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -20603,7 +20851,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":3020 + /* "sklearn/tree/_tree.pyx":3077 * SIZE_t max_depth, SIZE_t max_leaf_nodes): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -20612,7 +20860,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":3021 + /* "sklearn/tree/_tree.pyx":3078 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -20621,17 +20869,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":3022 + /* "sklearn/tree/_tree.pyx":3079 * 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 = 3022; __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 = 3079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->__pyx_base.min_weight_leaf = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":3023 + /* "sklearn/tree/_tree.pyx":3080 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -20640,7 +20888,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":3024 + /* "sklearn/tree/_tree.pyx":3081 * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes # <<<<<<<<<<<<<< @@ -20649,7 +20897,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":3016 + /* "sklearn/tree/_tree.pyx":3073 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -20668,7 +20916,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3026 +/* "sklearn/tree/_tree.pyx":3083 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20679,7 +20927,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":3027 + /* "sklearn/tree/_tree.pyx":3084 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -20733,7 +20981,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":3026 + /* "sklearn/tree/_tree.pyx":3083 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -20744,7 +20992,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 = 3026; __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 = 3083; __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); @@ -20761,7 +21009,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 = 3026; __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 = 3083; __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; @@ -20778,7 +21026,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 = 3026; __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 = 3083; __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; @@ -20790,14 +21038,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":3031 + /* "sklearn/tree/_tree.pyx":3088 * * # 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 = 3031; __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 = 3088; __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; @@ -20809,7 +21057,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 = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3088; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #if CYTHON_COMPILING_IN_CPYTHON if (likely(PyTuple_CheckExact(sequence))) { @@ -20825,17 +21073,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 = 3031; __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 = 3088; __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 = 3031; __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 = 3088; __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 = 3031; __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 = 3088; __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 = 3031; __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 = 3088; __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; @@ -20845,7 +21093,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 = 3031; __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 = 3088; __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; @@ -20853,11 +21101,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 = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3088; __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 = 3031; __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 = 3031; __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 = 3088; __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 = 3088; __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)); @@ -20865,7 +21113,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":3033 + /* "sklearn/tree/_tree.pyx":3090 * X, y, sample_weight = self._check_input(X, y, sample_weight) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -20874,7 +21122,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":3034 + /* "sklearn/tree/_tree.pyx":3091 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -20885,7 +21133,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":3035 + /* "sklearn/tree/_tree.pyx":3092 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -20897,7 +21145,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":3038 + /* "sklearn/tree/_tree.pyx":3095 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -20909,7 +21157,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":3039 + /* "sklearn/tree/_tree.pyx":3096 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes # <<<<<<<<<<<<<< @@ -20919,7 +21167,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":3040 + /* "sklearn/tree/_tree.pyx":3097 * 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 # <<<<<<<<<<<<<< @@ -20929,7 +21177,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":3041 + /* "sklearn/tree/_tree.pyx":3098 * 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 # <<<<<<<<<<<<<< @@ -20939,7 +21187,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":3042 + /* "sklearn/tree/_tree.pyx":3099 * 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 # <<<<<<<<<<<<<< @@ -20949,36 +21197,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":3045 + /* "sklearn/tree/_tree.pyx":3102 * * # 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 = 3045; __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 = 3102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3047 + /* "sklearn/tree/_tree.pyx":3104 * 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 = 3047; __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 = 3104; __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 = 3047; __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 = 3104; __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 = 3047; __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 = 3104; __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":3052 + /* "sklearn/tree/_tree.pyx":3109 * cdef PriorityHeapRecord split_node_right * * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -20988,7 +21236,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":3053 + /* "sklearn/tree/_tree.pyx":3110 * * cdef SIZE_t n_node_samples = splitter.n_samples * cdef SIZE_t max_split_nodes = max_leaf_nodes - 1 # <<<<<<<<<<<<<< @@ -20997,7 +21245,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":3055 + /* "sklearn/tree/_tree.pyx":3112 * cdef SIZE_t max_split_nodes = max_leaf_nodes - 1 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -21006,7 +21254,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":3056 + /* "sklearn/tree/_tree.pyx":3113 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -21015,7 +21263,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":3060 + /* "sklearn/tree/_tree.pyx":3117 * * # Initial capacity * cdef SIZE_t init_capacity = max_split_nodes + max_leaf_nodes # <<<<<<<<<<<<<< @@ -21024,16 +21272,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":3061 + /* "sklearn/tree/_tree.pyx":3118 * # 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 = 3061; __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 = 3118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3063 + /* "sklearn/tree/_tree.pyx":3120 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -21047,7 +21295,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3065 + /* "sklearn/tree/_tree.pyx":3122 * with nogil: * # add root to frontier * rc = self._add_split_node(splitter, tree, 0, n_node_samples, # <<<<<<<<<<<<<< @@ -21056,7 +21304,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":3068 + /* "sklearn/tree/_tree.pyx":3125 * INFINITY, IS_FIRST, IS_LEFT, NULL, 0, * &split_node_left) * if rc >= 0: # <<<<<<<<<<<<<< @@ -21066,7 +21314,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":3069 + /* "sklearn/tree/_tree.pyx":3126 * &split_node_left) * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -21079,7 +21327,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L9:; } - /* "sklearn/tree/_tree.pyx":3063 + /* "sklearn/tree/_tree.pyx":3120 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -21097,7 +21345,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":3070 + /* "sklearn/tree/_tree.pyx":3127 * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -21107,17 +21355,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":3071 + /* "sklearn/tree/_tree.pyx":3128 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3073 + /* "sklearn/tree/_tree.pyx":3130 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -21131,7 +21379,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3074 + /* "sklearn/tree/_tree.pyx":3131 * * with nogil: * while not frontier.is_empty(): # <<<<<<<<<<<<<< @@ -21142,7 +21390,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":3075 + /* "sklearn/tree/_tree.pyx":3132 * with nogil: * while not frontier.is_empty(): * frontier.pop(&record) # <<<<<<<<<<<<<< @@ -21151,7 +21399,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":3077 + /* "sklearn/tree/_tree.pyx":3134 * frontier.pop(&record) * * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -21160,7 +21408,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":3078 + /* "sklearn/tree/_tree.pyx":3135 * * node = &tree.nodes[record.node_id] * is_leaf = (record.is_leaf or max_split_nodes <= 0) # <<<<<<<<<<<<<< @@ -21178,7 +21426,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":3080 + /* "sklearn/tree/_tree.pyx":3137 * is_leaf = (record.is_leaf or max_split_nodes <= 0) * * if is_leaf: # <<<<<<<<<<<<<< @@ -21188,7 +21436,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":3082 + /* "sklearn/tree/_tree.pyx":3139 * if is_leaf: * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -21197,7 +21445,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":3083 + /* "sklearn/tree/_tree.pyx":3140 * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -21206,7 +21454,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":3084 + /* "sklearn/tree/_tree.pyx":3141 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -21215,7 +21463,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":3085 + /* "sklearn/tree/_tree.pyx":3142 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -21227,7 +21475,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3091 + /* "sklearn/tree/_tree.pyx":3148 * * # Decrement number of split nodes available * max_split_nodes -= 1 # <<<<<<<<<<<<<< @@ -21236,7 +21484,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":3094 + /* "sklearn/tree/_tree.pyx":3151 * * # Compute left split node * rc = self._add_split_node(splitter, tree, # <<<<<<<<<<<<<< @@ -21245,7 +21493,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":3100 + /* "sklearn/tree/_tree.pyx":3157 * record.depth + 1, * &split_node_left) * if rc == -1: # <<<<<<<<<<<<<< @@ -21255,7 +21503,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":3101 + /* "sklearn/tree/_tree.pyx":3158 * &split_node_left) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21265,7 +21513,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":3104 + /* "sklearn/tree/_tree.pyx":3161 * * # tree.nodes may have changed * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -21274,7 +21522,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":3107 + /* "sklearn/tree/_tree.pyx":3164 * * # Compute right split node * rc = self._add_split_node(splitter, tree, record.pos, # <<<<<<<<<<<<<< @@ -21283,7 +21531,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":3113 + /* "sklearn/tree/_tree.pyx":3170 * record.depth + 1, * &split_node_right) * if rc == -1: # <<<<<<<<<<<<<< @@ -21293,7 +21541,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":3114 + /* "sklearn/tree/_tree.pyx":3171 * &split_node_right) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21303,7 +21551,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":3117 + /* "sklearn/tree/_tree.pyx":3174 * * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -21312,7 +21560,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":3118 + /* "sklearn/tree/_tree.pyx":3175 * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -21322,7 +21570,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":3119 + /* "sklearn/tree/_tree.pyx":3176 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21332,7 +21580,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L15_break; } - /* "sklearn/tree/_tree.pyx":3121 + /* "sklearn/tree/_tree.pyx":3178 * break * * rc = _add_to_frontier(&split_node_right, frontier) # <<<<<<<<<<<<<< @@ -21341,7 +21589,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":3122 + /* "sklearn/tree/_tree.pyx":3179 * * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -21351,7 +21599,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":3123 + /* "sklearn/tree/_tree.pyx":3180 * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -21363,7 +21611,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L18:; - /* "sklearn/tree/_tree.pyx":3125 + /* "sklearn/tree/_tree.pyx":3182 * break * * if record.depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -21373,7 +21621,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":3126 + /* "sklearn/tree/_tree.pyx":3183 * * if record.depth > max_depth_seen: * max_depth_seen = record.depth # <<<<<<<<<<<<<< @@ -21388,7 +21636,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L15_break:; - /* "sklearn/tree/_tree.pyx":3128 + /* "sklearn/tree/_tree.pyx":3185 * max_depth_seen = record.depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -21398,7 +21646,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":3129 + /* "sklearn/tree/_tree.pyx":3186 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -21413,7 +21661,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L24:; - /* "sklearn/tree/_tree.pyx":3131 + /* "sklearn/tree/_tree.pyx":3188 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -21423,7 +21671,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":3132 + /* "sklearn/tree/_tree.pyx":3189 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -21436,7 +21684,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L25:; } - /* "sklearn/tree/_tree.pyx":3073 + /* "sklearn/tree/_tree.pyx":3130 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -21454,7 +21702,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":3134 + /* "sklearn/tree/_tree.pyx":3191 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -21464,17 +21712,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":3135 + /* "sklearn/tree/_tree.pyx":3192 * * 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 = 3135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3026 + /* "sklearn/tree/_tree.pyx":3083 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21522,7 +21770,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":3027 + /* "sklearn/tree/_tree.pyx":3084 * * cpdef build(self, Tree tree, object X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -21549,12 +21797,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 = 3026; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __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 = 3026; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -21563,7 +21811,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 = 3026; __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 = 3083; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -21582,18 +21830,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 = 3026; __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 = 3083; __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 = 3026; __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 = 3026; __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 = 3027; __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 = 3083; __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 = 3083; __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 = 3084; __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":3026 + /* "sklearn/tree/_tree.pyx":3083 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, object X, np.ndarray y, # <<<<<<<<<<<<<< @@ -21622,7 +21870,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 = 3026; __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 = 3083; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21639,7 +21887,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3137 +/* "sklearn/tree/_tree.pyx":3194 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -21662,7 +21910,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":3146 + /* "sklearn/tree/_tree.pyx":3203 * cdef SIZE_t node_id * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 # <<<<<<<<<<<<<< @@ -21671,7 +21919,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_constant_features = 0; - /* "sklearn/tree/_tree.pyx":3147 + /* "sklearn/tree/_tree.pyx":3204 * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -21681,7 +21929,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":3153 + /* "sklearn/tree/_tree.pyx":3210 * cdef double imp_diff * * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -21690,7 +21938,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":3155 + /* "sklearn/tree/_tree.pyx":3212 * splitter.node_reset(start, end, &weighted_n_node_samples) * * if is_first: # <<<<<<<<<<<<<< @@ -21700,7 +21948,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":3156 + /* "sklearn/tree/_tree.pyx":3213 * * if is_first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -21712,7 +21960,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3158 + /* "sklearn/tree/_tree.pyx":3215 * impurity = splitter.node_impurity() * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -21721,7 +21969,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":3159 + /* "sklearn/tree/_tree.pyx":3216 * * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or # <<<<<<<<<<<<<< @@ -21735,7 +21983,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3160 + /* "sklearn/tree/_tree.pyx":3217 * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or # <<<<<<<<<<<<<< @@ -21749,7 +21997,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3161 + /* "sklearn/tree/_tree.pyx":3218 * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or # <<<<<<<<<<<<<< @@ -21763,7 +22011,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3162 + /* "sklearn/tree/_tree.pyx":3219 * (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 # <<<<<<<<<<<<<< @@ -21777,7 +22025,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L4_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3163 + /* "sklearn/tree/_tree.pyx":3220 * (n_node_samples < 2 * self.min_samples_leaf) or * (weighted_n_node_samples < self.min_weight_leaf) or * (impurity <= MIN_IMPURITY_SPLIT)) # <<<<<<<<<<<<<< @@ -21789,7 +22037,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":3165 + /* "sklearn/tree/_tree.pyx":3222 * (impurity <= MIN_IMPURITY_SPLIT)) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -21799,7 +22047,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":3166 + /* "sklearn/tree/_tree.pyx":3223 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -21808,7 +22056,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":3167 + /* "sklearn/tree/_tree.pyx":3224 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< @@ -21829,7 +22077,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":3170 + /* "sklearn/tree/_tree.pyx":3227 * * node_id = tree._add_node(parent - tree.nodes * if parent != NULL # <<<<<<<<<<<<<< @@ -21838,7 +22086,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ if (((__pyx_v_parent != NULL) != 0)) { - /* "sklearn/tree/_tree.pyx":3169 + /* "sklearn/tree/_tree.pyx":3226 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -21848,7 +22096,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":3171 + /* "sklearn/tree/_tree.pyx":3228 * node_id = tree._add_node(parent - tree.nodes * if parent != NULL * else _TREE_UNDEFINED, # <<<<<<<<<<<<<< @@ -21858,7 +22106,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":3169 + /* "sklearn/tree/_tree.pyx":3226 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -21867,7 +22115,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":3175 + /* "sklearn/tree/_tree.pyx":3232 * split.feature, split.threshold, impurity, n_node_samples, * weighted_n_node_samples) * if node_id == (-1): # <<<<<<<<<<<<<< @@ -21877,7 +22125,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":3176 + /* "sklearn/tree/_tree.pyx":3233 * weighted_n_node_samples) * if node_id == (-1): * return -1 # <<<<<<<<<<<<<< @@ -21888,7 +22136,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3179 + /* "sklearn/tree/_tree.pyx":3236 * * # compute values also for split nodes (might become leafs later). * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -21897,7 +22145,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":3181 + /* "sklearn/tree/_tree.pyx":3238 * splitter.node_value(tree.value + node_id * tree.value_stride) * * res.node_id = node_id # <<<<<<<<<<<<<< @@ -21906,7 +22154,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":3182 + /* "sklearn/tree/_tree.pyx":3239 * * res.node_id = node_id * res.start = start # <<<<<<<<<<<<<< @@ -21915,7 +22163,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":3183 + /* "sklearn/tree/_tree.pyx":3240 * res.node_id = node_id * res.start = start * res.end = end # <<<<<<<<<<<<<< @@ -21924,7 +22172,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":3184 + /* "sklearn/tree/_tree.pyx":3241 * res.start = start * res.end = end * res.depth = depth # <<<<<<<<<<<<<< @@ -21933,7 +22181,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->depth = __pyx_v_depth; - /* "sklearn/tree/_tree.pyx":3185 + /* "sklearn/tree/_tree.pyx":3242 * res.end = end * res.depth = depth * res.impurity = impurity # <<<<<<<<<<<<<< @@ -21942,7 +22190,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":3187 + /* "sklearn/tree/_tree.pyx":3244 * res.impurity = impurity * * if not is_leaf: # <<<<<<<<<<<<<< @@ -21952,7 +22200,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":3189 + /* "sklearn/tree/_tree.pyx":3246 * if not is_leaf: * # is split node * res.pos = split.pos # <<<<<<<<<<<<<< @@ -21962,7 +22210,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":3190 + /* "sklearn/tree/_tree.pyx":3247 * # is split node * res.pos = split.pos * res.is_leaf = 0 # <<<<<<<<<<<<<< @@ -21971,7 +22219,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 0; - /* "sklearn/tree/_tree.pyx":3191 + /* "sklearn/tree/_tree.pyx":3248 * res.pos = split.pos * res.is_leaf = 0 * res.improvement = split.improvement # <<<<<<<<<<<<<< @@ -21981,7 +22229,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":3192 + /* "sklearn/tree/_tree.pyx":3249 * res.is_leaf = 0 * res.improvement = split.improvement * res.impurity_left = split.impurity_left # <<<<<<<<<<<<<< @@ -21991,7 +22239,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":3193 + /* "sklearn/tree/_tree.pyx":3250 * res.improvement = split.improvement * res.impurity_left = split.impurity_left * res.impurity_right = split.impurity_right # <<<<<<<<<<<<<< @@ -22004,7 +22252,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } /*else*/ { - /* "sklearn/tree/_tree.pyx":3197 + /* "sklearn/tree/_tree.pyx":3254 * else: * # is leaf => 0 improvement * res.pos = end # <<<<<<<<<<<<<< @@ -22013,7 +22261,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":3198 + /* "sklearn/tree/_tree.pyx":3255 * # is leaf => 0 improvement * res.pos = end * res.is_leaf = 1 # <<<<<<<<<<<<<< @@ -22022,7 +22270,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 1; - /* "sklearn/tree/_tree.pyx":3199 + /* "sklearn/tree/_tree.pyx":3256 * res.pos = end * res.is_leaf = 1 * res.improvement = 0.0 # <<<<<<<<<<<<<< @@ -22031,7 +22279,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->improvement = 0.0; - /* "sklearn/tree/_tree.pyx":3200 + /* "sklearn/tree/_tree.pyx":3257 * res.is_leaf = 1 * res.improvement = 0.0 * res.impurity_left = impurity # <<<<<<<<<<<<<< @@ -22040,7 +22288,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":3201 + /* "sklearn/tree/_tree.pyx":3258 * res.improvement = 0.0 * res.impurity_left = impurity * res.impurity_right = impurity # <<<<<<<<<<<<<< @@ -22051,7 +22299,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L13:; - /* "sklearn/tree/_tree.pyx":3203 + /* "sklearn/tree/_tree.pyx":3260 * res.impurity_right = impurity * * return 0 # <<<<<<<<<<<<<< @@ -22061,7 +22309,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3137 + /* "sklearn/tree/_tree.pyx":3194 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -22074,7 +22322,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3269 +/* "sklearn/tree/_tree.pyx":3326 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -22106,7 +22354,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":3271 + /* "sklearn/tree/_tree.pyx":3328 * def __get__(self): * # it's small; copy for memory safety * return sizet_ptr_to_ndarray(self.n_classes, self.n_outputs).copy() # <<<<<<<<<<<<<< @@ -22114,9 +22362,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 = 3271; __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 = 3328; __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 = 3271; __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 = 3328; __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; @@ -22130,10 +22378,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 = 3271; __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 = 3328; __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 = 3271; __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 = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22141,7 +22389,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":3269 + /* "sklearn/tree/_tree.pyx":3326 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -22162,7 +22410,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3274 +/* "sklearn/tree/_tree.pyx":3331 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -22193,7 +22441,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":3275 + /* "sklearn/tree/_tree.pyx":3332 * property children_left: * def __get__(self): * return self._get_node_ndarray()['left_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -22201,19 +22449,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 = 3275; __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 = 3332; __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 = 3275; __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 = 3332; __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 = 3275; __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 = 3332; __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":3274 + /* "sklearn/tree/_tree.pyx":3331 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -22233,7 +22481,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3278 +/* "sklearn/tree/_tree.pyx":3335 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -22264,7 +22512,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":3279 + /* "sklearn/tree/_tree.pyx":3336 * property children_right: * def __get__(self): * return self._get_node_ndarray()['right_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -22272,19 +22520,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 = 3279; __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 = 3336; __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 = 3279; __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 = 3336; __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 = 3279; __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 = 3336; __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":3278 + /* "sklearn/tree/_tree.pyx":3335 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -22304,7 +22552,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3282 +/* "sklearn/tree/_tree.pyx":3339 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -22335,7 +22583,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":3283 + /* "sklearn/tree/_tree.pyx":3340 * property feature: * def __get__(self): * return self._get_node_ndarray()['feature'][:self.node_count] # <<<<<<<<<<<<<< @@ -22343,19 +22591,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 = 3283; __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 = 3340; __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 = 3283; __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 = 3340; __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 = 3283; __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 = 3340; __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":3282 + /* "sklearn/tree/_tree.pyx":3339 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -22375,7 +22623,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3286 +/* "sklearn/tree/_tree.pyx":3343 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -22406,7 +22654,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":3287 + /* "sklearn/tree/_tree.pyx":3344 * property threshold: * def __get__(self): * return self._get_node_ndarray()['threshold'][:self.node_count] # <<<<<<<<<<<<<< @@ -22414,19 +22662,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 = 3287; __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 = 3344; __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 = 3287; __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 = 3344; __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 = 3287; __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 = 3344; __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":3286 + /* "sklearn/tree/_tree.pyx":3343 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -22446,7 +22694,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3290 +/* "sklearn/tree/_tree.pyx":3347 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -22477,7 +22725,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":3291 + /* "sklearn/tree/_tree.pyx":3348 * property impurity: * def __get__(self): * return self._get_node_ndarray()['impurity'][:self.node_count] # <<<<<<<<<<<<<< @@ -22485,19 +22733,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 = 3291; __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 = 3348; __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 = 3291; __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 = 3348; __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 = 3291; __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 = 3348; __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":3290 + /* "sklearn/tree/_tree.pyx":3347 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -22517,7 +22765,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3294 +/* "sklearn/tree/_tree.pyx":3351 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22548,7 +22796,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":3295 + /* "sklearn/tree/_tree.pyx":3352 * property n_node_samples: * def __get__(self): * return self._get_node_ndarray()['n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -22556,19 +22804,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 = 3295; __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 = 3352; __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 = 3295; __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 = 3352; __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 = 3295; __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 = 3352; __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":3294 + /* "sklearn/tree/_tree.pyx":3351 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22588,7 +22836,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3298 +/* "sklearn/tree/_tree.pyx":3355 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22619,7 +22867,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":3299 + /* "sklearn/tree/_tree.pyx":3356 * property weighted_n_node_samples: * def __get__(self): * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -22627,19 +22875,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 = 3299; __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 = 3356; __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 = 3299; __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 = 3356; __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 = 3299; __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 = 3356; __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":3298 + /* "sklearn/tree/_tree.pyx":3355 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -22659,7 +22907,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3302 +/* "sklearn/tree/_tree.pyx":3359 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -22690,7 +22938,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":3303 + /* "sklearn/tree/_tree.pyx":3360 * property value: * def __get__(self): * return self._get_value_ndarray()[:self.node_count] # <<<<<<<<<<<<<< @@ -22698,16 +22946,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 = 3303; __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 = 3360; __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 = 3303; __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 = 3360; __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":3302 + /* "sklearn/tree/_tree.pyx":3359 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -22727,7 +22975,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3305 +/* "sklearn/tree/_tree.pyx":3362 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -22768,16 +23016,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 = 3305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __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 = 3305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3362; __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 = 3305; __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 = 3362; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -22786,19 +23034,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 = 3305; __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 = 3362; __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 = 3306; __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 = 3363; __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 = 3305; __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 = 3362; __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 = 3305; __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 = 3362; __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 */ @@ -22833,11 +23081,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 = 3305; __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 = 3362; __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":3309 + /* "sklearn/tree/_tree.pyx":3366 * """Constructor.""" * # Input/Output layout * self.n_features = n_features # <<<<<<<<<<<<<< @@ -22846,7 +23094,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":3310 + /* "sklearn/tree/_tree.pyx":3367 * # Input/Output layout * self.n_features = n_features * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -22855,7 +23103,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":3311 + /* "sklearn/tree/_tree.pyx":3368 * self.n_features = n_features * self.n_outputs = n_outputs * self.n_classes = NULL # <<<<<<<<<<<<<< @@ -22864,25 +23112,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":3312 + /* "sklearn/tree/_tree.pyx":3369 * 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 = 3312; __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 = 3369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3314 + /* "sklearn/tree/_tree.pyx":3371 * 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 = 3314; __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 = 3371; __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 = 3314; __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 = 3371; __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; @@ -22896,25 +23144,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 = 3314; __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 = 3371; __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 = 3314; __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 = 3371; __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 = 3314; __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 = 3371; __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 = 3314; __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 = 3371; __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":3315 + /* "sklearn/tree/_tree.pyx":3372 * * self.max_n_classes = np.max(n_classes) * self.value_stride = n_outputs * self.max_n_classes # <<<<<<<<<<<<<< @@ -22923,7 +23171,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":3318 + /* "sklearn/tree/_tree.pyx":3375 * * cdef SIZE_t k * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -22934,7 +23182,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":3319 + /* "sklearn/tree/_tree.pyx":3376 * cdef SIZE_t k * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -22945,7 +23193,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":3322 + /* "sklearn/tree/_tree.pyx":3379 * * # Inner structures * self.max_depth = 0 # <<<<<<<<<<<<<< @@ -22954,7 +23202,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":3323 + /* "sklearn/tree/_tree.pyx":3380 * # Inner structures * self.max_depth = 0 * self.node_count = 0 # <<<<<<<<<<<<<< @@ -22963,7 +23211,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":3324 + /* "sklearn/tree/_tree.pyx":3381 * self.max_depth = 0 * self.node_count = 0 * self.capacity = 0 # <<<<<<<<<<<<<< @@ -22972,7 +23220,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->capacity = 0; - /* "sklearn/tree/_tree.pyx":3325 + /* "sklearn/tree/_tree.pyx":3382 * self.node_count = 0 * self.capacity = 0 * self.value = NULL # <<<<<<<<<<<<<< @@ -22981,7 +23229,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value = NULL; - /* "sklearn/tree/_tree.pyx":3326 + /* "sklearn/tree/_tree.pyx":3383 * self.capacity = 0 * self.value = NULL * self.nodes = NULL # <<<<<<<<<<<<<< @@ -22990,7 +23238,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->nodes = NULL; - /* "sklearn/tree/_tree.pyx":3305 + /* "sklearn/tree/_tree.pyx":3362 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -23020,7 +23268,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3328 +/* "sklearn/tree/_tree.pyx":3385 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23043,7 +23291,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":3331 + /* "sklearn/tree/_tree.pyx":3388 * """Destructor.""" * # Free all inner structures * free(self.n_classes) # <<<<<<<<<<<<<< @@ -23052,7 +23300,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":3332 + /* "sklearn/tree/_tree.pyx":3389 * # Free all inner structures * free(self.n_classes) * free(self.value) # <<<<<<<<<<<<<< @@ -23061,7 +23309,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":3333 + /* "sklearn/tree/_tree.pyx":3390 * free(self.n_classes) * free(self.value) * free(self.nodes) # <<<<<<<<<<<<<< @@ -23070,7 +23318,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":3328 + /* "sklearn/tree/_tree.pyx":3385 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -23082,7 +23330,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":3335 +/* "sklearn/tree/_tree.pyx":3392 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -23116,7 +23364,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":3337 + /* "sklearn/tree/_tree.pyx":3394 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< @@ -23124,37 +23372,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 = 3337; __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 = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3338 + /* "sklearn/tree/_tree.pyx":3395 * """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 = 3338; __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 = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":3339 + /* "sklearn/tree/_tree.pyx":3396 * 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 = 3339; __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 = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3337 + /* "sklearn/tree/_tree.pyx":3394 * 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 = 3337; __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 = 3394; __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); @@ -23166,14 +23414,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":3339 + /* "sklearn/tree/_tree.pyx":3396 * 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 = 3339; __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 = 3396; __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))) { @@ -23186,22 +23434,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 = 3339; __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 = 3396; __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 = 3339; __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 = 3396; __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":3337 + /* "sklearn/tree/_tree.pyx":3394 * 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 = 3337; __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 = 3394; __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))); @@ -23216,7 +23464,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":3335 + /* "sklearn/tree/_tree.pyx":3392 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -23238,7 +23486,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3341 +/* "sklearn/tree/_tree.pyx":3398 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -23270,55 +23518,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":3343 + /* "sklearn/tree/_tree.pyx":3400 * 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 = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __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":3344 + /* "sklearn/tree/_tree.pyx":3401 * """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 = 3344; __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 = 3401; __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 = 3344; __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 = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3345 + /* "sklearn/tree/_tree.pyx":3402 * 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 = 3345; __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 = 3402; __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 = 3345; __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 = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3346 + /* "sklearn/tree/_tree.pyx":3403 * 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 = 3346; __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 = 3403; __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 = 3346; __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 = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3347 + /* "sklearn/tree/_tree.pyx":3404 * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() * return d # <<<<<<<<<<<<<< @@ -23330,7 +23578,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":3341 + /* "sklearn/tree/_tree.pyx":3398 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -23350,7 +23598,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3349 +/* "sklearn/tree/_tree.pyx":3406 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -23395,101 +23643,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":3351 + /* "sklearn/tree/_tree.pyx":3408 * 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 = 3351; __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 = 3408; __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 = 3351; __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 = 3408; __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":3353 + /* "sklearn/tree/_tree.pyx":3410 * 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 = 3353; __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 = 3410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":3354 + /* "sklearn/tree/_tree.pyx":3411 * * 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 = 3354; __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 = 3411; __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 = 3354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3357 + /* "sklearn/tree/_tree.pyx":3414 * '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 = 3357; __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 = 3414; __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":3358 + /* "sklearn/tree/_tree.pyx":3415 * * 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 = 3358; __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 = 3415; __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":3360 + /* "sklearn/tree/_tree.pyx":3417 * 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 = 3360; __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 = 3417; __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 = 3360; __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 = 3417; __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 = 3360; __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 = 3417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3361 + /* "sklearn/tree/_tree.pyx":3418 * * 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 = 3361; __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 = 3418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":3360 + /* "sklearn/tree/_tree.pyx":3417 * 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 = 3360; __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 = 3417; __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); @@ -23503,18 +23751,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":3362 + /* "sklearn/tree/_tree.pyx":3419 * 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 = 3362; __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 = 3419; __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 = 3362; __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 = 3419; __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 = 3362; __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 = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_3) { } else { @@ -23522,21 +23770,21 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3363 + /* "sklearn/tree/_tree.pyx":3420 * 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 = 3363; __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 = 3420; __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 = 3363; __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 = 3420; __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 = 3363; __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 = 3420; __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 = 3363; __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 = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) { } else { @@ -23544,19 +23792,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3364 + /* "sklearn/tree/_tree.pyx":3421 * 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 = 3364; __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 = 3421; __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 = 3364; __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 = 3421; __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 = 3364; __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 = 3421; __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) { @@ -23565,18 +23813,18 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3365 + /* "sklearn/tree/_tree.pyx":3422 * 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 = 3365; __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 = 3422; __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 = 3365; __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 = 3422; __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 = 3365; __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 = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { } else { @@ -23584,19 +23832,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3366 + /* "sklearn/tree/_tree.pyx":3423 * 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 = 3366; __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 = 3423; __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 = 3366; __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 = 3423; __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 = 3366; __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 = 3423; __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) { @@ -23605,60 +23853,60 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx goto __pyx_L5_bool_binop_done; } - /* "sklearn/tree/_tree.pyx":3367 + /* "sklearn/tree/_tree.pyx":3424 * 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 = 3367; __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 = 3424; __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 = 3367; __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 = 3424; __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 = 3367; __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 = 3424; __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 = 3367; __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 = 3424; __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 = 3367; __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 = 3424; __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":3368 + /* "sklearn/tree/_tree.pyx":3425 * 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 = 3368; __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 = 3425; __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 = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3370 + /* "sklearn/tree/_tree.pyx":3427 * 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 = 3370; __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 = 3427; __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 = 3370; __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 = 3427; __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 = 3370; __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 = 3427; __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":3371 + /* "sklearn/tree/_tree.pyx":3428 * * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: # <<<<<<<<<<<<<< @@ -23671,32 +23919,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":3372 + /* "sklearn/tree/_tree.pyx":3429 * 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 = 3372; __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 = 3429; __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 = 3372; __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 = 3429; __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 = 3372; __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 = 3429; __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 = 3372; __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 = 3429; __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 = 3372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3373 + /* "sklearn/tree/_tree.pyx":3430 * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) * nodes = memcpy(self.nodes, ( node_ndarray).data, # <<<<<<<<<<<<<< @@ -23705,7 +23953,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":3375 + /* "sklearn/tree/_tree.pyx":3432 * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) * value = memcpy(self.value, ( value_ndarray).data, # <<<<<<<<<<<<<< @@ -23714,7 +23962,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":3349 + /* "sklearn/tree/_tree.pyx":3406 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -23741,7 +23989,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3378 +/* "sklearn/tree/_tree.pyx":3435 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -23759,7 +24007,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":3381 + /* "sklearn/tree/_tree.pyx":3438 * """Resize all inner arrays to `capacity`, if `capacity` == -1, then * double the size of the inner arrays.""" * if self._resize_c(capacity) != 0: # <<<<<<<<<<<<<< @@ -23772,17 +24020,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":3382 + /* "sklearn/tree/_tree.pyx":3439 * 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 = 3382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3378 + /* "sklearn/tree/_tree.pyx":3435 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -23798,7 +24046,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":3386 +/* "sklearn/tree/_tree.pyx":3443 * # 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: # <<<<<<<<<<<<<< @@ -23818,7 +24066,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } } - /* "sklearn/tree/_tree.pyx":3388 + /* "sklearn/tree/_tree.pyx":3445 * 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: # <<<<<<<<<<<<<< @@ -23836,7 +24084,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":3389 + /* "sklearn/tree/_tree.pyx":3446 * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: * return 0 # <<<<<<<<<<<<<< @@ -23847,7 +24095,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3391 + /* "sklearn/tree/_tree.pyx":3448 * return 0 * * if capacity == (-1): # <<<<<<<<<<<<<< @@ -23857,7 +24105,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":3392 + /* "sklearn/tree/_tree.pyx":3449 * * if capacity == (-1): * if self.capacity == 0: # <<<<<<<<<<<<<< @@ -23867,7 +24115,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":3393 + /* "sklearn/tree/_tree.pyx":3450 * if capacity == (-1): * if self.capacity == 0: * capacity = 3 # default initial value # <<<<<<<<<<<<<< @@ -23879,7 +24127,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":3395 + /* "sklearn/tree/_tree.pyx":3452 * capacity = 3 # default initial value * else: * capacity = 2 * self.capacity # <<<<<<<<<<<<<< @@ -23893,7 +24141,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":3398 + /* "sklearn/tree/_tree.pyx":3455 * * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) # <<<<<<<<<<<<<< @@ -23902,7 +24150,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":3399 + /* "sklearn/tree/_tree.pyx":3456 * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -23912,7 +24160,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":3400 + /* "sklearn/tree/_tree.pyx":3457 * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -23923,7 +24171,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3401 + /* "sklearn/tree/_tree.pyx":3458 * if ptr == NULL: * return -1 * self.nodes = ptr # <<<<<<<<<<<<<< @@ -23932,7 +24180,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":3402 + /* "sklearn/tree/_tree.pyx":3459 * return -1 * self.nodes = ptr * ptr = realloc(self.value, # <<<<<<<<<<<<<< @@ -23941,7 +24189,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":3404 + /* "sklearn/tree/_tree.pyx":3461 * ptr = realloc(self.value, * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -23951,7 +24199,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":3405 + /* "sklearn/tree/_tree.pyx":3462 * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -23962,7 +24210,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":3406 + /* "sklearn/tree/_tree.pyx":3463 * if ptr == NULL: * return -1 * self.value = ptr # <<<<<<<<<<<<<< @@ -23971,7 +24219,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":3409 + /* "sklearn/tree/_tree.pyx":3466 * * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: # <<<<<<<<<<<<<< @@ -23981,7 +24229,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":3410 + /* "sklearn/tree/_tree.pyx":3467 * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: * memset((self.value + self.capacity * self.value_stride), 0, # <<<<<<<<<<<<<< @@ -23993,7 +24241,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L10:; - /* "sklearn/tree/_tree.pyx":3415 + /* "sklearn/tree/_tree.pyx":3472 * * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: # <<<<<<<<<<<<<< @@ -24003,7 +24251,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":3416 + /* "sklearn/tree/_tree.pyx":3473 * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: * self.node_count = capacity # <<<<<<<<<<<<<< @@ -24015,7 +24263,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L11:; - /* "sklearn/tree/_tree.pyx":3418 + /* "sklearn/tree/_tree.pyx":3475 * self.node_count = capacity * * self.capacity = capacity # <<<<<<<<<<<<<< @@ -24024,7 +24272,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":3419 + /* "sklearn/tree/_tree.pyx":3476 * * self.capacity = capacity * return 0 # <<<<<<<<<<<<<< @@ -24034,7 +24282,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":3386 + /* "sklearn/tree/_tree.pyx":3443 * # 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: # <<<<<<<<<<<<<< @@ -24047,7 +24295,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3421 +/* "sklearn/tree/_tree.pyx":3478 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -24062,7 +24310,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":3430 + /* "sklearn/tree/_tree.pyx":3487 * Returns (size_t)(-1) on error. * """ * cdef SIZE_t node_id = self.node_count # <<<<<<<<<<<<<< @@ -24072,7 +24320,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":3432 + /* "sklearn/tree/_tree.pyx":3489 * cdef SIZE_t node_id = self.node_count * * if node_id >= self.capacity: # <<<<<<<<<<<<<< @@ -24082,7 +24330,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":3433 + /* "sklearn/tree/_tree.pyx":3490 * * if node_id >= self.capacity: * if self._resize_c() != 0: # <<<<<<<<<<<<<< @@ -24092,7 +24340,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":3434 + /* "sklearn/tree/_tree.pyx":3491 * if node_id >= self.capacity: * if self._resize_c() != 0: * return (-1) # <<<<<<<<<<<<<< @@ -24106,7 +24354,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3436 + /* "sklearn/tree/_tree.pyx":3493 * return (-1) * * cdef Node* node = &self.nodes[node_id] # <<<<<<<<<<<<<< @@ -24115,7 +24363,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":3437 + /* "sklearn/tree/_tree.pyx":3494 * * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity # <<<<<<<<<<<<<< @@ -24124,7 +24372,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":3438 + /* "sklearn/tree/_tree.pyx":3495 * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity * node.n_node_samples = n_node_samples # <<<<<<<<<<<<<< @@ -24133,7 +24381,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":3439 + /* "sklearn/tree/_tree.pyx":3496 * node.impurity = impurity * node.n_node_samples = n_node_samples * node.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -24142,7 +24390,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":3441 + /* "sklearn/tree/_tree.pyx":3498 * node.weighted_n_node_samples = weighted_n_node_samples * * if parent != _TREE_UNDEFINED: # <<<<<<<<<<<<<< @@ -24152,7 +24400,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":3442 + /* "sklearn/tree/_tree.pyx":3499 * * if parent != _TREE_UNDEFINED: * if is_left: # <<<<<<<<<<<<<< @@ -24162,7 +24410,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":3443 + /* "sklearn/tree/_tree.pyx":3500 * if parent != _TREE_UNDEFINED: * if is_left: * self.nodes[parent].left_child = node_id # <<<<<<<<<<<<<< @@ -24174,7 +24422,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3445 + /* "sklearn/tree/_tree.pyx":3502 * self.nodes[parent].left_child = node_id * else: * self.nodes[parent].right_child = node_id # <<<<<<<<<<<<<< @@ -24188,7 +24436,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":3447 + /* "sklearn/tree/_tree.pyx":3504 * self.nodes[parent].right_child = node_id * * if is_leaf: # <<<<<<<<<<<<<< @@ -24198,7 +24446,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":3448 + /* "sklearn/tree/_tree.pyx":3505 * * if is_leaf: * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -24207,7 +24455,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":3449 + /* "sklearn/tree/_tree.pyx":3506 * if is_leaf: * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -24216,7 +24464,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":3450 + /* "sklearn/tree/_tree.pyx":3507 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -24225,7 +24473,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":3451 + /* "sklearn/tree/_tree.pyx":3508 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -24237,7 +24485,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3455 + /* "sklearn/tree/_tree.pyx":3512 * else: * # left_child and right_child will be set later * node.feature = feature # <<<<<<<<<<<<<< @@ -24246,7 +24494,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":3456 + /* "sklearn/tree/_tree.pyx":3513 * # left_child and right_child will be set later * node.feature = feature * node.threshold = threshold # <<<<<<<<<<<<<< @@ -24257,7 +24505,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":3458 + /* "sklearn/tree/_tree.pyx":3515 * node.threshold = threshold * * self.node_count += 1 # <<<<<<<<<<<<<< @@ -24266,7 +24514,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":3460 + /* "sklearn/tree/_tree.pyx":3517 * self.node_count += 1 * * return node_id # <<<<<<<<<<<<<< @@ -24276,7 +24524,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":3421 + /* "sklearn/tree/_tree.pyx":3478 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -24289,7 +24537,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3462 +/* "sklearn/tree/_tree.pyx":3519 * return node_id * * cpdef np.ndarray predict(self, object X): # <<<<<<<<<<<<<< @@ -24318,7 +24566,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 = 3462; __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 = 3519; __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)); @@ -24334,21 +24582,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 = 3462; __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 = 3519; __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 = 3462; __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 = 3519; __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 = 3462; __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 = 3519; __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 = 3462; __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 = 3519; __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; @@ -24357,30 +24605,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":3464 + /* "sklearn/tree/_tree.pyx":3521 * 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 = 3464; __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 = 3521; __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 = 3464; __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 = 3521; __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 = 3464; __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 = 3521; __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 = 3464; __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 = 3521; __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 = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __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 = 3464; __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 = 3464; __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 = 3464; __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 = 3521; __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 = 3521; __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 = 3521; __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; @@ -24388,7 +24636,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":3466 + /* "sklearn/tree/_tree.pyx":3523 * out = self._get_value_ndarray().take(self.apply(X), axis=0, * mode='clip') * if self.n_outputs == 1: # <<<<<<<<<<<<<< @@ -24398,21 +24646,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":3467 + /* "sklearn/tree/_tree.pyx":3524 * 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 = 3467; __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 = 3524; __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 = 3467; __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 = 3524; __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 = 3467; __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 = 3524; __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 = 3467; __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 = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_7 = 0; @@ -24426,7 +24674,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 = 3467; __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 = 3524; __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; @@ -24437,7 +24685,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 = 3467; __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 = 3524; __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; @@ -24447,7 +24695,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3468 + /* "sklearn/tree/_tree.pyx":3525 * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) * return out # <<<<<<<<<<<<<< @@ -24455,12 +24703,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 = 3468; __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 = 3525; __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":3462 + /* "sklearn/tree/_tree.pyx":3519 * return node_id * * cpdef np.ndarray predict(self, object X): # <<<<<<<<<<<<<< @@ -24508,7 +24756,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 = 3462; __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 = 3519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24525,7 +24773,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3470 +/* "sklearn/tree/_tree.pyx":3527 * return out * * cpdef np.ndarray apply(self, object X): # <<<<<<<<<<<<<< @@ -24551,7 +24799,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 = 3470; __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 = 3527; __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)); @@ -24567,21 +24815,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 = 3470; __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 = 3527; __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 = 3470; __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 = 3527; __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 = 3470; __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 = 3527; __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 = 3470; __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 = 3527; __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; @@ -24590,14 +24838,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":3472 + /* "sklearn/tree/_tree.pyx":3529 * 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 = 3472; __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 = 3529; __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))) { @@ -24610,25 +24858,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 = 3472; __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 = 3529; __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 = 3472; __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 = 3529; __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 = 3472; __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 = 3529; __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 = 3472; __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 = 3529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":3473 + /* "sklearn/tree/_tree.pyx":3530 * """Finds the terminal region (=leaf node) for each sample in X.""" * if issparse(X): * return self._apply_sparse_csr(X) # <<<<<<<<<<<<<< @@ -24636,7 +24884,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 = 3473; __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 = 3530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -24644,7 +24892,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } /*else*/ { - /* "sklearn/tree/_tree.pyx":3475 + /* "sklearn/tree/_tree.pyx":3532 * return self._apply_sparse_csr(X) * else: * return self._apply_dense(X) # <<<<<<<<<<<<<< @@ -24652,14 +24900,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 = 3475; __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 = 3532; __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":3470 + /* "sklearn/tree/_tree.pyx":3527 * return out * * cpdef np.ndarray apply(self, object X): # <<<<<<<<<<<<<< @@ -24705,7 +24953,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 = 3470; __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 = 3527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -24722,7 +24970,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3478 +/* "sklearn/tree/_tree.pyx":3535 * * * cdef inline np.ndarray _apply_dense(self, object X): # <<<<<<<<<<<<<< @@ -24764,7 +25012,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":3482 + /* "sklearn/tree/_tree.pyx":3539 * * # Check input * if not isinstance(X, np.ndarray): # <<<<<<<<<<<<<< @@ -24775,93 +25023,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":3484 + /* "sklearn/tree/_tree.pyx":3541 * 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 = 3484; __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 = 3541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":3483 + /* "sklearn/tree/_tree.pyx":3540 * # 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 = 3483; __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 = 3540; __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 = 3483; __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 = 3540; __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 = 3483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3486 + /* "sklearn/tree/_tree.pyx":3543 * % 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 = 3486; __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 = 3543; __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 = 3486; __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 = 3543; __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 = 3486; __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 = 3543; __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 = 3486; __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 = 3543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":3487 + /* "sklearn/tree/_tree.pyx":3544 * * 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 = 3487; __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 = 3544; __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 = 3487; __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 = 3544; __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 = 3487; __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 = 3544; __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 = 3487; __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 = 3544; __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 = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3490 + /* "sklearn/tree/_tree.pyx":3547 * * # 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 = 3490; __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 = 3547; __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":3491 + /* "sklearn/tree/_tree.pyx":3548 * # Extract input * cdef np.ndarray X_ndarray = X * cdef DTYPE_t* X_ptr = X_ndarray.data # <<<<<<<<<<<<<< @@ -24870,107 +25118,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":3492 + /* "sklearn/tree/_tree.pyx":3549 * 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 = 3492; __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 = 3549; __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 = 3492; __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 = 3549; __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 = 3492; __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 = 3549; __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 = 3492; __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 = 3549; __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 = 3492; __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 = 3549; __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":3493 + /* "sklearn/tree/_tree.pyx":3550 * 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 = 3493; __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 = 3550; __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 = 3493; __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 = 3550; __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 = 3493; __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 = 3550; __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 = 3493; __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 = 3550; __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 = 3493; __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 = 3550; __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":3494 + /* "sklearn/tree/_tree.pyx":3551 * 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 = 3494; __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 = 3551; __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 = 3494; __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 = 3551; __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 = 3494; __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 = 3551; __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":3497 + /* "sklearn/tree/_tree.pyx":3554 * * # 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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __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 = 3554; __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 = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3554; __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]; } } @@ -24978,7 +25226,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":3498 + /* "sklearn/tree/_tree.pyx":3555 * # Initialize output * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) * cdef SIZE_t* out_ptr = out.data # <<<<<<<<<<<<<< @@ -24987,7 +25235,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":3501 + /* "sklearn/tree/_tree.pyx":3558 * * # Initialize auxiliary data-structure * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -24996,7 +25244,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":3502 + /* "sklearn/tree/_tree.pyx":3559 * # Initialize auxiliary data-structure * cdef Node* node = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -25005,7 +25253,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":3504 + /* "sklearn/tree/_tree.pyx":3561 * cdef SIZE_t i = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -25019,7 +25267,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3505 + /* "sklearn/tree/_tree.pyx":3562 * * with nogil: * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -25030,7 +25278,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":3506 + /* "sklearn/tree/_tree.pyx":3563 * with nogil: * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -25040,7 +25288,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":3508 + /* "sklearn/tree/_tree.pyx":3565 * node = self.nodes * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -25051,7 +25299,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":3511 + /* "sklearn/tree/_tree.pyx":3568 * # ... and node.right_child != _TREE_LEAF: * if X_ptr[X_sample_stride * i + * X_fx_stride * node.feature] <= node.threshold: # <<<<<<<<<<<<<< @@ -25061,7 +25309,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":3512 + /* "sklearn/tree/_tree.pyx":3569 * if X_ptr[X_sample_stride * i + * X_fx_stride * node.feature] <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -25073,7 +25321,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } /*else*/ { - /* "sklearn/tree/_tree.pyx":3514 + /* "sklearn/tree/_tree.pyx":3571 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -25085,7 +25333,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ __pyx_L12:; } - /* "sklearn/tree/_tree.pyx":3516 + /* "sklearn/tree/_tree.pyx":3573 * node = &self.nodes[node.right_child] * * out_ptr[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -25096,7 +25344,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } } - /* "sklearn/tree/_tree.pyx":3504 + /* "sklearn/tree/_tree.pyx":3561 * cdef SIZE_t i = 0 * * with nogil: # <<<<<<<<<<<<<< @@ -25114,7 +25362,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ } } - /* "sklearn/tree/_tree.pyx":3518 + /* "sklearn/tree/_tree.pyx":3575 * out_ptr[i] = (node - self.nodes) # node offset * * return out # <<<<<<<<<<<<<< @@ -25126,7 +25374,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":3478 + /* "sklearn/tree/_tree.pyx":3535 * * * cdef inline np.ndarray _apply_dense(self, object X): # <<<<<<<<<<<<<< @@ -25158,7 +25406,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_dense(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3520 +/* "sklearn/tree/_tree.pyx":3577 * return out * * cdef inline np.ndarray _apply_sparse_csr(self, object X): # <<<<<<<<<<<<<< @@ -25230,109 +25478,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":3525 + /* "sklearn/tree/_tree.pyx":3582 * """ * # 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 = 3525; __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 = 3582; __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 = 3525; __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 = 3582; __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":3527 + /* "sklearn/tree/_tree.pyx":3584 * 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 = 3527; __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 = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3526 + /* "sklearn/tree/_tree.pyx":3583 * # 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 = 3526; __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 = 3583; __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 = 3526; __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 = 3583; __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 = 3526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3529 + /* "sklearn/tree/_tree.pyx":3586 * % 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 = 3529; __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 = 3586; __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 = 3529; __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 = 3586; __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 = 3529; __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 = 3586; __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 = 3529; __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 = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":3530 + /* "sklearn/tree/_tree.pyx":3587 * * 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 = 3530; __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 = 3587; __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 = 3530; __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 = 3587; __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 = 3530; __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 = 3587; __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 = 3530; __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 = 3587; __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 = 3530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3533 + /* "sklearn/tree/_tree.pyx":3590 * * # 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 = 3533; __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 = 3590; __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 = 3533; __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 = 3590; __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 = 3533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __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]; } } @@ -25340,22 +25588,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":3534 + /* "sklearn/tree/_tree.pyx":3591 * # 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 = 3534; __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 = 3591; __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 = 3534; __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 = 3591; __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 = 3534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3591; __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]; } } @@ -25363,22 +25611,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":3535 + /* "sklearn/tree/_tree.pyx":3592 * 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 = 3535; __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 = 3592; __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 = 3535; __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 = 3592; __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 = 3535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __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]; } } @@ -25386,7 +25634,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":3537 + /* "sklearn/tree/_tree.pyx":3594 * cdef np.ndarray[ndim=1, dtype=INT32_t] X_indptr_ndarray = X.indptr * * cdef DTYPE_t* X_data = X_data_ndarray.data # <<<<<<<<<<<<<< @@ -25395,7 +25643,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":3538 + /* "sklearn/tree/_tree.pyx":3595 * * cdef DTYPE_t* X_data = X_data_ndarray.data * cdef INT32_t* X_indices = X_indices_ndarray.data # <<<<<<<<<<<<<< @@ -25404,7 +25652,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":3539 + /* "sklearn/tree/_tree.pyx":3596 * 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 # <<<<<<<<<<<<<< @@ -25413,99 +25661,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":3541 + /* "sklearn/tree/_tree.pyx":3598 * 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 = 3541; __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 = 3598; __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 = 3541; __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 = 3598; __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 = 3541; __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 = 3598; __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":3542 + /* "sklearn/tree/_tree.pyx":3599 * * 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 = 3542; __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 = 3599; __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 = 3542; __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 = 3599; __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 = 3542; __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 = 3599; __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":3545 + /* "sklearn/tree/_tree.pyx":3602 * * # 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 = 3545; __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 = 3602; __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 = 3545; __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 = 3602; __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 = 3545; __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 = 3602; __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 = 3545; __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 = 3602; __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 = 3545; __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 = 3602; __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 = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3546 + /* "sklearn/tree/_tree.pyx":3603 * # 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 = 3546; __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 = 3603; __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 = 3546; __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 = 3603; __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 = 3545; __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 = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "sklearn/tree/_tree.pyx":3545 + /* "sklearn/tree/_tree.pyx":3602 * * # 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 = 3545; __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 = 3602; __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 = 3545; __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 = 3602; __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 = 3545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __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]; } } @@ -25513,7 +25761,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":3547 + /* "sklearn/tree/_tree.pyx":3604 * cdef np.ndarray[SIZE_t, ndim=1] out = np.zeros((n_samples,), * dtype=np.intp) * cdef SIZE_t* out_ptr = out.data # <<<<<<<<<<<<<< @@ -25522,7 +25770,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":3550 + /* "sklearn/tree/_tree.pyx":3607 * * # Initialize auxiliary data-structure * cdef DTYPE_t feature_value = 0. # <<<<<<<<<<<<<< @@ -25531,7 +25779,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_feature_value = 0.; - /* "sklearn/tree/_tree.pyx":3551 + /* "sklearn/tree/_tree.pyx":3608 * # Initialize auxiliary data-structure * cdef DTYPE_t feature_value = 0. * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -25540,7 +25788,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":3552 + /* "sklearn/tree/_tree.pyx":3609 * cdef DTYPE_t feature_value = 0. * cdef Node* node = NULL * cdef DTYPE_t* X_sample = NULL # <<<<<<<<<<<<<< @@ -25549,7 +25797,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_X_sample = NULL; - /* "sklearn/tree/_tree.pyx":3553 + /* "sklearn/tree/_tree.pyx":3610 * cdef Node* node = NULL * cdef DTYPE_t* X_sample = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -25558,7 +25806,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":3554 + /* "sklearn/tree/_tree.pyx":3611 * cdef DTYPE_t* X_sample = NULL * cdef SIZE_t i = 0 * cdef INT32_t k = 0 # <<<<<<<<<<<<<< @@ -25567,7 +25815,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":3559 + /* "sklearn/tree/_tree.pyx":3616 * # 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 # <<<<<<<<<<<<<< @@ -25576,25 +25824,25 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ __pyx_v_feature_to_sample = NULL; - /* "sklearn/tree/_tree.pyx":3561 + /* "sklearn/tree/_tree.pyx":3618 * 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 = 3561; __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 = 3618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3562 + /* "sklearn/tree/_tree.pyx":3619 * * 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 = 3562; __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 = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3564 + /* "sklearn/tree/_tree.pyx":3621 * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * * with nogil: # <<<<<<<<<<<<<< @@ -25608,7 +25856,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3565 + /* "sklearn/tree/_tree.pyx":3622 * * with nogil: * memset(feature_to_sample, -1, n_features * sizeof(SIZE_t)) # <<<<<<<<<<<<<< @@ -25617,7 +25865,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":3567 + /* "sklearn/tree/_tree.pyx":3624 * memset(feature_to_sample, -1, n_features * sizeof(SIZE_t)) * * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -25628,7 +25876,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":3568 + /* "sklearn/tree/_tree.pyx":3625 * * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -25638,7 +25886,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":3570 + /* "sklearn/tree/_tree.pyx":3627 * node = self.nodes * * for k in range(X_indptr[i], X_indptr[i + 1]): # <<<<<<<<<<<<<< @@ -25649,7 +25897,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":3571 + /* "sklearn/tree/_tree.pyx":3628 * * for k in range(X_indptr[i], X_indptr[i + 1]): * feature_to_sample[X_indices[k]] = i # <<<<<<<<<<<<<< @@ -25658,7 +25906,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":3572 + /* "sklearn/tree/_tree.pyx":3629 * 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] # <<<<<<<<<<<<<< @@ -25668,7 +25916,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":3575 + /* "sklearn/tree/_tree.pyx":3632 * * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -25679,7 +25927,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":3577 + /* "sklearn/tree/_tree.pyx":3634 * while node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * if feature_to_sample[node.feature] == i: # <<<<<<<<<<<<<< @@ -25689,7 +25937,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":3578 + /* "sklearn/tree/_tree.pyx":3635 * # ... and node.right_child != _TREE_LEAF: * if feature_to_sample[node.feature] == i: * feature_value = X_sample[node.feature] # <<<<<<<<<<<<<< @@ -25701,7 +25949,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3581 + /* "sklearn/tree/_tree.pyx":3638 * * else: * feature_value = 0. # <<<<<<<<<<<<<< @@ -25712,7 +25960,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } __pyx_L14:; - /* "sklearn/tree/_tree.pyx":3583 + /* "sklearn/tree/_tree.pyx":3640 * feature_value = 0. * * if feature_value <= node.threshold: # <<<<<<<<<<<<<< @@ -25722,7 +25970,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":3584 + /* "sklearn/tree/_tree.pyx":3641 * * if feature_value <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -25734,7 +25982,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":3586 + /* "sklearn/tree/_tree.pyx":3643 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -25746,7 +25994,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru __pyx_L15:; } - /* "sklearn/tree/_tree.pyx":3588 + /* "sklearn/tree/_tree.pyx":3645 * node = &self.nodes[node.right_child] * * out_ptr[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -25756,7 +26004,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":3591 + /* "sklearn/tree/_tree.pyx":3648 * * # Free auxiliary arrays * free(X_sample) # <<<<<<<<<<<<<< @@ -25765,7 +26013,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru */ free(__pyx_v_X_sample); - /* "sklearn/tree/_tree.pyx":3592 + /* "sklearn/tree/_tree.pyx":3649 * # Free auxiliary arrays * free(X_sample) * free(feature_to_sample) # <<<<<<<<<<<<<< @@ -25775,7 +26023,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru free(__pyx_v_feature_to_sample); } - /* "sklearn/tree/_tree.pyx":3564 + /* "sklearn/tree/_tree.pyx":3621 * safe_realloc(&feature_to_sample, n_features * sizeof(SIZE_t)) * * with nogil: # <<<<<<<<<<<<<< @@ -25793,7 +26041,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru } } - /* "sklearn/tree/_tree.pyx":3594 + /* "sklearn/tree/_tree.pyx":3651 * free(feature_to_sample) * * return out # <<<<<<<<<<<<<< @@ -25805,7 +26053,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":3520 + /* "sklearn/tree/_tree.pyx":3577 * return out * * cdef inline np.ndarray _apply_sparse_csr(self, object X): # <<<<<<<<<<<<<< @@ -25845,7 +26093,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__apply_sparse_csr(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3596 +/* "sklearn/tree/_tree.pyx":3653 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -25899,7 +26147,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 = 3596; __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 = 3653; __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); @@ -25915,16 +26163,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 = 3596; __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 = 3653; __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 = 3596; __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 = 3653; __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 = 3596; __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 = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -25937,7 +26185,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":3600 + /* "sklearn/tree/_tree.pyx":3657 * cdef Node* left * cdef Node* right * cdef Node* nodes = self.nodes # <<<<<<<<<<<<<< @@ -25947,7 +26195,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":3601 + /* "sklearn/tree/_tree.pyx":3658 * cdef Node* right * cdef Node* nodes = self.nodes * cdef Node* node = nodes # <<<<<<<<<<<<<< @@ -25956,7 +26204,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_node = __pyx_v_nodes; - /* "sklearn/tree/_tree.pyx":3602 + /* "sklearn/tree/_tree.pyx":3659 * cdef Node* nodes = self.nodes * cdef Node* node = nodes * cdef Node* end_node = node + self.node_count # <<<<<<<<<<<<<< @@ -25965,7 +26213,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":3604 + /* "sklearn/tree/_tree.pyx":3661 * cdef Node* end_node = node + self.node_count * * cdef double normalizer = 0. # <<<<<<<<<<<<<< @@ -25974,21 +26222,21 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_normalizer = 0.; - /* "sklearn/tree/_tree.pyx":3607 + /* "sklearn/tree/_tree.pyx":3664 * * 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 = 3607; __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 = 3664; __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 = 3607; __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 = 3664; __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 = 3607; __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 = 3664; __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 = 3607; __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 = 3664; __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); @@ -26004,22 +26252,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 = 3607; __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 = 3664; __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 = 3607; __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 = 3664; __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 = 3607; __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 = 3664; __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 = 3607; __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 = 3664; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -26035,13 +26283,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 = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3664; __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":3608 + /* "sklearn/tree/_tree.pyx":3665 * cdef np.ndarray[np.float64_t, ndim=1] importances * importances = np.zeros((self.n_features,)) * cdef DOUBLE_t* importance_data = importances.data # <<<<<<<<<<<<<< @@ -26050,7 +26298,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":3610 + /* "sklearn/tree/_tree.pyx":3667 * cdef DOUBLE_t* importance_data = importances.data * * with nogil: # <<<<<<<<<<<<<< @@ -26064,7 +26312,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":3611 + /* "sklearn/tree/_tree.pyx":3668 * * with nogil: * while node != end_node: # <<<<<<<<<<<<<< @@ -26075,7 +26323,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":3612 + /* "sklearn/tree/_tree.pyx":3669 * with nogil: * while node != end_node: * if node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -26085,7 +26333,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":3614 + /* "sklearn/tree/_tree.pyx":3671 * if node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] # <<<<<<<<<<<<<< @@ -26094,7 +26342,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":3615 + /* "sklearn/tree/_tree.pyx":3672 * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] * right = &nodes[node.right_child] # <<<<<<<<<<<<<< @@ -26103,7 +26351,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":3617 + /* "sklearn/tree/_tree.pyx":3674 * right = &nodes[node.right_child] * * importance_data[node.feature] += ( # <<<<<<<<<<<<<< @@ -26112,7 +26360,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_t_13 = __pyx_v_node->feature; - /* "sklearn/tree/_tree.pyx":3619 + /* "sklearn/tree/_tree.pyx":3676 * importance_data[node.feature] += ( * node.weighted_n_node_samples * node.impurity - * left.weighted_n_node_samples * left.impurity - # <<<<<<<<<<<<<< @@ -26124,7 +26372,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":3621 + /* "sklearn/tree/_tree.pyx":3678 * left.weighted_n_node_samples * left.impurity - * right.weighted_n_node_samples * right.impurity) * node += 1 # <<<<<<<<<<<<<< @@ -26135,7 +26383,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } - /* "sklearn/tree/_tree.pyx":3610 + /* "sklearn/tree/_tree.pyx":3667 * cdef DOUBLE_t* importance_data = importances.data * * with nogil: # <<<<<<<<<<<<<< @@ -26153,19 +26401,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } } - /* "sklearn/tree/_tree.pyx":3623 + /* "sklearn/tree/_tree.pyx":3680 * 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 = 3623; __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 = 3680; __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 = 3623; __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 = 3680; __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 = 3623; __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 = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -26181,32 +26429,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 = 3623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __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":3625 + /* "sklearn/tree/_tree.pyx":3682 * 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 = 3625; __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 = 3682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_12) { - /* "sklearn/tree/_tree.pyx":3626 + /* "sklearn/tree/_tree.pyx":3683 * * 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 = 3626; __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 = 3683; __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 = 3626; __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 = 3683; __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; @@ -26220,25 +26468,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 = 3626; __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 = 3683; __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 = 3626; __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 = 3683; __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 = 3626; __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 = 3683; __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 = 3626; __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 = 3683; __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":3628 + /* "sklearn/tree/_tree.pyx":3685 * normalizer = np.sum(importances) * * if normalizer > 0.0: # <<<<<<<<<<<<<< @@ -26248,19 +26496,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":3630 + /* "sklearn/tree/_tree.pyx":3687 * 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 = 3630; __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 = 3687; __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 = 3630; __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 = 3687; __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 = 3630; __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 = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -26276,7 +26524,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 = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_4)); @@ -26288,7 +26536,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":3632 + /* "sklearn/tree/_tree.pyx":3689 * importances /= normalizer * * return importances # <<<<<<<<<<<<<< @@ -26300,7 +26548,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":3596 + /* "sklearn/tree/_tree.pyx":3653 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -26363,7 +26611,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 = 3596; __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 = 3653; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -26376,7 +26624,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 = 3596; __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 = 3653; __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(); @@ -26401,7 +26649,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 = 3596; __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 = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26418,11 +26666,11 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3634 +/* "sklearn/tree/_tree.pyx":3691 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< - * """Wraps value as a 3-d NumPy array + * """Wraps value as a 3-d NumPy array. * */ @@ -26437,7 +26685,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":3641 + /* "sklearn/tree/_tree.pyx":3698 * """ * cdef np.npy_intp shape[3] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -26446,7 +26694,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":3642 + /* "sklearn/tree/_tree.pyx":3699 * cdef np.npy_intp shape[3] * shape[0] = self.node_count * shape[1] = self.n_outputs # <<<<<<<<<<<<<< @@ -26455,7 +26703,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":3643 + /* "sklearn/tree/_tree.pyx":3700 * shape[0] = self.node_count * shape[1] = self.n_outputs * shape[2] = self.max_n_classes # <<<<<<<<<<<<<< @@ -26464,20 +26712,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":3645 + /* "sklearn/tree/_tree.pyx":3702 * 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 = 3645; __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 = 3702; __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 = 3645; __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 = 3702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":3646 + /* "sklearn/tree/_tree.pyx":3703 * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -26486,7 +26734,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":3647 + /* "sklearn/tree/_tree.pyx":3704 * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -26495,7 +26743,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":3648 + /* "sklearn/tree/_tree.pyx":3705 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -26507,11 +26755,11 @@ 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":3634 + /* "sklearn/tree/_tree.pyx":3691 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< - * """Wraps value as a 3-d NumPy array + * """Wraps value as a 3-d NumPy array. * */ @@ -26527,11 +26775,11 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3650 +/* "sklearn/tree/_tree.pyx":3707 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< - * """Wraps nodes as a NumPy struct array + * """Wraps nodes as a NumPy struct array. * */ @@ -26548,7 +26796,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":3658 + /* "sklearn/tree/_tree.pyx":3715 * """ * cdef np.npy_intp shape[1] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -26557,7 +26805,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":3660 + /* "sklearn/tree/_tree.pyx":3717 * shape[0] = self.node_count * cdef np.npy_intp strides[1] * strides[0] = sizeof(Node) # <<<<<<<<<<<<<< @@ -26566,51 +26814,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":3662 + /* "sklearn/tree/_tree.pyx":3719 * 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 = 3662; __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 = 3719; __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":3663 + /* "sklearn/tree/_tree.pyx":3720 * 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 = 3663; __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 = 3720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":3665 + /* "sklearn/tree/_tree.pyx":3722 * 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 = 3663; __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 = 3720; __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":3663 + /* "sklearn/tree/_tree.pyx":3720 * 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 = 3663; __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 = 3720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":3666 + /* "sklearn/tree/_tree.pyx":3723 * strides, self.nodes, * np.NPY_DEFAULT, None) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -26619,7 +26867,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":3667 + /* "sklearn/tree/_tree.pyx":3724 * np.NPY_DEFAULT, None) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -26628,7 +26876,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":3668 + /* "sklearn/tree/_tree.pyx":3725 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -26640,11 +26888,11 @@ 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":3650 + /* "sklearn/tree/_tree.pyx":3707 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< - * """Wraps nodes as a NumPy struct array + * """Wraps nodes as a NumPy struct array. * */ @@ -26661,7 +26909,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru return __pyx_r; } -/* "sklearn/tree/_tree.pxd":164 +/* "sklearn/tree/_tree.pxd":165 * * # Input/Output layout * cdef public SIZE_t n_features # Number of features in X # <<<<<<<<<<<<<< @@ -26691,7 +26939,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __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[1]; __pyx_lineno = 164; __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[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26729,7 +26977,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features_2__set__(struct __p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_features = __pyx_t_1; /* function exit code */ @@ -26743,7 +26991,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features_2__set__(struct __p return __pyx_r; } -/* "sklearn/tree/_tree.pxd":166 +/* "sklearn/tree/_tree.pxd":167 * cdef public SIZE_t n_features # Number of features in X * cdef SIZE_t* n_classes # Number of classes in y[:, k] * cdef public SIZE_t n_outputs # Number of outputs in y # <<<<<<<<<<<<<< @@ -26773,7 +27021,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_outputs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 166; __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[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26811,7 +27059,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs_2__set__(struct __pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_outputs = __pyx_t_1; /* function exit code */ @@ -26825,7 +27073,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs_2__set__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pxd":167 +/* "sklearn/tree/_tree.pxd":168 * cdef SIZE_t* n_classes # Number of classes in y[:, k] * cdef public SIZE_t n_outputs # Number of outputs in y * cdef public SIZE_t max_n_classes # max(n_classes) # <<<<<<<<<<<<<< @@ -26855,7 +27103,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes___get__(st int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26893,7 +27141,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes_2__set__(struct const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_n_classes = __pyx_t_1; /* function exit code */ @@ -26907,7 +27155,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes_2__set__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pxd":171 +/* "sklearn/tree/_tree.pxd":172 * # Inner structures: values are stored separately from node structure, * # since size is determined at runtime. * cdef public SIZE_t max_depth # Max depth of the tree # <<<<<<<<<<<<<< @@ -26937,7 +27185,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -26975,7 +27223,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth_2__set__(struct __pyx const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_depth = __pyx_t_1; /* function exit code */ @@ -26989,7 +27237,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth_2__set__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pxd":172 +/* "sklearn/tree/_tree.pxd":173 * # since size is determined at runtime. * cdef public SIZE_t max_depth # Max depth of the tree * cdef public SIZE_t node_count # Counter for node IDs # <<<<<<<<<<<<<< @@ -27019,7 +27267,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->node_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __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[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -27057,7 +27305,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count_2__set__(struct __p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->node_count = __pyx_t_1; /* function exit code */ @@ -27071,7 +27319,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count_2__set__(struct __p return __pyx_r; } -/* "sklearn/tree/_tree.pxd":173 +/* "sklearn/tree/_tree.pxd":174 * cdef public SIZE_t max_depth # Max depth of the tree * cdef public SIZE_t node_count # Counter for node IDs * cdef public SIZE_t capacity # Capacity of tree, in terms of nodes # <<<<<<<<<<<<<< @@ -27101,7 +27349,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->capacity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->capacity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -27139,7 +27387,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->capacity = __pyx_t_1; /* function exit code */ @@ -27153,7 +27401,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3685 +/* "sklearn/tree/_tree.pyx":3742 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27175,7 +27423,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":3688 + /* "sklearn/tree/_tree.pyx":3745 * # 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]) # <<<<<<<<<<<<<< @@ -27184,7 +27432,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":3689 + /* "sklearn/tree/_tree.pyx":3746 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -27194,18 +27442,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":3692 + /* "sklearn/tree/_tree.pyx":3749 * # 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 = 3692; __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 = 3749; __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 = 3692; __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 = 3749; __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 = 3692; __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 = 3749; __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); @@ -27213,31 +27461,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 = 3692; __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 = 3749; __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":3691 + /* "sklearn/tree/_tree.pyx":3748 * 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 = 3691; __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 = 3748; __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 = 3691; __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 = 3748; __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 = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3693 + /* "sklearn/tree/_tree.pyx":3750 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -27246,7 +27494,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":3694 + /* "sklearn/tree/_tree.pyx":3751 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -27256,32 +27504,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":3695 + /* "sklearn/tree/_tree.pyx":3752 * 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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3697 + /* "sklearn/tree/_tree.pyx":3754 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -27290,7 +27538,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":3698 + /* "sklearn/tree/_tree.pyx":3755 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -27300,7 +27548,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":3685 + /* "sklearn/tree/_tree.pyx":3742 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27334,7 +27582,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":3688 + /* "sklearn/tree/_tree.pyx":3745 * # 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]) # <<<<<<<<<<<<<< @@ -27343,7 +27591,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":3689 + /* "sklearn/tree/_tree.pyx":3746 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -27353,18 +27601,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":3692 + /* "sklearn/tree/_tree.pyx":3749 * # 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 = 3692; __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 = 3749; __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 = 3692; __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 = 3749; __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 = 3692; __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 = 3749; __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); @@ -27372,31 +27620,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 = 3692; __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 = 3749; __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":3691 + /* "sklearn/tree/_tree.pyx":3748 * 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 = 3691; __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 = 3748; __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 = 3691; __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 = 3748; __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 = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3693 + /* "sklearn/tree/_tree.pyx":3750 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -27405,7 +27653,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":3694 + /* "sklearn/tree/_tree.pyx":3751 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -27415,32 +27663,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":3695 + /* "sklearn/tree/_tree.pyx":3752 * 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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3697 + /* "sklearn/tree/_tree.pyx":3754 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -27449,7 +27697,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":3698 + /* "sklearn/tree/_tree.pyx":3755 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -27459,7 +27707,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":3685 + /* "sklearn/tree/_tree.pyx":3742 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27493,7 +27741,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":3688 + /* "sklearn/tree/_tree.pyx":3745 * # 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]) # <<<<<<<<<<<<<< @@ -27502,7 +27750,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":3689 + /* "sklearn/tree/_tree.pyx":3746 * # 0.20.1 to crash. * cdef size_t nbytes = nelems * sizeof(p[0][0]) * if nbytes / sizeof(p[0][0]) != nelems: # <<<<<<<<<<<<<< @@ -27512,18 +27760,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":3692 + /* "sklearn/tree/_tree.pyx":3749 * # 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 = 3692; __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 = 3749; __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 = 3692; __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 = 3749; __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 = 3692; __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 = 3749; __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); @@ -27531,31 +27779,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 = 3692; __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 = 3749; __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":3691 + /* "sklearn/tree/_tree.pyx":3748 * 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 = 3691; __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 = 3748; __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 = 3691; __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 = 3748; __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 = 3691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3693 + /* "sklearn/tree/_tree.pyx":3750 * raise MemoryError("could not allocate (%d * %d) bytes" * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) # <<<<<<<<<<<<<< @@ -27564,7 +27812,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":3694 + /* "sklearn/tree/_tree.pyx":3751 * % (nelems, sizeof(p[0][0]))) * cdef realloc_ptr tmp = realloc(p[0], nbytes) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -27574,32 +27822,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":3695 + /* "sklearn/tree/_tree.pyx":3752 * 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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __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 = 3752; __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 = 3695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":3697 + /* "sklearn/tree/_tree.pyx":3754 * raise MemoryError("could not allocate %d bytes" % nbytes) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -27608,7 +27856,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":3698 + /* "sklearn/tree/_tree.pyx":3755 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -27618,7 +27866,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":3685 + /* "sklearn/tree/_tree.pyx":3742 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t nelems) except *: # <<<<<<<<<<<<<< @@ -27638,7 +27886,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3701 +/* "sklearn/tree/_tree.pyx":3758 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -27670,7 +27918,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":3704 + /* "sklearn/tree/_tree.pyx":3761 * # Helper for tests. Tries to allocate (-1) / 2 * sizeof(size_t) * # bytes, which will always overflow. * cdef SIZE_t* p = NULL # <<<<<<<<<<<<<< @@ -27679,16 +27927,16 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ __pyx_v_p = NULL; - /* "sklearn/tree/_tree.pyx":3705 + /* "sklearn/tree/_tree.pyx":3762 * # 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 = 3705; __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 = 3762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":3706 + /* "sklearn/tree/_tree.pyx":3763 * cdef SIZE_t* p = NULL * safe_realloc(&p, (-1) / 2) * if p != NULL: # <<<<<<<<<<<<<< @@ -27698,7 +27946,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":3707 + /* "sklearn/tree/_tree.pyx":3764 * safe_realloc(&p, (-1) / 2) * if p != NULL: * free(p) # <<<<<<<<<<<<<< @@ -27707,7 +27955,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ free(__pyx_v_p); - /* "sklearn/tree/_tree.pyx":3708 + /* "sklearn/tree/_tree.pyx":3765 * if p != NULL: * free(p) * assert False # <<<<<<<<<<<<<< @@ -27718,7 +27966,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 = 3708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif @@ -27726,7 +27974,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":3701 + /* "sklearn/tree/_tree.pyx":3758 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -27746,7 +27994,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3713 +/* "sklearn/tree/_tree.pyx":3770 * # 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: # <<<<<<<<<<<<<< @@ -27758,7 +28006,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":3714 + /* "sklearn/tree/_tree.pyx":3771 * # 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) # <<<<<<<<<<<<<< @@ -27768,7 +28016,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":3715 + /* "sklearn/tree/_tree.pyx":3772 * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) # <<<<<<<<<<<<<< @@ -27778,7 +28026,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":3716 + /* "sklearn/tree/_tree.pyx":3773 * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) * seed[0] ^= (seed[0] << 5) # <<<<<<<<<<<<<< @@ -27788,7 +28036,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":3718 + /* "sklearn/tree/_tree.pyx":3775 * seed[0] ^= (seed[0] << 5) * * return seed[0] % (RAND_R_MAX + 1) # <<<<<<<<<<<<<< @@ -27798,7 +28046,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":3713 + /* "sklearn/tree/_tree.pyx":3770 * # 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: # <<<<<<<<<<<<<< @@ -27811,7 +28059,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3720 +/* "sklearn/tree/_tree.pyx":3777 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -27829,7 +28077,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":3723 + /* "sklearn/tree/_tree.pyx":3780 * """Encapsulate data into a 1D numpy array of intp's.""" * cdef np.npy_intp shape[1] * shape[0] = size # <<<<<<<<<<<<<< @@ -27838,7 +28086,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":3724 + /* "sklearn/tree/_tree.pyx":3781 * cdef np.npy_intp shape[1] * shape[0] = size * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) # <<<<<<<<<<<<<< @@ -27846,14 +28094,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 = 3724; __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 = 3781; __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 = 3724; __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 = 3781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":3720 + /* "sklearn/tree/_tree.pyx":3777 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -27872,7 +28120,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3726 +/* "sklearn/tree/_tree.pyx":3783 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, # <<<<<<<<<<<<<< @@ -27883,7 +28131,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":3729 + /* "sklearn/tree/_tree.pyx":3786 * UINT32_t* random_state) nogil: * """Generate a random integer in [0; end).""" * return low + our_rand_r(random_state) % (high - low) # <<<<<<<<<<<<<< @@ -27893,7 +28141,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":3726 + /* "sklearn/tree/_tree.pyx":3783 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t low, SIZE_t high, # <<<<<<<<<<<<<< @@ -27906,7 +28154,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3731 +/* "sklearn/tree/_tree.pyx":3788 * return low + our_rand_r(random_state) % (high - low) * * cdef inline double rand_uniform(double low, double high, # <<<<<<<<<<<<<< @@ -27917,7 +28165,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":3735 + /* "sklearn/tree/_tree.pyx":3792 * """Generate a random double in [low; high).""" * return ((high - low) * our_rand_r(random_state) / * RAND_R_MAX) + low # <<<<<<<<<<<<<< @@ -27927,7 +28175,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":3731 + /* "sklearn/tree/_tree.pyx":3788 * return low + our_rand_r(random_state) % (high - low) * * cdef inline double rand_uniform(double low, double high, # <<<<<<<<<<<<<< @@ -27940,7 +28188,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_uniform(double __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":3737 +/* "sklearn/tree/_tree.pyx":3794 * RAND_R_MAX) + low * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -27950,7 +28198,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":3738 + /* "sklearn/tree/_tree.pyx":3795 * * cdef inline double log(double x) nogil: * return ln(x) / ln(2.0) # <<<<<<<<<<<<<< @@ -27958,7 +28206,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":3737 + /* "sklearn/tree/_tree.pyx":3794 * RAND_R_MAX) + low * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -27970,7 +28218,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 +/* "../../../anaconda/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -28020,7 +28268,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -28033,7 +28281,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -28042,7 +28290,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -28051,7 +28299,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -28060,7 +28308,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -28070,7 +28318,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":212 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -28082,7 +28330,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":214 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -28093,7 +28341,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":216 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -28107,7 +28355,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../../../anaconda/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -28119,7 +28367,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L6_bool_binop_done:; if (__pyx_t_1) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -28133,7 +28381,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;} } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -28147,7 +28395,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../../../anaconda/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -28159,7 +28407,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L9_bool_binop_done:; if (__pyx_t_1) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -28173,7 +28421,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;} } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":224 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -28182,7 +28430,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":225 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -28191,7 +28439,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":226 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -28201,7 +28449,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -28210,7 +28458,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))); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -28219,7 +28467,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231 + /* "../../../anaconda/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -28230,7 +28478,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../anaconda/lib/python3.4/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] # <<<<<<<<<<<<<< @@ -28239,7 +28487,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]); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../anaconda/lib/python3.4/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] # <<<<<<<<<<<<<< @@ -28252,7 +28500,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -28261,7 +28509,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)); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -28272,7 +28520,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":237 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -28281,7 +28529,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":238 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -28290,7 +28538,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -28299,7 +28547,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":242 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -28308,7 +28556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":243 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -28320,7 +28568,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":247 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -28329,7 +28577,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":249 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -28347,7 +28595,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":251 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -28363,7 +28611,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":254 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -28378,7 +28626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":256 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -28388,7 +28636,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":257 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -28398,7 +28646,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":258 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -28418,7 +28666,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../anaconda/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -28436,7 +28684,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L19_bool_binop_done:; if (__pyx_t_1) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -28450,7 +28698,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;} } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28459,7 +28707,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28470,7 +28718,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28481,7 +28729,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28492,7 +28740,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28503,7 +28751,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28514,7 +28762,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28525,7 +28773,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28536,7 +28784,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28547,7 +28795,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28558,7 +28806,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28569,7 +28817,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28580,7 +28828,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28591,7 +28839,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28602,7 +28850,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28613,7 +28861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28624,7 +28872,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28635,7 +28883,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -28647,7 +28895,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -28673,7 +28921,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -28682,7 +28930,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":281 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -28694,7 +28942,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":283 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -28703,7 +28951,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -28712,7 +28960,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -28721,7 +28969,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../anaconda/lib/python3.4/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, # <<<<<<<<<<<<<< @@ -28731,7 +28979,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":289 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -28741,7 +28989,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197 + /* "../../../anaconda/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -28773,7 +29021,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -28797,7 +29045,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -28807,7 +29055,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":293 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -28819,7 +29067,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":294 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -28829,7 +29077,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":295 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -28841,7 +29089,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -28853,7 +29101,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -28870,7 +29118,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -28884,7 +29132,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -28903,7 +29151,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -28920,7 +29168,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -28934,7 +29182,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -28953,7 +29201,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -28970,7 +29218,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -28984,7 +29232,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -29003,7 +29251,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -29020,7 +29268,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -29034,7 +29282,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -29053,7 +29301,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../../../anaconda/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -29070,7 +29318,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -29084,7 +29332,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../anaconda/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -29103,7 +29351,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 +/* "../../../anaconda/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -29135,7 +29383,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":793 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -29144,7 +29392,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -29153,7 +29401,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -29176,7 +29424,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -29193,7 +29441,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":799 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -29232,7 +29480,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":801 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -29249,7 +29497,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -29263,7 +29511,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;} } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -29283,7 +29531,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":805 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -29301,7 +29549,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_L7_bool_binop_done:; if (__pyx_t_6) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -29315,7 +29563,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;} } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -29331,7 +29579,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":817 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -29340,7 +29588,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -29349,7 +29597,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":819 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -29360,7 +29608,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); } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -29370,7 +29618,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); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":823 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -29380,7 +29628,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":824 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -29392,7 +29640,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":825 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -29402,7 +29650,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -29416,7 +29664,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;} } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29434,7 +29682,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29452,7 +29700,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29470,7 +29718,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29488,7 +29736,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29506,7 +29754,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29524,7 +29772,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29542,7 +29790,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29560,7 +29808,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29578,7 +29826,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29596,7 +29844,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29614,7 +29862,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29632,7 +29880,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29650,7 +29898,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -29670,7 +29918,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -29690,7 +29938,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../anaconda/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -29710,7 +29958,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../anaconda/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -29729,7 +29977,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -29752,7 +30000,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":848 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -29764,7 +30012,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852 + /* "../../../anaconda/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -29776,7 +30024,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":797 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -29786,7 +30034,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":853 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -29796,7 +30044,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786 + /* "../../../anaconda/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -29821,7 +30069,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -29836,7 +30084,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); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../../../anaconda/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -29847,7 +30095,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -29859,7 +30107,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -29868,7 +30116,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":975 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -29879,7 +30127,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -29888,7 +30136,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -29897,7 +30145,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -29909,7 +30157,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 +/* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -29923,7 +30171,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -29933,7 +30181,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) { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":981 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -29947,7 +30195,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":983 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -29958,7 +30206,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -30022,7 +30270,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. \n\n This object stores methods on how to calculate how good a split is using \n different metrics.\n ", /*tp_doc*/ + "Interface for impurity criteria.\n\n This object stores methods on how to calculate how good a split is using\n different metrics.\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30562,7 +30810,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_TreeBuilder = { 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*/ - "Interface for different tree building strategies. ", /*tp_doc*/ + "Interface for different tree building strategies.", /*tp_doc*/ __pyx_tp_traverse_7sklearn_4tree_5_tree_TreeBuilder, /*tp_traverse*/ __pyx_tp_clear_7sklearn_4tree_5_tree_TreeBuilder, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30723,7 +30971,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*/ - "A class representing the Cross Entropy impurity criteria. \n\n This handles cases where the target is a classification taking values \n 0, 1, ... K-2, K-1. If node m represents a region Rm with Nm observations, \n then let\n\n count_k = 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} count_k log(count_k)\n ", /*tp_doc*/ + "Cross Entropy impurity criterion.\n\n This handles cases where the target is a classification taking values\n 0, 1, ... K-2, K-1. If node m represents a region Rm with Nm observations,\n then let\n\n count_k = 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} count_k log(count_k)\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30790,7 +31038,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*/ - "The Gini Index impurity criteria. \n\n This handles cases where the target is a classification taking values \n 0, 1, ... K-2, K-1. If node m represents a region Rm with Nm observations, \n then let\n\n count_k = 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} count_k (1 - count_k)\n = 1 - \\sum_{k=0}^{K-1} count_k ** 2\n ", /*tp_doc*/ + "Gini Index impurity criterion.\n\n This handles cases where the target is a classification taking values\n 0, 1, ... K-2, K-1. If node m represents a region Rm with Nm observations,\n then let\n\n count_k = 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} count_k (1 - count_k)\n = 1 - \\sum_{k=0}^{K-1} count_k ** 2\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -30884,7 +31132,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*/ - "A regression criteria. \n\n This handles cases where the target is a continuous value, and is \n evaluated by computing the variance of the target values left and right \n of the split point. The computation takes linear time with `n_samples` \n 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*/ + "Abstract regression criterion.\n\n This handles cases where the target is a continuous value, and is\n evaluated by computing the variance of the target values left and right\n of the split point. The computation takes linear time with `n_samples`\n 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*/ @@ -31808,6 +32056,7 @@ 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}, @@ -31899,16 +32148,15 @@ 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}, {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 = 281; __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 = 297; __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 = 2103; __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 = 301; __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 = 317; __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 = 2140; __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:; @@ -31919,51 +32167,51 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/tree/_tree.pyx":2103 + /* "sklearn/tree/_tree.pyx":2140 * * 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 = 2103; __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 = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "sklearn/tree/_tree.pyx":2837 + /* "sklearn/tree/_tree.pyx":2894 * * 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 = 2837; __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 = 2894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "sklearn/tree/_tree.pyx":3354 + /* "sklearn/tree/_tree.pyx":3411 * * 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 = 3354; __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 = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "sklearn/tree/_tree.pyx":3368 + /* "sklearn/tree/_tree.pyx":3425 * 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 = 3368; __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 = 3425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -31974,7 +32222,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -31985,7 +32233,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -31996,7 +32244,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -32007,7 +32255,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806 + /* "../../../anaconda/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -32018,7 +32266,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":826 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -32029,17 +32277,17 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "sklearn/tree/_tree.pyx":3701 + /* "sklearn/tree/_tree.pyx":3758 * * * 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 = 3701; __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 = 3758; __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, 3701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3701; __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_Users_ajoly_Dropbox_git_scikit, __pyx_n_s_realloc_test, 3758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -32156,6 +32404,7 @@ 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; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.proxy_impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_proxy_impurity_improvement; 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 = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -32167,10 +32416,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 = 1112; __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 = 1123; __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 = 1112; __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 = 1112; __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 = 1123; __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 = 1123; __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; @@ -32183,18 +32432,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 = 3210; __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 = 3267; __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 = 3210; __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 = 3210; __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 = 3267; __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 = 3267; __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 = 2818; __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 = 2875; __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 = 2818; __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 = 2818; __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 = 2875; __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 = 2875; __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; @@ -32205,30 +32454,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 = 232; __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 = 252; __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 = 232; __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 = 232; __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 = 252; __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 = 252; __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 = 509; __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 = 516; __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 = 509; __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 = 509; __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 = 516; __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 = 516; __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 = 615; __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 = 620; __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 = 615; __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 = 615; __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 = 620; __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 = 620; __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; @@ -32239,66 +32488,68 @@ 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 = 730; __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 = 729; __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 = 730; __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 = 730; __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 = 729; __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 = 729; __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_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base.__pyx_base.proxy_impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_3MSE_proxy_impurity_improvement; __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 = 1026; __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 = 931; __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 = 1026; __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 = 1026; __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 = 931; __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 = 931; __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_vtable_7sklearn_4tree_5_tree_FriedmanMSE.__pyx_base.__pyx_base.__pyx_base.proxy_impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_proxy_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 = 1067; __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 = 1047; __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 = 1067; __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 = 1067; __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 = 1047; __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 = 1047; __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 = 1285; __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 = 1299; __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 = 1285; __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 = 1285; __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 = 1299; __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 = 1299; __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 = 1315; __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 = 1329; __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 = 1315; __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 = 1315; __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 = 1329; __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 = 1329; __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 = 1614; __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 = 1635; __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 = 1614; __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 = 1614; __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 = 1635; __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 = 1635; __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 = 1816; __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 = 1846; __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 = 1816; __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 = 1816; __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 = 1846; __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 = 1846; __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_BaseSparseSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter; __pyx_vtable_7sklearn_4tree_5_tree_BaseSparseSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; @@ -32306,47 +32557,47 @@ PyMODINIT_FUNC PyInit__tree(void) __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 = 2063; __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 = 2100; __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 = 2063; __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 = 2063; __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 = 2100; __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 = 2100; __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 = 2382; __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 = 2419; __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 = 2382; __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 = 2382; __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 = 2419; __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 = 2419; __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 = 2600; __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 = 2645; __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 = 2600; __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 = 2600; __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 = 2645; __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 = 2645; __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 = 2857; __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 = 2914; __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 = 2857; __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 = 2857; __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 = 2914; __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 = 2914; __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 = 3006; __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 = 3063; __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 = 3006; __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 = 3006; __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 = 3063; __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 = 3063; __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", @@ -32849,7 +33100,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":3386 + /* "sklearn/tree/_tree.pyx":3443 * # 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: # <<<<<<<<<<<<<< @@ -32858,16 +33109,16 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_k__5 = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1); - /* "sklearn/tree/_tree.pyx":3701 + /* "sklearn/tree/_tree.pyx":3758 * * * 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 = 3701; __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 = 3758; __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 = 3701; __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 = 3758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/tree/_tree.pyx":1 @@ -32880,7 +33131,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; - /* "../forest/local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979 + /* "../../../anaconda/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":979 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< diff --git a/sklearn/tree/_tree.pxd b/sklearn/tree/_tree.pxd index 2256a10480648..5025eec40612f 100644 --- a/sklearn/tree/_tree.pxd +++ b/sklearn/tree/_tree.pxd @@ -58,6 +58,7 @@ cdef class Criterion: double* impurity_right) nogil cdef void node_value(self, double* dest) nogil cdef double impurity_improvement(self, double impurity) nogil + cdef double proxy_impurity_improvement(self) nogil # ============================================================================= diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index 442c9e1dde3b5..e5ec436d28a62 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -197,6 +197,24 @@ cdef class Criterion: pass + cdef double proxy_impurity_improvement(self) nogil: + """Compute a proxy of the impurity reduction + + This method is used to speed up the search for the best split. + It is a proxy quantity such that the split that maximizes this value + also maximizes the impurity improvement. It neglects all constant terms + of the impurity decrease for a given split. + + The absolute impurity improvement is only computed by the + impurity_improvement method once the best split has been found. + """ + cdef double impurity_left + cdef double impurity_right + self.children_impurity(&impurity_left, &impurity_right) + + return (- self.weighted_n_right * impurity_right + - self.weighted_n_left * impurity_left) + cdef double impurity_improvement(self, double impurity) nogil: """Placeholder for improvement in impurity after a split. @@ -436,7 +454,6 @@ cdef class ClassificationCriterion(Criterion): 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 - 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 @@ -721,14 +738,8 @@ cdef class RegressionCriterion(Criterion): = (\sum_i^n y_i ** 2) - n_samples * y_bar ** 2 """ - cdef double* mean_left - cdef double* mean_right - cdef double* mean_total - cdef double* sq_sum_left - cdef double* sq_sum_right + cdef double* sq_sum_tmp cdef double* sq_sum_total - cdef double* var_left - cdef double* var_right cdef double* sum_left cdef double* sum_right cdef double* sum_total @@ -760,39 +771,21 @@ cdef class RegressionCriterion(Criterion): # Allocate accumulators. Make sure they are NULL, not uninitialized, # before an exception can be raised (which triggers __dealloc__). - self.mean_left = NULL - self.mean_right = NULL - self.mean_total = NULL - self.sq_sum_left = NULL - self.sq_sum_right = NULL + self.sq_sum_tmp = NULL self.sq_sum_total = NULL - self.var_left = NULL - self.var_right = NULL self.sum_left = NULL 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)) - self.sq_sum_left = calloc(n_outputs, sizeof(double)) - self.sq_sum_right = calloc(n_outputs, sizeof(double)) + self.sq_sum_tmp = calloc(n_outputs, sizeof(double)) 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)) self.sum_left = calloc(n_outputs, sizeof(double)) self.sum_right = calloc(n_outputs, sizeof(double)) self.sum_total = calloc(n_outputs, sizeof(double)) - if (self.mean_left == NULL or - self.mean_right == NULL or - self.mean_total == NULL or - self.sq_sum_left == NULL or - self.sq_sum_right == NULL or + if (self.sq_sum_tmp == NULL or self.sq_sum_total == NULL or - self.var_left == NULL or - self.var_right == NULL or self.sum_left == NULL or self.sum_right == NULL or self.sum_total == NULL): @@ -800,15 +793,8 @@ cdef class RegressionCriterion(Criterion): def __dealloc__(self): """Destructor""" - - free(self.mean_left) - free(self.mean_right) - free(self.mean_total) - free(self.sq_sum_left) - free(self.sq_sum_right) + free(self.sq_sum_tmp) free(self.sq_sum_total) - free(self.var_left) - free(self.var_right) free(self.sum_left) free(self.sum_right) free(self.sum_total) @@ -840,16 +826,7 @@ cdef class RegressionCriterion(Criterion): # Initialize accumulators cdef SIZE_t n_outputs = self.n_outputs - cdef double* mean_left = self.mean_left - cdef double* mean_right = self.mean_right - 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 cdef double* sq_sum_total = self.sq_sum_total - cdef double* var_left = self.var_left - cdef double* var_right = self.var_right - cdef double* sum_left = self.sum_left - cdef double* sum_right = self.sum_right cdef double* sum_total = self.sum_total cdef SIZE_t i = 0 @@ -860,16 +837,7 @@ cdef class RegressionCriterion(Criterion): cdef DOUBLE_t w = 1.0 cdef SIZE_t n_bytes = n_outputs * sizeof(double) - memset(mean_left, 0, n_bytes) - memset(mean_right, 0, n_bytes) - memset(mean_total, 0, n_bytes) - memset(sq_sum_left, 0, n_bytes) - memset(sq_sum_right, 0, n_bytes) memset(sq_sum_total, 0, n_bytes) - memset(var_left, 0, n_bytes) - memset(var_right, 0, n_bytes) - memset(sum_left, 0, n_bytes) - memset(sum_right, 0, n_bytes) memset(sum_total, 0, n_bytes) for p in range(start, end): @@ -888,45 +856,18 @@ cdef class RegressionCriterion(Criterion): self.weighted_n_node_samples = weighted_n_node_samples - for k in range(n_outputs): - mean_total[k] = sum_total[k] / weighted_n_node_samples - # Reset to pos=start self.reset() cdef void reset(self) nogil: """Reset the criterion at pos=start.""" - self.pos = self.start + cdef SIZE_t n_bytes = self.n_outputs * sizeof(double) + memset(self.sum_left, 0, n_bytes) + memcpy(self.sum_right, self.sum_total, n_bytes) self.weighted_n_left = 0.0 self.weighted_n_right = self.weighted_n_node_samples - - cdef SIZE_t n_outputs = self.n_outputs - cdef double* mean_left = self.mean_left - cdef double* mean_right = self.mean_right - 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 - cdef double* sq_sum_total = self.sq_sum_total - 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 - cdef double* sum_left = self.sum_left - cdef double* sum_right = self.sum_right - cdef double* sum_total = self.sum_total - - cdef SIZE_t k = 0 - - for k in range(n_outputs): - mean_right[k] = mean_total[k] - mean_left[k] = 0.0 - 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 - - mean_right[k] * mean_right[k]) - var_left[k] = 0.0 - sum_right[k] = sum_total[k] - sum_left[k] = 0.0 + self.pos = self.start cdef void update(self, SIZE_t new_pos) nogil: """Updated statistics by moving samples[pos:new_pos] to the left.""" @@ -939,24 +880,15 @@ cdef class RegressionCriterion(Criterion): cdef SIZE_t pos = self.pos cdef SIZE_t n_outputs = self.n_outputs - cdef double* mean_left = self.mean_left - 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 - cdef double* var_left = self.var_left - cdef double* var_right = self.var_right cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right + cdef double* sum_total = self.sum_total - cdef double weighted_n_left = self.weighted_n_left - cdef double weighted_n_right = self.weighted_n_right - - cdef SIZE_t i - cdef SIZE_t p - cdef SIZE_t k + cdef SIZE_t i = 0 + cdef SIZE_t p = 0 + cdef SIZE_t k = 0 cdef DOUBLE_t w = 1.0 cdef DOUBLE_t diff_w = 0.0 - cdef DOUBLE_t y_ik, w_y_ik # Note: We assume start <= pos < new_pos <= end for p in range(pos, new_pos): @@ -966,30 +898,15 @@ cdef class RegressionCriterion(Criterion): w = sample_weight[i] for k in range(n_outputs): - y_ik = y[i * y_stride + k] - w_y_ik = w * y_ik - - sum_left[k] += w_y_ik - sum_right[k] -= w_y_ik - - sq_sum_left[k] += w_y_ik * y_ik - sq_sum_right[k] -= w_y_ik * y_ik + sum_left[k] += w * y[i * y_stride + k] diff_w += w - weighted_n_left += diff_w - weighted_n_right -= diff_w - for k in range(n_outputs): - 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 - - mean_left[k] * mean_left[k]) - var_right[k] = (sq_sum_right[k] / weighted_n_right - - mean_right[k] * mean_right[k]) + sum_right[k] = sum_total[k] - sum_left[k] - self.weighted_n_left = weighted_n_left - self.weighted_n_right = weighted_n_right + self.weighted_n_left += diff_w + self.weighted_n_right -= diff_w self.pos = new_pos @@ -1002,7 +919,13 @@ cdef class RegressionCriterion(Criterion): 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)) + cdef SIZE_t n_outputs = self.n_outputs + cdef double* sum_total = self.sum_total + cdef double weighted_n_node_samples = self.weighted_n_node_samples + cdef SIZE_t k = 0 + + for k in range(n_outputs): + dest[k] = sum_total[k] / weighted_n_node_samples cdef class MSE(RegressionCriterion): @@ -1015,32 +938,107 @@ cdef class MSE(RegressionCriterion): samples[start:end].""" cdef SIZE_t n_outputs = self.n_outputs cdef double* sq_sum_total = self.sq_sum_total - cdef double* mean_total = self.mean_total + cdef double* sum_total = self.sum_total cdef double weighted_n_node_samples = self.weighted_n_node_samples + cdef double mean_total_k = 0. cdef double total = 0.0 - cdef SIZE_t k + cdef SIZE_t k = 0 for k in range(n_outputs): + mean_total_k = sum_total[k] / weighted_n_node_samples total += (sq_sum_total[k] / weighted_n_node_samples - - mean_total[k] * mean_total[k]) + mean_total_k * mean_total_k) return total / n_outputs + cdef double proxy_impurity_improvement(self) nogil: + """Compute a proxy of the impurity reduction + + This method is used to speed up the search for the best split. + It is a proxy quantity such that the split that maximizes this value + also maximizes the impurity improvement. It neglects all constant terms + of the impurity decrease for a given split. + + The absolute impurity improvement is only computed by the + impurity_improvement method once the best split has been found. + """ + cdef SIZE_t n_outputs = self.n_outputs + + cdef double weighted_n_left = self.weighted_n_left + cdef double weighted_n_right = self.weighted_n_right + + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right + + cdef SIZE_t k = 0 + cdef double proxy_impurity_left = 0. + cdef double proxy_impurity_right = 0. + + for k in range(n_outputs): + proxy_impurity_left += sum_left[k] * sum_left[k] + proxy_impurity_right += sum_right[k] * sum_right[k] + + return (proxy_impurity_left / weighted_n_left + + proxy_impurity_right / weighted_n_right) + 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]).""" + + cdef DOUBLE_t* y = self.y + cdef SIZE_t y_stride = self.y_stride + cdef DOUBLE_t* sample_weight = self.sample_weight + + cdef SIZE_t* samples = self.samples + cdef SIZE_t pos = self.pos + cdef SIZE_t start = self.start + cdef SIZE_t n_outputs = self.n_outputs - cdef double* var_left = self.var_left - cdef double* var_right = self.var_right + + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right + cdef double* sq_sum_tmp = self.sq_sum_tmp + cdef double* sq_sum_total = self.sq_sum_total + cdef double weighted_n_left = self.weighted_n_left + cdef double weighted_n_right = self.weighted_n_right + cdef double total_left = 0.0 cdef double total_right = 0.0 - cdef SIZE_t k + cdef double mean_left_k = 0.0 + cdef double mean_right_k = 0.0 + + cdef SIZE_t i = 0 + cdef SIZE_t p = 0 + cdef SIZE_t k = 0 + cdef DOUBLE_t w = 1.0 + cdef DOUBLE_t diff_w = 0.0 + cdef DOUBLE_t y_ik + + # Compute squared sum + cdef SIZE_t n_bytes = n_outputs * sizeof(double) + memset(sq_sum_tmp, 0, n_bytes) + + for p in range(start, pos): + i = samples[p] + + if sample_weight != NULL: + w = sample_weight[i] + + for k in range(n_outputs): + y_ik = y[i * y_stride + k] + sq_sum_tmp[k] += w * y_ik * y_ik + # Compute impurity for k in range(n_outputs): - total_left += var_left[k] - total_right += var_right[k] + mean_left_k = sum_left[k] / weighted_n_left + total_left += (sq_sum_tmp[k] / weighted_n_left - + mean_left_k * mean_left_k) + + mean_right_k = sum_right[k] / weighted_n_right + total_right += ((sq_sum_total[k] - sq_sum_tmp[k]) / weighted_n_right - + mean_right_k * mean_right_k) impurity_left[0] = total_left / n_outputs impurity_right[0] = total_right / n_outputs @@ -1055,28 +1053,59 @@ cdef class FriedmanMSE(MSE): improvement = n_left * n_right * diff^2 / (n_left + n_right) """ - cdef double impurity_improvement(self, double impurity) nogil: + cdef double proxy_impurity_improvement(self) nogil: + """Compute a proxy of the impurity reduction + + This method is used to speed up the search for the best split. + It is a proxy quantity such that the split that maximizes this value + also maximizes the impurity improvement. It neglects all constant terms + of the impurity decrease for a given split. + + The absolute impurity improvement is only computed by the + impurity_improvement method once the best split has been found. + """ cdef SIZE_t n_outputs = self.n_outputs - cdef SIZE_t k cdef double* sum_left = self.sum_left cdef double* sum_right = self.sum_right + cdef double weighted_n_left = self.weighted_n_left + cdef double weighted_n_right = self.weighted_n_right cdef double total_sum_left = 0.0 cdef double total_sum_right = 0.0 + + cdef SIZE_t k = 0 + cdef double diff = 0.0 + + for k in range(n_outputs): + total_sum_left += sum_left[k] + total_sum_right += sum_right[k] + + diff = (weighted_n_right * total_sum_left - + weighted_n_left * total_sum_right) + + return diff * diff / (weighted_n_left * weighted_n_right) + + cdef double impurity_improvement(self, double impurity) nogil: + cdef SIZE_t n_outputs = self.n_outputs + cdef double* sum_left = self.sum_left + cdef double* sum_right = self.sum_right cdef double weighted_n_left = self.weighted_n_left cdef double weighted_n_right = self.weighted_n_right + cdef double weighted_n_node_samples = self.weighted_n_node_samples + cdef double total_sum_left = 0.0 + cdef double total_sum_right = 0.0 + + cdef SIZE_t k = 0 cdef double diff = 0.0 for k in range(n_outputs): total_sum_left += sum_left[k] total_sum_right += sum_right[k] - total_sum_left = total_sum_left / n_outputs - total_sum_right = total_sum_right / n_outputs - diff = ((total_sum_left / weighted_n_left) - - (total_sum_right / weighted_n_right)) + diff = (weighted_n_right * total_sum_left - + weighted_n_left * total_sum_right) / n_outputs - return (weighted_n_left * weighted_n_right * diff * diff / - (weighted_n_left + weighted_n_right)) + return (diff * diff / + (weighted_n_left * weighted_n_right * weighted_n_node_samples)) # ============================================================================= # Splitter @@ -1328,6 +1357,8 @@ cdef class BestSplitter(BaseDenseSplitter): cdef UINT32_t* random_state = &self.rand_r_state cdef SplitRecord best, current + cdef double current_proxy_improvement = - INFINITY + cdef double best_proxy_improvement = - INFINITY cdef SIZE_t f_i = n_features cdef SIZE_t f_j, p, tmp @@ -1442,11 +1473,10 @@ cdef class BestSplitter(BaseDenseSplitter): (self.criterion.weighted_n_right < min_weight_leaf)): continue - current.improvement = self.criterion.impurity_improvement(impurity) + current_proxy_improvement = self.criterion.proxy_impurity_improvement() - if current.improvement > best.improvement: - self.criterion.children_impurity(¤t.impurity_left, - ¤t.impurity_right) + if current_proxy_improvement > best_proxy_improvement: + best_proxy_improvement = current_proxy_improvement current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 if current.threshold == Xf[p]: @@ -1471,6 +1501,12 @@ cdef class BestSplitter(BaseDenseSplitter): samples[partition_end] = samples[p] samples[p] = tmp + self.criterion.reset() + self.criterion.update(best.pos) + best.improvement = self.criterion.impurity_improvement(impurity) + self.criterion.children_impurity(&best.impurity_left, + &best.impurity_right) + # Respect invariant for constant features: the original order of # element in features[:n_known_constants] must be preserved for sibling # and child nodes @@ -1627,6 +1663,8 @@ cdef class RandomSplitter(BaseDenseSplitter): cdef UINT32_t* random_state = &self.rand_r_state cdef SplitRecord best, current + cdef double current_proxy_improvement = - INFINITY + cdef double best_proxy_improvement = - INFINITY cdef SIZE_t f_i = n_features cdef SIZE_t f_j, p, tmp @@ -1759,29 +1797,36 @@ cdef class RandomSplitter(BaseDenseSplitter): (self.criterion.weighted_n_right < min_weight_leaf)): continue - current.improvement = self.criterion.impurity_improvement(impurity) + current_proxy_improvement = self.criterion.proxy_impurity_improvement() - if current.improvement > best.improvement: - self.criterion.children_impurity(¤t.impurity_left, - ¤t.impurity_right) + if current_proxy_improvement > best_proxy_improvement: + best_proxy_improvement = current_proxy_improvement best = current # copy # Reorganize into samples[start:best.pos] + samples[best.pos:end] - if best.pos < end and current.feature != best.feature: - partition_end = end - p = start + if best.pos < end: + if current.feature != best.feature: + partition_end = end + p = start - while p < partition_end: - if X[X_sample_stride * samples[p] + - X_fx_stride * best.feature] <= best.threshold: - p += 1 + while p < partition_end: + if X[X_sample_stride * samples[p] + + X_fx_stride * best.feature] <= best.threshold: + p += 1 - else: - partition_end -= 1 + else: + partition_end -= 1 + + tmp = samples[partition_end] + samples[partition_end] = samples[p] + samples[p] = tmp - tmp = samples[partition_end] - samples[partition_end] = samples[p] - samples[p] = tmp + + self.criterion.reset() + self.criterion.update(best.pos) + best.improvement = self.criterion.impurity_improvement(impurity) + self.criterion.children_impurity(&best.impurity_left, + &best.impurity_right) # Respect invariant for constant features: the original order of # element in features[:n_known_constants] must be preserved for sibling @@ -1880,6 +1925,8 @@ cdef class PresortBestSplitter(BaseDenseSplitter): cdef UINT32_t* random_state = &self.rand_r_state cdef SplitRecord best, current + cdef double current_proxy_improvement = - INFINITY + cdef double best_proxy_improvement = - INFINITY cdef SIZE_t f_i = n_features cdef SIZE_t f_j, p @@ -1998,11 +2045,10 @@ cdef class PresortBestSplitter(BaseDenseSplitter): (self.criterion.weighted_n_right < min_weight_leaf)): continue - current.improvement = self.criterion.impurity_improvement(impurity) + current_proxy_improvement = self.criterion.proxy_impurity_improvement() - if current.improvement > best.improvement: - self.criterion.children_impurity(¤t.impurity_left, - ¤t.impurity_right) + if current_proxy_improvement > best_proxy_improvement: + best_proxy_improvement = current_proxy_improvement current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 if current.threshold == Xf[p]: @@ -2027,6 +2073,12 @@ cdef class PresortBestSplitter(BaseDenseSplitter): samples[partition_end] = samples[p] samples[p] = tmp + self.criterion.reset() + self.criterion.update(best.pos) + best.improvement = self.criterion.impurity_improvement(impurity) + self.criterion.children_impurity(&best.impurity_left, + &best.impurity_right) + # Reset sample mask for p in range(start, end): sample_mask[samples[p]] = 0 @@ -2402,6 +2454,8 @@ cdef class BestSparseSplitter(BaseSparseSplitter): cdef SplitRecord best, current _init_split(&best, end) + cdef double current_proxy_improvement = - INFINITY + cdef double best_proxy_improvement = - INFINITY cdef SIZE_t f_i = n_features cdef SIZE_t f_j, p, tmp @@ -2548,10 +2602,10 @@ cdef class BestSparseSplitter(BaseSparseSplitter): (self.criterion.weighted_n_right < min_weight_leaf)): continue - current.improvement = self.criterion.impurity_improvement(impurity) - if current.improvement > best.improvement: - self.criterion.children_impurity(¤t.impurity_left, - ¤t.impurity_right) + current_proxy_improvement = self.criterion.proxy_impurity_improvement() + + if current_proxy_improvement > best_proxy_improvement: + best_proxy_improvement = current_proxy_improvement current.threshold = (Xf[p_prev] + Xf[p]) / 2.0 if current.threshold == Xf[p]: @@ -2567,6 +2621,12 @@ cdef class BestSparseSplitter(BaseSparseSplitter): self._partition(best.threshold, end_negative, start_positive, best.pos) + self.criterion.reset() + self.criterion.update(best.pos) + best.improvement = self.criterion.impurity_improvement(impurity) + self.criterion.children_impurity(&best.impurity_left, + &best.impurity_right) + # Respect invariant for constant features: the original order of # element in features[:n_known_constants] must be preserved for sibling # and child nodes @@ -2620,6 +2680,8 @@ cdef class RandomSparseSplitter(BaseSparseSplitter): cdef SplitRecord best, current _init_split(&best, end) + cdef double current_proxy_improvement = - INFINITY + cdef double best_proxy_improvement = - INFINITY cdef DTYPE_t current_feature_value @@ -2767,20 +2829,30 @@ cdef class RandomSparseSplitter(BaseSparseSplitter): (self.criterion.weighted_n_right < min_weight_leaf)): continue - current.improvement = self.criterion.impurity_improvement(impurity) + current_proxy_improvement = self.criterion.proxy_impurity_improvement() + + if current_proxy_improvement > best_proxy_improvement: + best_proxy_improvement = current_proxy_improvement + current.improvement = self.criterion.impurity_improvement(impurity) - if current.improvement > best.improvement: self.criterion.children_impurity(¤t.impurity_left, ¤t.impurity_right) best = current # 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, - &is_samples_sorted) + if best.pos < end: + if current.feature != best.feature: + self.extract_nnz(best.feature, &end_negative, &start_positive, + &is_samples_sorted) - self._partition(best.threshold, end_negative, start_positive, - best.pos) + self._partition(best.threshold, end_negative, start_positive, + best.pos) + + self.criterion.reset() + self.criterion.update(best.pos) + best.improvement = self.criterion.impurity_improvement(impurity) + self.criterion.children_impurity(&best.impurity_left, + &best.impurity_right) # Respect invariant for constant features: the original order of # element in features[:n_known_constants] must be preserved for sibling