From 004ac5a5732538a4c773d7268e78292d992241d8 Mon Sep 17 00:00:00 2001 From: MatthieuBizien Date: Sat, 5 Jul 2014 02:51:28 +0200 Subject: [PATCH] First draft of categorical split --- sklearn/tree/_tree.c | 6989 ++++++++++++++++++++++------------------ sklearn/tree/_tree.pxd | 2 + sklearn/tree/_tree.pyx | 127 +- 3 files changed, 3912 insertions(+), 3206 deletions(-) diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index b2d75541fc8b3..895ef48eb6315 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.20.2 on Sat Jun 28 00:23:06 2014 */ +/* Generated by Cython 0.20 on Sat Jul 5 04:06:03 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -19,7 +19,7 @@ #elif PY_VERSION_HEX < 0x02040000 #error Cython requires Python 2.4+. #else -#define CYTHON_ABI "0_20_2" +#define CYTHON_ABI "0_20" #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -54,7 +54,7 @@ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 +#if CYTHON_COMPILING_IN_PYPY #define Py_OptimizeFlag 0 #endif #if PY_VERSION_HEX < 0x02050000 @@ -116,7 +116,7 @@ #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) + PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" @@ -161,16 +161,10 @@ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#define __Pyx_PyUnicode_Concat(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ + PyNumber_Add(a, b) : PyUnicode_Concat(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else @@ -237,7 +231,7 @@ #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif -#if PY_VERSION_HEX < 0x030200A4 +#if PY_VERSION_HEX < 0x03020000 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong @@ -316,12 +310,6 @@ static CYTHON_INLINE float __PYX_NAN() { return value; } #endif -#ifdef __cplusplus -template -void __Pyx_call_destructor(T* x) { - x->~T(); -} -#endif #if PY_MAJOR_VERSION >= 3 @@ -353,6 +341,13 @@ void __Pyx_call_destructor(T* x) { #include "numpy/ufuncobject.h" #include "math.h" #include "pythread.h" +#include +#include "ios" +#include "new" +#include "stdexcept" +#include "typeinfo" +#include +#include #ifdef _OPENMP #include #endif /* _OPENMP */ @@ -398,7 +393,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -408,17 +403,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #endif #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) +#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) +#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) +#define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s) +#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) +#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) #if PY_MAJOR_VERSION < 3 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; - return (size_t)(u_end - u - 1); + return u_end - u - 1; } #else #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen @@ -441,21 +436,18 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; + PyObject* sys = NULL; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; + if (sys == NULL) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { + if (default_encoding == NULL) goto bad; + if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { + const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { @@ -463,21 +455,23 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; + if (ascii_chars_u == NULL) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); } - Py_DECREF(default_encoding); + Py_XDECREF(sys); + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); return 0; bad: + Py_XDECREF(sys); Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); @@ -491,22 +485,21 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; + PyObject* sys = NULL; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; + if (sys == NULL) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; + if (default_encoding == NULL) goto bad; + default_encoding_c = PyBytes_AS_STRING(default_encoding); __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(sys); Py_DECREF(default_encoding); return 0; bad: + Py_XDECREF(sys); Py_XDECREF(default_encoding); return -1; } @@ -514,11 +507,16 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #endif -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ +#ifdef __GNUC__ + /* Test for GCC > 2.95 */ + #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) + #else /* __GNUC__ > 2 ... */ + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ > 2 ... */ +#else /* __GNUC__ */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ @@ -600,7 +598,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -609,7 +607,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -618,7 +616,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -627,7 +625,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -636,7 +634,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -645,7 +643,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -654,7 +652,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -663,7 +661,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -672,7 +670,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -681,7 +679,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -690,7 +688,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< @@ -699,7 +697,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< @@ -708,7 +706,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -717,7 +715,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -726,7 +724,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -735,7 +733,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -744,7 +742,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -753,7 +751,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -762,7 +760,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -771,7 +769,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -780,7 +778,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -864,25 +862,25 @@ typedef npy_uint32 __pyx_t_7sklearn_4tree_5_tree_UINT32_t; /*--- Type declarations ---*/ -struct __pyx_obj_7sklearn_4tree_6_utils_Stack; -struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap; -struct __pyx_obj_7sklearn_4tree_5_tree_Criterion; struct __pyx_obj_7sklearn_4tree_5_tree_Splitter; +struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_Tree; +struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder; +struct __pyx_obj_7sklearn_4tree_6_utils_Stack; +struct __pyx_obj_7sklearn_4tree_5_tree_Criterion; struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion; -struct __pyx_obj_7sklearn_4tree_5_tree_Entropy; struct __pyx_obj_7sklearn_4tree_5_tree_Gini; struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion; struct __pyx_obj_7sklearn_4tree_5_tree_MSE; struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE; -struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter; -struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter; -struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter; -struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; +struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap; +struct __pyx_obj_7sklearn_4tree_5_tree_Entropy; struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; +struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; +struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -891,7 +889,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -900,7 +898,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -909,7 +907,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -978,9 +976,11 @@ struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord { double improvement; double impurity_left; double impurity_right; + int split_type; + int split_categories; }; -/* "sklearn/tree/_tree.pxd":147 +/* "sklearn/tree/_tree.pxd":149 * # ============================================================================= * * cdef struct Node: # <<<<<<<<<<<<<< @@ -997,7 +997,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":186 * double weighted_n_samples) nogil * cdef void _resize(self, SIZE_t capacity) * cdef int _resize_c(self, SIZE_t capacity=*) nogil # <<<<<<<<<<<<<< @@ -1009,7 +1009,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":191 +/* "sklearn/tree/_tree.pxd":193 * cpdef np.ndarray predict(self, np.ndarray[DTYPE_t, ndim=2] X) * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] X) * cpdef compute_feature_importances(self, normalize=*) # <<<<<<<<<<<<<< @@ -1021,7 +1021,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances { PyObject *normalize; }; -/* "sklearn/tree/_tree.pxd":213 +/* "sklearn/tree/_tree.pxd":215 * cdef SIZE_t max_depth # Maximal tree depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1032,7 +1032,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":60 +/* "sklearn/tree/_tree.pyx":65 * cdef int IS_NOT_LEFT = 0 * * cdef enum: # <<<<<<<<<<<<<< @@ -1043,7 +1043,7 @@ enum { __pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX = 0x7FFFFFFF }; -/* "sklearn/tree/_tree.pyx":1809 +/* "sklearn/tree/_tree.pyx":1922 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1055,7 +1055,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":1974 +/* "sklearn/tree/_tree.pyx":2087 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1067,65 +1067,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_utils.pxd":29 - * SIZE_t n_constant_features - * - * cdef class Stack: # <<<<<<<<<<<<<< - * cdef SIZE_t capacity - * cdef SIZE_t top - */ -struct __pyx_obj_7sklearn_4tree_6_utils_Stack { - PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtab; - __pyx_t_7sklearn_4tree_6_utils_SIZE_t capacity; - __pyx_t_7sklearn_4tree_6_utils_SIZE_t top; - struct __pyx_t_7sklearn_4tree_6_utils_StackRecord *stack_; -}; - - -/* "sklearn/tree/_utils.pxd":58 - * double improvement - * - * cdef class PriorityHeap: # <<<<<<<<<<<<<< - * cdef SIZE_t capacity - * cdef SIZE_t heap_ptr - */ -struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap { - PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtab; - __pyx_t_7sklearn_4tree_6_utils_SIZE_t capacity; - __pyx_t_7sklearn_4tree_6_utils_SIZE_t heap_ptr; - struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *heap_; -}; - - -/* "sklearn/tree/_tree.pxd":25 - * # ============================================================================= - * - * cdef class Criterion: # <<<<<<<<<<<<<< - * # The criterion computes the impurity of a node and the reduction of - * # impurity of a split on that node. It also computes the output statistics - */ -struct __pyx_obj_7sklearn_4tree_5_tree_Criterion { - PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *__pyx_vtab; - __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *y; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t y_stride; - __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *sample_weight; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t *samples; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t start; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t pos; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t end; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_outputs; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_node_samples; - double weighted_n_samples; - double weighted_n_node_samples; - double weighted_n_left; - double weighted_n_right; -}; - - -/* "sklearn/tree/_tree.pxd":79 +/* "sklearn/tree/_tree.pxd":81 * * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1159,7 +1101,25 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { }; -/* "sklearn/tree/_tree.pxd":158 +/* "sklearn/tree/_tree.pyx":1648 + * + * + * cdef class PresortBestSplitter(Splitter): # <<<<<<<<<<<<<< + * """Splitter for finding the best split, using presorting.""" + * cdef DTYPE_t* X_old + */ +struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter { + struct __pyx_obj_7sklearn_4tree_5_tree_Splitter __pyx_base; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *X_old; + PyArrayObject *X_argsorted; + __pyx_t_7sklearn_4tree_5_tree_INT32_t *X_argsorted_ptr; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t X_argsorted_stride; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_total_samples; + unsigned char *sample_mask; +}; + + +/* "sklearn/tree/_tree.pxd":160 * DOUBLE_t weighted_n_node_samples # Weighted number of samples at the node * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1182,7 +1142,19 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Tree { }; -/* "sklearn/tree/_tree.pxd":198 +/* "sklearn/tree/_tree.pyx":1444 + * + * + * cdef class RandomSplitter(Splitter): # <<<<<<<<<<<<<< + * """Splitter for finding the best random split.""" + * def __reduce__(self): + */ +struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter { + struct __pyx_obj_7sklearn_4tree_5_tree_Splitter __pyx_base; +}; + + +/* "sklearn/tree/_tree.pxd":200 * # ============================================================================= * * cdef class TreeBuilder: # <<<<<<<<<<<<<< @@ -1200,7 +1172,49 @@ struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder { }; -/* "sklearn/tree/_tree.pyx":141 +/* "sklearn/tree/_utils.pxd":29 + * SIZE_t n_constant_features + * + * cdef class Stack: # <<<<<<<<<<<<<< + * cdef SIZE_t capacity + * cdef SIZE_t top + */ +struct __pyx_obj_7sklearn_4tree_6_utils_Stack { + PyObject_HEAD + struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtab; + __pyx_t_7sklearn_4tree_6_utils_SIZE_t capacity; + __pyx_t_7sklearn_4tree_6_utils_SIZE_t top; + struct __pyx_t_7sklearn_4tree_6_utils_StackRecord *stack_; +}; + + +/* "sklearn/tree/_tree.pxd":25 + * # ============================================================================= + * + * cdef class Criterion: # <<<<<<<<<<<<<< + * # The criterion computes the impurity of a node and the reduction of + * # impurity of a split on that node. It also computes the output statistics + */ +struct __pyx_obj_7sklearn_4tree_5_tree_Criterion { + PyObject_HEAD + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *__pyx_vtab; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *y; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t y_stride; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *sample_weight; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t start; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t pos; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t end; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_outputs; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_node_samples; + double weighted_n_samples; + double weighted_n_node_samples; + double weighted_n_left; + double weighted_n_right; +}; + + +/* "sklearn/tree/_tree.pyx":157 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1217,19 +1231,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion { }; -/* "sklearn/tree/_tree.pyx":359 - * - * - * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Cross Entropy impurity criteria. - * - */ -struct __pyx_obj_7sklearn_4tree_5_tree_Entropy { - struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; -}; - - -/* "sklearn/tree/_tree.pyx":450 +/* "sklearn/tree/_tree.pyx":466 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1241,7 +1243,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Gini { }; -/* "sklearn/tree/_tree.pyx":544 +/* "sklearn/tree/_tree.pyx":560 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1264,7 +1266,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion { }; -/* "sklearn/tree/_tree.pyx":827 +/* "sklearn/tree/_tree.pyx":843 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1276,7 +1278,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_MSE { }; -/* "sklearn/tree/_tree.pyx":868 +/* "sklearn/tree/_tree.pyx":884 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1288,49 +1290,48 @@ struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE { }; -/* "sklearn/tree/_tree.pyx":1031 - * +/* "sklearn/tree/_utils.pxd":58 + * double improvement * - * cdef class BestSplitter(Splitter): # <<<<<<<<<<<<<< - * """Splitter for finding the best split.""" - * def __reduce__(self): + * cdef class PriorityHeap: # <<<<<<<<<<<<<< + * cdef SIZE_t capacity + * cdef SIZE_t heap_ptr */ -struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter { - struct __pyx_obj_7sklearn_4tree_5_tree_Splitter __pyx_base; +struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap { + PyObject_HEAD + struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtab; + __pyx_t_7sklearn_4tree_6_utils_SIZE_t capacity; + __pyx_t_7sklearn_4tree_6_utils_SIZE_t heap_ptr; + struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *heap_; }; -/* "sklearn/tree/_tree.pyx":1331 +/* "sklearn/tree/_tree.pyx":375 * * - * cdef class RandomSplitter(Splitter): # <<<<<<<<<<<<<< - * """Splitter for finding the best random split.""" - * def __reduce__(self): + * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< + * """Cross Entropy impurity criteria. + * */ -struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter { - struct __pyx_obj_7sklearn_4tree_5_tree_Splitter __pyx_base; +struct __pyx_obj_7sklearn_4tree_5_tree_Entropy { + struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; }; -/* "sklearn/tree/_tree.pyx":1535 +/* "sklearn/tree/_tree.pyx":2065 * * - * cdef class PresortBestSplitter(Splitter): # <<<<<<<<<<<<<< - * """Splitter for finding the best split, using presorting.""" - * cdef DTYPE_t* X_old + * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< + * """Build a decision tree in best-first fashion. + * */ -struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter { - struct __pyx_obj_7sklearn_4tree_5_tree_Splitter __pyx_base; - __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *X_old; - PyArrayObject *X_argsorted; - __pyx_t_7sklearn_4tree_5_tree_INT32_t *X_argsorted_ptr; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t X_argsorted_stride; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_total_samples; - unsigned char *sample_mask; +struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder { + struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder __pyx_base; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_leaf_nodes; }; -/* "sklearn/tree/_tree.pyx":1796 +/* "sklearn/tree/_tree.pyx":1909 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1342,53 +1343,20 @@ struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { }; -/* "sklearn/tree/_tree.pyx":1952 - * - * - * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< - * """Build a decision tree in best-first fashion. +/* "sklearn/tree/_tree.pyx":1047 * - */ -struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder { - struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder __pyx_base; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_leaf_nodes; -}; - - - -/* "sklearn/tree/_utils.pxd":29 - * SIZE_t n_constant_features * - * cdef class Stack: # <<<<<<<<<<<<<< - * cdef SIZE_t capacity - * cdef SIZE_t top + * cdef class BestSplitter(Splitter): # <<<<<<<<<<<<<< + * """Splitter for finding the best split.""" + * def __reduce__(self): */ - -struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { - int (*is_empty)(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *); - int (*push)(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, int, double, __pyx_t_7sklearn_4tree_6_utils_SIZE_t); - int (*pop)(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *, struct __pyx_t_7sklearn_4tree_6_utils_StackRecord *); +struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter { + struct __pyx_obj_7sklearn_4tree_5_tree_Splitter __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "sklearn/tree/_utils.pxd":58 - * double improvement - * - * cdef class PriorityHeap: # <<<<<<<<<<<<<< - * cdef SIZE_t capacity - * cdef SIZE_t heap_ptr - */ - -struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap { - int (*is_empty)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *); - int (*push)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, int, double, double, double, double); - int (*pop)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *, struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *); -}; -static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap; - -/* "sklearn/tree/_tree.pyx":88 +/* "sklearn/tree/_tree.pyx":104 * # ============================================================================= * * cdef class Criterion: # <<<<<<<<<<<<<< @@ -1408,25 +1376,63 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; -/* "sklearn/tree/_tree.pyx":914 +/* "sklearn/tree/_tree.pyx":560 * * - * cdef class Splitter: # <<<<<<<<<<<<<< - * def __cinit__(self, Criterion criterion, SIZE_t max_features, - * SIZE_t min_samples_leaf, + * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< + * """Abstract criterion for regression. + * */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter { - void (*init)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyArrayObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *); - void (*node_reset)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double *); - void (*node_split)(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 *); - void (*node_value)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double *); - double (*node_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *); +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion; + + +/* "sklearn/tree/_tree.pyx":843 + * + * + * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< + * """Mean squared error impurity criterion. + * + */ + +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion __pyx_base; +}; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE *__pyx_vtabptr_7sklearn_4tree_5_tree_MSE; + + +/* "sklearn/tree/_tree.pyx":884 + * + * + * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< + * """Mean squared error impurity criterion with improvement score by Friedman + * + */ + +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE __pyx_base; +}; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE; + + +/* "sklearn/tree/_tree.pyx":1898 + * # Tree builders + * # ============================================================================= + * cdef class TreeBuilder: # <<<<<<<<<<<<<< + * """Interface for different tree building strategies. """ + * + */ + +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder { + PyObject *(*build)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args); +}; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; -/* "sklearn/tree/_tree.pyx":2166 +/* "sklearn/tree/_tree.pyx":2279 * # ============================================================================= * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1447,119 +1453,127 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *__pyx_vtabptr_7sklearn_4tree_5_tree_Tree; -/* "sklearn/tree/_tree.pyx":1785 - * # Tree builders - * # ============================================================================= - * cdef class TreeBuilder: # <<<<<<<<<<<<<< - * """Interface for different tree building strategies. """ +/* "sklearn/tree/_tree.pyx":1909 + * # Depth first builder --------------------------------------------------------- + * + * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< + * """Build a decision tree in depth-first fashion.""" * */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder { - PyObject *(*build)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build *__pyx_optional_args); +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; -/* "sklearn/tree/_tree.pyx":141 +/* "sklearn/tree/_tree.pyx":930 * * - * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< - * """Abstract criterion for classification.""" - * cdef SIZE_t* n_classes + * cdef class Splitter: # <<<<<<<<<<<<<< + * def __cinit__(self, Criterion criterion, SIZE_t max_features, + * SIZE_t min_samples_leaf, */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter { + void (*init)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyArrayObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *); + void (*node_reset)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double *); + void (*node_split)(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 *); + void (*node_value)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double *); + double (*node_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *); }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; -/* "sklearn/tree/_tree.pyx":359 +/* "sklearn/tree/_tree.pyx":1047 * * - * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Cross Entropy impurity criteria. - * + * cdef class BestSplitter(Splitter): # <<<<<<<<<<<<<< + * """Splitter for finding the best split.""" + * def __reduce__(self): */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy *__pyx_vtabptr_7sklearn_4tree_5_tree_Entropy; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter; -/* "sklearn/tree/_tree.pyx":450 +/* "sklearn/tree/_tree.pyx":157 * * - * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< - * """Gini Index impurity criteria. - * + * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< + * """Abstract criterion for classification.""" + * cdef SIZE_t* n_classes */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini *__pyx_vtabptr_7sklearn_4tree_5_tree_Gini; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion; -/* "sklearn/tree/_tree.pyx":544 +/* "sklearn/tree/_tree.pyx":466 * * - * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< - * """Abstract criterion for regression. + * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< + * """Gini Index impurity criteria. * */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini *__pyx_vtabptr_7sklearn_4tree_5_tree_Gini; -/* "sklearn/tree/_tree.pyx":827 - * - * - * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< - * """Mean squared error impurity criterion. +/* "sklearn/tree/_utils.pxd":29 + * SIZE_t n_constant_features * + * cdef class Stack: # <<<<<<<<<<<<<< + * cdef SIZE_t capacity + * cdef SIZE_t top */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { + int (*is_empty)(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *); + int (*push)(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, int, double, __pyx_t_7sklearn_4tree_6_utils_SIZE_t); + int (*pop)(struct __pyx_obj_7sklearn_4tree_6_utils_Stack *, struct __pyx_t_7sklearn_4tree_6_utils_StackRecord *); }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE *__pyx_vtabptr_7sklearn_4tree_5_tree_MSE; +static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "sklearn/tree/_tree.pyx":868 +/* "sklearn/tree/_tree.pyx":375 * * - * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< - * """Mean squared error impurity criterion with improvement score by Friedman + * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< + * """Cross Entropy impurity criteria. * */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion __pyx_base; }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy *__pyx_vtabptr_7sklearn_4tree_5_tree_Entropy; -/* "sklearn/tree/_tree.pyx":1031 +/* "sklearn/tree/_tree.pyx":2065 * * - * cdef class BestSplitter(Splitter): # <<<<<<<<<<<<<< - * """Splitter for finding the best split.""" - * def __reduce__(self): + * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< + * """Build a decision tree in best-first fashion. + * */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter __pyx_base; +struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder { + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder __pyx_base; + int (*_add_split_node)(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 *); }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder; +static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(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 *); -/* "sklearn/tree/_tree.pyx":1331 +/* "sklearn/tree/_tree.pyx":1444 * * * cdef class RandomSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1573,7 +1587,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":1535 +/* "sklearn/tree/_tree.pyx":1648 * * * cdef class PresortBestSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1587,34 +1601,20 @@ 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":1796 - * # Depth first builder --------------------------------------------------------- - * - * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< - * """Build a decision tree in depth-first fashion.""" - * - */ - -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder __pyx_base; -}; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; - - -/* "sklearn/tree/_tree.pyx":1952 - * - * - * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< - * """Build a decision tree in best-first fashion. +/* "sklearn/tree/_utils.pxd":58 + * double improvement * + * cdef class PriorityHeap: # <<<<<<<<<<<<<< + * cdef SIZE_t capacity + * cdef SIZE_t heap_ptr */ -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder { - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder __pyx_base; - int (*_add_split_node)(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 *); +struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap { + int (*is_empty)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *); + int (*push)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, __pyx_t_7sklearn_4tree_6_utils_SIZE_t, int, double, double, double, double); + int (*pop)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *, struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *); }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder; -static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__add_split_node(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 *); +static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif @@ -1714,12 +1714,6 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback); /*proto*/ @@ -1813,9 +1807,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *); +static CYTHON_INLINE long __Pyx_pow_long(long, long); /* proto */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); -static CYTHON_INLINE long __Pyx_pow_long(long, long); /* proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 @@ -1919,8 +1915,6 @@ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(do #endif #endif -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - static int __Pyx_check_binary_version(void); #if !defined(__Pyx_PyIdentifier_FromString) @@ -2052,26 +2046,34 @@ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from 'cpython' */ +/* Module declarations from 'libcpp.utility' */ + +/* Module declarations from 'libcpp.pair' */ + +/* Module declarations from 'libcpp.set' */ + +/* Module declarations from 'libcpp.map' */ + /* Module declarations from 'sklearn.tree._utils' */ static PyTypeObject *__pyx_ptype_7sklearn_4tree_6_utils_Stack = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = 0; /* Module declarations from 'sklearn.tree._tree' */ -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Criterion = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Splitter = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Tree = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Criterion = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion = 0; -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Entropy = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Gini = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Entropy = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_MSE = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_FriedmanMSE = 0; -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter = 0; -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter = 0; -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter = 0; -static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestFirstTreeBuilder = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = 0; +static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter = 0; static double __pyx_v_7sklearn_4tree_5_tree_INFINITY; static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF; static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; @@ -2082,6 +2084,9 @@ static int __pyx_v_7sklearn_4tree_5_tree_IS_FIRST; static int __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST; static int __pyx_v_7sklearn_4tree_5_tree_IS_LEFT; static int __pyx_v_7sklearn_4tree_5_tree_IS_NOT_LEFT; +static int __pyx_v_7sklearn_4tree_5_tree_CONTINUOUS; +static int __pyx_v_7sklearn_4tree_5_tree_CATEGORICAL; +static int __pyx_f_7sklearn_4tree_5_tree_is_left_var(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t, int, std::map<__pyx_t_7sklearn_4tree_5_tree_DTYPE_t,__pyx_t_7sklearn_4tree_5_tree_SIZE_t>); /*proto*/ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx_t_7sklearn_4tree_5_tree_SplitRecord *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); /*proto*/ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); /*proto*/ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); /*proto*/ @@ -2108,6 +2113,7 @@ int __pyx_module_is_main_sklearn__tree___tree = 0; /* Implementation of 'sklearn.tree._tree' */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_xrange; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs, PyArrayObject *__pyx_v_n_classes); /* proto */ @@ -2175,21 +2181,21 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Criterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Splitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Tree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Criterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_ClassificationCriterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Entropy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Gini(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Entropy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RegressionCriterion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_MSE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_FriedmanMSE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_DepthFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_DepthFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k_B[] = "B"; static char __pyx_k_C[] = "C"; static char __pyx_k_H[] = "H"; @@ -2241,6 +2247,7 @@ static char __pyx_k_zeros[] = "zeros"; static char __pyx_k_DOUBLE[] = "DOUBLE"; static char __pyx_k_import[] = "__import__"; static char __pyx_k_values[] = "values"; +static char __pyx_k_xrange[] = "xrange"; static char __pyx_k_argsort[] = "argsort"; static char __pyx_k_asarray[] = "asarray"; static char __pyx_k_feature[] = "feature"; @@ -2294,7 +2301,7 @@ static char __pyx_k_we_just_allocated_d_bytes[] = "we just allocated %d bytes!"; 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_home_ndawe_workspace_sklearn_sk[] = "/home/ndawe/workspace/sklearn/sklearn/tree/_tree.pyx"; +static char __pyx_k_Users_matthieu_Programmes_sciki[] = "/Users/matthieu/Programmes/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_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"; @@ -2314,6 +2321,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_matthieu_Programmes_sciki; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_X; static PyObject *__pyx_kp_s_You_have_loaded_Tree_version_whi; @@ -2338,7 +2346,6 @@ static PyObject *__pyx_n_s_float32; static PyObject *__pyx_n_s_float64; static PyObject *__pyx_n_s_formats; static PyObject *__pyx_n_s_getstate; -static PyObject *__pyx_kp_s_home_ndawe_workspace_sklearn_sk; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_impurity; static PyObject *__pyx_n_s_inf; @@ -2395,6 +2402,7 @@ static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_values; static PyObject *__pyx_kp_s_we_just_allocated_d_bytes; static PyObject *__pyx_n_s_weighted_n_node_samples; +static PyObject *__pyx_n_s_xrange; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_int_0; @@ -2413,7 +2421,51 @@ static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_codeobj__11; -/* "sklearn/tree/_tree.pyx":91 +/* "sklearn/tree/_tree.pyx":92 + * }) + * + * cdef int is_left_var(DTYPE_t x, int split, # <<<<<<<<<<<<<< + * map_[DTYPE_t, SIZE_t] categories) nogil: + * """Return whether the category belong to the left branch, according to a + */ + +static int __pyx_f_7sklearn_4tree_5_tree_is_left_var(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_v_x, int __pyx_v_split, std::map<__pyx_t_7sklearn_4tree_5_tree_DTYPE_t,__pyx_t_7sklearn_4tree_5_tree_SIZE_t> __pyx_v_categories) { + int __pyx_v_i; + int __pyx_r; + + /* "sklearn/tree/_tree.pyx":96 + * """Return whether the category belong to the left branch, according to a + * split""" + * cdef int i = categories[x] # <<<<<<<<<<<<<< + * return (split >> i) & 1 + * + */ + __pyx_v_i = (__pyx_v_categories[__pyx_v_x]); + + /* "sklearn/tree/_tree.pyx":97 + * split""" + * cdef int i = categories[x] + * return (split >> i) & 1 # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = ((__pyx_v_split >> __pyx_v_i) & 1); + goto __pyx_L0; + + /* "sklearn/tree/_tree.pyx":92 + * }) + * + * cdef int is_left_var(DTYPE_t x, int split, # <<<<<<<<<<<<<< + * map_[DTYPE_t, SIZE_t] categories) nogil: + * """Return whether the category belong to the left branch, according to a + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "sklearn/tree/_tree.pyx":107 * """Interface for impurity criteria.""" * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -2426,7 +2478,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_init(CYTHON_UNUSED struct _ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":98 +/* "sklearn/tree/_tree.pyx":114 * pass * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -2439,7 +2491,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_reset(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":102 +/* "sklearn/tree/_tree.pyx":118 * pass * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -2452,7 +2504,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_update(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":107 +/* "sklearn/tree/_tree.pyx":123 * pass * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -2468,7 +2520,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity(CYTHON_UNUS return __pyx_r; } -/* "sklearn/tree/_tree.pyx":112 +/* "sklearn/tree/_tree.pyx":128 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -2481,7 +2533,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity(CYTHON_UN /* function exit code */ } -/* "sklearn/tree/_tree.pyx":118 +/* "sklearn/tree/_tree.pyx":134 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -2494,7 +2546,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value(CYTHON_UNUSED st /* function exit code */ } -/* "sklearn/tree/_tree.pyx":122 +/* "sklearn/tree/_tree.pyx":138 * pass * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -2507,7 +2559,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":134 + /* "sklearn/tree/_tree.pyx":150 * cdef double impurity_right * * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< @@ -2516,7 +2568,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":136 + /* "sklearn/tree/_tree.pyx":152 * self.children_impurity(&impurity_left, &impurity_right) * * return ((self.weighted_n_node_samples / self.weighted_n_samples) * # <<<<<<<<<<<<<< @@ -2526,7 +2578,7 @@ 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":122 + /* "sklearn/tree/_tree.pyx":138 * pass * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -2539,7 +2591,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":149 +/* "sklearn/tree/_tree.pyx":165 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< @@ -2578,11 +2630,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 = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __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 = 149; __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 = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2590,18 +2642,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 = 149; __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 = 165; __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 = 149; __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 = 165; __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 = 150; __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 = 166; __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 */ @@ -2641,11 +2693,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 = 149; __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 = 165; __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":152 + /* "sklearn/tree/_tree.pyx":168 * np.ndarray[SIZE_t, ndim=1] n_classes): * # Default values * self.y = NULL # <<<<<<<<<<<<<< @@ -2654,7 +2706,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":153 + /* "sklearn/tree/_tree.pyx":169 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -2663,7 +2715,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":154 + /* "sklearn/tree/_tree.pyx":170 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -2672,7 +2724,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":156 + /* "sklearn/tree/_tree.pyx":172 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -2681,7 +2733,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":157 + /* "sklearn/tree/_tree.pyx":173 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -2690,7 +2742,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":158 + /* "sklearn/tree/_tree.pyx":174 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -2699,7 +2751,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":159 + /* "sklearn/tree/_tree.pyx":175 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -2708,7 +2760,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":161 + /* "sklearn/tree/_tree.pyx":177 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -2717,7 +2769,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":162 + /* "sklearn/tree/_tree.pyx":178 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -2726,7 +2778,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":163 + /* "sklearn/tree/_tree.pyx":179 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -2735,7 +2787,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":164 + /* "sklearn/tree/_tree.pyx":180 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -2744,7 +2796,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":165 + /* "sklearn/tree/_tree.pyx":181 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -2753,7 +2805,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_tree.pyx":167 + /* "sklearn/tree/_tree.pyx":183 * self.weighted_n_right = 0.0 * * self.label_count_left = NULL # <<<<<<<<<<<<<< @@ -2762,7 +2814,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_left = NULL; - /* "sklearn/tree/_tree.pyx":168 + /* "sklearn/tree/_tree.pyx":184 * * self.label_count_left = NULL * self.label_count_right = NULL # <<<<<<<<<<<<<< @@ -2771,7 +2823,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_right = NULL; - /* "sklearn/tree/_tree.pyx":169 + /* "sklearn/tree/_tree.pyx":185 * self.label_count_left = NULL * self.label_count_right = NULL * self.label_count_total = NULL # <<<<<<<<<<<<<< @@ -2780,7 +2832,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_total = NULL; - /* "sklearn/tree/_tree.pyx":172 + /* "sklearn/tree/_tree.pyx":188 * * # Count labels for each output * self.n_classes = NULL # <<<<<<<<<<<<<< @@ -2789,16 +2841,16 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_tree.pyx":173 + /* "sklearn/tree/_tree.pyx":189 * # Count labels for each output * self.n_classes = NULL * safe_realloc(&self.n_classes, n_outputs) # <<<<<<<<<<<<<< * * cdef SIZE_t k = 0 */ - __pyx_t_1 = __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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":175 + /* "sklearn/tree/_tree.pyx":191 * safe_realloc(&self.n_classes, n_outputs) * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -2807,7 +2859,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":176 + /* "sklearn/tree/_tree.pyx":192 * * cdef SIZE_t k = 0 * cdef SIZE_t label_count_stride = 0 # <<<<<<<<<<<<<< @@ -2816,7 +2868,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_label_count_stride = 0; - /* "sklearn/tree/_tree.pyx":178 + /* "sklearn/tree/_tree.pyx":194 * cdef SIZE_t label_count_stride = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -2827,7 +2879,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":179 + /* "sklearn/tree/_tree.pyx":195 * * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -2837,7 +2889,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_4 = __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_4, __pyx_pybuffernd_n_classes.diminfo[0].strides)); - /* "sklearn/tree/_tree.pyx":181 + /* "sklearn/tree/_tree.pyx":197 * self.n_classes[k] = n_classes[k] * * if n_classes[k] > label_count_stride: # <<<<<<<<<<<<<< @@ -2848,7 +2900,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_6 = (((*__Pyx_BufPtrStrided1d(__pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_pybuffernd_n_classes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_n_classes.diminfo[0].strides)) > __pyx_v_label_count_stride) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":182 + /* "sklearn/tree/_tree.pyx":198 * * if n_classes[k] > label_count_stride: * label_count_stride = n_classes[k] # <<<<<<<<<<<<<< @@ -2862,7 +2914,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":184 + /* "sklearn/tree/_tree.pyx":200 * label_count_stride = n_classes[k] * * self.label_count_stride = label_count_stride # <<<<<<<<<<<<<< @@ -2871,7 +2923,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":187 + /* "sklearn/tree/_tree.pyx":203 * * # Allocate counters * cdef SIZE_t n_elements = n_outputs * label_count_stride # <<<<<<<<<<<<<< @@ -2880,7 +2932,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":188 + /* "sklearn/tree/_tree.pyx":204 * # Allocate counters * cdef SIZE_t n_elements = n_outputs * label_count_stride * self.label_count_left = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< @@ -2889,7 +2941,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":189 + /* "sklearn/tree/_tree.pyx":205 * 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)) # <<<<<<<<<<<<<< @@ -2898,7 +2950,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":190 + /* "sklearn/tree/_tree.pyx":206 * 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)) # <<<<<<<<<<<<<< @@ -2907,7 +2959,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":193 + /* "sklearn/tree/_tree.pyx":209 * * # Check for allocation errors * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< @@ -2917,7 +2969,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_6 = ((__pyx_v_self->label_count_left == NULL) != 0); if (!__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":194 + /* "sklearn/tree/_tree.pyx":210 * # Check for allocation errors * if (self.label_count_left == NULL or * self.label_count_right == NULL or # <<<<<<<<<<<<<< @@ -2927,7 +2979,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_8 = ((__pyx_v_self->label_count_right == NULL) != 0); if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":195 + /* "sklearn/tree/_tree.pyx":211 * if (self.label_count_left == NULL or * self.label_count_right == NULL or * self.label_count_total == NULL): # <<<<<<<<<<<<<< @@ -2945,17 +2997,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st } if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":196 + /* "sklearn/tree/_tree.pyx":212 * 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 = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":149 + /* "sklearn/tree/_tree.pyx":165 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< @@ -2981,7 +3033,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":198 +/* "sklearn/tree/_tree.pyx":214 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3004,7 +3056,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":200 + /* "sklearn/tree/_tree.pyx":216 * def __dealloc__(self): * """Destructor.""" * free(self.n_classes) # <<<<<<<<<<<<<< @@ -3013,7 +3065,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->n_classes); - /* "sklearn/tree/_tree.pyx":201 + /* "sklearn/tree/_tree.pyx":217 * """Destructor.""" * free(self.n_classes) * free(self.label_count_left) # <<<<<<<<<<<<<< @@ -3022,7 +3074,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_left); - /* "sklearn/tree/_tree.pyx":202 + /* "sklearn/tree/_tree.pyx":218 * free(self.n_classes) * free(self.label_count_left) * free(self.label_count_right) # <<<<<<<<<<<<<< @@ -3031,7 +3083,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_right); - /* "sklearn/tree/_tree.pyx":203 + /* "sklearn/tree/_tree.pyx":219 * free(self.label_count_left) * free(self.label_count_right) * free(self.label_count_total) # <<<<<<<<<<<<<< @@ -3040,7 +3092,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_total); - /* "sklearn/tree/_tree.pyx":198 + /* "sklearn/tree/_tree.pyx":214 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3052,7 +3104,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":205 +/* "sklearn/tree/_tree.pyx":221 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3084,7 +3136,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":206 + /* "sklearn/tree/_tree.pyx":222 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< @@ -3093,34 +3145,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":207 + /* "sklearn/tree/_tree.pyx":223 * 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 = 207; __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 = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":208 + /* "sklearn/tree/_tree.pyx":224 * 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 = 208; __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 = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":207 + /* "sklearn/tree/_tree.pyx":223 * 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 = 207; __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 = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -3129,27 +3181,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":209 + /* "sklearn/tree/_tree.pyx":225 * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, 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 = 209; __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 = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":206 + /* "sklearn/tree/_tree.pyx":222 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< * (self.n_outputs, * sizet_ptr_to_ndarray(self.n_classes, self.n_outputs)), */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __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 = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_ClassificationCriterion))); @@ -3164,7 +3216,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":205 + /* "sklearn/tree/_tree.pyx":221 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3185,7 +3237,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red return __pyx_r; } -/* "sklearn/tree/_tree.pyx":211 +/* "sklearn/tree/_tree.pyx":227 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3215,7 +3267,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":212 + /* "sklearn/tree/_tree.pyx":228 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -3223,13 +3275,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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __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":211 + /* "sklearn/tree/_tree.pyx":227 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3248,7 +3300,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get return __pyx_r; } -/* "sklearn/tree/_tree.pyx":214 +/* "sklearn/tree/_tree.pyx":230 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -3281,7 +3333,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_8__set return __pyx_r; } -/* "sklearn/tree/_tree.pyx":217 +/* "sklearn/tree/_tree.pyx":233 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< @@ -3310,7 +3362,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":223 + /* "sklearn/tree/_tree.pyx":239 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -3319,7 +3371,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":224 + /* "sklearn/tree/_tree.pyx":240 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -3328,7 +3380,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":225 + /* "sklearn/tree/_tree.pyx":241 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -3337,7 +3389,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":226 + /* "sklearn/tree/_tree.pyx":242 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -3346,7 +3398,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":227 + /* "sklearn/tree/_tree.pyx":243 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -3355,7 +3407,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":228 + /* "sklearn/tree/_tree.pyx":244 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -3364,7 +3416,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":229 + /* "sklearn/tree/_tree.pyx":245 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< @@ -3373,7 +3425,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":230 + /* "sklearn/tree/_tree.pyx":246 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -3382,7 +3434,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":231 + /* "sklearn/tree/_tree.pyx":247 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -3391,7 +3443,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_weighted_n_node_samples = 0.0; - /* "sklearn/tree/_tree.pyx":234 + /* "sklearn/tree/_tree.pyx":250 * * # Initialize label_count_total and weighted_n_node_samples * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3401,7 +3453,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":235 + /* "sklearn/tree/_tree.pyx":251 * # Initialize label_count_total and weighted_n_node_samples * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3411,7 +3463,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":236 + /* "sklearn/tree/_tree.pyx":252 * 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 # <<<<<<<<<<<<<< @@ -3421,7 +3473,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":237 + /* "sklearn/tree/_tree.pyx":253 * 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 # <<<<<<<<<<<<<< @@ -3431,7 +3483,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":239 + /* "sklearn/tree/_tree.pyx":255 * cdef double* label_count_total = self.label_count_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -3440,7 +3492,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":240 + /* "sklearn/tree/_tree.pyx":256 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -3449,7 +3501,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":241 + /* "sklearn/tree/_tree.pyx":257 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3458,7 +3510,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":242 + /* "sklearn/tree/_tree.pyx":258 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 # <<<<<<<<<<<<<< @@ -3467,7 +3519,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_c = 0; - /* "sklearn/tree/_tree.pyx":243 + /* "sklearn/tree/_tree.pyx":259 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -3476,7 +3528,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":244 + /* "sklearn/tree/_tree.pyx":260 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 * cdef SIZE_t offset = 0 # <<<<<<<<<<<<<< @@ -3485,7 +3537,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_offset = 0; - /* "sklearn/tree/_tree.pyx":246 + /* "sklearn/tree/_tree.pyx":262 * cdef SIZE_t offset = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3496,7 +3548,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":247 + /* "sklearn/tree/_tree.pyx":263 * * for k in range(n_outputs): * memset(label_count_total + offset, 0, # <<<<<<<<<<<<<< @@ -3505,7 +3557,7 @@ 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":249 + /* "sklearn/tree/_tree.pyx":265 * memset(label_count_total + offset, 0, * n_classes[k] * sizeof(double)) * offset += label_count_stride # <<<<<<<<<<<<<< @@ -3515,7 +3567,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_v_offset = (__pyx_v_offset + __pyx_v_label_count_stride); } - /* "sklearn/tree/_tree.pyx":251 + /* "sklearn/tree/_tree.pyx":267 * offset += label_count_stride * * for p in range(start, end): # <<<<<<<<<<<<<< @@ -3526,7 +3578,7 @@ 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":252 + /* "sklearn/tree/_tree.pyx":268 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -3535,7 +3587,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":254 + /* "sklearn/tree/_tree.pyx":270 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -3545,7 +3597,7 @@ 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":255 + /* "sklearn/tree/_tree.pyx":271 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -3557,7 +3609,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":257 + /* "sklearn/tree/_tree.pyx":273 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3568,7 +3620,7 @@ 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":258 + /* "sklearn/tree/_tree.pyx":274 * * for k in range(n_outputs): * c = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -3577,7 +3629,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":259 + /* "sklearn/tree/_tree.pyx":275 * for k in range(n_outputs): * c = y[i * y_stride + k] * label_count_total[k * label_count_stride + c] += w # <<<<<<<<<<<<<< @@ -3588,7 +3640,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":261 + /* "sklearn/tree/_tree.pyx":277 * label_count_total[k * label_count_stride + c] += w * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -3598,7 +3650,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":263 + /* "sklearn/tree/_tree.pyx":279 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3607,7 +3659,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":266 + /* "sklearn/tree/_tree.pyx":282 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -3616,7 +3668,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":217 + /* "sklearn/tree/_tree.pyx":233 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< @@ -3627,7 +3679,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":268 +/* "sklearn/tree/_tree.pyx":284 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3649,7 +3701,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":270 + /* "sklearn/tree/_tree.pyx":286 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" * self.pos = self.start # <<<<<<<<<<<<<< @@ -3659,7 +3711,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":272 + /* "sklearn/tree/_tree.pyx":288 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -3668,7 +3720,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":273 + /* "sklearn/tree/_tree.pyx":289 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3678,7 +3730,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":275 + /* "sklearn/tree/_tree.pyx":291 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3688,7 +3740,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":276 + /* "sklearn/tree/_tree.pyx":292 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3698,7 +3750,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":277 + /* "sklearn/tree/_tree.pyx":293 * 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 # <<<<<<<<<<<<<< @@ -3708,7 +3760,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":278 + /* "sklearn/tree/_tree.pyx":294 * 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 # <<<<<<<<<<<<<< @@ -3718,7 +3770,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":279 + /* "sklearn/tree/_tree.pyx":295 * 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 # <<<<<<<<<<<<<< @@ -3728,7 +3780,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":280 + /* "sklearn/tree/_tree.pyx":296 * 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 # <<<<<<<<<<<<<< @@ -3738,7 +3790,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":282 + /* "sklearn/tree/_tree.pyx":298 * cdef double* label_count_right = self.label_count_right * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3747,7 +3799,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":284 + /* "sklearn/tree/_tree.pyx":300 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3758,7 +3810,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":285 + /* "sklearn/tree/_tree.pyx":301 * * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -3767,7 +3819,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":286 + /* "sklearn/tree/_tree.pyx":302 * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) * memcpy(label_count_right, label_count_total, # <<<<<<<<<<<<<< @@ -3776,7 +3828,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":289 + /* "sklearn/tree/_tree.pyx":305 * n_classes[k] * sizeof(double)) * * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -3785,7 +3837,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":290 + /* "sklearn/tree/_tree.pyx":306 * * label_count_total += label_count_stride * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -3794,7 +3846,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":291 + /* "sklearn/tree/_tree.pyx":307 * label_count_total += label_count_stride * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -3804,7 +3856,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":268 + /* "sklearn/tree/_tree.pyx":284 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3815,7 +3867,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":293 +/* "sklearn/tree/_tree.pyx":309 * label_count_right += label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -3851,7 +3903,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":296 + /* "sklearn/tree/_tree.pyx":312 * """Update the collected statistics by moving samples[pos:new_pos] from * the right child to the left child.""" * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< @@ -3861,7 +3913,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":297 + /* "sklearn/tree/_tree.pyx":313 * the right child to the left child.""" * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< @@ -3871,7 +3923,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":298 + /* "sklearn/tree/_tree.pyx":314 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -3881,7 +3933,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":300 + /* "sklearn/tree/_tree.pyx":316 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -3891,7 +3943,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":301 + /* "sklearn/tree/_tree.pyx":317 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -3901,7 +3953,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":303 + /* "sklearn/tree/_tree.pyx":319 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3911,7 +3963,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":304 + /* "sklearn/tree/_tree.pyx":320 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3921,7 +3973,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_3 = __pyx_v_self->n_classes; __pyx_v_n_classes = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":305 + /* "sklearn/tree/_tree.pyx":321 * 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 # <<<<<<<<<<<<<< @@ -3931,7 +3983,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_2 = __pyx_v_self->label_count_stride; __pyx_v_label_count_stride = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":306 + /* "sklearn/tree/_tree.pyx":322 * 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 # <<<<<<<<<<<<<< @@ -3941,7 +3993,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_4 = __pyx_v_self->label_count_total; __pyx_v_label_count_total = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":307 + /* "sklearn/tree/_tree.pyx":323 * 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 # <<<<<<<<<<<<<< @@ -3951,7 +4003,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_t_4 = __pyx_v_self->label_count_left; __pyx_v_label_count_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":308 + /* "sklearn/tree/_tree.pyx":324 * 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 # <<<<<<<<<<<<<< @@ -3961,7 +4013,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":314 + /* "sklearn/tree/_tree.pyx":330 * cdef SIZE_t k * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -3970,7 +4022,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":315 + /* "sklearn/tree/_tree.pyx":331 * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -3979,7 +4031,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":319 + /* "sklearn/tree/_tree.pyx":335 * # Note: We assume start <= pos < new_pos <= end * * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -3990,7 +4042,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc 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":320 + /* "sklearn/tree/_tree.pyx":336 * * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -3999,7 +4051,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":322 + /* "sklearn/tree/_tree.pyx":338 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -4009,7 +4061,7 @@ 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":323 + /* "sklearn/tree/_tree.pyx":339 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -4021,7 +4073,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":325 + /* "sklearn/tree/_tree.pyx":341 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4032,7 +4084,7 @@ 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":326 + /* "sklearn/tree/_tree.pyx":342 * * for k in range(n_outputs): * label_index = (k * label_count_stride + # <<<<<<<<<<<<<< @@ -4041,7 +4093,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":328 + /* "sklearn/tree/_tree.pyx":344 * label_index = (k * label_count_stride + * y[i * y_stride + k]) * label_count_left[label_index] += w # <<<<<<<<<<<<<< @@ -4051,7 +4103,7 @@ 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":329 + /* "sklearn/tree/_tree.pyx":345 * y[i * y_stride + k]) * label_count_left[label_index] += w * label_count_right[label_index] -= w # <<<<<<<<<<<<<< @@ -4062,7 +4114,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc (__pyx_v_label_count_right[__pyx_t_9]) = ((__pyx_v_label_count_right[__pyx_t_9]) - __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":331 + /* "sklearn/tree/_tree.pyx":347 * label_count_right[label_index] -= w * * diff_w += w # <<<<<<<<<<<<<< @@ -4072,7 +4124,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":333 + /* "sklearn/tree/_tree.pyx":349 * diff_w += w * * self.weighted_n_left += diff_w # <<<<<<<<<<<<<< @@ -4081,7 +4133,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_self->__pyx_base.weighted_n_left = (__pyx_v_self->__pyx_base.weighted_n_left + __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":334 + /* "sklearn/tree/_tree.pyx":350 * * self.weighted_n_left += diff_w * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< @@ -4090,7 +4142,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_self->__pyx_base.weighted_n_right = (__pyx_v_self->__pyx_base.weighted_n_right - __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":336 + /* "sklearn/tree/_tree.pyx":352 * self.weighted_n_right -= diff_w * * self.pos = new_pos # <<<<<<<<<<<<<< @@ -4099,7 +4151,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_self->__pyx_base.pos = __pyx_v_new_pos; - /* "sklearn/tree/_tree.pyx":293 + /* "sklearn/tree/_tree.pyx":309 * label_count_right += label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -4110,7 +4162,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":338 +/* "sklearn/tree/_tree.pyx":354 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4126,7 +4178,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_impur return __pyx_r; } -/* "sklearn/tree/_tree.pyx":341 +/* "sklearn/tree/_tree.pyx":357 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4139,7 +4191,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_children_imp /* function exit code */ } -/* "sklearn/tree/_tree.pyx":345 +/* "sklearn/tree/_tree.pyx":361 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4158,7 +4210,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":347 + /* "sklearn/tree/_tree.pyx":363 * cdef void node_value(self, double* dest) nogil: * """Compute the node value of samples[start:end] into dest.""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4168,7 +4220,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":348 + /* "sklearn/tree/_tree.pyx":364 * """Compute the node value of samples[start:end] into dest.""" * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4178,7 +4230,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":349 + /* "sklearn/tree/_tree.pyx":365 * 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 # <<<<<<<<<<<<<< @@ -4188,7 +4240,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":350 + /* "sklearn/tree/_tree.pyx":366 * 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 # <<<<<<<<<<<<<< @@ -4198,7 +4250,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":353 + /* "sklearn/tree/_tree.pyx":369 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4209,7 +4261,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":354 + /* "sklearn/tree/_tree.pyx":370 * * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -4218,7 +4270,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":355 + /* "sklearn/tree/_tree.pyx":371 * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride # <<<<<<<<<<<<<< @@ -4227,7 +4279,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":356 + /* "sklearn/tree/_tree.pyx":372 * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4237,7 +4289,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":345 + /* "sklearn/tree/_tree.pyx":361 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4248,7 +4300,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s /* function exit code */ } -/* "sklearn/tree/_tree.pyx":373 +/* "sklearn/tree/_tree.pyx":389 * cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4277,7 +4329,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":376 + /* "sklearn/tree/_tree.pyx":392 * """Evaluate the impurity of the current node, i.e. the impurity of * samples[start:end].""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4287,7 +4339,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":378 + /* "sklearn/tree/_tree.pyx":394 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4297,7 +4349,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":379 + /* "sklearn/tree/_tree.pyx":395 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4307,7 +4359,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":380 + /* "sklearn/tree/_tree.pyx":396 * 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 # <<<<<<<<<<<<<< @@ -4317,7 +4369,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":381 + /* "sklearn/tree/_tree.pyx":397 * 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 # <<<<<<<<<<<<<< @@ -4327,7 +4379,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":383 + /* "sklearn/tree/_tree.pyx":399 * cdef double* label_count_total = self.label_count_total * * cdef double entropy = 0.0 # <<<<<<<<<<<<<< @@ -4336,7 +4388,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":384 + /* "sklearn/tree/_tree.pyx":400 * * cdef double entropy = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -4345,7 +4397,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":389 + /* "sklearn/tree/_tree.pyx":405 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4356,7 +4408,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":390 + /* "sklearn/tree/_tree.pyx":406 * * for k in range(n_outputs): * entropy = 0.0 # <<<<<<<<<<<<<< @@ -4365,7 +4417,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":392 + /* "sklearn/tree/_tree.pyx":408 * entropy = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -4376,7 +4428,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":393 + /* "sklearn/tree/_tree.pyx":409 * * for c in range(n_classes[k]): * tmp = label_count_total[c] # <<<<<<<<<<<<<< @@ -4385,7 +4437,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_tmp = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":394 + /* "sklearn/tree/_tree.pyx":410 * for c in range(n_classes[k]): * tmp = label_count_total[c] * if tmp > 0.0: # <<<<<<<<<<<<<< @@ -4395,7 +4447,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_t_8 = ((__pyx_v_tmp > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":395 + /* "sklearn/tree/_tree.pyx":411 * tmp = label_count_total[c] * if tmp > 0.0: * tmp /= weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4404,7 +4456,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_tmp = (__pyx_v_tmp / __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":396 + /* "sklearn/tree/_tree.pyx":412 * if tmp > 0.0: * tmp /= weighted_n_node_samples * entropy -= tmp * log(tmp) # <<<<<<<<<<<<<< @@ -4417,7 +4469,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_L7:; } - /* "sklearn/tree/_tree.pyx":398 + /* "sklearn/tree/_tree.pyx":414 * entropy -= tmp * log(tmp) * * total += entropy # <<<<<<<<<<<<<< @@ -4426,7 +4478,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_total = (__pyx_v_total + __pyx_v_entropy); - /* "sklearn/tree/_tree.pyx":399 + /* "sklearn/tree/_tree.pyx":415 * * total += entropy * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4436,7 +4488,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":401 + /* "sklearn/tree/_tree.pyx":417 * label_count_total += label_count_stride * * return total / n_outputs # <<<<<<<<<<<<<< @@ -4446,7 +4498,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":373 + /* "sklearn/tree/_tree.pyx":389 * cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4459,7 +4511,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":403 +/* "sklearn/tree/_tree.pyx":419 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4492,7 +4544,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":408 + /* "sklearn/tree/_tree.pyx":424 * left child (samples[start:pos]) and the impurity the right child * (samples[pos:end]).""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4502,7 +4554,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":409 + /* "sklearn/tree/_tree.pyx":425 * (samples[pos:end]).""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -4512,7 +4564,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":410 + /* "sklearn/tree/_tree.pyx":426 * 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 # <<<<<<<<<<<<<< @@ -4522,7 +4574,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":412 + /* "sklearn/tree/_tree.pyx":428 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4532,7 +4584,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":413 + /* "sklearn/tree/_tree.pyx":429 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4542,7 +4594,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":414 + /* "sklearn/tree/_tree.pyx":430 * 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 # <<<<<<<<<<<<<< @@ -4552,7 +4604,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":415 + /* "sklearn/tree/_tree.pyx":431 * 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 # <<<<<<<<<<<<<< @@ -4562,7 +4614,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":416 + /* "sklearn/tree/_tree.pyx":432 * 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 # <<<<<<<<<<<<<< @@ -4572,7 +4624,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":418 + /* "sklearn/tree/_tree.pyx":434 * cdef double* label_count_right = self.label_count_right * * cdef double entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4581,7 +4633,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":419 + /* "sklearn/tree/_tree.pyx":435 * * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4590,7 +4642,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":420 + /* "sklearn/tree/_tree.pyx":436 * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -4599,7 +4651,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":421 + /* "sklearn/tree/_tree.pyx":437 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -4608,7 +4660,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":426 + /* "sklearn/tree/_tree.pyx":442 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4619,7 +4671,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":427 + /* "sklearn/tree/_tree.pyx":443 * * for k in range(n_outputs): * entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4628,7 +4680,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":428 + /* "sklearn/tree/_tree.pyx":444 * for k in range(n_outputs): * entropy_left = 0.0 * entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4637,7 +4689,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":430 + /* "sklearn/tree/_tree.pyx":446 * entropy_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -4648,7 +4700,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py 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":431 + /* "sklearn/tree/_tree.pyx":447 * * for c in range(n_classes[k]): * tmp = label_count_left[c] # <<<<<<<<<<<<<< @@ -4657,7 +4709,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_tmp = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":432 + /* "sklearn/tree/_tree.pyx":448 * for c in range(n_classes[k]): * tmp = label_count_left[c] * if tmp > 0.0: # <<<<<<<<<<<<<< @@ -4667,7 +4719,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_8 = ((__pyx_v_tmp > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":433 + /* "sklearn/tree/_tree.pyx":449 * tmp = label_count_left[c] * if tmp > 0.0: * tmp /= weighted_n_left # <<<<<<<<<<<<<< @@ -4676,7 +4728,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_tmp = (__pyx_v_tmp / __pyx_v_weighted_n_left); - /* "sklearn/tree/_tree.pyx":434 + /* "sklearn/tree/_tree.pyx":450 * if tmp > 0.0: * tmp /= weighted_n_left * entropy_left -= tmp * log(tmp) # <<<<<<<<<<<<<< @@ -4688,7 +4740,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":436 + /* "sklearn/tree/_tree.pyx":452 * entropy_left -= tmp * log(tmp) * * tmp = label_count_right[c] # <<<<<<<<<<<<<< @@ -4697,7 +4749,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_tmp = (__pyx_v_label_count_right[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":437 + /* "sklearn/tree/_tree.pyx":453 * * tmp = label_count_right[c] * if tmp > 0.0: # <<<<<<<<<<<<<< @@ -4707,7 +4759,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_t_8 = ((__pyx_v_tmp > 0.0) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":438 + /* "sklearn/tree/_tree.pyx":454 * tmp = label_count_right[c] * if tmp > 0.0: * tmp /= weighted_n_right # <<<<<<<<<<<<<< @@ -4716,7 +4768,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_tmp = (__pyx_v_tmp / __pyx_v_weighted_n_right); - /* "sklearn/tree/_tree.pyx":439 + /* "sklearn/tree/_tree.pyx":455 * if tmp > 0.0: * tmp /= weighted_n_right * entropy_right -= tmp * log(tmp) # <<<<<<<<<<<<<< @@ -4729,7 +4781,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":441 + /* "sklearn/tree/_tree.pyx":457 * entropy_right -= tmp * log(tmp) * * total_left += entropy_left # <<<<<<<<<<<<<< @@ -4738,7 +4790,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":442 + /* "sklearn/tree/_tree.pyx":458 * * total_left += entropy_left * total_right += entropy_right # <<<<<<<<<<<<<< @@ -4747,7 +4799,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":443 + /* "sklearn/tree/_tree.pyx":459 * total_left += entropy_left * total_right += entropy_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -4756,7 +4808,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":444 + /* "sklearn/tree/_tree.pyx":460 * total_right += entropy_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -4766,7 +4818,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":446 + /* "sklearn/tree/_tree.pyx":462 * label_count_right += label_count_stride * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -4775,7 +4827,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":447 + /* "sklearn/tree/_tree.pyx":463 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -4784,7 +4836,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":403 + /* "sklearn/tree/_tree.pyx":419 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4795,7 +4847,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":465 +/* "sklearn/tree/_tree.pyx":481 * = 1 - \sum_{k=0}^{K-1} pmk ** 2 * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4823,7 +4875,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":468 + /* "sklearn/tree/_tree.pyx":484 * """Evaluate the impurity of the current node, i.e. the impurity of * samples[start:end].""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4833,7 +4885,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":470 + /* "sklearn/tree/_tree.pyx":486 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4843,7 +4895,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":471 + /* "sklearn/tree/_tree.pyx":487 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4853,7 +4905,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":472 + /* "sklearn/tree/_tree.pyx":488 * 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 # <<<<<<<<<<<<<< @@ -4863,7 +4915,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":473 + /* "sklearn/tree/_tree.pyx":489 * 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 # <<<<<<<<<<<<<< @@ -4873,7 +4925,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":475 + /* "sklearn/tree/_tree.pyx":491 * cdef double* label_count_total = self.label_count_total * * cdef double gini = 0.0 # <<<<<<<<<<<<<< @@ -4882,7 +4934,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":476 + /* "sklearn/tree/_tree.pyx":492 * * cdef double gini = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -4891,7 +4943,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":481 + /* "sklearn/tree/_tree.pyx":497 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4902,7 +4954,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":482 + /* "sklearn/tree/_tree.pyx":498 * * for k in range(n_outputs): * gini = 0.0 # <<<<<<<<<<<<<< @@ -4911,7 +4963,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":484 + /* "sklearn/tree/_tree.pyx":500 * gini = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -4922,7 +4974,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":485 + /* "sklearn/tree/_tree.pyx":501 * * for c in range(n_classes[k]): * tmp = label_count_total[c] # <<<<<<<<<<<<<< @@ -4931,7 +4983,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_tmp = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":486 + /* "sklearn/tree/_tree.pyx":502 * for c in range(n_classes[k]): * tmp = label_count_total[c] * gini += tmp * tmp # <<<<<<<<<<<<<< @@ -4941,7 +4993,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj __pyx_v_gini = (__pyx_v_gini + (__pyx_v_tmp * __pyx_v_tmp)); } - /* "sklearn/tree/_tree.pyx":488 + /* "sklearn/tree/_tree.pyx":504 * gini += tmp * tmp * * gini = 1.0 - gini / (weighted_n_node_samples * # <<<<<<<<<<<<<< @@ -4950,7 +5002,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = (1.0 - (__pyx_v_gini / (__pyx_v_weighted_n_node_samples * __pyx_v_weighted_n_node_samples))); - /* "sklearn/tree/_tree.pyx":491 + /* "sklearn/tree/_tree.pyx":507 * weighted_n_node_samples) * * total += gini # <<<<<<<<<<<<<< @@ -4959,7 +5011,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":492 + /* "sklearn/tree/_tree.pyx":508 * * total += gini * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4969,7 +5021,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":494 + /* "sklearn/tree/_tree.pyx":510 * label_count_total += label_count_stride * * return total / n_outputs # <<<<<<<<<<<<<< @@ -4979,7 +5031,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":465 + /* "sklearn/tree/_tree.pyx":481 * = 1 - \sum_{k=0}^{K-1} pmk ** 2 * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4992,7 +5044,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":496 +/* "sklearn/tree/_tree.pyx":512 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -5025,7 +5077,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":501 + /* "sklearn/tree/_tree.pyx":517 * left child (samples[start:pos]) and the impurity the right child * (samples[pos:end]).""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -5035,7 +5087,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":502 + /* "sklearn/tree/_tree.pyx":518 * (samples[pos:end]).""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -5045,7 +5097,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":503 + /* "sklearn/tree/_tree.pyx":519 * 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 # <<<<<<<<<<<<<< @@ -5055,7 +5107,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":505 + /* "sklearn/tree/_tree.pyx":521 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -5065,7 +5117,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":506 + /* "sklearn/tree/_tree.pyx":522 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -5075,7 +5127,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":507 + /* "sklearn/tree/_tree.pyx":523 * 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 # <<<<<<<<<<<<<< @@ -5085,7 +5137,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":508 + /* "sklearn/tree/_tree.pyx":524 * 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 # <<<<<<<<<<<<<< @@ -5095,7 +5147,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":509 + /* "sklearn/tree/_tree.pyx":525 * 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 # <<<<<<<<<<<<<< @@ -5105,7 +5157,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":511 + /* "sklearn/tree/_tree.pyx":527 * cdef double* label_count_right = self.label_count_right * * cdef double gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5114,7 +5166,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":512 + /* "sklearn/tree/_tree.pyx":528 * * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5123,7 +5175,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":513 + /* "sklearn/tree/_tree.pyx":529 * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -5132,7 +5184,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":514 + /* "sklearn/tree/_tree.pyx":530 * cdef double gini_right = 0.0 * cdef double total = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -5141,7 +5193,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":515 + /* "sklearn/tree/_tree.pyx":531 * cdef double total = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -5150,7 +5202,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":520 + /* "sklearn/tree/_tree.pyx":536 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -5161,7 +5213,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":521 + /* "sklearn/tree/_tree.pyx":537 * * for k in range(n_outputs): * gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5170,7 +5222,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":522 + /* "sklearn/tree/_tree.pyx":538 * for k in range(n_outputs): * gini_left = 0.0 * gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5179,7 +5231,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":524 + /* "sklearn/tree/_tree.pyx":540 * gini_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -5190,7 +5242,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o 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":525 + /* "sklearn/tree/_tree.pyx":541 * * for c in range(n_classes[k]): * tmp = label_count_left[c] # <<<<<<<<<<<<<< @@ -5199,7 +5251,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_tmp = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":526 + /* "sklearn/tree/_tree.pyx":542 * for c in range(n_classes[k]): * tmp = label_count_left[c] * gini_left += tmp * tmp # <<<<<<<<<<<<<< @@ -5208,7 +5260,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_left = (__pyx_v_gini_left + (__pyx_v_tmp * __pyx_v_tmp)); - /* "sklearn/tree/_tree.pyx":527 + /* "sklearn/tree/_tree.pyx":543 * tmp = label_count_left[c] * gini_left += tmp * tmp * tmp = label_count_right[c] # <<<<<<<<<<<<<< @@ -5217,7 +5269,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_tmp = (__pyx_v_label_count_right[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":528 + /* "sklearn/tree/_tree.pyx":544 * gini_left += tmp * tmp * tmp = label_count_right[c] * gini_right += tmp * tmp # <<<<<<<<<<<<<< @@ -5227,7 +5279,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o __pyx_v_gini_right = (__pyx_v_gini_right + (__pyx_v_tmp * __pyx_v_tmp)); } - /* "sklearn/tree/_tree.pyx":530 + /* "sklearn/tree/_tree.pyx":546 * gini_right += tmp * tmp * * gini_left = 1.0 - gini_left / (weighted_n_left * # <<<<<<<<<<<<<< @@ -5236,7 +5288,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_left = (1.0 - (__pyx_v_gini_left / (__pyx_v_weighted_n_left * __pyx_v_weighted_n_left))); - /* "sklearn/tree/_tree.pyx":532 + /* "sklearn/tree/_tree.pyx":548 * gini_left = 1.0 - gini_left / (weighted_n_left * * weighted_n_left) * gini_right = 1.0 - gini_right / (weighted_n_right * # <<<<<<<<<<<<<< @@ -5245,7 +5297,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_right = (1.0 - (__pyx_v_gini_right / (__pyx_v_weighted_n_right * __pyx_v_weighted_n_right))); - /* "sklearn/tree/_tree.pyx":535 + /* "sklearn/tree/_tree.pyx":551 * weighted_n_right) * * total_left += gini_left # <<<<<<<<<<<<<< @@ -5254,7 +5306,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":536 + /* "sklearn/tree/_tree.pyx":552 * * total_left += gini_left * total_right += gini_right # <<<<<<<<<<<<<< @@ -5263,7 +5315,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":537 + /* "sklearn/tree/_tree.pyx":553 * total_left += gini_left * total_right += gini_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -5272,7 +5324,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":538 + /* "sklearn/tree/_tree.pyx":554 * total_right += gini_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -5282,7 +5334,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":540 + /* "sklearn/tree/_tree.pyx":556 * label_count_right += label_count_stride * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -5291,7 +5343,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":541 + /* "sklearn/tree/_tree.pyx":557 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -5300,7 +5352,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":496 + /* "sklearn/tree/_tree.pyx":512 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -5311,7 +5363,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o /* function exit code */ } -/* "sklearn/tree/_tree.pyx":565 +/* "sklearn/tree/_tree.pyx":581 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< @@ -5347,18 +5399,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 = 565; __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 = 581; __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 = 565; __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 = 581; __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 = 565; __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 = 581; __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(); @@ -5391,7 +5443,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":567 + /* "sklearn/tree/_tree.pyx":583 * def __cinit__(self, SIZE_t n_outputs): * # Default values * self.y = NULL # <<<<<<<<<<<<<< @@ -5400,7 +5452,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":568 + /* "sklearn/tree/_tree.pyx":584 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -5409,7 +5461,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":569 + /* "sklearn/tree/_tree.pyx":585 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -5418,7 +5470,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":571 + /* "sklearn/tree/_tree.pyx":587 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -5427,7 +5479,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":572 + /* "sklearn/tree/_tree.pyx":588 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -5436,7 +5488,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":573 + /* "sklearn/tree/_tree.pyx":589 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -5445,7 +5497,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":574 + /* "sklearn/tree/_tree.pyx":590 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -5454,7 +5506,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":576 + /* "sklearn/tree/_tree.pyx":592 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -5463,7 +5515,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":577 + /* "sklearn/tree/_tree.pyx":593 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -5472,7 +5524,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":578 + /* "sklearn/tree/_tree.pyx":594 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -5481,7 +5533,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":579 + /* "sklearn/tree/_tree.pyx":595 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -5490,7 +5542,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":580 + /* "sklearn/tree/_tree.pyx":596 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -5499,7 +5551,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.weighted_n_right = 0.0; - /* "sklearn/tree/_tree.pyx":584 + /* "sklearn/tree/_tree.pyx":600 * # Allocate accumulators. Make sure they are NULL, not uninitialized, * # before an exception can be raised (which triggers __dealloc__). * self.mean_left = NULL # <<<<<<<<<<<<<< @@ -5508,7 +5560,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_left = NULL; - /* "sklearn/tree/_tree.pyx":585 + /* "sklearn/tree/_tree.pyx":601 * # before an exception can be raised (which triggers __dealloc__). * self.mean_left = NULL * self.mean_right = NULL # <<<<<<<<<<<<<< @@ -5517,7 +5569,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_right = NULL; - /* "sklearn/tree/_tree.pyx":586 + /* "sklearn/tree/_tree.pyx":602 * self.mean_left = NULL * self.mean_right = NULL * self.mean_total = NULL # <<<<<<<<<<<<<< @@ -5526,7 +5578,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_total = NULL; - /* "sklearn/tree/_tree.pyx":587 + /* "sklearn/tree/_tree.pyx":603 * self.mean_right = NULL * self.mean_total = NULL * self.sq_sum_left = NULL # <<<<<<<<<<<<<< @@ -5535,7 +5587,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_left = NULL; - /* "sklearn/tree/_tree.pyx":588 + /* "sklearn/tree/_tree.pyx":604 * self.mean_total = NULL * self.sq_sum_left = NULL * self.sq_sum_right = NULL # <<<<<<<<<<<<<< @@ -5544,7 +5596,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_right = NULL; - /* "sklearn/tree/_tree.pyx":589 + /* "sklearn/tree/_tree.pyx":605 * self.sq_sum_left = NULL * self.sq_sum_right = NULL * self.sq_sum_total = NULL # <<<<<<<<<<<<<< @@ -5553,7 +5605,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_total = NULL; - /* "sklearn/tree/_tree.pyx":590 + /* "sklearn/tree/_tree.pyx":606 * self.sq_sum_right = NULL * self.sq_sum_total = NULL * self.var_left = NULL # <<<<<<<<<<<<<< @@ -5562,7 +5614,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_left = NULL; - /* "sklearn/tree/_tree.pyx":591 + /* "sklearn/tree/_tree.pyx":607 * self.sq_sum_total = NULL * self.var_left = NULL * self.var_right = NULL # <<<<<<<<<<<<<< @@ -5571,7 +5623,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_right = NULL; - /* "sklearn/tree/_tree.pyx":592 + /* "sklearn/tree/_tree.pyx":608 * self.var_left = NULL * self.var_right = NULL * self.sum_left = NULL # <<<<<<<<<<<<<< @@ -5580,7 +5632,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_left = NULL; - /* "sklearn/tree/_tree.pyx":593 + /* "sklearn/tree/_tree.pyx":609 * self.var_right = NULL * self.sum_left = NULL * self.sum_right = NULL # <<<<<<<<<<<<<< @@ -5589,7 +5641,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_right = NULL; - /* "sklearn/tree/_tree.pyx":594 + /* "sklearn/tree/_tree.pyx":610 * self.sum_left = NULL * self.sum_right = NULL * self.sum_total = NULL # <<<<<<<<<<<<<< @@ -5598,7 +5650,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_total = NULL; - /* "sklearn/tree/_tree.pyx":596 + /* "sklearn/tree/_tree.pyx":612 * self.sum_total = NULL * * self.mean_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5607,7 +5659,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":597 + /* "sklearn/tree/_tree.pyx":613 * * self.mean_left = calloc(n_outputs, sizeof(double)) * self.mean_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5616,7 +5668,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":598 + /* "sklearn/tree/_tree.pyx":614 * self.mean_left = calloc(n_outputs, sizeof(double)) * self.mean_right = calloc(n_outputs, sizeof(double)) * self.mean_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5625,7 +5677,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":599 + /* "sklearn/tree/_tree.pyx":615 * 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)) # <<<<<<<<<<<<<< @@ -5634,7 +5686,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":600 + /* "sklearn/tree/_tree.pyx":616 * 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)) # <<<<<<<<<<<<<< @@ -5643,7 +5695,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":601 + /* "sklearn/tree/_tree.pyx":617 * 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)) # <<<<<<<<<<<<<< @@ -5652,7 +5704,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":602 + /* "sklearn/tree/_tree.pyx":618 * 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)) # <<<<<<<<<<<<<< @@ -5661,7 +5713,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":603 + /* "sklearn/tree/_tree.pyx":619 * 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)) # <<<<<<<<<<<<<< @@ -5670,7 +5722,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":604 + /* "sklearn/tree/_tree.pyx":620 * self.var_left = calloc(n_outputs, sizeof(double)) * self.var_right = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5679,7 +5731,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_left = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":605 + /* "sklearn/tree/_tree.pyx":621 * self.var_right = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5688,7 +5740,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_right = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":606 + /* "sklearn/tree/_tree.pyx":622 * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) * self.sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5697,7 +5749,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_total = ((double *)calloc(__pyx_v_n_outputs, (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":608 + /* "sklearn/tree/_tree.pyx":624 * self.sum_total = calloc(n_outputs, sizeof(double)) * * if (self.mean_left == NULL or # <<<<<<<<<<<<<< @@ -5707,7 +5759,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_1 = ((__pyx_v_self->mean_left == NULL) != 0); if (!__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":609 + /* "sklearn/tree/_tree.pyx":625 * * if (self.mean_left == NULL or * self.mean_right == NULL or # <<<<<<<<<<<<<< @@ -5717,7 +5769,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_2 = ((__pyx_v_self->mean_right == NULL) != 0); if (!__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":610 + /* "sklearn/tree/_tree.pyx":626 * if (self.mean_left == NULL or * self.mean_right == NULL or * self.mean_total == NULL or # <<<<<<<<<<<<<< @@ -5727,7 +5779,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_3 = ((__pyx_v_self->mean_total == NULL) != 0); if (!__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":611 + /* "sklearn/tree/_tree.pyx":627 * self.mean_right == NULL or * self.mean_total == NULL or * self.sq_sum_left == NULL or # <<<<<<<<<<<<<< @@ -5737,7 +5789,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_4 = ((__pyx_v_self->sq_sum_left == NULL) != 0); if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":612 + /* "sklearn/tree/_tree.pyx":628 * self.mean_total == NULL or * self.sq_sum_left == NULL or * self.sq_sum_right == NULL or # <<<<<<<<<<<<<< @@ -5747,7 +5799,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_5 = ((__pyx_v_self->sq_sum_right == NULL) != 0); if (!__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":613 + /* "sklearn/tree/_tree.pyx":629 * self.sq_sum_left == NULL or * self.sq_sum_right == NULL or * self.sq_sum_total == NULL or # <<<<<<<<<<<<<< @@ -5757,7 +5809,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_6 = ((__pyx_v_self->sq_sum_total == NULL) != 0); if (!__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":614 + /* "sklearn/tree/_tree.pyx":630 * self.sq_sum_right == NULL or * self.sq_sum_total == NULL or * self.var_left == NULL or # <<<<<<<<<<<<<< @@ -5767,7 +5819,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_7 = ((__pyx_v_self->var_left == NULL) != 0); if (!__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":615 + /* "sklearn/tree/_tree.pyx":631 * self.sq_sum_total == NULL or * self.var_left == NULL or * self.var_right == NULL or # <<<<<<<<<<<<<< @@ -5777,7 +5829,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_8 = ((__pyx_v_self->var_right == NULL) != 0); if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":616 + /* "sklearn/tree/_tree.pyx":632 * self.var_left == NULL or * self.var_right == NULL or * self.sum_left == NULL or # <<<<<<<<<<<<<< @@ -5787,7 +5839,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_9 = ((__pyx_v_self->sum_left == NULL) != 0); if (!__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":617 + /* "sklearn/tree/_tree.pyx":633 * self.var_right == NULL or * self.sum_left == NULL or * self.sum_right == NULL or # <<<<<<<<<<<<<< @@ -5797,7 +5849,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct __pyx_t_10 = ((__pyx_v_self->sum_right == NULL) != 0); if (!__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":618 + /* "sklearn/tree/_tree.pyx":634 * self.sum_left == NULL or * self.sum_right == NULL or * self.sum_total == NULL): # <<<<<<<<<<<<<< @@ -5847,17 +5899,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct } if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":619 + /* "sklearn/tree/_tree.pyx":635 * self.sum_right == NULL or * self.sum_total == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":565 + /* "sklearn/tree/_tree.pyx":581 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< @@ -5876,7 +5928,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":621 +/* "sklearn/tree/_tree.pyx":637 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5899,7 +5951,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":623 + /* "sklearn/tree/_tree.pyx":639 * def __dealloc__(self): * """Destructor.""" * free(self.mean_left) # <<<<<<<<<<<<<< @@ -5908,7 +5960,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_left); - /* "sklearn/tree/_tree.pyx":624 + /* "sklearn/tree/_tree.pyx":640 * """Destructor.""" * free(self.mean_left) * free(self.mean_right) # <<<<<<<<<<<<<< @@ -5917,7 +5969,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_right); - /* "sklearn/tree/_tree.pyx":625 + /* "sklearn/tree/_tree.pyx":641 * free(self.mean_left) * free(self.mean_right) * free(self.mean_total) # <<<<<<<<<<<<<< @@ -5926,7 +5978,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_total); - /* "sklearn/tree/_tree.pyx":626 + /* "sklearn/tree/_tree.pyx":642 * free(self.mean_right) * free(self.mean_total) * free(self.sq_sum_left) # <<<<<<<<<<<<<< @@ -5935,7 +5987,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_left); - /* "sklearn/tree/_tree.pyx":627 + /* "sklearn/tree/_tree.pyx":643 * free(self.mean_total) * free(self.sq_sum_left) * free(self.sq_sum_right) # <<<<<<<<<<<<<< @@ -5944,7 +5996,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_right); - /* "sklearn/tree/_tree.pyx":628 + /* "sklearn/tree/_tree.pyx":644 * free(self.sq_sum_left) * free(self.sq_sum_right) * free(self.sq_sum_total) # <<<<<<<<<<<<<< @@ -5953,7 +6005,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_total); - /* "sklearn/tree/_tree.pyx":629 + /* "sklearn/tree/_tree.pyx":645 * free(self.sq_sum_right) * free(self.sq_sum_total) * free(self.var_left) # <<<<<<<<<<<<<< @@ -5962,7 +6014,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->var_left); - /* "sklearn/tree/_tree.pyx":630 + /* "sklearn/tree/_tree.pyx":646 * free(self.sq_sum_total) * free(self.var_left) * free(self.var_right) # <<<<<<<<<<<<<< @@ -5971,7 +6023,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->var_right); - /* "sklearn/tree/_tree.pyx":631 + /* "sklearn/tree/_tree.pyx":647 * free(self.var_left) * free(self.var_right) * free(self.sum_left) # <<<<<<<<<<<<<< @@ -5980,7 +6032,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_left); - /* "sklearn/tree/_tree.pyx":632 + /* "sklearn/tree/_tree.pyx":648 * free(self.var_right) * free(self.sum_left) * free(self.sum_right) # <<<<<<<<<<<<<< @@ -5989,7 +6041,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_right); - /* "sklearn/tree/_tree.pyx":633 + /* "sklearn/tree/_tree.pyx":649 * free(self.sum_left) * free(self.sum_right) * free(self.sum_total) # <<<<<<<<<<<<<< @@ -5998,7 +6050,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_total); - /* "sklearn/tree/_tree.pyx":621 + /* "sklearn/tree/_tree.pyx":637 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6010,7 +6062,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":635 +/* "sklearn/tree/_tree.pyx":651 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6042,7 +6094,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":636 + /* "sklearn/tree/_tree.pyx":652 * * def __reduce__(self): * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) # <<<<<<<<<<<<<< @@ -6050,19 +6102,19 @@ 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 = 636; __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 = 652; __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 = 636; __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 = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __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 = 636; __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 = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __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(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __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 = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion))); @@ -6077,7 +6129,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":635 + /* "sklearn/tree/_tree.pyx":651 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6098,7 +6150,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":638 +/* "sklearn/tree/_tree.pyx":654 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6128,7 +6180,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":639 + /* "sklearn/tree/_tree.pyx":655 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -6136,13 +6188,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 = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __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":638 + /* "sklearn/tree/_tree.pyx":654 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6161,7 +6213,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":641 +/* "sklearn/tree/_tree.pyx":657 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -6194,7 +6246,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_8__setstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":644 +/* "sklearn/tree/_tree.pyx":660 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -6231,7 +6283,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":650 + /* "sklearn/tree/_tree.pyx":666 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -6240,7 +6292,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":651 + /* "sklearn/tree/_tree.pyx":667 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -6249,7 +6301,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":652 + /* "sklearn/tree/_tree.pyx":668 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -6258,7 +6310,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":653 + /* "sklearn/tree/_tree.pyx":669 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -6267,7 +6319,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":654 + /* "sklearn/tree/_tree.pyx":670 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -6276,7 +6328,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":655 + /* "sklearn/tree/_tree.pyx":671 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -6285,7 +6337,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":656 + /* "sklearn/tree/_tree.pyx":672 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< @@ -6294,7 +6346,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":657 + /* "sklearn/tree/_tree.pyx":673 * self.end = end * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -6303,7 +6355,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":658 + /* "sklearn/tree/_tree.pyx":674 * self.n_node_samples = end - start * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0. # <<<<<<<<<<<<<< @@ -6312,7 +6364,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_weighted_n_node_samples = 0.; - /* "sklearn/tree/_tree.pyx":661 + /* "sklearn/tree/_tree.pyx":677 * * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -6322,7 +6374,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":662 + /* "sklearn/tree/_tree.pyx":678 * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -6332,7 +6384,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->mean_left; __pyx_v_mean_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":663 + /* "sklearn/tree/_tree.pyx":679 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -6342,7 +6394,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->mean_right; __pyx_v_mean_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":664 + /* "sklearn/tree/_tree.pyx":680 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -6352,7 +6404,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->mean_total; __pyx_v_mean_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":665 + /* "sklearn/tree/_tree.pyx":681 * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -6362,7 +6414,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sq_sum_left; __pyx_v_sq_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":666 + /* "sklearn/tree/_tree.pyx":682 * 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 # <<<<<<<<<<<<<< @@ -6372,7 +6424,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sq_sum_right; __pyx_v_sq_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":667 + /* "sklearn/tree/_tree.pyx":683 * 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 # <<<<<<<<<<<<<< @@ -6382,7 +6434,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":668 + /* "sklearn/tree/_tree.pyx":684 * 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 # <<<<<<<<<<<<<< @@ -6392,7 +6444,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->var_left; __pyx_v_var_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":669 + /* "sklearn/tree/_tree.pyx":685 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -6402,7 +6454,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->var_right; __pyx_v_var_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":670 + /* "sklearn/tree/_tree.pyx":686 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -6412,7 +6464,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sum_left; __pyx_v_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":671 + /* "sklearn/tree/_tree.pyx":687 * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -6422,7 +6474,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_t_2 = __pyx_v_self->sum_right; __pyx_v_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":672 + /* "sklearn/tree/_tree.pyx":688 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< @@ -6432,7 +6484,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":674 + /* "sklearn/tree/_tree.pyx":690 * cdef double* sum_total = self.sum_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -6441,7 +6493,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":675 + /* "sklearn/tree/_tree.pyx":691 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -6450,7 +6502,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":676 + /* "sklearn/tree/_tree.pyx":692 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -6459,7 +6511,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":677 + /* "sklearn/tree/_tree.pyx":693 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6468,7 +6520,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":678 + /* "sklearn/tree/_tree.pyx":694 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6477,7 +6529,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":679 + /* "sklearn/tree/_tree.pyx":695 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -6486,7 +6538,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":681 + /* "sklearn/tree/_tree.pyx":697 * cdef DOUBLE_t w = 1.0 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< @@ -6495,7 +6547,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_n_bytes = (__pyx_v_n_outputs * (sizeof(double))); - /* "sklearn/tree/_tree.pyx":682 + /* "sklearn/tree/_tree.pyx":698 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) * memset(mean_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6504,7 +6556,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_mean_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":683 + /* "sklearn/tree/_tree.pyx":699 * cdef SIZE_t n_bytes = n_outputs * sizeof(double) * memset(mean_left, 0, n_bytes) * memset(mean_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6513,7 +6565,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_mean_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":684 + /* "sklearn/tree/_tree.pyx":700 * memset(mean_left, 0, n_bytes) * memset(mean_right, 0, n_bytes) * memset(mean_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6522,7 +6574,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_mean_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":685 + /* "sklearn/tree/_tree.pyx":701 * memset(mean_right, 0, n_bytes) * memset(mean_total, 0, n_bytes) * memset(sq_sum_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6531,7 +6583,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sq_sum_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":686 + /* "sklearn/tree/_tree.pyx":702 * memset(mean_total, 0, n_bytes) * memset(sq_sum_left, 0, n_bytes) * memset(sq_sum_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6540,7 +6592,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sq_sum_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":687 + /* "sklearn/tree/_tree.pyx":703 * memset(sq_sum_left, 0, n_bytes) * memset(sq_sum_right, 0, n_bytes) * memset(sq_sum_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6549,7 +6601,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sq_sum_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":688 + /* "sklearn/tree/_tree.pyx":704 * memset(sq_sum_right, 0, n_bytes) * memset(sq_sum_total, 0, n_bytes) * memset(var_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6558,7 +6610,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_var_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":689 + /* "sklearn/tree/_tree.pyx":705 * memset(sq_sum_total, 0, n_bytes) * memset(var_left, 0, n_bytes) * memset(var_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6567,7 +6619,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_var_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":690 + /* "sklearn/tree/_tree.pyx":706 * memset(var_left, 0, n_bytes) * memset(var_right, 0, n_bytes) * memset(sum_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6576,7 +6628,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sum_left, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":691 + /* "sklearn/tree/_tree.pyx":707 * memset(var_right, 0, n_bytes) * memset(sum_left, 0, n_bytes) * memset(sum_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6585,7 +6637,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sum_right, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":692 + /* "sklearn/tree/_tree.pyx":708 * memset(sum_left, 0, n_bytes) * memset(sum_right, 0, n_bytes) * memset(sum_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6594,7 +6646,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ memset(__pyx_v_sum_total, 0, __pyx_v_n_bytes); - /* "sklearn/tree/_tree.pyx":694 + /* "sklearn/tree/_tree.pyx":710 * memset(sum_total, 0, n_bytes) * * for p in range(start, end): # <<<<<<<<<<<<<< @@ -6605,7 +6657,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py for (__pyx_t_3 = __pyx_v_start; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_p = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":695 + /* "sklearn/tree/_tree.pyx":711 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -6614,7 +6666,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":697 + /* "sklearn/tree/_tree.pyx":713 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -6624,7 +6676,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":698 + /* "sklearn/tree/_tree.pyx":714 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -6636,7 +6688,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":700 + /* "sklearn/tree/_tree.pyx":716 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6647,7 +6699,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":701 + /* "sklearn/tree/_tree.pyx":717 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -6656,7 +6708,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":702 + /* "sklearn/tree/_tree.pyx":718 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -6665,7 +6717,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":703 + /* "sklearn/tree/_tree.pyx":719 * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik * sum_total[k] += w_y_ik # <<<<<<<<<<<<<< @@ -6675,7 +6727,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":704 + /* "sklearn/tree/_tree.pyx":720 * w_y_ik = w * y_ik * sum_total[k] += w_y_ik * sq_sum_total[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -6686,7 +6738,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":706 + /* "sklearn/tree/_tree.pyx":722 * sq_sum_total[k] += w_y_ik * y_ik * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -6696,7 +6748,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py __pyx_v_weighted_n_node_samples = (__pyx_v_weighted_n_node_samples + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":708 + /* "sklearn/tree/_tree.pyx":724 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6705,7 +6757,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_self->__pyx_base.weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":710 + /* "sklearn/tree/_tree.pyx":726 * self.weighted_n_node_samples = weighted_n_node_samples * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6716,7 +6768,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":711 + /* "sklearn/tree/_tree.pyx":727 * * for k in range(n_outputs): * mean_total[k] = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6726,7 +6778,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py (__pyx_v_mean_total[__pyx_v_k]) = ((__pyx_v_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples); } - /* "sklearn/tree/_tree.pyx":714 + /* "sklearn/tree/_tree.pyx":730 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -6735,7 +6787,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":644 + /* "sklearn/tree/_tree.pyx":660 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< @@ -6746,7 +6798,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":716 +/* "sklearn/tree/_tree.pyx":732 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -6774,7 +6826,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p double *__pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":718 + /* "sklearn/tree/_tree.pyx":734 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" * self.pos = self.start # <<<<<<<<<<<<<< @@ -6784,7 +6836,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.start; __pyx_v_self->__pyx_base.pos = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":720 + /* "sklearn/tree/_tree.pyx":736 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -6793,7 +6845,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ __pyx_v_self->__pyx_base.weighted_n_left = 0.0; - /* "sklearn/tree/_tree.pyx":721 + /* "sklearn/tree/_tree.pyx":737 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6803,7 +6855,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_self->__pyx_base.weighted_n_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":723 + /* "sklearn/tree/_tree.pyx":739 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -6813,7 +6865,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":724 + /* "sklearn/tree/_tree.pyx":740 * * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -6823,7 +6875,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->mean_left; __pyx_v_mean_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":725 + /* "sklearn/tree/_tree.pyx":741 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -6833,7 +6885,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->mean_right; __pyx_v_mean_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":726 + /* "sklearn/tree/_tree.pyx":742 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -6843,7 +6895,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->mean_total; __pyx_v_mean_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":727 + /* "sklearn/tree/_tree.pyx":743 * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -6853,7 +6905,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sq_sum_left; __pyx_v_sq_sum_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":728 + /* "sklearn/tree/_tree.pyx":744 * 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 # <<<<<<<<<<<<<< @@ -6863,7 +6915,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sq_sum_right; __pyx_v_sq_sum_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":729 + /* "sklearn/tree/_tree.pyx":745 * 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 # <<<<<<<<<<<<<< @@ -6873,7 +6925,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":730 + /* "sklearn/tree/_tree.pyx":746 * 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 # <<<<<<<<<<<<<< @@ -6883,7 +6935,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->var_left; __pyx_v_var_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":731 + /* "sklearn/tree/_tree.pyx":747 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -6893,7 +6945,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->var_right; __pyx_v_var_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":732 + /* "sklearn/tree/_tree.pyx":748 * 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 # <<<<<<<<<<<<<< @@ -6903,7 +6955,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":733 + /* "sklearn/tree/_tree.pyx":749 * 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 # <<<<<<<<<<<<<< @@ -6913,7 +6965,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sum_left; __pyx_v_sum_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":734 + /* "sklearn/tree/_tree.pyx":750 * 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 # <<<<<<<<<<<<<< @@ -6923,7 +6975,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sum_right; __pyx_v_sum_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":735 + /* "sklearn/tree/_tree.pyx":751 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< @@ -6933,7 +6985,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p __pyx_t_3 = __pyx_v_self->sum_total; __pyx_v_sum_total = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":737 + /* "sklearn/tree/_tree.pyx":753 * cdef double* sum_total = self.sum_total * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -6942,7 +6994,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":739 + /* "sklearn/tree/_tree.pyx":755 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6953,7 +7005,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":740 + /* "sklearn/tree/_tree.pyx":756 * * for k in range(n_outputs): * mean_right[k] = mean_total[k] # <<<<<<<<<<<<<< @@ -6962,7 +7014,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_mean_right[__pyx_v_k]) = (__pyx_v_mean_total[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":741 + /* "sklearn/tree/_tree.pyx":757 * for k in range(n_outputs): * mean_right[k] = mean_total[k] * mean_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -6971,7 +7023,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_mean_left[__pyx_v_k]) = 0.0; - /* "sklearn/tree/_tree.pyx":742 + /* "sklearn/tree/_tree.pyx":758 * mean_right[k] = mean_total[k] * mean_left[k] = 0.0 * sq_sum_right[k] = sq_sum_total[k] # <<<<<<<<<<<<<< @@ -6980,7 +7032,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_sq_sum_right[__pyx_v_k]) = (__pyx_v_sq_sum_total[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":743 + /* "sklearn/tree/_tree.pyx":759 * mean_left[k] = 0.0 * sq_sum_right[k] = sq_sum_total[k] * sq_sum_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -6989,7 +7041,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_sq_sum_left[__pyx_v_k]) = 0.0; - /* "sklearn/tree/_tree.pyx":744 + /* "sklearn/tree/_tree.pyx":760 * 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 - # <<<<<<<<<<<<<< @@ -6998,7 +7050,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_var_right[__pyx_v_k]) = (((__pyx_v_sq_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_node_samples) - ((__pyx_v_mean_right[__pyx_v_k]) * (__pyx_v_mean_right[__pyx_v_k]))); - /* "sklearn/tree/_tree.pyx":746 + /* "sklearn/tree/_tree.pyx":762 * var_right[k] = (sq_sum_right[k] / weighted_n_node_samples - * mean_right[k] * mean_right[k]) * var_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -7007,7 +7059,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_var_left[__pyx_v_k]) = 0.0; - /* "sklearn/tree/_tree.pyx":747 + /* "sklearn/tree/_tree.pyx":763 * mean_right[k] * mean_right[k]) * var_left[k] = 0.0 * sum_right[k] = sum_total[k] # <<<<<<<<<<<<<< @@ -7016,7 +7068,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ (__pyx_v_sum_right[__pyx_v_k]) = (__pyx_v_sum_total[__pyx_v_k]); - /* "sklearn/tree/_tree.pyx":748 + /* "sklearn/tree/_tree.pyx":764 * var_left[k] = 0.0 * sum_right[k] = sum_total[k] * sum_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -7026,7 +7078,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p (__pyx_v_sum_left[__pyx_v_k]) = 0.0; } - /* "sklearn/tree/_tree.pyx":716 + /* "sklearn/tree/_tree.pyx":732 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -7037,7 +7089,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":750 +/* "sklearn/tree/_tree.pyx":766 * sum_left[k] = 0.0 * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -7080,7 +7132,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_9; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_10; - /* "sklearn/tree/_tree.pyx":753 + /* "sklearn/tree/_tree.pyx":769 * """Update the collected statistics by moving samples[pos:new_pos] from * the right child to the left child.""" * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< @@ -7090,7 +7142,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_1 = __pyx_v_self->__pyx_base.y; __pyx_v_y = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":754 + /* "sklearn/tree/_tree.pyx":770 * the right child to the left child.""" * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< @@ -7100,7 +7152,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":755 + /* "sklearn/tree/_tree.pyx":771 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -7110,7 +7162,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":757 + /* "sklearn/tree/_tree.pyx":773 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -7120,7 +7172,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":758 + /* "sklearn/tree/_tree.pyx":774 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -7130,7 +7182,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_2 = __pyx_v_self->__pyx_base.pos; __pyx_v_pos = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":760 + /* "sklearn/tree/_tree.pyx":776 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7140,7 +7192,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_2 = __pyx_v_self->__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":761 + /* "sklearn/tree/_tree.pyx":777 * * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -7150,7 +7202,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->mean_left; __pyx_v_mean_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":762 + /* "sklearn/tree/_tree.pyx":778 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -7160,7 +7212,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->mean_right; __pyx_v_mean_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":763 + /* "sklearn/tree/_tree.pyx":779 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -7170,7 +7222,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sq_sum_left; __pyx_v_sq_sum_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":764 + /* "sklearn/tree/_tree.pyx":780 * 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 # <<<<<<<<<<<<<< @@ -7180,7 +7232,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sq_sum_right; __pyx_v_sq_sum_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":765 + /* "sklearn/tree/_tree.pyx":781 * 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 # <<<<<<<<<<<<<< @@ -7190,7 +7242,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->var_left; __pyx_v_var_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":766 + /* "sklearn/tree/_tree.pyx":782 * cdef double* sq_sum_right = self.sq_sum_right * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7200,7 +7252,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->var_right; __pyx_v_var_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":767 + /* "sklearn/tree/_tree.pyx":783 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -7210,7 +7262,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sum_left; __pyx_v_sum_left = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":768 + /* "sklearn/tree/_tree.pyx":784 * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -7220,7 +7272,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_4 = __pyx_v_self->sum_right; __pyx_v_sum_right = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":770 + /* "sklearn/tree/_tree.pyx":786 * cdef double* sum_right = self.sum_right * * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -7230,7 +7282,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_5 = __pyx_v_self->__pyx_base.weighted_n_left; __pyx_v_weighted_n_left = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":771 + /* "sklearn/tree/_tree.pyx":787 * * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< @@ -7240,7 +7292,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_5 = __pyx_v_self->__pyx_base.weighted_n_right; __pyx_v_weighted_n_right = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":776 + /* "sklearn/tree/_tree.pyx":792 * cdef SIZE_t p * cdef SIZE_t k * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -7249,7 +7301,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":777 + /* "sklearn/tree/_tree.pyx":793 * cdef SIZE_t k * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -7258,7 +7310,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":781 + /* "sklearn/tree/_tree.pyx":797 * * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -7269,7 +7321,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ for (__pyx_t_6 = __pyx_v_pos; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_p = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":782 + /* "sklearn/tree/_tree.pyx":798 * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -7278,7 +7330,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_i = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":784 + /* "sklearn/tree/_tree.pyx":800 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -7288,7 +7340,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_7 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":785 + /* "sklearn/tree/_tree.pyx":801 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -7300,7 +7352,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":787 + /* "sklearn/tree/_tree.pyx":803 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7311,7 +7363,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_k = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":788 + /* "sklearn/tree/_tree.pyx":804 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -7320,7 +7372,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_y_ik = (__pyx_v_y[((__pyx_v_i * __pyx_v_y_stride) + __pyx_v_k)]); - /* "sklearn/tree/_tree.pyx":789 + /* "sklearn/tree/_tree.pyx":805 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -7329,7 +7381,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_w_y_ik = (__pyx_v_w * __pyx_v_y_ik); - /* "sklearn/tree/_tree.pyx":791 + /* "sklearn/tree/_tree.pyx":807 * w_y_ik = w * y_ik * * sum_left[k] += w_y_ik # <<<<<<<<<<<<<< @@ -7339,7 +7391,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_10 = __pyx_v_k; (__pyx_v_sum_left[__pyx_t_10]) = ((__pyx_v_sum_left[__pyx_t_10]) + __pyx_v_w_y_ik); - /* "sklearn/tree/_tree.pyx":792 + /* "sklearn/tree/_tree.pyx":808 * * sum_left[k] += w_y_ik * sum_right[k] -= w_y_ik # <<<<<<<<<<<<<< @@ -7349,7 +7401,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_10 = __pyx_v_k; (__pyx_v_sum_right[__pyx_t_10]) = ((__pyx_v_sum_right[__pyx_t_10]) - __pyx_v_w_y_ik); - /* "sklearn/tree/_tree.pyx":794 + /* "sklearn/tree/_tree.pyx":810 * sum_right[k] -= w_y_ik * * sq_sum_left[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -7359,7 +7411,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_t_10 = __pyx_v_k; (__pyx_v_sq_sum_left[__pyx_t_10]) = ((__pyx_v_sq_sum_left[__pyx_t_10]) + (__pyx_v_w_y_ik * __pyx_v_y_ik)); - /* "sklearn/tree/_tree.pyx":795 + /* "sklearn/tree/_tree.pyx":811 * * sq_sum_left[k] += w_y_ik * y_ik * sq_sum_right[k] -= w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -7370,7 +7422,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ (__pyx_v_sq_sum_right[__pyx_t_10]) = ((__pyx_v_sq_sum_right[__pyx_t_10]) - (__pyx_v_w_y_ik * __pyx_v_y_ik)); } - /* "sklearn/tree/_tree.pyx":797 + /* "sklearn/tree/_tree.pyx":813 * sq_sum_right[k] -= w_y_ik * y_ik * * diff_w += w # <<<<<<<<<<<<<< @@ -7380,7 +7432,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ __pyx_v_diff_w = (__pyx_v_diff_w + __pyx_v_w); } - /* "sklearn/tree/_tree.pyx":799 + /* "sklearn/tree/_tree.pyx":815 * diff_w += w * * weighted_n_left += diff_w # <<<<<<<<<<<<<< @@ -7389,7 +7441,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_weighted_n_left = (__pyx_v_weighted_n_left + __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":800 + /* "sklearn/tree/_tree.pyx":816 * * weighted_n_left += diff_w * weighted_n_right -= diff_w # <<<<<<<<<<<<<< @@ -7398,7 +7450,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_weighted_n_right = (__pyx_v_weighted_n_right - __pyx_v_diff_w); - /* "sklearn/tree/_tree.pyx":802 + /* "sklearn/tree/_tree.pyx":818 * weighted_n_right -= diff_w * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7409,7 +7461,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_k = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":803 + /* "sklearn/tree/_tree.pyx":819 * * for k in range(n_outputs): * mean_left[k] = sum_left[k] / weighted_n_left # <<<<<<<<<<<<<< @@ -7418,7 +7470,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ (__pyx_v_mean_left[__pyx_v_k]) = ((__pyx_v_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left); - /* "sklearn/tree/_tree.pyx":804 + /* "sklearn/tree/_tree.pyx":820 * for k in range(n_outputs): * mean_left[k] = sum_left[k] / weighted_n_left * mean_right[k] = sum_right[k] / weighted_n_right # <<<<<<<<<<<<<< @@ -7427,7 +7479,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ (__pyx_v_mean_right[__pyx_v_k]) = ((__pyx_v_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right); - /* "sklearn/tree/_tree.pyx":805 + /* "sklearn/tree/_tree.pyx":821 * 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 - # <<<<<<<<<<<<<< @@ -7436,7 +7488,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ (__pyx_v_var_left[__pyx_v_k]) = (((__pyx_v_sq_sum_left[__pyx_v_k]) / __pyx_v_weighted_n_left) - ((__pyx_v_mean_left[__pyx_v_k]) * (__pyx_v_mean_left[__pyx_v_k]))); - /* "sklearn/tree/_tree.pyx":807 + /* "sklearn/tree/_tree.pyx":823 * 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 - # <<<<<<<<<<<<<< @@ -7446,7 +7498,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ (__pyx_v_var_right[__pyx_v_k]) = (((__pyx_v_sq_sum_right[__pyx_v_k]) / __pyx_v_weighted_n_right) - ((__pyx_v_mean_right[__pyx_v_k]) * (__pyx_v_mean_right[__pyx_v_k]))); } - /* "sklearn/tree/_tree.pyx":810 + /* "sklearn/tree/_tree.pyx":826 * mean_right[k] * mean_right[k]) * * self.weighted_n_left = weighted_n_left # <<<<<<<<<<<<<< @@ -7455,7 +7507,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_self->__pyx_base.weighted_n_left = __pyx_v_weighted_n_left; - /* "sklearn/tree/_tree.pyx":811 + /* "sklearn/tree/_tree.pyx":827 * * self.weighted_n_left = weighted_n_left * self.weighted_n_right = weighted_n_right # <<<<<<<<<<<<<< @@ -7464,7 +7516,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_self->__pyx_base.weighted_n_right = __pyx_v_weighted_n_right; - /* "sklearn/tree/_tree.pyx":813 + /* "sklearn/tree/_tree.pyx":829 * self.weighted_n_right = weighted_n_right * * self.pos = new_pos # <<<<<<<<<<<<<< @@ -7473,7 +7525,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_self->__pyx_base.pos = __pyx_v_new_pos; - /* "sklearn/tree/_tree.pyx":750 + /* "sklearn/tree/_tree.pyx":766 * sum_left[k] = 0.0 * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -7484,7 +7536,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":815 +/* "sklearn/tree/_tree.pyx":831 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7500,7 +7552,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_impurity( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":818 +/* "sklearn/tree/_tree.pyx":834 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7513,7 +7565,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurit /* function exit code */ } -/* "sklearn/tree/_tree.pyx":822 +/* "sklearn/tree/_tree.pyx":838 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -7523,7 +7575,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurit static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, double *__pyx_v_dest) { - /* "sklearn/tree/_tree.pyx":824 + /* "sklearn/tree/_tree.pyx":840 * 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)) # <<<<<<<<<<<<<< @@ -7532,7 +7584,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struc */ memcpy(__pyx_v_dest, __pyx_v_self->mean_total, (__pyx_v_self->__pyx_base.n_outputs * (sizeof(double)))); - /* "sklearn/tree/_tree.pyx":822 + /* "sklearn/tree/_tree.pyx":838 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -7543,7 +7595,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":832 +/* "sklearn/tree/_tree.pyx":848 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7564,7 +7616,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ double __pyx_t_3; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_4; - /* "sklearn/tree/_tree.pyx":835 + /* "sklearn/tree/_tree.pyx":851 * """Evaluate the impurity of the current node, i.e. the impurity of * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7574,7 +7626,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":836 + /* "sklearn/tree/_tree.pyx":852 * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< @@ -7584,7 +7636,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_2 = __pyx_v_self->__pyx_base.sq_sum_total; __pyx_v_sq_sum_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":837 + /* "sklearn/tree/_tree.pyx":853 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -7594,7 +7646,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_2 = __pyx_v_self->__pyx_base.mean_total; __pyx_v_mean_total = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":838 + /* "sklearn/tree/_tree.pyx":854 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* mean_total = self.mean_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -7604,7 +7656,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.weighted_n_node_samples; __pyx_v_weighted_n_node_samples = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":839 + /* "sklearn/tree/_tree.pyx":855 * cdef double* mean_total = self.mean_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -7613,7 +7665,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":842 + /* "sklearn/tree/_tree.pyx":858 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7624,7 +7676,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) { __pyx_v_k = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":843 + /* "sklearn/tree/_tree.pyx":859 * * for k in range(n_outputs): * total += (sq_sum_total[k] / weighted_n_node_samples - # <<<<<<<<<<<<<< @@ -7634,7 +7686,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_v_total = (__pyx_v_total + (((__pyx_v_sq_sum_total[__pyx_v_k]) / __pyx_v_weighted_n_node_samples) - ((__pyx_v_mean_total[__pyx_v_k]) * (__pyx_v_mean_total[__pyx_v_k])))); } - /* "sklearn/tree/_tree.pyx":846 + /* "sklearn/tree/_tree.pyx":862 * mean_total[k] * mean_total[k]) * * return total / n_outputs # <<<<<<<<<<<<<< @@ -7644,7 +7696,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ __pyx_r = (__pyx_v_total / __pyx_v_n_outputs); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":832 + /* "sklearn/tree/_tree.pyx":848 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7657,7 +7709,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":848 +/* "sklearn/tree/_tree.pyx":864 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7676,7 +7728,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob double *__pyx_t_2; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_3; - /* "sklearn/tree/_tree.pyx":853 + /* "sklearn/tree/_tree.pyx":869 * left child (samples[start:pos]) and the impurity the right child * (samples[pos:end]).""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7686,7 +7738,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":854 + /* "sklearn/tree/_tree.pyx":870 * (samples[pos:end]).""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< @@ -7696,7 +7748,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_t_2 = __pyx_v_self->__pyx_base.var_left; __pyx_v_var_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":855 + /* "sklearn/tree/_tree.pyx":871 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7706,7 +7758,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_t_2 = __pyx_v_self->__pyx_base.var_right; __pyx_v_var_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":856 + /* "sklearn/tree/_tree.pyx":872 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -7715,7 +7767,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":857 + /* "sklearn/tree/_tree.pyx":873 * cdef double* var_right = self.var_right * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -7724,7 +7776,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":860 + /* "sklearn/tree/_tree.pyx":876 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7735,7 +7787,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) { __pyx_v_k = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":861 + /* "sklearn/tree/_tree.pyx":877 * * for k in range(n_outputs): * total_left += var_left[k] # <<<<<<<<<<<<<< @@ -7744,7 +7796,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ __pyx_v_total_left = (__pyx_v_total_left + (__pyx_v_var_left[__pyx_v_k])); - /* "sklearn/tree/_tree.pyx":862 + /* "sklearn/tree/_tree.pyx":878 * for k in range(n_outputs): * total_left += var_left[k] * total_right += var_right[k] # <<<<<<<<<<<<<< @@ -7754,7 +7806,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob __pyx_v_total_right = (__pyx_v_total_right + (__pyx_v_var_right[__pyx_v_k])); } - /* "sklearn/tree/_tree.pyx":864 + /* "sklearn/tree/_tree.pyx":880 * total_right += var_right[k] * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -7763,7 +7815,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":865 + /* "sklearn/tree/_tree.pyx":881 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -7772,7 +7824,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob */ (__pyx_v_impurity_right[0]) = (__pyx_v_total_right / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":848 + /* "sklearn/tree/_tree.pyx":864 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7783,7 +7835,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob /* function exit code */ } -/* "sklearn/tree/_tree.pyx":877 +/* "sklearn/tree/_tree.pyx":893 * """ * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -7806,7 +7858,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s double *__pyx_t_2; double __pyx_t_3; - /* "sklearn/tree/_tree.pyx":878 + /* "sklearn/tree/_tree.pyx":894 * * cdef double impurity_improvement(self, double impurity) nogil: * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7816,7 +7868,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.n_outputs; __pyx_v_n_outputs = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":880 + /* "sklearn/tree/_tree.pyx":896 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t k * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -7826,7 +7878,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_left; __pyx_v_sum_left = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":881 + /* "sklearn/tree/_tree.pyx":897 * cdef SIZE_t k * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -7836,7 +7888,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.sum_right; __pyx_v_sum_right = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":882 + /* "sklearn/tree/_tree.pyx":898 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< @@ -7845,7 +7897,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = 0.0; - /* "sklearn/tree/_tree.pyx":883 + /* "sklearn/tree/_tree.pyx":899 * cdef double* sum_right = self.sum_right * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 # <<<<<<<<<<<<<< @@ -7854,7 +7906,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_right = 0.0; - /* "sklearn/tree/_tree.pyx":884 + /* "sklearn/tree/_tree.pyx":900 * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -7864,7 +7916,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_left; __pyx_v_weighted_n_left = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":885 + /* "sklearn/tree/_tree.pyx":901 * 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 # <<<<<<<<<<<<<< @@ -7874,7 +7926,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.weighted_n_right; __pyx_v_weighted_n_right = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":886 + /* "sklearn/tree/_tree.pyx":902 * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right * cdef double diff = 0.0 # <<<<<<<<<<<<<< @@ -7883,7 +7935,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_diff = 0.0; - /* "sklearn/tree/_tree.pyx":888 + /* "sklearn/tree/_tree.pyx":904 * cdef double diff = 0.0 * * for k from 0 <= k < n_outputs: # <<<<<<<<<<<<<< @@ -7893,7 +7945,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_t_1 = __pyx_v_n_outputs; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_1; __pyx_v_k++) { - /* "sklearn/tree/_tree.pyx":889 + /* "sklearn/tree/_tree.pyx":905 * * for k from 0 <= k < n_outputs: * total_sum_left += sum_left[k] # <<<<<<<<<<<<<< @@ -7902,7 +7954,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = (__pyx_v_total_sum_left + (__pyx_v_sum_left[__pyx_v_k])); - /* "sklearn/tree/_tree.pyx":890 + /* "sklearn/tree/_tree.pyx":906 * for k from 0 <= k < n_outputs: * total_sum_left += sum_left[k] * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< @@ -7912,7 +7964,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_v_total_sum_right = (__pyx_v_total_sum_right + (__pyx_v_sum_right[__pyx_v_k])); } - /* "sklearn/tree/_tree.pyx":892 + /* "sklearn/tree/_tree.pyx":908 * total_sum_right += sum_right[k] * * total_sum_left = total_sum_left / n_outputs # <<<<<<<<<<<<<< @@ -7921,7 +7973,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = (__pyx_v_total_sum_left / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":893 + /* "sklearn/tree/_tree.pyx":909 * * total_sum_left = total_sum_left / n_outputs * total_sum_right = total_sum_right / n_outputs # <<<<<<<<<<<<<< @@ -7930,7 +7982,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_right = (__pyx_v_total_sum_right / __pyx_v_n_outputs); - /* "sklearn/tree/_tree.pyx":894 + /* "sklearn/tree/_tree.pyx":910 * total_sum_left = total_sum_left / n_outputs * total_sum_right = total_sum_right / n_outputs * diff = ((total_sum_left / weighted_n_left) - # <<<<<<<<<<<<<< @@ -7939,7 +7991,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_diff = ((__pyx_v_total_sum_left / __pyx_v_weighted_n_left) - (__pyx_v_total_sum_right / __pyx_v_weighted_n_right)); - /* "sklearn/tree/_tree.pyx":897 + /* "sklearn/tree/_tree.pyx":913 * (total_sum_right / weighted_n_right)) * * return (weighted_n_left * weighted_n_right * diff * diff / # <<<<<<<<<<<<<< @@ -7949,7 +8001,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s __pyx_r = ((((__pyx_v_weighted_n_left * __pyx_v_weighted_n_right) * __pyx_v_diff) * __pyx_v_diff) / (__pyx_v_weighted_n_left + __pyx_v_weighted_n_right)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":877 + /* "sklearn/tree/_tree.pyx":893 * """ * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -7962,7 +8014,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":905 +/* "sklearn/tree/_tree.pyx":921 * # ============================================================================= * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: # <<<<<<<<<<<<<< @@ -7972,7 +8024,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":906 + /* "sklearn/tree/_tree.pyx":922 * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: * self.impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -7981,7 +8033,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":907 + /* "sklearn/tree/_tree.pyx":923 * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: * self.impurity_left = INFINITY * self.impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -7990,7 +8042,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":908 + /* "sklearn/tree/_tree.pyx":924 * self.impurity_left = INFINITY * self.impurity_right = INFINITY * self.pos = start_pos # <<<<<<<<<<<<<< @@ -7999,7 +8051,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":909 + /* "sklearn/tree/_tree.pyx":925 * self.impurity_right = INFINITY * self.pos = start_pos * self.feature = 0 # <<<<<<<<<<<<<< @@ -8008,7 +8060,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->feature = 0; - /* "sklearn/tree/_tree.pyx":910 + /* "sklearn/tree/_tree.pyx":926 * self.pos = start_pos * self.feature = 0 * self.threshold = 0. # <<<<<<<<<<<<<< @@ -8017,7 +8069,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx */ __pyx_v_self->threshold = 0.; - /* "sklearn/tree/_tree.pyx":911 + /* "sklearn/tree/_tree.pyx":927 * self.feature = 0 * self.threshold = 0. * self.improvement = -INFINITY # <<<<<<<<<<<<<< @@ -8026,7 +8078,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":905 + /* "sklearn/tree/_tree.pyx":921 * # ============================================================================= * * cdef inline void _init_split(SplitRecord* self, SIZE_t start_pos) nogil: # <<<<<<<<<<<<<< @@ -8037,7 +8089,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree__init_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":915 +/* "sklearn/tree/_tree.pyx":931 * * cdef class Splitter: * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -8082,26 +8134,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 = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __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 = 915; __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 = 931; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -8113,20 +8165,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 = 915; __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 = 916; __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 = 917; __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 = 931; __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 = 932; __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 = 933; __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 = 915; __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 = 931; __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 = 915; __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 = 931; __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 */ @@ -8143,7 +8195,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":919 + /* "sklearn/tree/_tree.pyx":935 * double min_weight_leaf, * object random_state): * self.criterion = criterion # <<<<<<<<<<<<<< @@ -8156,7 +8208,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":921 + /* "sklearn/tree/_tree.pyx":937 * self.criterion = criterion * * self.samples = NULL # <<<<<<<<<<<<<< @@ -8165,7 +8217,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->samples = NULL; - /* "sklearn/tree/_tree.pyx":922 + /* "sklearn/tree/_tree.pyx":938 * * self.samples = NULL * self.n_samples = 0 # <<<<<<<<<<<<<< @@ -8174,7 +8226,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":923 + /* "sklearn/tree/_tree.pyx":939 * self.samples = NULL * self.n_samples = 0 * self.features = NULL # <<<<<<<<<<<<<< @@ -8183,7 +8235,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->features = NULL; - /* "sklearn/tree/_tree.pyx":924 + /* "sklearn/tree/_tree.pyx":940 * self.n_samples = 0 * self.features = NULL * self.n_features = 0 # <<<<<<<<<<<<<< @@ -8192,7 +8244,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":925 + /* "sklearn/tree/_tree.pyx":941 * self.features = NULL * self.n_features = 0 * self.feature_values = NULL # <<<<<<<<<<<<<< @@ -8201,7 +8253,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":927 + /* "sklearn/tree/_tree.pyx":943 * self.feature_values = NULL * * self.X = NULL # <<<<<<<<<<<<<< @@ -8210,7 +8262,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->X = NULL; - /* "sklearn/tree/_tree.pyx":928 + /* "sklearn/tree/_tree.pyx":944 * * self.X = NULL * self.X_sample_stride = 0 # <<<<<<<<<<<<<< @@ -8219,7 +8271,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->X_sample_stride = 0; - /* "sklearn/tree/_tree.pyx":929 + /* "sklearn/tree/_tree.pyx":945 * self.X = NULL * self.X_sample_stride = 0 * self.X_fx_stride = 0 # <<<<<<<<<<<<<< @@ -8228,7 +8280,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->X_fx_stride = 0; - /* "sklearn/tree/_tree.pyx":930 + /* "sklearn/tree/_tree.pyx":946 * self.X_sample_stride = 0 * self.X_fx_stride = 0 * self.y = NULL # <<<<<<<<<<<<<< @@ -8237,7 +8289,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->y = NULL; - /* "sklearn/tree/_tree.pyx":931 + /* "sklearn/tree/_tree.pyx":947 * self.X_fx_stride = 0 * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -8246,7 +8298,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":932 + /* "sklearn/tree/_tree.pyx":948 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -8255,7 +8307,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":934 + /* "sklearn/tree/_tree.pyx":950 * self.sample_weight = NULL * * self.max_features = max_features # <<<<<<<<<<<<<< @@ -8264,7 +8316,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":935 + /* "sklearn/tree/_tree.pyx":951 * * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -8273,7 +8325,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":936 + /* "sklearn/tree/_tree.pyx":952 * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -8282,7 +8334,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":937 + /* "sklearn/tree/_tree.pyx":953 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.random_state = random_state # <<<<<<<<<<<<<< @@ -8295,7 +8347,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":915 + /* "sklearn/tree/_tree.pyx":931 * * cdef class Splitter: * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -8309,7 +8361,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":939 +/* "sklearn/tree/_tree.pyx":955 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8332,7 +8384,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":941 + /* "sklearn/tree/_tree.pyx":957 * def __dealloc__(self): * """Destructor.""" * free(self.samples) # <<<<<<<<<<<<<< @@ -8341,7 +8393,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->samples); - /* "sklearn/tree/_tree.pyx":942 + /* "sklearn/tree/_tree.pyx":958 * """Destructor.""" * free(self.samples) * free(self.features) # <<<<<<<<<<<<<< @@ -8350,7 +8402,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->features); - /* "sklearn/tree/_tree.pyx":943 + /* "sklearn/tree/_tree.pyx":959 * free(self.samples) * free(self.features) * free(self.constant_features) # <<<<<<<<<<<<<< @@ -8359,7 +8411,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":944 + /* "sklearn/tree/_tree.pyx":960 * free(self.features) * free(self.constant_features) * free(self.feature_values) # <<<<<<<<<<<<<< @@ -8368,7 +8420,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":939 + /* "sklearn/tree/_tree.pyx":955 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8380,7 +8432,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":946 +/* "sklearn/tree/_tree.pyx":962 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8410,7 +8462,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":947 + /* "sklearn/tree/_tree.pyx":963 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -8418,13 +8470,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 = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __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":946 + /* "sklearn/tree/_tree.pyx":962 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8443,7 +8495,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_4__getstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":949 +/* "sklearn/tree/_tree.pyx":965 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -8476,7 +8528,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_6__setstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":952 +/* "sklearn/tree/_tree.pyx":968 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -8522,27 +8574,27 @@ 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_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; { __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 = 952; __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 = 968; __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":958 + /* "sklearn/tree/_tree.pyx":974 * """Initialize the splitter.""" * # Reset random state * self.rand_r_state = self.random_state.randint(0, RAND_R_MAX) # <<<<<<<<<<<<<< * * # Initialize samples and features structures */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->random_state, __pyx_n_s_randint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->random_state, __pyx_n_s_randint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __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 = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0); @@ -8550,15 +8602,15 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyInt_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_npy_uint32(__pyx_t_2); if (unlikely((__pyx_t_4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->rand_r_state = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":961 + /* "sklearn/tree/_tree.pyx":977 * * # Initialize samples and features structures * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< @@ -8567,17 +8619,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_n_samples = (__pyx_v_X->dimensions[0]); - /* "sklearn/tree/_tree.pyx":962 + /* "sklearn/tree/_tree.pyx":978 * # Initialize samples and features structures * cdef SIZE_t n_samples = X.shape[0] * cdef SIZE_t* samples = safe_realloc(&self.samples, n_samples) # <<<<<<<<<<<<<< * * cdef SIZE_t i, j */ - __pyx_t_5 = __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 = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __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 = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_samples = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":965 + /* "sklearn/tree/_tree.pyx":981 * * cdef SIZE_t i, j * cdef double weighted_n_samples = 0.0 # <<<<<<<<<<<<<< @@ -8586,7 +8638,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":966 + /* "sklearn/tree/_tree.pyx":982 * cdef SIZE_t i, j * cdef double weighted_n_samples = 0.0 * j = 0 # <<<<<<<<<<<<<< @@ -8595,7 +8647,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_j = 0; - /* "sklearn/tree/_tree.pyx":968 + /* "sklearn/tree/_tree.pyx":984 * j = 0 * * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -8606,7 +8658,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea 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":970 + /* "sklearn/tree/_tree.pyx":986 * for i in range(n_samples): * # Only work with positively weighted samples * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< @@ -8622,7 +8674,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":971 + /* "sklearn/tree/_tree.pyx":987 * # Only work with positively weighted samples * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i # <<<<<<<<<<<<<< @@ -8631,7 +8683,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":972 + /* "sklearn/tree/_tree.pyx":988 * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i * j += 1 # <<<<<<<<<<<<<< @@ -8643,7 +8695,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":974 + /* "sklearn/tree/_tree.pyx":990 * j += 1 * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -8653,7 +8705,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_10 = ((__pyx_v_sample_weight != NULL) != 0); if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":975 + /* "sklearn/tree/_tree.pyx":991 * * if sample_weight != NULL: * weighted_n_samples += sample_weight[i] # <<<<<<<<<<<<<< @@ -8665,7 +8717,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":977 + /* "sklearn/tree/_tree.pyx":993 * weighted_n_samples += sample_weight[i] * else: * weighted_n_samples += 1.0 # <<<<<<<<<<<<<< @@ -8677,7 +8729,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_L6:; } - /* "sklearn/tree/_tree.pyx":979 + /* "sklearn/tree/_tree.pyx":995 * weighted_n_samples += 1.0 * * self.n_samples = j # <<<<<<<<<<<<<< @@ -8686,7 +8738,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":980 + /* "sklearn/tree/_tree.pyx":996 * * self.n_samples = j * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< @@ -8695,7 +8747,7 @@ 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":982 + /* "sklearn/tree/_tree.pyx":998 * self.weighted_n_samples = weighted_n_samples * * cdef SIZE_t n_features = X.shape[1] # <<<<<<<<<<<<<< @@ -8704,17 +8756,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_n_features = (__pyx_v_X->dimensions[1]); - /* "sklearn/tree/_tree.pyx":983 + /* "sklearn/tree/_tree.pyx":999 * * 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_5 = __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 = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __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 = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_features = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":985 + /* "sklearn/tree/_tree.pyx":1001 * cdef SIZE_t* features = safe_realloc(&self.features, n_features) * * for i in range(n_features): # <<<<<<<<<<<<<< @@ -8725,7 +8777,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea 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":986 + /* "sklearn/tree/_tree.pyx":1002 * * for i in range(n_features): * features[i] = i # <<<<<<<<<<<<<< @@ -8735,7 +8787,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":988 + /* "sklearn/tree/_tree.pyx":1004 * features[i] = i * * self.n_features = n_features # <<<<<<<<<<<<<< @@ -8744,25 +8796,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":990 + /* "sklearn/tree/_tree.pyx":1006 * self.n_features = n_features * * safe_realloc(&self.feature_values, n_samples) # <<<<<<<<<<<<<< * safe_realloc(&self.constant_features, n_features) * */ - __pyx_t_11 = __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 = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __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 = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":991 + /* "sklearn/tree/_tree.pyx":1007 * * safe_realloc(&self.feature_values, n_samples) * safe_realloc(&self.constant_features, n_features) # <<<<<<<<<<<<<< * * # Initialize X, y, sample_weight */ - __pyx_t_5 = __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 = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __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 = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":994 + /* "sklearn/tree/_tree.pyx":1010 * * # Initialize X, y, sample_weight * self.X = X.data # <<<<<<<<<<<<<< @@ -8771,33 +8823,33 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->X = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)__pyx_v_X->data); - /* "sklearn/tree/_tree.pyx":995 + /* "sklearn/tree/_tree.pyx":1011 * # Initialize X, y, sample_weight * self.X = X.data * self.X_sample_stride = X.strides[0] / X.itemsize # <<<<<<<<<<<<<< * self.X_fx_stride = X.strides[1] / X.itemsize * self.y = y.data */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __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_v_X->strides[0])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_6)); - /* "sklearn/tree/_tree.pyx":996 + /* "sklearn/tree/_tree.pyx":1012 * self.X = X.data * self.X_sample_stride = X.strides[0] / X.itemsize * self.X_fx_stride = X.strides[1] / X.itemsize # <<<<<<<<<<<<<< * self.y = y.data * self.y_stride = y.strides[0] / y.itemsize */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->X_fx_stride = (((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)(__pyx_v_X->strides[1])) / ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)__pyx_t_6)); - /* "sklearn/tree/_tree.pyx":997 + /* "sklearn/tree/_tree.pyx":1013 * self.X_sample_stride = X.strides[0] / X.itemsize * self.X_fx_stride = X.strides[1] / X.itemsize * self.y = y.data # <<<<<<<<<<<<<< @@ -8806,20 +8858,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":998 + /* "sklearn/tree/_tree.pyx":1014 * self.X_fx_stride = X.strides[1] / X.itemsize * self.y = y.data * self.y_stride = y.strides[0] / y.itemsize # <<<<<<<<<<<<<< * self.sample_weight = sample_weight * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_6)); - /* "sklearn/tree/_tree.pyx":999 + /* "sklearn/tree/_tree.pyx":1015 * self.y = y.data * self.y_stride = y.strides[0] / y.itemsize * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -8828,7 +8880,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":952 + /* "sklearn/tree/_tree.pyx":968 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -8856,7 +8908,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1001 +/* "sklearn/tree/_tree.pyx":1017 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< @@ -8867,7 +8919,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end, double *__pyx_v_weighted_n_node_samples) { double __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1004 + /* "sklearn/tree/_tree.pyx":1020 * double* weighted_n_node_samples) nogil: * """Reset splitter on node samples[start:end].""" * self.start = start # <<<<<<<<<<<<<< @@ -8876,7 +8928,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":1005 + /* "sklearn/tree/_tree.pyx":1021 * """Reset splitter on node samples[start:end].""" * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -8885,7 +8937,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ */ __pyx_v_self->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1007 + /* "sklearn/tree/_tree.pyx":1023 * self.end = end * * self.criterion.init(self.y, # <<<<<<<<<<<<<< @@ -8894,7 +8946,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->criterion->__pyx_vtab)->init(__pyx_v_self->criterion, __pyx_v_self->y, __pyx_v_self->y_stride, __pyx_v_self->sample_weight, __pyx_v_self->weighted_n_samples, __pyx_v_self->samples, __pyx_v_start, __pyx_v_end); - /* "sklearn/tree/_tree.pyx":1015 + /* "sklearn/tree/_tree.pyx":1031 * end) * * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -8904,7 +8956,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ __pyx_t_1 = __pyx_v_self->criterion->weighted_n_node_samples; (__pyx_v_weighted_n_node_samples[0]) = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1001 + /* "sklearn/tree/_tree.pyx":1017 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< @@ -8915,7 +8967,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1017 +/* "sklearn/tree/_tree.pyx":1033 * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -8928,7 +8980,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split(CYTHON_UNUSED str /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1022 +/* "sklearn/tree/_tree.pyx":1038 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -8938,7 +8990,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":1024 + /* "sklearn/tree/_tree.pyx":1040 * cdef void node_value(self, double* dest) nogil: * """Copy the value of node samples[start:end] into dest.""" * self.criterion.node_value(dest) # <<<<<<<<<<<<<< @@ -8947,7 +8999,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":1022 + /* "sklearn/tree/_tree.pyx":1038 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -8958,7 +9010,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value(struct __pyx_obj_ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1026 +/* "sklearn/tree/_tree.pyx":1042 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -8969,7 +9021,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":1028 + /* "sklearn/tree/_tree.pyx":1044 * cdef double node_impurity(self) nogil: * """Copy the impurity of node samples[start:end.""" * return self.criterion.node_impurity() # <<<<<<<<<<<<<< @@ -8979,7 +9031,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":1026 + /* "sklearn/tree/_tree.pyx":1042 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -8992,7 +9044,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":88 * * # Internal structures * cdef public Criterion criterion # Impurity criterion # <<<<<<<<<<<<<< @@ -9050,7 +9102,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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -9100,7 +9152,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":89 * # Internal structures * cdef public Criterion criterion # Impurity criterion * cdef public SIZE_t max_features # Number of features to test # <<<<<<<<<<<<<< @@ -9130,7 +9182,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 = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9168,7 +9220,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 = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_features = __pyx_t_1; /* function exit code */ @@ -9182,7 +9234,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":90 * 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 # <<<<<<<<<<<<<< @@ -9212,7 +9264,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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9250,7 +9302,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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->min_samples_leaf = __pyx_t_1; /* function exit code */ @@ -9264,7 +9316,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":91 * 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 # <<<<<<<<<<<<<< @@ -9294,7 +9346,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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9332,7 +9384,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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->min_weight_leaf = __pyx_t_1; /* function exit code */ @@ -9346,7 +9398,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_15min_weight_leaf_2__set__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1033 +/* "sklearn/tree/_tree.pyx":1049 * cdef class BestSplitter(Splitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9379,7 +9431,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1034 + /* "sklearn/tree/_tree.pyx":1050 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -9388,44 +9440,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1035 + /* "sklearn/tree/_tree.pyx":1051 * 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.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1036 + /* "sklearn/tree/_tree.pyx":1052 * 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.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1037 + /* "sklearn/tree/_tree.pyx":1053 * 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.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1034 + /* "sklearn/tree/_tree.pyx":1050 * """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 = 1034; __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 = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.criterion)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.criterion)); @@ -9443,27 +9495,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1038 + /* "sklearn/tree/_tree.pyx":1054 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __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 = 1038; __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 = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1034 + /* "sklearn/tree/_tree.pyx":1050 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __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 = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter))); @@ -9478,7 +9530,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1033 + /* "sklearn/tree/_tree.pyx":1049 * cdef class BestSplitter(Splitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9500,7 +9552,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1040 +/* "sklearn/tree/_tree.pyx":1056 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -9526,16 +9578,27 @@ 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; + int __pyx_v_n_categorical; + int __pyx_v_n_categories; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_v_category; + int *__pyx_v_outcome_by_cat; + std::set<__pyx_t_7sklearn_4tree_5_tree_DTYPE_t> __pyx_v_set_categories; + std::map<__pyx_t_7sklearn_4tree_5_tree_DTYPE_t,__pyx_t_7sklearn_4tree_5_tree_SIZE_t> __pyx_v_categories; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_i; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_c_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_f_j; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_p; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_tmp; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_right_p; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_visited_features; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_found_constants; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_drawn_constants; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_known_constants; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_total_constants; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_partition_end; + std::pair<__pyx_t_7sklearn_4tree_5_tree_DTYPE_t,__pyx_t_7sklearn_4tree_5_tree_SIZE_t> __pyx_v_cat_pair; + long __pyx_v_split_categories; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_t_1; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_2; __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_t_3; @@ -9545,8 +9608,13 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx int __pyx_t_7; int __pyx_t_8; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_9; + std::set<__pyx_t_7sklearn_4tree_5_tree_DTYPE_t>::iterator __pyx_t_10; + __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_t_11; + int __pyx_t_12; + long __pyx_t_13; + long __pyx_t_14; - /* "sklearn/tree/_tree.pyx":1044 + /* "sklearn/tree/_tree.pyx":1060 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -9556,7 +9624,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_1 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1045 + /* "sklearn/tree/_tree.pyx":1061 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -9566,7 +9634,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1046 + /* "sklearn/tree/_tree.pyx":1062 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -9576,7 +9644,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1048 + /* "sklearn/tree/_tree.pyx":1064 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -9586,7 +9654,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_1 = __pyx_v_self->__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1049 + /* "sklearn/tree/_tree.pyx":1065 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -9596,7 +9664,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_1 = __pyx_v_self->__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1050 + /* "sklearn/tree/_tree.pyx":1066 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -9606,7 +9674,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1052 + /* "sklearn/tree/_tree.pyx":1068 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -9616,7 +9684,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":1053 + /* "sklearn/tree/_tree.pyx":1069 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -9626,7 +9694,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_3 = __pyx_v_self->__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1054 + /* "sklearn/tree/_tree.pyx":1070 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -9636,7 +9704,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":1055 + /* "sklearn/tree/_tree.pyx":1071 * 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 # <<<<<<<<<<<<<< @@ -9646,7 +9714,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":1056 + /* "sklearn/tree/_tree.pyx":1072 * 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 # <<<<<<<<<<<<<< @@ -9656,7 +9724,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1057 + /* "sklearn/tree/_tree.pyx":1073 * 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 # <<<<<<<<<<<<<< @@ -9666,7 +9734,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_2 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1058 + /* "sklearn/tree/_tree.pyx":1074 * 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 # <<<<<<<<<<<<<< @@ -9676,7 +9744,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1059 + /* "sklearn/tree/_tree.pyx":1075 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef double weighted_n_samples = self.weighted_n_samples # <<<<<<<<<<<<<< @@ -9686,7 +9754,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = __pyx_v_self->__pyx_base.weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1060 + /* "sklearn/tree/_tree.pyx":1076 * cdef double min_weight_leaf = self.min_weight_leaf * cdef double weighted_n_samples = self.weighted_n_samples * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -9695,25 +9763,43 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":1064 + /* "sklearn/tree/_tree.pyx":1080 * cdef SplitRecord best, current * + * cdef int n_categorical = 0 #TODO # <<<<<<<<<<<<<< + * cdef int n_categories + * cdef DTYPE_t category + */ + __pyx_v_n_categorical = 0; + + /* "sklearn/tree/_tree.pyx":1087 + * cdef map_[DTYPE_t, SIZE_t] categories + * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< - * cdef SIZE_t f_j, p, tmp - * cdef SIZE_t n_visited_features = 0 + * cdef SIZE_t c_i = n_features - n_categorical + * cdef SIZE_t f_j, p, tmp, right_p, i */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":1066 + /* "sklearn/tree/_tree.pyx":1088 + * * cdef SIZE_t f_i = n_features - * cdef SIZE_t f_j, p, tmp + * cdef SIZE_t c_i = n_features - n_categorical # <<<<<<<<<<<<<< + * cdef SIZE_t f_j, p, tmp, right_p, i + * cdef SIZE_t n_visited_features = 0 + */ + __pyx_v_c_i = (__pyx_v_n_features - __pyx_v_n_categorical); + + /* "sklearn/tree/_tree.pyx":1090 + * cdef SIZE_t c_i = n_features - n_categorical + * cdef SIZE_t f_j, p, tmp, right_p, i * 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 */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1068 + /* "sklearn/tree/_tree.pyx":1092 * 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 # <<<<<<<<<<<<<< @@ -9722,7 +9808,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1070 + /* "sklearn/tree/_tree.pyx":1094 * 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 # <<<<<<<<<<<<<< @@ -9731,7 +9817,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1071 + /* "sklearn/tree/_tree.pyx":1095 * # 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] # <<<<<<<<<<<<<< @@ -9740,7 +9826,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":1073 + /* "sklearn/tree/_tree.pyx":1097 * 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 # <<<<<<<<<<<<<< @@ -9749,8 +9835,8 @@ 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":1077 - * cdef SIZE_t partition_end + /* "sklearn/tree/_tree.pyx":1103 + * cdef pair[DTYPE_t, SIZE_t] cat_pair * * _init_split(&best, end) # <<<<<<<<<<<<<< * @@ -9758,7 +9844,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":1088 + /* "sklearn/tree/_tree.pyx":1114 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -9769,7 +9855,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1090 + /* "sklearn/tree/_tree.pyx":1116 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -9779,7 +9865,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_6 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); if (!__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1092 + /* "sklearn/tree/_tree.pyx":1118 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -9797,17 +9883,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":1094 + /* "sklearn/tree/_tree.pyx":1120 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< * - * # Loop invariant: elements of features in + * # TODO */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":1109 - * # Draw a feature at random + /* "sklearn/tree/_tree.pyx":1141 + * # f_j is in the interval [n_drawn_constant, f_i - n_found_constants[ * f_j = rand_int(f_i - n_drawn_constants - n_found_constants, * random_state) + n_drawn_constants # <<<<<<<<<<<<<< * @@ -9815,7 +9901,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_f_i - __pyx_v_n_drawn_constants) - __pyx_v_n_found_constants), __pyx_v_random_state) + __pyx_v_n_drawn_constants); - /* "sklearn/tree/_tree.pyx":1111 + /* "sklearn/tree/_tree.pyx":1143 * random_state) + n_drawn_constants * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -9825,7 +9911,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_6 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1113 + /* "sklearn/tree/_tree.pyx":1145 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -9834,7 +9920,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":1114 + /* "sklearn/tree/_tree.pyx":1146 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -9843,7 +9929,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":1115 + /* "sklearn/tree/_tree.pyx":1147 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -9852,7 +9938,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":1117 + /* "sklearn/tree/_tree.pyx":1149 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -9864,7 +9950,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1121 + /* "sklearn/tree/_tree.pyx":1153 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -9873,7 +9959,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":1124 + /* "sklearn/tree/_tree.pyx":1156 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -9882,7 +9968,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":1130 + /* "sklearn/tree/_tree.pyx":1162 * # Xf[i] == X[samples[i], j], so the sort uses the cache more * # effectively. * for p in range(start, end): # <<<<<<<<<<<<<< @@ -9893,7 +9979,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx for (__pyx_t_9 = __pyx_v_start; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) { __pyx_v_p = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1131 + /* "sklearn/tree/_tree.pyx":1163 * # effectively. * for p in range(start, end): * Xf[p] = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -9903,7 +9989,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":1134 + /* "sklearn/tree/_tree.pyx":1166 * X_fx_stride * current.feature] * * sort(Xf + start, samples + start, end - start) # <<<<<<<<<<<<<< @@ -9912,27 +9998,27 @@ 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":1136 + /* "sklearn/tree/_tree.pyx":1168 * sort(Xf + start, samples + start, end - start) * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< + * # If f_j is constant so we add it to the constants features * features[f_j] = features[n_total_constants] - * features[n_total_constants] = current.feature */ __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":1137 - * + /* "sklearn/tree/_tree.pyx":1170 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: + * # If f_j is constant so we add it to the constants features * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< * features[n_total_constants] = current.feature * */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":1138 - * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: + /* "sklearn/tree/_tree.pyx":1171 + * # If f_j is constant so we add it to the constants features * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< * @@ -9941,7 +10027,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":1140 + /* "sklearn/tree/_tree.pyx":1173 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -9950,40 +10036,349 @@ 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":1141 + /* "sklearn/tree/_tree.pyx":1174 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< * - * else: + * elif f_j >= c_i: */ __pyx_v_n_total_constants = (__pyx_v_n_total_constants + 1); goto __pyx_L8; } - /*else*/ { - /* "sklearn/tree/_tree.pyx":1144 + /* "sklearn/tree/_tree.pyx":1176 + * n_total_constants += 1 * - * else: + * elif f_j >= c_i: # <<<<<<<<<<<<<< + * # f_j is categorical and not constant + * f_i -= 1 + */ + __pyx_t_6 = ((__pyx_v_f_j >= __pyx_v_c_i) != 0); + if (__pyx_t_6) { + + /* "sklearn/tree/_tree.pyx":1178 + * elif f_j >= c_i: + * # f_j is categorical and not constant * f_i -= 1 # <<<<<<<<<<<<<< * features[f_i], features[f_j] = features[f_j], features[f_i] * */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":1145 - * else: + /* "sklearn/tree/_tree.pyx":1179 + * # f_j is categorical and not constant * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< * - * # Evaluate all splits + * # We find the categories that are in the data */ __pyx_t_2 = (__pyx_v_features[__pyx_v_f_j]); __pyx_t_9 = (__pyx_v_features[__pyx_v_f_i]); (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1148 + /* "sklearn/tree/_tree.pyx":1182 + * + * # We find the categories that are in the data + * set_categories.clear() # <<<<<<<<<<<<<< + * for p in xrange(start, end): + * set_categories.insert(Xf[p]) + */ + __pyx_v_set_categories.clear(); + + /* "sklearn/tree/_tree.pyx":1183 + * # We find the categories that are in the data + * set_categories.clear() + * for p in xrange(start, end): # <<<<<<<<<<<<<< + * set_categories.insert(Xf[p]) + * n_categories = set_categories.size() + */ + __pyx_t_9 = __pyx_v_end; + for (__pyx_t_2 = __pyx_v_start; __pyx_t_2 < __pyx_t_9; __pyx_t_2+=1) { + __pyx_v_p = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1184 + * set_categories.clear() + * for p in xrange(start, end): + * set_categories.insert(Xf[p]) # <<<<<<<<<<<<<< + * n_categories = set_categories.size() + * i = 0 + */ + __pyx_v_set_categories.insert((__pyx_v_Xf[__pyx_v_p])); + } + + /* "sklearn/tree/_tree.pyx":1185 + * for p in xrange(start, end): + * set_categories.insert(Xf[p]) + * n_categories = set_categories.size() # <<<<<<<<<<<<<< + * i = 0 + * for category in set_categories: + */ + __pyx_v_n_categories = __pyx_v_set_categories.size(); + + /* "sklearn/tree/_tree.pyx":1186 + * set_categories.insert(Xf[p]) + * n_categories = set_categories.size() + * i = 0 # <<<<<<<<<<<<<< + * for category in set_categories: + * cat_pair.first = category + */ + __pyx_v_i = 0; + + /* "sklearn/tree/_tree.pyx":1187 + * n_categories = set_categories.size() + * i = 0 + * for category in set_categories: # <<<<<<<<<<<<<< + * cat_pair.first = category + * cat_pair.second = i + */ + __pyx_t_10 = __pyx_v_set_categories.begin(); + for (;;) { + if (!(__pyx_t_10 != __pyx_v_set_categories.end())) break; + __pyx_t_11 = *__pyx_t_10; + ++__pyx_t_10; + __pyx_v_category = __pyx_t_11; + + /* "sklearn/tree/_tree.pyx":1188 + * i = 0 + * for category in set_categories: + * cat_pair.first = category # <<<<<<<<<<<<<< + * cat_pair.second = i + * categories.insert(cat_pair) + */ + __pyx_v_cat_pair.first = __pyx_v_category; + + /* "sklearn/tree/_tree.pyx":1189 + * for category in set_categories: + * cat_pair.first = category + * cat_pair.second = i # <<<<<<<<<<<<<< + * categories.insert(cat_pair) + * i += 1 + */ + __pyx_v_cat_pair.second = __pyx_v_i; + + /* "sklearn/tree/_tree.pyx":1190 + * cat_pair.first = category + * cat_pair.second = i + * categories.insert(cat_pair) # <<<<<<<<<<<<<< + * i += 1 + * + */ + __pyx_v_categories.insert(__pyx_v_cat_pair); + + /* "sklearn/tree/_tree.pyx":1191 + * cat_pair.second = i + * categories.insert(cat_pair) + * i += 1 # <<<<<<<<<<<<<< + * + * # First we count the outcomes per category, so we don't + */ + __pyx_v_i = (__pyx_v_i + 1); + } + + /* "sklearn/tree/_tree.pyx":1197 + * #safe_realloc(&outcome_by_cat, + * # self.n_features * self.n_categories) + * outcome_by_cat = malloc( # <<<<<<<<<<<<<< + * sizeof(int) * n_features * n_categories) + * p = start + */ + __pyx_v_outcome_by_cat = ((int *)malloc((((sizeof(int)) * __pyx_v_n_features) * __pyx_v_n_categories))); + + /* "sklearn/tree/_tree.pyx":1199 + * outcome_by_cat = malloc( + * sizeof(int) * n_features * n_categories) + * p = start # <<<<<<<<<<<<<< + * while p < end: + * i = categories[Xf[p]] + */ + __pyx_v_p = __pyx_v_start; + + /* "sklearn/tree/_tree.pyx":1200 + * sizeof(int) * n_features * n_categories) + * p = start + * while p < end: # <<<<<<<<<<<<<< + * i = categories[Xf[p]] + * outcome_by_cat[p + i * n_features] += 1 + */ + while (1) { + __pyx_t_6 = ((__pyx_v_p < __pyx_v_end) != 0); + if (!__pyx_t_6) break; + + /* "sklearn/tree/_tree.pyx":1201 + * p = start + * while p < end: + * i = categories[Xf[p]] # <<<<<<<<<<<<<< + * outcome_by_cat[p + i * n_features] += 1 + * p += 1 + */ + __pyx_v_i = (__pyx_v_categories[(__pyx_v_Xf[__pyx_v_p])]); + + /* "sklearn/tree/_tree.pyx":1202 + * while p < end: + * i = categories[Xf[p]] + * outcome_by_cat[p + i * n_features] += 1 # <<<<<<<<<<<<<< + * p += 1 + * # We test all the combinations of categories. Not efficient + */ + __pyx_t_12 = (__pyx_v_p + (__pyx_v_i * __pyx_v_n_features)); + (__pyx_v_outcome_by_cat[__pyx_t_12]) = ((__pyx_v_outcome_by_cat[__pyx_t_12]) + 1); + + /* "sklearn/tree/_tree.pyx":1203 + * i = categories[Xf[p]] + * outcome_by_cat[p + i * n_features] += 1 + * p += 1 # <<<<<<<<<<<<<< + * # We test all the combinations of categories. Not efficient + * # if there is many dummies. + */ + __pyx_v_p = (__pyx_v_p + 1); + } + + /* "sklearn/tree/_tree.pyx":1206 + * # We test all the combinations of categories. Not efficient + * # if there is many dummies. + * for split_categories in xrange(2**(n_categories-1)): # <<<<<<<<<<<<<< + * # The first category is always in the right branch. + * # It doesn't change anything because of symmetry + */ + __pyx_t_13 = __Pyx_pow_long(2, (__pyx_v_n_categories - 1)); + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { + __pyx_v_split_categories = __pyx_t_14; + + /* "sklearn/tree/_tree.pyx":1211 + * # TODO how to calculate the impurities using + * # outcome_by_cat ? + * current.impurity_left = 0 # <<<<<<<<<<<<<< + * current.impurity_right = 0 + * current.improvement = 0 + */ + __pyx_v_current.impurity_left = 0.0; + + /* "sklearn/tree/_tree.pyx":1212 + * # outcome_by_cat ? + * current.impurity_left = 0 + * current.impurity_right = 0 # <<<<<<<<<<<<<< + * current.improvement = 0 + * # Example loop through categories + */ + __pyx_v_current.impurity_right = 0.0; + + /* "sklearn/tree/_tree.pyx":1213 + * current.impurity_left = 0 + * current.impurity_right = 0 + * current.improvement = 0 # <<<<<<<<<<<<<< + * # Example loop through categories + * # for i in xrange(n_categories): + */ + __pyx_v_current.improvement = 0.0; + + /* "sklearn/tree/_tree.pyx":1218 + * # category = categories[i] #TODO check + * # is_left = (split >> i) & 1 + * if current.improvement > best.improvement: # <<<<<<<<<<<<<< + * best.impurity_left = current.impurity_left + * best.impurity_right = current.impurity_right + */ + __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); + if (__pyx_t_6) { + + /* "sklearn/tree/_tree.pyx":1219 + * # is_left = (split >> i) & 1 + * if current.improvement > best.improvement: + * best.impurity_left = current.impurity_left # <<<<<<<<<<<<<< + * best.impurity_right = current.impurity_right + * best.improvement = current.improvement + */ + __pyx_t_4 = __pyx_v_current.impurity_left; + __pyx_v_best.impurity_left = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1220 + * if current.improvement > best.improvement: + * best.impurity_left = current.impurity_left + * best.impurity_right = current.impurity_right # <<<<<<<<<<<<<< + * best.improvement = current.improvement + * best.feature = current.feature + */ + __pyx_t_4 = __pyx_v_current.impurity_right; + __pyx_v_best.impurity_right = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1221 + * best.impurity_left = current.impurity_left + * best.impurity_right = current.impurity_right + * best.improvement = current.improvement # <<<<<<<<<<<<<< + * best.feature = current.feature + * best.split_categories = split_categories + */ + __pyx_t_4 = __pyx_v_current.improvement; + __pyx_v_best.improvement = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1222 + * best.impurity_right = current.impurity_right + * best.improvement = current.improvement + * best.feature = current.feature # <<<<<<<<<<<<<< + * best.split_categories = split_categories + * best.split_type = CATEGORICAL + */ + __pyx_t_9 = __pyx_v_current.feature; + __pyx_v_best.feature = __pyx_t_9; + + /* "sklearn/tree/_tree.pyx":1223 + * best.improvement = current.improvement + * best.feature = current.feature + * best.split_categories = split_categories # <<<<<<<<<<<<<< + * best.split_type = CATEGORICAL + * free(outcome_by_cat) + */ + __pyx_v_best.split_categories = __pyx_v_split_categories; + + /* "sklearn/tree/_tree.pyx":1224 + * best.feature = current.feature + * best.split_categories = split_categories + * best.split_type = CATEGORICAL # <<<<<<<<<<<<<< + * free(outcome_by_cat) + * + */ + __pyx_v_best.split_type = __pyx_v_7sklearn_4tree_5_tree_CATEGORICAL; + goto __pyx_L17; + } + __pyx_L17:; + } + + /* "sklearn/tree/_tree.pyx":1225 + * best.split_categories = split_categories + * best.split_type = CATEGORICAL + * free(outcome_by_cat) # <<<<<<<<<<<<<< + * + * else: + */ + free(__pyx_v_outcome_by_cat); + goto __pyx_L8; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":1229 + * else: + * # f_j is continuous and not constant + * f_i -= 1 # <<<<<<<<<<<<<< + * features[f_i], features[f_j] = features[f_j], features[f_i] + * + */ + __pyx_v_f_i = (__pyx_v_f_i - 1); + + /* "sklearn/tree/_tree.pyx":1230 + * # f_j is continuous and not constant + * f_i -= 1 + * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< + * + * # Evaluate all splits + */ + __pyx_t_9 = (__pyx_v_features[__pyx_v_f_j]); + __pyx_t_2 = (__pyx_v_features[__pyx_v_f_i]); + (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_9; + (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1233 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -9992,7 +10387,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.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1149 + /* "sklearn/tree/_tree.pyx":1234 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -10001,7 +10396,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1151 + /* "sklearn/tree/_tree.pyx":1236 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -10012,7 +10407,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_6 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":1152 + /* "sklearn/tree/_tree.pyx":1237 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -10023,7 +10418,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_6 = (((__pyx_v_p + 1) < __pyx_v_end) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1153 + /* "sklearn/tree/_tree.pyx":1238 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -10037,7 +10432,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1154 + /* "sklearn/tree/_tree.pyx":1239 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -10047,7 +10442,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":1158 + /* "sklearn/tree/_tree.pyx":1243 * # (p + 1 >= end) or (X[samples[p + 1], current.feature] > * # X[samples[p], current.feature]) * p += 1 # <<<<<<<<<<<<<< @@ -10056,7 +10451,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":1162 + /* "sklearn/tree/_tree.pyx":1247 * # X[samples[p - 1], current.feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -10066,7 +10461,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_8 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1163 + /* "sklearn/tree/_tree.pyx":1248 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -10075,7 +10470,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":1166 + /* "sklearn/tree/_tree.pyx":1251 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -10085,7 +10480,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_8 = (((__pyx_v_current.pos - __pyx_v_start) < __pyx_v_min_samples_leaf) != 0); if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1167 + /* "sklearn/tree/_tree.pyx":1252 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -10099,17 +10494,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1168 + /* "sklearn/tree/_tree.pyx":1253 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< * * self.criterion.update(current.pos) */ - goto __pyx_L9_continue; + goto __pyx_L18_continue; } - /* "sklearn/tree/_tree.pyx":1170 + /* "sklearn/tree/_tree.pyx":1255 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -10118,7 +10513,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.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":1173 + /* "sklearn/tree/_tree.pyx":1258 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -10128,7 +10523,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_self->__pyx_base.criterion->weighted_n_left < __pyx_v_min_weight_leaf) != 0); if (!__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1174 + /* "sklearn/tree/_tree.pyx":1259 * # 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)): # <<<<<<<<<<<<<< @@ -10142,17 +10537,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1175 + /* "sklearn/tree/_tree.pyx":1260 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< * * current.improvement = self.criterion.impurity_improvement(impurity) */ - goto __pyx_L9_continue; + goto __pyx_L18_continue; } - /* "sklearn/tree/_tree.pyx":1177 + /* "sklearn/tree/_tree.pyx":1262 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -10161,7 +10556,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":1179 + /* "sklearn/tree/_tree.pyx":1264 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -10171,25 +10566,75 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_6 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1180 + /* "sklearn/tree/_tree.pyx":1265 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< * ¤t.impurity_right) - * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 + * best.impurity_left = current.impurity_left */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":1182 + /* "sklearn/tree/_tree.pyx":1267 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) + * best.impurity_left = current.impurity_left # <<<<<<<<<<<<<< + * best.impurity_right = current.impurity_right + * best.improvement = current.improvement + */ + __pyx_t_4 = __pyx_v_current.impurity_left; + __pyx_v_best.impurity_left = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1268 + * ¤t.impurity_right) + * best.impurity_left = current.impurity_left + * best.impurity_right = current.impurity_right # <<<<<<<<<<<<<< + * best.improvement = current.improvement + * best.pos = current.pos + */ + __pyx_t_4 = __pyx_v_current.impurity_right; + __pyx_v_best.impurity_right = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1269 + * best.impurity_left = current.impurity_left + * best.impurity_right = current.impurity_right + * best.improvement = current.improvement # <<<<<<<<<<<<<< + * best.pos = current.pos + * best.feature = current.feature + */ + __pyx_t_4 = __pyx_v_current.improvement; + __pyx_v_best.improvement = __pyx_t_4; + + /* "sklearn/tree/_tree.pyx":1270 + * best.impurity_right = current.impurity_right + * best.improvement = current.improvement + * best.pos = current.pos # <<<<<<<<<<<<<< + * best.feature = current.feature + * + */ + __pyx_t_2 = __pyx_v_current.pos; + __pyx_v_best.pos = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1271 + * best.improvement = current.improvement + * best.pos = current.pos + * best.feature = current.feature # <<<<<<<<<<<<<< + * + * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 + */ + __pyx_t_2 = __pyx_v_current.feature; + __pyx_v_best.feature = __pyx_t_2; + + /* "sklearn/tree/_tree.pyx":1273 + * best.feature = current.feature + * * 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":1184 + /* "sklearn/tree/_tree.pyx":1275 * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -10199,7 +10644,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_6 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1185 + /* "sklearn/tree/_tree.pyx":1276 * * if current.threshold == Xf[p]: * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -10207,25 +10652,34 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx * best = current # copy */ __pyx_v_current.threshold = (__pyx_v_Xf[(__pyx_v_p - 1)]); - goto __pyx_L17; + goto __pyx_L26; } - __pyx_L17:; + __pyx_L26:; - /* "sklearn/tree/_tree.pyx":1187 + /* "sklearn/tree/_tree.pyx":1278 * current.threshold = Xf[p - 1] * * best = current # copy # <<<<<<<<<<<<<< + * best.split_type = CONTINUOUS * - * # Reorganize into samples[start:best.pos] + samples[best.pos:end] */ __pyx_v_best = __pyx_v_current; - goto __pyx_L16; + + /* "sklearn/tree/_tree.pyx":1279 + * + * best = current # copy + * best.split_type = CONTINUOUS # <<<<<<<<<<<<<< + * + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + */ + __pyx_v_best.split_type = __pyx_v_7sklearn_4tree_5_tree_CONTINUOUS; + goto __pyx_L25; } - __pyx_L16:; - goto __pyx_L13; + __pyx_L25:; + goto __pyx_L22; } - __pyx_L13:; - __pyx_L9_continue:; + __pyx_L22:; + __pyx_L18_continue:; } } __pyx_L8:; @@ -10233,27 +10687,33 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":1190 + /* "sklearn/tree/_tree.pyx":1282 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: # <<<<<<<<<<<<<< + * if best.split_type == CONTINUOUS and best.pos < end: # <<<<<<<<<<<<<< * partition_end = end * p = start */ - __pyx_t_6 = ((__pyx_v_best.pos < __pyx_v_end) != 0); + __pyx_t_6 = ((__pyx_v_best.split_type == __pyx_v_7sklearn_4tree_5_tree_CONTINUOUS) != 0); if (__pyx_t_6) { + __pyx_t_5 = ((__pyx_v_best.pos < __pyx_v_end) != 0); + __pyx_t_8 = __pyx_t_5; + } else { + __pyx_t_8 = __pyx_t_6; + } + if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1191 + /* "sklearn/tree/_tree.pyx":1283 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] - * if best.pos < end: + * if best.split_type == CONTINUOUS and best.pos < end: * partition_end = end # <<<<<<<<<<<<<< * p = start * */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1192 - * if best.pos < end: + /* "sklearn/tree/_tree.pyx":1284 + * if best.split_type == CONTINUOUS and best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< * @@ -10261,7 +10721,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1194 + /* "sklearn/tree/_tree.pyx":1286 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -10269,20 +10729,20 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx * X_fx_stride * best.feature] <= best.threshold: */ while (1) { - __pyx_t_6 = ((__pyx_v_p < __pyx_v_partition_end) != 0); - if (!__pyx_t_6) break; + __pyx_t_8 = ((__pyx_v_p < __pyx_v_partition_end) != 0); + if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1196 + /* "sklearn/tree/_tree.pyx":1288 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< * p += 1 * */ - __pyx_t_6 = (((__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_6) { + __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":1197 + /* "sklearn/tree/_tree.pyx":1289 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -10290,11 +10750,11 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx * else: */ __pyx_v_p = (__pyx_v_p + 1); - goto __pyx_L21; + goto __pyx_L30; } /*else*/ { - /* "sklearn/tree/_tree.pyx":1200 + /* "sklearn/tree/_tree.pyx":1292 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -10303,7 +10763,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":1202 + /* "sklearn/tree/_tree.pyx":1294 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -10312,7 +10772,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":1203 + /* "sklearn/tree/_tree.pyx":1295 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -10321,22 +10781,160 @@ 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":1204 + /* "sklearn/tree/_tree.pyx":1296 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< * - * # Respect invariant for constant features: the original order of + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + */ + (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; + } + __pyx_L30:; + } + goto __pyx_L27; + } + __pyx_L27:; + + /* "sklearn/tree/_tree.pyx":1299 + * + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + * if best.split_type == CATEGORICAL: # <<<<<<<<<<<<<< + * p = start + * right_p = end + */ + __pyx_t_8 = ((__pyx_v_best.split_type == __pyx_v_7sklearn_4tree_5_tree_CATEGORICAL) != 0); + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":1300 + * # Reorganize into samples[start:best.pos] + samples[best.pos:end] + * if best.split_type == CATEGORICAL: + * p = start # <<<<<<<<<<<<<< + * right_p = end + * while p < right_p: + */ + __pyx_v_p = __pyx_v_start; + + /* "sklearn/tree/_tree.pyx":1301 + * if best.split_type == CATEGORICAL: + * p = start + * right_p = end # <<<<<<<<<<<<<< + * while p < right_p: + * if is_left_var( + */ + __pyx_v_right_p = __pyx_v_end; + + /* "sklearn/tree/_tree.pyx":1302 + * p = start + * right_p = end + * while p < right_p: # <<<<<<<<<<<<<< + * if is_left_var( + * X[X_sample_stride * samples[p] + + */ + while (1) { + __pyx_t_8 = ((__pyx_v_p < __pyx_v_right_p) != 0); + if (!__pyx_t_8) break; + + /* "sklearn/tree/_tree.pyx":1303 + * right_p = end + * while p < right_p: + * if is_left_var( # <<<<<<<<<<<<<< + * X[X_sample_stride * samples[p] + + * X_fx_stride * best.feature], + */ + __pyx_t_8 = (__pyx_f_7sklearn_4tree_5_tree_is_left_var((__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.split_categories, __pyx_v_categories) != 0); + if (__pyx_t_8) { + + /* "sklearn/tree/_tree.pyx":1307 + * X_fx_stride * best.feature], + * best.split_categories, categories): + * p += 1 # <<<<<<<<<<<<<< + * else: + * while not is_left_var( + */ + __pyx_v_p = (__pyx_v_p + 1); + goto __pyx_L34; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":1309 + * p += 1 + * else: + * while not is_left_var( # <<<<<<<<<<<<<< + * X[X_sample_stride * samples[right_p] + + * X_fx_stride * best.feature], + */ + while (1) { + + /* "sklearn/tree/_tree.pyx":1312 + * X[X_sample_stride * samples[right_p] + + * X_fx_stride * best.feature], + * best.split_categories, categories) and p < right_p: # <<<<<<<<<<<<<< + * right_p -= 1 + * tmp = samples[right_p] + */ + __pyx_t_8 = ((!(__pyx_f_7sklearn_4tree_5_tree_is_left_var((__pyx_v_X[((__pyx_v_X_sample_stride * (__pyx_v_samples[__pyx_v_right_p])) + (__pyx_v_X_fx_stride * __pyx_v_best.feature))]), __pyx_v_best.split_categories, __pyx_v_categories) != 0)) != 0); + if (__pyx_t_8) { + __pyx_t_6 = ((__pyx_v_p < __pyx_v_right_p) != 0); + __pyx_t_5 = __pyx_t_6; + } else { + __pyx_t_5 = __pyx_t_8; + } + if (!__pyx_t_5) break; + + /* "sklearn/tree/_tree.pyx":1313 + * X_fx_stride * best.feature], + * best.split_categories, categories) and p < right_p: + * right_p -= 1 # <<<<<<<<<<<<<< + * tmp = samples[right_p] + * samples[right_p] = samples[p] + */ + __pyx_v_right_p = (__pyx_v_right_p - 1); + } + + /* "sklearn/tree/_tree.pyx":1314 + * best.split_categories, categories) and p < right_p: + * right_p -= 1 + * tmp = samples[right_p] # <<<<<<<<<<<<<< + * samples[right_p] = samples[p] + * samples[p] = tmp + */ + __pyx_v_tmp = (__pyx_v_samples[__pyx_v_right_p]); + + /* "sklearn/tree/_tree.pyx":1315 + * right_p -= 1 + * tmp = samples[right_p] + * samples[right_p] = samples[p] # <<<<<<<<<<<<<< + * samples[p] = tmp + * p += 1 + */ + (__pyx_v_samples[__pyx_v_right_p]) = (__pyx_v_samples[__pyx_v_p]); + + /* "sklearn/tree/_tree.pyx":1316 + * tmp = samples[right_p] + * samples[right_p] = samples[p] + * samples[p] = tmp # <<<<<<<<<<<<<< + * p += 1 + * */ (__pyx_v_samples[__pyx_v_p]) = __pyx_v_tmp; + + /* "sklearn/tree/_tree.pyx":1317 + * samples[right_p] = samples[p] + * samples[p] = tmp + * p += 1 # <<<<<<<<<<<<<< + * + * # Respect invariant for constant features: the original order of + */ + __pyx_v_p = (__pyx_v_p + 1); } - __pyx_L21:; + __pyx_L34:; } - goto __pyx_L18; + goto __pyx_L31; } - __pyx_L18:; + __pyx_L31:; - /* "sklearn/tree/_tree.pyx":1209 + /* "sklearn/tree/_tree.pyx":1322 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -10345,7 +10943,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":1212 + /* "sklearn/tree/_tree.pyx":1325 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -10354,7 +10952,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":1217 + /* "sklearn/tree/_tree.pyx":1330 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -10363,7 +10961,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":1218 + /* "sklearn/tree/_tree.pyx":1331 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -10372,7 +10970,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":1040 + /* "sklearn/tree/_tree.pyx":1056 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -10383,7 +10981,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1223 +/* "sklearn/tree/_tree.pyx":1336 * # 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: # <<<<<<<<<<<<<< @@ -10394,7 +10992,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":1224 + /* "sklearn/tree/_tree.pyx":1337 * # 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) # <<<<<<<<<<<<<< @@ -10403,7 +11001,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":1225 + /* "sklearn/tree/_tree.pyx":1338 * 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) # <<<<<<<<<<<<<< @@ -10412,7 +11010,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":1223 + /* "sklearn/tree/_tree.pyx":1336 * # 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: # <<<<<<<<<<<<<< @@ -10423,7 +11021,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1228 +/* "sklearn/tree/_tree.pyx":1341 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10437,7 +11035,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":1230 + /* "sklearn/tree/_tree.pyx":1343 * 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] # <<<<<<<<<<<<<< @@ -10449,7 +11047,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":1231 + /* "sklearn/tree/_tree.pyx":1344 * # Helper for sort * Xf[i], Xf[j] = Xf[j], Xf[i] * samples[i], samples[j] = samples[j], samples[i] # <<<<<<<<<<<<<< @@ -10461,7 +11059,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":1228 + /* "sklearn/tree/_tree.pyx":1341 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10472,7 +11070,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1234 +/* "sklearn/tree/_tree.pyx":1347 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10487,7 +11085,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":1237 + /* "sklearn/tree/_tree.pyx":1350 * # 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] # <<<<<<<<<<<<<< @@ -10498,7 +11096,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":1238 + /* "sklearn/tree/_tree.pyx":1351 * # 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: # <<<<<<<<<<<<<< @@ -10508,7 +11106,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":1239 + /* "sklearn/tree/_tree.pyx":1352 * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] * if a < b: * if b < c: # <<<<<<<<<<<<<< @@ -10518,7 +11116,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":1240 + /* "sklearn/tree/_tree.pyx":1353 * if a < b: * if b < c: * return b # <<<<<<<<<<<<<< @@ -10529,7 +11127,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1241 + /* "sklearn/tree/_tree.pyx":1354 * if b < c: * return b * elif a < c: # <<<<<<<<<<<<<< @@ -10539,7 +11137,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":1242 + /* "sklearn/tree/_tree.pyx":1355 * return b * elif a < c: * return c # <<<<<<<<<<<<<< @@ -10551,7 +11149,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1244 + /* "sklearn/tree/_tree.pyx":1357 * return c * else: * return a # <<<<<<<<<<<<<< @@ -10563,7 +11161,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } } - /* "sklearn/tree/_tree.pyx":1245 + /* "sklearn/tree/_tree.pyx":1358 * else: * return a * elif b < c: # <<<<<<<<<<<<<< @@ -10573,7 +11171,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":1246 + /* "sklearn/tree/_tree.pyx":1359 * return a * elif b < c: * if a < c: # <<<<<<<<<<<<<< @@ -10583,7 +11181,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":1247 + /* "sklearn/tree/_tree.pyx":1360 * elif b < c: * if a < c: * return a # <<<<<<<<<<<<<< @@ -10595,7 +11193,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1249 + /* "sklearn/tree/_tree.pyx":1362 * return a * else: * return c # <<<<<<<<<<<<<< @@ -10608,7 +11206,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1251 + /* "sklearn/tree/_tree.pyx":1364 * return c * else: * return b # <<<<<<<<<<<<<< @@ -10619,7 +11217,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1234 + /* "sklearn/tree/_tree.pyx":1347 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10632,7 +11230,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1256 +/* "sklearn/tree/_tree.pyx":1369 * # 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: # <<<<<<<<<<<<<< @@ -10647,7 +11245,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":1260 + /* "sklearn/tree/_tree.pyx":1373 * cdef SIZE_t i, l, r * * while n > 1: # <<<<<<<<<<<<<< @@ -10658,7 +11256,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":1261 + /* "sklearn/tree/_tree.pyx":1374 * * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") # <<<<<<<<<<<<<< @@ -10668,7 +11266,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":1262 + /* "sklearn/tree/_tree.pyx":1375 * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) # <<<<<<<<<<<<<< @@ -10677,7 +11275,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":1263 + /* "sklearn/tree/_tree.pyx":1376 * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) * return # <<<<<<<<<<<<<< @@ -10687,7 +11285,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1264 + /* "sklearn/tree/_tree.pyx":1377 * heapsort(Xf, samples, n) * return * maxd -= 1 # <<<<<<<<<<<<<< @@ -10696,7 +11294,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":1266 + /* "sklearn/tree/_tree.pyx":1379 * maxd -= 1 * * pivot = median3(Xf, n) # <<<<<<<<<<<<<< @@ -10705,7 +11303,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":1269 + /* "sklearn/tree/_tree.pyx":1382 * * # Three-way partition. * i = l = 0 # <<<<<<<<<<<<<< @@ -10715,7 +11313,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":1270 + /* "sklearn/tree/_tree.pyx":1383 * # Three-way partition. * i = l = 0 * r = n # <<<<<<<<<<<<<< @@ -10724,7 +11322,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":1271 + /* "sklearn/tree/_tree.pyx":1384 * i = l = 0 * r = n * while i < r: # <<<<<<<<<<<<<< @@ -10735,7 +11333,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":1272 + /* "sklearn/tree/_tree.pyx":1385 * r = n * while i < r: * if Xf[i] < pivot: # <<<<<<<<<<<<<< @@ -10745,7 +11343,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":1273 + /* "sklearn/tree/_tree.pyx":1386 * while i < r: * if Xf[i] < pivot: * swap(Xf, samples, i, l) # <<<<<<<<<<<<<< @@ -10754,7 +11352,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":1274 + /* "sklearn/tree/_tree.pyx":1387 * if Xf[i] < pivot: * swap(Xf, samples, i, l) * i += 1 # <<<<<<<<<<<<<< @@ -10763,7 +11361,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":1275 + /* "sklearn/tree/_tree.pyx":1388 * swap(Xf, samples, i, l) * i += 1 * l += 1 # <<<<<<<<<<<<<< @@ -10774,7 +11372,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L8; } - /* "sklearn/tree/_tree.pyx":1276 + /* "sklearn/tree/_tree.pyx":1389 * i += 1 * l += 1 * elif Xf[i] > pivot: # <<<<<<<<<<<<<< @@ -10784,7 +11382,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":1277 + /* "sklearn/tree/_tree.pyx":1390 * l += 1 * elif Xf[i] > pivot: * r -= 1 # <<<<<<<<<<<<<< @@ -10793,7 +11391,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":1278 + /* "sklearn/tree/_tree.pyx":1391 * elif Xf[i] > pivot: * r -= 1 * swap(Xf, samples, i, r) # <<<<<<<<<<<<<< @@ -10805,7 +11403,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1280 + /* "sklearn/tree/_tree.pyx":1393 * swap(Xf, samples, i, r) * else: * i += 1 # <<<<<<<<<<<<<< @@ -10817,7 +11415,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1282 + /* "sklearn/tree/_tree.pyx":1395 * i += 1 * * introsort(Xf, samples, l, maxd) # <<<<<<<<<<<<<< @@ -10826,7 +11424,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":1283 + /* "sklearn/tree/_tree.pyx":1396 * * introsort(Xf, samples, l, maxd) * Xf += r # <<<<<<<<<<<<<< @@ -10835,7 +11433,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":1284 + /* "sklearn/tree/_tree.pyx":1397 * introsort(Xf, samples, l, maxd) * Xf += r * samples += r # <<<<<<<<<<<<<< @@ -10844,7 +11442,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":1285 + /* "sklearn/tree/_tree.pyx":1398 * Xf += r * samples += r * n -= r # <<<<<<<<<<<<<< @@ -10854,7 +11452,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":1256 + /* "sklearn/tree/_tree.pyx":1369 * # 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: # <<<<<<<<<<<<<< @@ -10866,7 +11464,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L0:; } -/* "sklearn/tree/_tree.pyx":1288 +/* "sklearn/tree/_tree.pyx":1401 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -10882,7 +11480,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea int __pyx_t_2; int __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1293 + /* "sklearn/tree/_tree.pyx":1406 * cdef SIZE_t child, maxind, root * * root = start # <<<<<<<<<<<<<< @@ -10891,7 +11489,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":1294 + /* "sklearn/tree/_tree.pyx":1407 * * root = start * while True: # <<<<<<<<<<<<<< @@ -10900,7 +11498,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ while (1) { - /* "sklearn/tree/_tree.pyx":1295 + /* "sklearn/tree/_tree.pyx":1408 * root = start * while True: * child = root * 2 + 1 # <<<<<<<<<<<<<< @@ -10909,7 +11507,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":1298 + /* "sklearn/tree/_tree.pyx":1411 * * # find max of root, left child, right child * maxind = root # <<<<<<<<<<<<<< @@ -10918,7 +11516,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":1299 + /* "sklearn/tree/_tree.pyx":1412 * # find max of root, left child, right child * maxind = root * if child < end and Xf[maxind] < Xf[child]: # <<<<<<<<<<<<<< @@ -10934,7 +11532,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":1300 + /* "sklearn/tree/_tree.pyx":1413 * maxind = root * if child < end and Xf[maxind] < Xf[child]: * maxind = child # <<<<<<<<<<<<<< @@ -10946,7 +11544,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1301 + /* "sklearn/tree/_tree.pyx":1414 * if child < end and Xf[maxind] < Xf[child]: * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: # <<<<<<<<<<<<<< @@ -10962,7 +11560,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":1302 + /* "sklearn/tree/_tree.pyx":1415 * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: * maxind = child + 1 # <<<<<<<<<<<<<< @@ -10974,7 +11572,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":1304 + /* "sklearn/tree/_tree.pyx":1417 * maxind = child + 1 * * if maxind == root: # <<<<<<<<<<<<<< @@ -10984,7 +11582,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea __pyx_t_2 = ((__pyx_v_maxind == __pyx_v_root) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":1305 + /* "sklearn/tree/_tree.pyx":1418 * * if maxind == root: * break # <<<<<<<<<<<<<< @@ -10995,7 +11593,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":1307 + /* "sklearn/tree/_tree.pyx":1420 * break * else: * swap(Xf, samples, root, maxind) # <<<<<<<<<<<<<< @@ -11004,7 +11602,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":1308 + /* "sklearn/tree/_tree.pyx":1421 * else: * swap(Xf, samples, root, maxind) * root = maxind # <<<<<<<<<<<<<< @@ -11016,7 +11614,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1288 + /* "sklearn/tree/_tree.pyx":1401 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -11027,7 +11625,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1311 +/* "sklearn/tree/_tree.pyx":1424 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11040,7 +11638,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":1315 + /* "sklearn/tree/_tree.pyx":1428 * * # heapify * start = (n - 2) / 2 # <<<<<<<<<<<<<< @@ -11049,7 +11647,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":1316 + /* "sklearn/tree/_tree.pyx":1429 * # heapify * start = (n - 2) / 2 * end = n # <<<<<<<<<<<<<< @@ -11058,7 +11656,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":1317 + /* "sklearn/tree/_tree.pyx":1430 * start = (n - 2) / 2 * end = n * while True: # <<<<<<<<<<<<<< @@ -11067,7 +11665,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ while (1) { - /* "sklearn/tree/_tree.pyx":1318 + /* "sklearn/tree/_tree.pyx":1431 * end = n * while True: * sift_down(Xf, samples, start, end) # <<<<<<<<<<<<<< @@ -11076,7 +11674,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":1319 + /* "sklearn/tree/_tree.pyx":1432 * while True: * sift_down(Xf, samples, start, end) * if start == 0: # <<<<<<<<<<<<<< @@ -11086,7 +11684,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":1320 + /* "sklearn/tree/_tree.pyx":1433 * sift_down(Xf, samples, start, end) * if start == 0: * break # <<<<<<<<<<<<<< @@ -11096,7 +11694,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":1321 + /* "sklearn/tree/_tree.pyx":1434 * if start == 0: * break * start -= 1 # <<<<<<<<<<<<<< @@ -11107,7 +11705,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1324 + /* "sklearn/tree/_tree.pyx":1437 * * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 # <<<<<<<<<<<<<< @@ -11116,7 +11714,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":1325 + /* "sklearn/tree/_tree.pyx":1438 * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 * while end > 0: # <<<<<<<<<<<<<< @@ -11127,7 +11725,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":1326 + /* "sklearn/tree/_tree.pyx":1439 * end = n - 1 * while end > 0: * swap(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11136,7 +11734,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":1327 + /* "sklearn/tree/_tree.pyx":1440 * while end > 0: * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11145,7 +11743,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":1328 + /* "sklearn/tree/_tree.pyx":1441 * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) * end = end - 1 # <<<<<<<<<<<<<< @@ -11155,7 +11753,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":1311 + /* "sklearn/tree/_tree.pyx":1424 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11166,7 +11764,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1333 +/* "sklearn/tree/_tree.pyx":1446 * cdef class RandomSplitter(Splitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11199,7 +11797,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1334 + /* "sklearn/tree/_tree.pyx":1447 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -11208,44 +11806,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1335 + /* "sklearn/tree/_tree.pyx":1448 * 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.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1336 + /* "sklearn/tree/_tree.pyx":1449 * 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.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1337 + /* "sklearn/tree/_tree.pyx":1450 * 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.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1334 + /* "sklearn/tree/_tree.pyx":1447 * """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 = 1334; __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 = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.criterion)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.criterion)); @@ -11263,27 +11861,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1338 + /* "sklearn/tree/_tree.pyx":1451 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SplitRecord* split, */ - __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 = 1338; __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 = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1334 + /* "sklearn/tree/_tree.pyx":1447 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __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 = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter))); @@ -11298,7 +11896,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1333 + /* "sklearn/tree/_tree.pyx":1446 * cdef class RandomSplitter(Splitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11320,7 +11918,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1340 +/* "sklearn/tree/_tree.pyx":1453 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -11369,7 +11967,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p int __pyx_t_8; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1344 + /* "sklearn/tree/_tree.pyx":1457 * """Find the best random split on node samples[start:end].""" * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -11379,7 +11977,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1345 + /* "sklearn/tree/_tree.pyx":1458 * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -11389,7 +11987,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1346 + /* "sklearn/tree/_tree.pyx":1459 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -11399,7 +11997,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1348 + /* "sklearn/tree/_tree.pyx":1461 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -11409,7 +12007,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1349 + /* "sklearn/tree/_tree.pyx":1462 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -11419,7 +12017,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_1 = __pyx_v_self->__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1350 + /* "sklearn/tree/_tree.pyx":1463 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -11429,7 +12027,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1352 + /* "sklearn/tree/_tree.pyx":1465 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -11439,7 +12037,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":1353 + /* "sklearn/tree/_tree.pyx":1466 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -11449,7 +12047,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_3 = __pyx_v_self->__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1354 + /* "sklearn/tree/_tree.pyx":1467 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -11459,7 +12057,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":1355 + /* "sklearn/tree/_tree.pyx":1468 * 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 # <<<<<<<<<<<<<< @@ -11469,7 +12067,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":1356 + /* "sklearn/tree/_tree.pyx":1469 * 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 # <<<<<<<<<<<<<< @@ -11479,7 +12077,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1357 + /* "sklearn/tree/_tree.pyx":1470 * 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 # <<<<<<<<<<<<<< @@ -11489,7 +12087,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_2 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1358 + /* "sklearn/tree/_tree.pyx":1471 * 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 # <<<<<<<<<<<<<< @@ -11499,7 +12097,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_4 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1359 + /* "sklearn/tree/_tree.pyx":1472 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef double weighted_n_samples = self.weighted_n_samples # <<<<<<<<<<<<<< @@ -11509,7 +12107,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_4 = __pyx_v_self->__pyx_base.weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1360 + /* "sklearn/tree/_tree.pyx":1473 * cdef double min_weight_leaf = self.min_weight_leaf * cdef double weighted_n_samples = self.weighted_n_samples * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -11518,7 +12116,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":1364 + /* "sklearn/tree/_tree.pyx":1477 * cdef SplitRecord best, current * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -11527,7 +12125,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":1367 + /* "sklearn/tree/_tree.pyx":1480 * 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 # <<<<<<<<<<<<<< @@ -11536,7 +12134,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1369 + /* "sklearn/tree/_tree.pyx":1482 * 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 # <<<<<<<<<<<<<< @@ -11545,7 +12143,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1370 + /* "sklearn/tree/_tree.pyx":1483 * # 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] # <<<<<<<<<<<<<< @@ -11554,7 +12152,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":1372 + /* "sklearn/tree/_tree.pyx":1485 * 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 # <<<<<<<<<<<<<< @@ -11563,7 +12161,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":1373 + /* "sklearn/tree/_tree.pyx":1486 * # 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 # <<<<<<<<<<<<<< @@ -11572,7 +12170,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1379 + /* "sklearn/tree/_tree.pyx":1492 * cdef SIZE_t partition_end * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -11581,7 +12179,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":1390 + /* "sklearn/tree/_tree.pyx":1503 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -11592,7 +12190,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1392 + /* "sklearn/tree/_tree.pyx":1505 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -11602,7 +12200,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); if (!__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1394 + /* "sklearn/tree/_tree.pyx":1507 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -11620,7 +12218,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":1395 + /* "sklearn/tree/_tree.pyx":1508 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -11629,7 +12227,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":1410 + /* "sklearn/tree/_tree.pyx":1523 * # Draw a feature at random * f_j = rand_int(f_i - n_drawn_constants - n_found_constants, * random_state) + n_drawn_constants # <<<<<<<<<<<<<< @@ -11638,7 +12236,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_f_i - __pyx_v_n_drawn_constants) - __pyx_v_n_found_constants), __pyx_v_random_state) + __pyx_v_n_drawn_constants); - /* "sklearn/tree/_tree.pyx":1412 + /* "sklearn/tree/_tree.pyx":1525 * random_state) + n_drawn_constants * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -11648,7 +12246,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1414 + /* "sklearn/tree/_tree.pyx":1527 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -11657,7 +12255,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":1415 + /* "sklearn/tree/_tree.pyx":1528 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -11666,7 +12264,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":1416 + /* "sklearn/tree/_tree.pyx":1529 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -11675,7 +12273,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":1418 + /* "sklearn/tree/_tree.pyx":1531 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -11687,7 +12285,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1422 + /* "sklearn/tree/_tree.pyx":1535 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -11696,7 +12294,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":1425 + /* "sklearn/tree/_tree.pyx":1538 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -11705,7 +12303,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":1428 + /* "sklearn/tree/_tree.pyx":1541 * * # Find min, max * min_feature_value = X[X_sample_stride * samples[start] + # <<<<<<<<<<<<<< @@ -11714,7 +12312,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":1430 + /* "sklearn/tree/_tree.pyx":1543 * min_feature_value = X[X_sample_stride * samples[start] + * X_fx_stride * current.feature] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -11723,7 +12321,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":1431 + /* "sklearn/tree/_tree.pyx":1544 * X_fx_stride * current.feature] * max_feature_value = min_feature_value * Xf[start] = min_feature_value # <<<<<<<<<<<<<< @@ -11732,7 +12330,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":1433 + /* "sklearn/tree/_tree.pyx":1546 * Xf[start] = min_feature_value * * for p in range(start + 1, end): # <<<<<<<<<<<<<< @@ -11743,7 +12341,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p for (__pyx_t_9 = (__pyx_v_start + 1); __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) { __pyx_v_p = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1434 + /* "sklearn/tree/_tree.pyx":1547 * * for p in range(start + 1, end): * current_feature_value = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -11752,7 +12350,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":1436 + /* "sklearn/tree/_tree.pyx":1549 * current_feature_value = X[X_sample_stride * samples[p] + * X_fx_stride * current.feature] * Xf[p] = current_feature_value # <<<<<<<<<<<<<< @@ -11761,7 +12359,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":1438 + /* "sklearn/tree/_tree.pyx":1551 * Xf[p] = current_feature_value * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -11771,7 +12369,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1439 + /* "sklearn/tree/_tree.pyx":1552 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -11782,7 +12380,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L8; } - /* "sklearn/tree/_tree.pyx":1440 + /* "sklearn/tree/_tree.pyx":1553 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -11792,7 +12390,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1441 + /* "sklearn/tree/_tree.pyx":1554 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -11805,7 +12403,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1443 + /* "sklearn/tree/_tree.pyx":1556 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -11815,7 +12413,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __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":1444 + /* "sklearn/tree/_tree.pyx":1557 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -11824,7 +12422,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":1445 + /* "sklearn/tree/_tree.pyx":1558 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -11834,7 +12432,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":1447 + /* "sklearn/tree/_tree.pyx":1560 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -11843,7 +12441,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":1448 + /* "sklearn/tree/_tree.pyx":1561 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -11855,7 +12453,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1451 + /* "sklearn/tree/_tree.pyx":1564 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -11864,7 +12462,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":1452 + /* "sklearn/tree/_tree.pyx":1565 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -11876,7 +12474,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_9; - /* "sklearn/tree/_tree.pyx":1455 + /* "sklearn/tree/_tree.pyx":1568 * * # Draw a random threshold * current.threshold = (min_feature_value + # <<<<<<<<<<<<<< @@ -11885,7 +12483,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current.threshold = (__pyx_v_min_feature_value + (__pyx_f_7sklearn_4tree_5_tree_rand_double(__pyx_v_random_state) * (__pyx_v_max_feature_value - __pyx_v_min_feature_value))); - /* "sklearn/tree/_tree.pyx":1460 + /* "sklearn/tree/_tree.pyx":1573 * min_feature_value)) * * if current.threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -11895,7 +12493,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_current.threshold == __pyx_v_max_feature_value) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1461 + /* "sklearn/tree/_tree.pyx":1574 * * if current.threshold == max_feature_value: * current.threshold = min_feature_value # <<<<<<<<<<<<<< @@ -11907,7 +12505,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L10:; - /* "sklearn/tree/_tree.pyx":1464 + /* "sklearn/tree/_tree.pyx":1577 * * # Partition * partition_end = end # <<<<<<<<<<<<<< @@ -11916,7 +12514,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":1465 + /* "sklearn/tree/_tree.pyx":1578 * # Partition * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -11925,7 +12523,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1466 + /* "sklearn/tree/_tree.pyx":1579 * partition_end = end * p = start * while p < partition_end: # <<<<<<<<<<<<<< @@ -11936,7 +12534,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":1467 + /* "sklearn/tree/_tree.pyx":1580 * p = start * while p < partition_end: * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -11945,7 +12543,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":1468 + /* "sklearn/tree/_tree.pyx":1581 * while p < partition_end: * current_feature_value = Xf[p] * if current_feature_value <= current.threshold: # <<<<<<<<<<<<<< @@ -11955,7 +12553,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_current_feature_value <= __pyx_v_current.threshold) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1469 + /* "sklearn/tree/_tree.pyx":1582 * current_feature_value = Xf[p] * if current_feature_value <= current.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -11967,7 +12565,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1471 + /* "sklearn/tree/_tree.pyx":1584 * p += 1 * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -11976,7 +12574,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":1473 + /* "sklearn/tree/_tree.pyx":1586 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -11985,7 +12583,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":1474 + /* "sklearn/tree/_tree.pyx":1587 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = current_feature_value # <<<<<<<<<<<<<< @@ -11994,7 +12592,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":1476 + /* "sklearn/tree/_tree.pyx":1589 * Xf[partition_end] = current_feature_value * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -12003,7 +12601,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":1477 + /* "sklearn/tree/_tree.pyx":1590 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -12012,7 +12610,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":1478 + /* "sklearn/tree/_tree.pyx":1591 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -12024,7 +12622,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":1480 + /* "sklearn/tree/_tree.pyx":1593 * samples[p] = tmp * * current.pos = partition_end # <<<<<<<<<<<<<< @@ -12033,7 +12631,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":1483 + /* "sklearn/tree/_tree.pyx":1596 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -12043,7 +12641,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = (((__pyx_v_current.pos - __pyx_v_start) < __pyx_v_min_samples_leaf) != 0); if (!__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1484 + /* "sklearn/tree/_tree.pyx":1597 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -12057,7 +12655,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1485 + /* "sklearn/tree/_tree.pyx":1598 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -12067,7 +12665,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1488 + /* "sklearn/tree/_tree.pyx":1601 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -12076,7 +12674,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.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1489 + /* "sklearn/tree/_tree.pyx":1602 * # Evaluate split * self.criterion.reset() * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -12085,7 +12683,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.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":1492 + /* "sklearn/tree/_tree.pyx":1605 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -12095,7 +12693,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_8 = ((__pyx_v_self->__pyx_base.criterion->weighted_n_left < __pyx_v_min_weight_leaf) != 0); if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1493 + /* "sklearn/tree/_tree.pyx":1606 * # 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)): # <<<<<<<<<<<<<< @@ -12109,7 +12707,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1494 + /* "sklearn/tree/_tree.pyx":1607 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -12119,7 +12717,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1496 + /* "sklearn/tree/_tree.pyx":1609 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -12128,7 +12726,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":1498 + /* "sklearn/tree/_tree.pyx":1611 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -12138,7 +12736,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1499 + /* "sklearn/tree/_tree.pyx":1612 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -12147,7 +12745,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.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":1501 + /* "sklearn/tree/_tree.pyx":1614 * self.criterion.children_impurity(¤t.impurity_left, * ¤t.impurity_right) * best = current # copy # <<<<<<<<<<<<<< @@ -12165,7 +12763,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":1504 + /* "sklearn/tree/_tree.pyx":1617 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: # <<<<<<<<<<<<<< @@ -12181,7 +12779,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1505 + /* "sklearn/tree/_tree.pyx":1618 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end and current.feature != best.feature: * partition_end = end # <<<<<<<<<<<<<< @@ -12190,7 +12788,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":1506 + /* "sklearn/tree/_tree.pyx":1619 * if best.pos < end and current.feature != best.feature: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -12199,7 +12797,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1508 + /* "sklearn/tree/_tree.pyx":1621 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -12210,7 +12808,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":1510 + /* "sklearn/tree/_tree.pyx":1623 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -12220,7 +12818,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_6 = (((__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_6) { - /* "sklearn/tree/_tree.pyx":1511 + /* "sklearn/tree/_tree.pyx":1624 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -12232,7 +12830,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1514 + /* "sklearn/tree/_tree.pyx":1627 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -12241,7 +12839,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":1516 + /* "sklearn/tree/_tree.pyx":1629 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -12250,7 +12848,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":1517 + /* "sklearn/tree/_tree.pyx":1630 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -12259,7 +12857,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":1518 + /* "sklearn/tree/_tree.pyx":1631 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -12274,7 +12872,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L17:; - /* "sklearn/tree/_tree.pyx":1523 + /* "sklearn/tree/_tree.pyx":1636 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -12283,7 +12881,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":1526 + /* "sklearn/tree/_tree.pyx":1639 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -12292,7 +12890,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":1531 + /* "sklearn/tree/_tree.pyx":1644 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -12301,7 +12899,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":1532 + /* "sklearn/tree/_tree.pyx":1645 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -12310,7 +12908,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":1340 + /* "sklearn/tree/_tree.pyx":1453 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -12321,7 +12919,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1545 +/* "sklearn/tree/_tree.pyx":1658 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12366,26 +12964,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 = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __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 = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __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 = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __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 = 1545; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __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 = 1545; __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 = 1658; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -12397,20 +12995,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 = 1545; __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 = 1546; __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 = 1547; __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 = 1658; __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 = 1659; __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 = 1660; __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 = 1545; __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 = 1658; __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 = 1545; __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 = 1658; __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 */ @@ -12427,7 +13025,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1550 + /* "sklearn/tree/_tree.pyx":1663 * object random_state): * # Initialize pointers * self.X_old = NULL # <<<<<<<<<<<<<< @@ -12436,7 +13034,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_old = NULL; - /* "sklearn/tree/_tree.pyx":1551 + /* "sklearn/tree/_tree.pyx":1664 * # Initialize pointers * self.X_old = NULL * self.X_argsorted_ptr = NULL # <<<<<<<<<<<<<< @@ -12445,7 +13043,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1552 + /* "sklearn/tree/_tree.pyx":1665 * self.X_old = NULL * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 # <<<<<<<<<<<<<< @@ -12454,7 +13052,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_stride = 0; - /* "sklearn/tree/_tree.pyx":1553 + /* "sklearn/tree/_tree.pyx":1666 * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 * self.sample_mask = NULL # <<<<<<<<<<<<<< @@ -12463,7 +13061,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1545 + /* "sklearn/tree/_tree.pyx":1658 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12477,7 +13075,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1555 +/* "sklearn/tree/_tree.pyx":1668 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12500,7 +13098,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":1557 + /* "sklearn/tree/_tree.pyx":1670 * def __dealloc__(self): * """Destructor.""" * free(self.sample_mask) # <<<<<<<<<<<<<< @@ -12509,7 +13107,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st */ free(__pyx_v_self->sample_mask); - /* "sklearn/tree/_tree.pyx":1555 + /* "sklearn/tree/_tree.pyx":1668 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12521,7 +13119,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1559 +/* "sklearn/tree/_tree.pyx":1672 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -12554,7 +13152,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1560 + /* "sklearn/tree/_tree.pyx":1673 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -12563,44 +13161,44 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1561 + /* "sklearn/tree/_tree.pyx":1674 * 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.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.max_features); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1562 + /* "sklearn/tree/_tree.pyx":1675 * 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.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->__pyx_base.min_samples_leaf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1563 + /* "sklearn/tree/_tree.pyx":1676 * 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.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.min_weight_leaf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1560 + /* "sklearn/tree/_tree.pyx":1673 * * 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 = 1560; __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 = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.criterion)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->__pyx_base.criterion)); @@ -12618,27 +13216,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1564 + /* "sklearn/tree/_tree.pyx":1677 * self.min_samples_leaf, * self.min_weight_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void init(self, */ - __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 = 1564; __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 = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":1560 + /* "sklearn/tree/_tree.pyx":1673 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __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 = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter))); @@ -12653,7 +13251,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1559 + /* "sklearn/tree/_tree.pyx":1672 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -12675,7 +13273,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1566 +/* "sklearn/tree/_tree.pyx":1679 * self.random_state), self.__getstate__()) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -12713,16 +13311,16 @@ 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_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; { __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 = 1566; __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 = 1679; __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":1570 + /* "sklearn/tree/_tree.pyx":1683 * np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, * DOUBLE_t* sample_weight): * cdef void* sample_mask = NULL # <<<<<<<<<<<<<< @@ -12731,7 +13329,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1573 + /* "sklearn/tree/_tree.pyx":1686 * * # Call parent initializer * Splitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< @@ -12740,7 +13338,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter->init(((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)__pyx_v_self), ((PyArrayObject *)__pyx_v_X), ((PyArrayObject *)__pyx_v_y), __pyx_v_sample_weight); - /* "sklearn/tree/_tree.pyx":1576 + /* "sklearn/tree/_tree.pyx":1689 * * # Pre-sort X * if self.X_old != self.X: # <<<<<<<<<<<<<< @@ -12750,7 +13348,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __pyx_t_1 = ((__pyx_v_self->X_old != __pyx_v_self->__pyx_base.X) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1577 + /* "sklearn/tree/_tree.pyx":1690 * # Pre-sort X * if self.X_old != self.X: * self.X_old = self.X # <<<<<<<<<<<<<< @@ -12760,79 +13358,79 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __pyx_t_2 = __pyx_v_self->__pyx_base.X; __pyx_v_self->X_old = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1578 + /* "sklearn/tree/_tree.pyx":1691 * if self.X_old != self.X: * self.X_old = self.X * self.X_argsorted = np.asfortranarray(np.argsort(X, axis=0), # <<<<<<<<<<<<<< * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __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 = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __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 = 1578; __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 = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_argsort); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __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 = 1578; __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 = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_X)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_X)); __Pyx_GIVEREF(((PyObject *)__pyx_v_X)); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __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 = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __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 = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __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_3); __pyx_t_3 = 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 = 1578; __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 = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "sklearn/tree/_tree.pyx":1579 + /* "sklearn/tree/_tree.pyx":1692 * self.X_old = self.X * self.X_argsorted = np.asfortranarray(np.argsort(X, axis=0), * dtype=np.int32) # <<<<<<<<<<<<<< * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __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 = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1578 + /* "sklearn/tree/_tree.pyx":1691 * if self.X_old != self.X: * self.X_old = self.X * self.X_argsorted = np.asfortranarray(np.argsort(X, 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 = 1578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; __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 = 1578; __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 = 1691; __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":1580 + /* "sklearn/tree/_tree.pyx":1693 * self.X_argsorted = np.asfortranarray(np.argsort(X, axis=0), * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data # <<<<<<<<<<<<<< @@ -12841,19 +13439,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":1582 + /* "sklearn/tree/_tree.pyx":1695 * 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 = 1582; __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 = 1695; __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 = 1582; __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 = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1581 + /* "sklearn/tree/_tree.pyx":1694 * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / # <<<<<<<<<<<<<< @@ -12862,7 +13460,7 @@ 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":1584 + /* "sklearn/tree/_tree.pyx":1697 * self.X_argsorted.itemsize) * * self.n_total_samples = X.shape[0] # <<<<<<<<<<<<<< @@ -12871,17 +13469,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_self->n_total_samples = (__pyx_v_X->dimensions[0]); - /* "sklearn/tree/_tree.pyx":1585 + /* "sklearn/tree/_tree.pyx":1698 * * 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 = 1585; __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 = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sample_mask = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1586 + /* "sklearn/tree/_tree.pyx":1699 * 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) # <<<<<<<<<<<<<< @@ -12893,7 +13491,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1566 + /* "sklearn/tree/_tree.pyx":1679 * self.random_state), self.__getstate__()) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -12923,7 +13521,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1588 +/* "sklearn/tree/_tree.pyx":1701 * memset(sample_mask, 0, self.n_total_samples) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -12977,7 +13575,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc int __pyx_t_10; int __pyx_t_11; - /* "sklearn/tree/_tree.pyx":1592 + /* "sklearn/tree/_tree.pyx":1705 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -12987,7 +13585,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_1 = __pyx_v_self->__pyx_base.samples; __pyx_v_samples = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1593 + /* "sklearn/tree/_tree.pyx":1706 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -12997,7 +13595,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.start; __pyx_v_start = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1594 + /* "sklearn/tree/_tree.pyx":1707 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -13007,7 +13605,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.end; __pyx_v_end = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1596 + /* "sklearn/tree/_tree.pyx":1709 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -13017,7 +13615,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_1 = __pyx_v_self->__pyx_base.features; __pyx_v_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1597 + /* "sklearn/tree/_tree.pyx":1710 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -13027,7 +13625,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_1 = __pyx_v_self->__pyx_base.constant_features; __pyx_v_constant_features = __pyx_t_1; - /* "sklearn/tree/_tree.pyx":1598 + /* "sklearn/tree/_tree.pyx":1711 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -13037,7 +13635,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.n_features; __pyx_v_n_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1600 + /* "sklearn/tree/_tree.pyx":1713 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -13047,7 +13645,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":1601 + /* "sklearn/tree/_tree.pyx":1714 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -13057,7 +13655,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_3 = __pyx_v_self->__pyx_base.feature_values; __pyx_v_Xf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":1602 + /* "sklearn/tree/_tree.pyx":1715 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -13067,7 +13665,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":1603 + /* "sklearn/tree/_tree.pyx":1716 * 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 # <<<<<<<<<<<<<< @@ -13077,7 +13675,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":1604 + /* "sklearn/tree/_tree.pyx":1717 * 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 # <<<<<<<<<<<<<< @@ -13087,7 +13685,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":1605 + /* "sklearn/tree/_tree.pyx":1718 * 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 # <<<<<<<<<<<<<< @@ -13097,7 +13695,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":1606 + /* "sklearn/tree/_tree.pyx":1719 * 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 # <<<<<<<<<<<<<< @@ -13107,7 +13705,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":1607 + /* "sklearn/tree/_tree.pyx":1720 * 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 # <<<<<<<<<<<<<< @@ -13117,7 +13715,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":1609 + /* "sklearn/tree/_tree.pyx":1722 * cdef unsigned char* sample_mask = self.sample_mask * * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -13127,7 +13725,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.max_features; __pyx_v_max_features = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1610 + /* "sklearn/tree/_tree.pyx":1723 * * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -13137,7 +13735,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_2 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1611 + /* "sklearn/tree/_tree.pyx":1724 * 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 # <<<<<<<<<<<<<< @@ -13147,7 +13745,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_6 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1612 + /* "sklearn/tree/_tree.pyx":1725 * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef double min_weight_leaf = self.min_weight_leaf * cdef double weighted_n_samples = self.weighted_n_samples # <<<<<<<<<<<<<< @@ -13157,7 +13755,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_6 = __pyx_v_self->__pyx_base.weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1613 + /* "sklearn/tree/_tree.pyx":1726 * cdef double min_weight_leaf = self.min_weight_leaf * cdef double weighted_n_samples = self.weighted_n_samples * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -13166,7 +13764,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_random_state = (&__pyx_v_self->__pyx_base.rand_r_state); - /* "sklearn/tree/_tree.pyx":1617 + /* "sklearn/tree/_tree.pyx":1730 * cdef SplitRecord best, current * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -13175,7 +13773,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":1620 + /* "sklearn/tree/_tree.pyx":1733 * cdef SIZE_t f_j, p * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -13184,7 +13782,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1622 + /* "sklearn/tree/_tree.pyx":1735 * 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 # <<<<<<<<<<<<<< @@ -13193,7 +13791,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1623 + /* "sklearn/tree/_tree.pyx":1736 * # 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] # <<<<<<<<<<<<<< @@ -13202,7 +13800,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":1625 + /* "sklearn/tree/_tree.pyx":1738 * 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 # <<<<<<<<<<<<<< @@ -13211,7 +13809,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":1626 + /* "sklearn/tree/_tree.pyx":1739 * # 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 # <<<<<<<<<<<<<< @@ -13220,7 +13818,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1630 + /* "sklearn/tree/_tree.pyx":1743 * cdef SIZE_t i, j * * _init_split(&best, end) # <<<<<<<<<<<<<< @@ -13229,7 +13827,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":1633 + /* "sklearn/tree/_tree.pyx":1746 * * # Set sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -13240,7 +13838,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":1634 + /* "sklearn/tree/_tree.pyx":1747 * # Set sample mask * for p in range(start, end): * sample_mask[samples[p]] = 1 # <<<<<<<<<<<<<< @@ -13250,7 +13848,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":1645 + /* "sklearn/tree/_tree.pyx":1758 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -13261,7 +13859,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1647 + /* "sklearn/tree/_tree.pyx":1760 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -13271,7 +13869,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); if (!__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1649 + /* "sklearn/tree/_tree.pyx":1762 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -13289,7 +13887,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":1650 + /* "sklearn/tree/_tree.pyx":1763 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -13298,7 +13896,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":1665 + /* "sklearn/tree/_tree.pyx":1778 * # Draw a feature at random * f_j = rand_int(f_i - n_drawn_constants - n_found_constants, * random_state) + n_drawn_constants # <<<<<<<<<<<<<< @@ -13307,7 +13905,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_f_i - __pyx_v_n_drawn_constants) - __pyx_v_n_found_constants), __pyx_v_random_state) + __pyx_v_n_drawn_constants); - /* "sklearn/tree/_tree.pyx":1667 + /* "sklearn/tree/_tree.pyx":1780 * random_state) + n_drawn_constants * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -13317,7 +13915,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1669 + /* "sklearn/tree/_tree.pyx":1782 * if f_j < n_known_constants: * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -13326,7 +13924,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":1670 + /* "sklearn/tree/_tree.pyx":1783 * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -13335,7 +13933,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":1671 + /* "sklearn/tree/_tree.pyx":1784 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -13344,7 +13942,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":1673 + /* "sklearn/tree/_tree.pyx":1786 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -13356,7 +13954,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1677 + /* "sklearn/tree/_tree.pyx":1790 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -13365,7 +13963,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":1680 + /* "sklearn/tree/_tree.pyx":1793 * # f_j in the interval [n_total_constants, f_i[ * * current.feature = features[f_j] # <<<<<<<<<<<<<< @@ -13374,7 +13972,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":1683 + /* "sklearn/tree/_tree.pyx":1796 * * # Extract ordering from X_argsorted * p = start # <<<<<<<<<<<<<< @@ -13383,7 +13981,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1685 + /* "sklearn/tree/_tree.pyx":1798 * p = start * * for i in range(n_total_samples): # <<<<<<<<<<<<<< @@ -13394,7 +13992,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":1686 + /* "sklearn/tree/_tree.pyx":1799 * * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current.feature + i] # <<<<<<<<<<<<<< @@ -13403,7 +14001,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":1687 + /* "sklearn/tree/_tree.pyx":1800 * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current.feature + i] * if sample_mask[j] == 1: # <<<<<<<<<<<<<< @@ -13413,7 +14011,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = (((__pyx_v_sample_mask[__pyx_v_j]) == 1) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1688 + /* "sklearn/tree/_tree.pyx":1801 * j = X_argsorted[X_argsorted_stride * current.feature + i] * if sample_mask[j] == 1: * samples[p] = j # <<<<<<<<<<<<<< @@ -13422,7 +14020,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":1689 + /* "sklearn/tree/_tree.pyx":1802 * if sample_mask[j] == 1: * samples[p] = j * Xf[p] = X[X_sample_stride * j + # <<<<<<<<<<<<<< @@ -13431,7 +14029,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":1691 + /* "sklearn/tree/_tree.pyx":1804 * Xf[p] = X[X_sample_stride * j + * X_fx_stride * current.feature] * p += 1 # <<<<<<<<<<<<<< @@ -13444,7 +14042,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":1694 + /* "sklearn/tree/_tree.pyx":1807 * * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -13454,7 +14052,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = (((__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_9) { - /* "sklearn/tree/_tree.pyx":1695 + /* "sklearn/tree/_tree.pyx":1808 * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -13463,7 +14061,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":1696 + /* "sklearn/tree/_tree.pyx":1809 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current.feature # <<<<<<<<<<<<<< @@ -13473,7 +14071,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":1698 + /* "sklearn/tree/_tree.pyx":1811 * features[n_total_constants] = current.feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -13482,7 +14080,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":1699 + /* "sklearn/tree/_tree.pyx":1812 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -13494,7 +14092,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1702 + /* "sklearn/tree/_tree.pyx":1815 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -13503,7 +14101,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":1703 + /* "sklearn/tree/_tree.pyx":1816 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -13515,7 +14113,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":1705 + /* "sklearn/tree/_tree.pyx":1818 * features[f_i], features[f_j] = features[f_j], features[f_i] * * self.criterion.reset() # <<<<<<<<<<<<<< @@ -13524,7 +14122,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.criterion->__pyx_vtab)->reset(__pyx_v_self->__pyx_base.criterion); - /* "sklearn/tree/_tree.pyx":1706 + /* "sklearn/tree/_tree.pyx":1819 * * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -13533,7 +14131,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1708 + /* "sklearn/tree/_tree.pyx":1821 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -13544,7 +14142,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":1709 + /* "sklearn/tree/_tree.pyx":1822 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -13555,7 +14153,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = (((__pyx_v_p + 1) < __pyx_v_end) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1710 + /* "sklearn/tree/_tree.pyx":1823 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -13569,7 +14167,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (!__pyx_t_11) break; - /* "sklearn/tree/_tree.pyx":1711 + /* "sklearn/tree/_tree.pyx":1824 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -13579,7 +14177,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":1715 + /* "sklearn/tree/_tree.pyx":1828 * # (p + 1 >= end) or (X[samples[p + 1], current.feature] > * # X[samples[p], current.feature]) * p += 1 # <<<<<<<<<<<<<< @@ -13588,7 +14186,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":1719 + /* "sklearn/tree/_tree.pyx":1832 * # X[samples[p - 1], current.feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -13598,7 +14196,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_11 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_11) { - /* "sklearn/tree/_tree.pyx":1720 + /* "sklearn/tree/_tree.pyx":1833 * * if p < end: * current.pos = p # <<<<<<<<<<<<<< @@ -13607,7 +14205,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current.pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":1723 + /* "sklearn/tree/_tree.pyx":1836 * * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -13617,7 +14215,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_11 = (((__pyx_v_current.pos - __pyx_v_start) < __pyx_v_min_samples_leaf) != 0); if (!__pyx_t_11) { - /* "sklearn/tree/_tree.pyx":1724 + /* "sklearn/tree/_tree.pyx":1837 * # Reject if min_samples_leaf is not guaranteed * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -13631,7 +14229,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1725 + /* "sklearn/tree/_tree.pyx":1838 * if (((current.pos - start) < min_samples_leaf) or * ((end - current.pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -13641,7 +14239,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1727 + /* "sklearn/tree/_tree.pyx":1840 * continue * * self.criterion.update(current.pos) # <<<<<<<<<<<<<< @@ -13650,7 +14248,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.criterion->__pyx_vtab)->update(__pyx_v_self->__pyx_base.criterion, __pyx_v_current.pos); - /* "sklearn/tree/_tree.pyx":1730 + /* "sklearn/tree/_tree.pyx":1843 * * # Reject if min_weight_leaf is not satisfied * if ((self.criterion.weighted_n_left < min_weight_leaf) or # <<<<<<<<<<<<<< @@ -13660,7 +14258,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_self->__pyx_base.criterion->weighted_n_left < __pyx_v_min_weight_leaf) != 0); if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1731 + /* "sklearn/tree/_tree.pyx":1844 * # 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)): # <<<<<<<<<<<<<< @@ -13674,7 +14272,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1732 + /* "sklearn/tree/_tree.pyx":1845 * if ((self.criterion.weighted_n_left < min_weight_leaf) or * (self.criterion.weighted_n_right < min_weight_leaf)): * continue # <<<<<<<<<<<<<< @@ -13684,7 +14282,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1734 + /* "sklearn/tree/_tree.pyx":1847 * continue * * current.improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -13693,7 +14291,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current.improvement = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *)__pyx_v_self->__pyx_base.criterion->__pyx_vtab)->impurity_improvement(__pyx_v_self->__pyx_base.criterion, __pyx_v_impurity); - /* "sklearn/tree/_tree.pyx":1736 + /* "sklearn/tree/_tree.pyx":1849 * current.improvement = self.criterion.impurity_improvement(impurity) * * if current.improvement > best.improvement: # <<<<<<<<<<<<<< @@ -13703,7 +14301,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_current.improvement > __pyx_v_best.improvement) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1737 + /* "sklearn/tree/_tree.pyx":1850 * * if current.improvement > best.improvement: * self.criterion.children_impurity(¤t.impurity_left, # <<<<<<<<<<<<<< @@ -13712,7 +14310,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.criterion->__pyx_vtab)->children_impurity(__pyx_v_self->__pyx_base.criterion, (&__pyx_v_current.impurity_left), (&__pyx_v_current.impurity_right)); - /* "sklearn/tree/_tree.pyx":1740 + /* "sklearn/tree/_tree.pyx":1853 * ¤t.impurity_right) * * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< @@ -13721,7 +14319,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":1741 + /* "sklearn/tree/_tree.pyx":1854 * * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -13731,7 +14329,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_current.threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1742 + /* "sklearn/tree/_tree.pyx":1855 * current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 * if current.threshold == Xf[p]: * current.threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -13743,7 +14341,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } __pyx_L20:; - /* "sklearn/tree/_tree.pyx":1744 + /* "sklearn/tree/_tree.pyx":1857 * current.threshold = Xf[p - 1] * * best = current # copy # <<<<<<<<<<<<<< @@ -13765,7 +14363,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L7:; } - /* "sklearn/tree/_tree.pyx":1747 + /* "sklearn/tree/_tree.pyx":1860 * * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: # <<<<<<<<<<<<<< @@ -13775,7 +14373,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_best.pos < __pyx_v_end) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":1748 + /* "sklearn/tree/_tree.pyx":1861 * # Reorganize into samples[start:best.pos] + samples[best.pos:end] * if best.pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -13784,7 +14382,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1749 + /* "sklearn/tree/_tree.pyx":1862 * if best.pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -13793,7 +14391,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1751 + /* "sklearn/tree/_tree.pyx":1864 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -13804,7 +14402,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_9) break; - /* "sklearn/tree/_tree.pyx":1753 + /* "sklearn/tree/_tree.pyx":1866 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: # <<<<<<<<<<<<<< @@ -13814,7 +14412,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_9 = (((__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_9) { - /* "sklearn/tree/_tree.pyx":1754 + /* "sklearn/tree/_tree.pyx":1867 * if X[X_sample_stride * samples[p] + * X_fx_stride * best.feature] <= best.threshold: * p += 1 # <<<<<<<<<<<<<< @@ -13826,7 +14424,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1757 + /* "sklearn/tree/_tree.pyx":1870 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -13835,7 +14433,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":1759 + /* "sklearn/tree/_tree.pyx":1872 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -13844,7 +14442,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":1760 + /* "sklearn/tree/_tree.pyx":1873 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -13853,7 +14451,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1761 + /* "sklearn/tree/_tree.pyx":1874 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -13868,7 +14466,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } __pyx_L21:; - /* "sklearn/tree/_tree.pyx":1764 + /* "sklearn/tree/_tree.pyx":1877 * * # Reset sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -13879,7 +14477,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":1765 + /* "sklearn/tree/_tree.pyx":1878 * # Reset sample mask * for p in range(start, end): * sample_mask[samples[p]] = 0 # <<<<<<<<<<<<<< @@ -13889,7 +14487,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":1770 + /* "sklearn/tree/_tree.pyx":1883 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -13898,7 +14496,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":1773 + /* "sklearn/tree/_tree.pyx":1886 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -13907,7 +14505,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":1778 + /* "sklearn/tree/_tree.pyx":1891 * * # Return values * split[0] = best # <<<<<<<<<<<<<< @@ -13916,7 +14514,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_split[0]) = __pyx_v_best; - /* "sklearn/tree/_tree.pyx":1779 + /* "sklearn/tree/_tree.pyx":1892 * # Return values * split[0] = best * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -13925,7 +14523,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":1588 + /* "sklearn/tree/_tree.pyx":1701 * memset(sample_mask, 0, self.n_total_samples) * * cdef void node_split(self, double impurity, SplitRecord* split, # <<<<<<<<<<<<<< @@ -13936,7 +14534,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1788 +/* "sklearn/tree/_tree.pyx":1901 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -13947,7 +14545,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc 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 PyArrayObject *__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":1789 + /* "sklearn/tree/_tree.pyx":1902 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -13970,7 +14568,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED } } - /* "sklearn/tree/_tree.pyx":1788 + /* "sklearn/tree/_tree.pyx":1901 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -13981,11 +14579,11 @@ 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 = 1788; __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 = 1901; __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); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_tree)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_tree)); @@ -13999,7 +14597,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -14010,7 +14608,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":1790 + /* "sklearn/tree/_tree.pyx":1903 * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): * """Build a decision tree from the training set (X, y).""" # <<<<<<<<<<<<<< @@ -14033,7 +14631,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1788 +/* "sklearn/tree/_tree.pyx":1901 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14059,7 +14657,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":1789 + /* "sklearn/tree/_tree.pyx":1902 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -14086,12 +14684,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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -14100,7 +14698,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 = 1788; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -14119,19 +14717,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 = 1788; __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 = 1901; __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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __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 = 1788; __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 = 1789; __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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __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 = 1901; __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 = 1902; __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":1788 + /* "sklearn/tree/_tree.pyx":1901 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14160,7 +14758,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 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self->__pyx_vtab)->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 = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *)__pyx_v_self->__pyx_vtab)->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 = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14177,7 +14775,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1799 +/* "sklearn/tree/_tree.pyx":1912 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -14222,26 +14820,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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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 = 1799; __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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -14253,20 +14851,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 = 1799; __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 = 1800; __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 = 1801; __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 = 1802; __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 = 1912; __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 = 1913; __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 = 1914; __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 = 1915; __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 = 1799; __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 = 1912; __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 = 1799; __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 = 1912; __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 */ @@ -14283,7 +14881,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1803 + /* "sklearn/tree/_tree.pyx":1916 * double min_weight_leaf, * SIZE_t max_depth): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -14296,7 +14894,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":1804 + /* "sklearn/tree/_tree.pyx":1917 * SIZE_t max_depth): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -14305,7 +14903,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":1805 + /* "sklearn/tree/_tree.pyx":1918 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -14314,7 +14912,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":1806 + /* "sklearn/tree/_tree.pyx":1919 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -14323,7 +14921,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":1807 + /* "sklearn/tree/_tree.pyx":1920 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -14332,7 +14930,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":1799 + /* "sklearn/tree/_tree.pyx":1912 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -14346,7 +14944,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1809 +/* "sklearn/tree/_tree.pyx":1922 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14357,7 +14955,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, PyArrayObject *__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":1810 + /* "sklearn/tree/_tree.pyx":1923 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -14419,7 +15017,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":1809 + /* "sklearn/tree/_tree.pyx":1922 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14430,11 +15028,11 @@ 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 = 1809; __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 = 1922; __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); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_tree)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_tree)); @@ -14448,7 +15046,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -14459,82 +15057,82 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":1813 + /* "sklearn/tree/_tree.pyx":1926 * """Build a decision tree from the training set (X, y).""" * # check if dtype is correct * if X.dtype != DTYPE: # <<<<<<<<<<<<<< * # since we have to copy we will make it fortran for efficiency * X = np.asfortranarray(X, dtype=DTYPE) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __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 = 1926; __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 = 1813; __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 = 1926; __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1815 + /* "sklearn/tree/_tree.pyx":1928 * if 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 = 1815; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 1815; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_X)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_X)); __Pyx_GIVEREF(((PyObject *)__pyx_v_X)); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 1815; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_X, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L3; } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1817 + /* "sklearn/tree/_tree.pyx":1930 * X = np.asfortranarray(X, dtype=DTYPE) * * if y.dtype != DOUBLE or not y.flags.contiguous: # <<<<<<<<<<<<<< * y = np.ascontiguousarray(y, dtype=DOUBLE) * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __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 = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) { - __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 = 1817; __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 = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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 = 1817; __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 = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); __pyx_t_6 = __pyx_t_7; @@ -14543,42 +15141,42 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1818 + /* "sklearn/tree/_tree.pyx":1931 * * if y.dtype != DOUBLE or not y.flags.contiguous: * y = np.ascontiguousarray(y, dtype=DOUBLE) # <<<<<<<<<<<<<< * * cdef DOUBLE_t* sample_weight_ptr = NULL */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_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 = 1818; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_y)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_y)); __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 1818; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; goto __pyx_L4; } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":1820 + /* "sklearn/tree/_tree.pyx":1933 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -14587,7 +15185,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1821 + /* "sklearn/tree/_tree.pyx":1934 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -14598,37 +15196,37 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = (__pyx_t_6 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1822 + /* "sklearn/tree/_tree.pyx":1935 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * if ((sample_weight.dtype != DOUBLE) or # <<<<<<<<<<<<<< * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1823 + /* "sklearn/tree/_tree.pyx":1936 * if sample_weight is not None: * if ((sample_weight.dtype != DOUBLE) or * (not sample_weight.flags.contiguous)): # <<<<<<<<<<<<<< * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = (!__pyx_t_6); __pyx_t_6 = __pyx_t_7; @@ -14637,59 +15235,59 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1824 + /* "sklearn/tree/_tree.pyx":1937 * if ((sample_weight.dtype != DOUBLE) or * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, # <<<<<<<<<<<<<< * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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 = 1824; __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1825 + /* "sklearn/tree/_tree.pyx":1938 * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") # <<<<<<<<<<<<<< * sample_weight_ptr = sample_weight.data * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; __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 = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1824 + /* "sklearn/tree/_tree.pyx":1937 * if ((sample_weight.dtype != DOUBLE) or * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, # <<<<<<<<<<<<<< * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __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 = 1824; __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 = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; goto __pyx_L6; } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":1826 + /* "sklearn/tree/_tree.pyx":1939 * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -14701,7 +15299,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1831 + /* "sklearn/tree/_tree.pyx":1944 * cdef int init_capacity * * if tree.max_depth <= 10: # <<<<<<<<<<<<<< @@ -14711,7 +15309,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_6 = ((__pyx_v_tree->max_depth <= 10) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1832 + /* "sklearn/tree/_tree.pyx":1945 * * if tree.max_depth <= 10: * init_capacity = (2 ** (tree.max_depth + 1)) - 1 # <<<<<<<<<<<<<< @@ -14723,7 +15321,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":1834 + /* "sklearn/tree/_tree.pyx":1947 * init_capacity = (2 ** (tree.max_depth + 1)) - 1 * else: * init_capacity = 2047 # <<<<<<<<<<<<<< @@ -14734,7 +15332,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":1836 + /* "sklearn/tree/_tree.pyx":1949 * init_capacity = 2047 * * tree._resize(init_capacity) # <<<<<<<<<<<<<< @@ -14743,7 +15341,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); - /* "sklearn/tree/_tree.pyx":1839 + /* "sklearn/tree/_tree.pyx":1952 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -14755,7 +15353,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_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1840 + /* "sklearn/tree/_tree.pyx":1953 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth # <<<<<<<<<<<<<< @@ -14765,7 +15363,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_8 = __pyx_v_self->__pyx_base.max_depth; __pyx_v_max_depth = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1841 + /* "sklearn/tree/_tree.pyx":1954 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -14775,7 +15373,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_8 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1842 + /* "sklearn/tree/_tree.pyx":1955 * 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 # <<<<<<<<<<<<<< @@ -14785,7 +15383,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1843 + /* "sklearn/tree/_tree.pyx":1956 * 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 # <<<<<<<<<<<<<< @@ -14795,7 +15393,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_8 = __pyx_v_self->__pyx_base.min_samples_split; __pyx_v_min_samples_split = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1846 + /* "sklearn/tree/_tree.pyx":1959 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< @@ -14804,7 +15402,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)->init(__pyx_v_splitter, __pyx_v_X, __pyx_v_y, __pyx_v_sample_weight_ptr); - /* "sklearn/tree/_tree.pyx":1853 + /* "sklearn/tree/_tree.pyx":1966 * cdef SIZE_t parent * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -14814,7 +15412,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_8 = __pyx_v_splitter->n_samples; __pyx_v_n_node_samples = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1854 + /* "sklearn/tree/_tree.pyx":1967 * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -14824,7 +15422,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_splitter->weighted_n_samples; __pyx_v_weighted_n_samples = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1860 + /* "sklearn/tree/_tree.pyx":1973 * * cdef double threshold * cdef double impurity = INFINITY # <<<<<<<<<<<<<< @@ -14833,7 +15431,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":1863 + /* "sklearn/tree/_tree.pyx":1976 * cdef SIZE_t n_constant_features * cdef bint is_leaf * cdef bint first = 1 # <<<<<<<<<<<<<< @@ -14842,7 +15440,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_first = 1; - /* "sklearn/tree/_tree.pyx":1864 + /* "sklearn/tree/_tree.pyx":1977 * cdef bint is_leaf * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -14851,7 +15449,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":1865 + /* "sklearn/tree/_tree.pyx":1978 * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -14860,27 +15458,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":1867 + /* "sklearn/tree/_tree.pyx":1980 * cdef int rc = 0 * * cdef Stack stack = Stack(INITIAL_STACK_SIZE) # <<<<<<<<<<<<<< * cdef StackRecord stack_record * */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_Stack)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_stack = ((struct __pyx_obj_7sklearn_4tree_6_utils_Stack *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1871 + /* "sklearn/tree/_tree.pyx":1984 * * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) # <<<<<<<<<<<<<< @@ -14889,7 +15487,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":1872 + /* "sklearn/tree/_tree.pyx":1985 * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) * if rc == -1: # <<<<<<<<<<<<<< @@ -14899,17 +15497,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_6 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1874 + /* "sklearn/tree/_tree.pyx":1987 * if rc == -1: * # got return code -1 - out-of-memory * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1876 + /* "sklearn/tree/_tree.pyx":1989 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -14923,7 +15521,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":1877 + /* "sklearn/tree/_tree.pyx":1990 * * with nogil: * while not stack.is_empty(): # <<<<<<<<<<<<<< @@ -14934,7 +15532,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_6 = ((!(((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *)__pyx_v_stack->__pyx_vtab)->is_empty(__pyx_v_stack) != 0)) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":1878 + /* "sklearn/tree/_tree.pyx":1991 * with nogil: * while not stack.is_empty(): * stack.pop(&stack_record) # <<<<<<<<<<<<<< @@ -14943,7 +15541,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":1880 + /* "sklearn/tree/_tree.pyx":1993 * stack.pop(&stack_record) * * start = stack_record.start # <<<<<<<<<<<<<< @@ -14953,7 +15551,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_stack_record.start; __pyx_v_start = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1881 + /* "sklearn/tree/_tree.pyx":1994 * * start = stack_record.start * end = stack_record.end # <<<<<<<<<<<<<< @@ -14963,7 +15561,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_stack_record.end; __pyx_v_end = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1882 + /* "sklearn/tree/_tree.pyx":1995 * start = stack_record.start * end = stack_record.end * depth = stack_record.depth # <<<<<<<<<<<<<< @@ -14973,7 +15571,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_stack_record.depth; __pyx_v_depth = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1883 + /* "sklearn/tree/_tree.pyx":1996 * end = stack_record.end * depth = stack_record.depth * parent = stack_record.parent # <<<<<<<<<<<<<< @@ -14983,7 +15581,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_stack_record.parent; __pyx_v_parent = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1884 + /* "sklearn/tree/_tree.pyx":1997 * depth = stack_record.depth * parent = stack_record.parent * is_left = stack_record.is_left # <<<<<<<<<<<<<< @@ -14993,7 +15591,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_6 = __pyx_v_stack_record.is_left; __pyx_v_is_left = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1885 + /* "sklearn/tree/_tree.pyx":1998 * parent = stack_record.parent * is_left = stack_record.is_left * impurity = stack_record.impurity # <<<<<<<<<<<<<< @@ -15003,7 +15601,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.impurity; __pyx_v_impurity = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1886 + /* "sklearn/tree/_tree.pyx":1999 * is_left = stack_record.is_left * impurity = stack_record.impurity * n_constant_features = stack_record.n_constant_features # <<<<<<<<<<<<<< @@ -15013,7 +15611,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_stack_record.n_constant_features; __pyx_v_n_constant_features = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1888 + /* "sklearn/tree/_tree.pyx":2001 * n_constant_features = stack_record.n_constant_features * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -15022,7 +15620,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":1889 + /* "sklearn/tree/_tree.pyx":2002 * * n_node_samples = end - start * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -15031,7 +15629,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":1891 + /* "sklearn/tree/_tree.pyx":2004 * splitter.node_reset(start, end, &weighted_n_node_samples) * * is_leaf = ((depth >= max_depth) or # <<<<<<<<<<<<<< @@ -15041,7 +15639,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_6 = (__pyx_v_depth >= __pyx_v_max_depth); if (!__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1892 + /* "sklearn/tree/_tree.pyx":2005 * * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or # <<<<<<<<<<<<<< @@ -15051,7 +15649,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = (__pyx_v_n_node_samples < __pyx_v_min_samples_split); if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1893 + /* "sklearn/tree/_tree.pyx":2006 * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf) or # <<<<<<<<<<<<<< @@ -15061,7 +15659,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_7 = (__pyx_v_n_node_samples < (2 * __pyx_v_min_samples_leaf)); if (!__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1894 + /* "sklearn/tree/_tree.pyx":2007 * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf) or * (weighted_n_node_samples < min_weight_leaf)) # <<<<<<<<<<<<<< @@ -15083,7 +15681,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_v_is_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1896 + /* "sklearn/tree/_tree.pyx":2009 * (weighted_n_node_samples < min_weight_leaf)) * * if first: # <<<<<<<<<<<<<< @@ -15093,7 +15691,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = (__pyx_v_first != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1897 + /* "sklearn/tree/_tree.pyx":2010 * * if first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -15102,7 +15700,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":1898 + /* "sklearn/tree/_tree.pyx":2011 * if first: * impurity = splitter.node_impurity() * first = 0 # <<<<<<<<<<<<<< @@ -15114,7 +15712,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L14:; - /* "sklearn/tree/_tree.pyx":1900 + /* "sklearn/tree/_tree.pyx":2013 * first = 0 * * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) # <<<<<<<<<<<<<< @@ -15129,7 +15727,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_v_is_leaf = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1902 + /* "sklearn/tree/_tree.pyx":2015 * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -15139,7 +15737,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_6 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1903 + /* "sklearn/tree/_tree.pyx":2016 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -15148,7 +15746,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":1904 + /* "sklearn/tree/_tree.pyx":2017 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< @@ -15166,7 +15764,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L15:; - /* "sklearn/tree/_tree.pyx":1906 + /* "sklearn/tree/_tree.pyx":2019 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent, is_left, is_leaf, split.feature, # <<<<<<<<<<<<<< @@ -15175,7 +15773,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":1910 + /* "sklearn/tree/_tree.pyx":2023 * weighted_n_node_samples) * * if is_leaf: # <<<<<<<<<<<<<< @@ -15185,7 +15783,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = (__pyx_v_is_leaf != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1912 + /* "sklearn/tree/_tree.pyx":2025 * if is_leaf: * # Don't store value for internal nodes * splitter.node_value(tree.value + # <<<<<<<<<<<<<< @@ -15197,7 +15795,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":1917 + /* "sklearn/tree/_tree.pyx":2030 * else: * # Push right child on stack * rc = stack.push(split.pos, end, depth + 1, node_id, 0, # <<<<<<<<<<<<<< @@ -15206,7 +15804,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":1919 + /* "sklearn/tree/_tree.pyx":2032 * rc = stack.push(split.pos, end, depth + 1, node_id, 0, * split.impurity_right, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -15216,7 +15814,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1920 + /* "sklearn/tree/_tree.pyx":2033 * split.impurity_right, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -15226,7 +15824,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_break; } - /* "sklearn/tree/_tree.pyx":1923 + /* "sklearn/tree/_tree.pyx":2036 * * # Push left child on stack * rc = stack.push(start, split.pos, depth + 1, node_id, 1, # <<<<<<<<<<<<<< @@ -15235,7 +15833,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":1925 + /* "sklearn/tree/_tree.pyx":2038 * rc = stack.push(start, split.pos, depth + 1, node_id, 1, * split.impurity_left, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -15245,7 +15843,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1926 + /* "sklearn/tree/_tree.pyx":2039 * split.impurity_left, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -15257,7 +15855,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":1928 + /* "sklearn/tree/_tree.pyx":2041 * break * * if depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -15267,7 +15865,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = ((__pyx_v_depth > __pyx_v_max_depth_seen) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1929 + /* "sklearn/tree/_tree.pyx":2042 * * if depth > max_depth_seen: * max_depth_seen = depth # <<<<<<<<<<<<<< @@ -15281,7 +15879,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L13_break:; - /* "sklearn/tree/_tree.pyx":1931 + /* "sklearn/tree/_tree.pyx":2044 * max_depth_seen = depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -15291,7 +15889,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1932 + /* "sklearn/tree/_tree.pyx":2045 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -15306,7 +15904,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L20:; - /* "sklearn/tree/_tree.pyx":1934 + /* "sklearn/tree/_tree.pyx":2047 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -15316,7 +15914,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1935 + /* "sklearn/tree/_tree.pyx":2048 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -15329,7 +15927,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_L21:; } - /* "sklearn/tree/_tree.pyx":1876 + /* "sklearn/tree/_tree.pyx":1989 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -15347,7 +15945,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } } - /* "sklearn/tree/_tree.pyx":1937 + /* "sklearn/tree/_tree.pyx":2050 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -15357,17 +15955,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1938 + /* "sklearn/tree/_tree.pyx":2051 * * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1809 + /* "sklearn/tree/_tree.pyx":1922 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15414,7 +16012,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":1810 + /* "sklearn/tree/_tree.pyx":1923 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -15441,12 +16039,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 = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __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 = 1809; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -15455,7 +16053,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 = 1809; __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 = 1922; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -15474,19 +16072,19 @@ 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 = 1809; __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 = 1922; __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 = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1809; __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 = 1809; __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 = 1810; __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 = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __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 = 1922; __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 = 1923; __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":1809 + /* "sklearn/tree/_tree.pyx":1922 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15515,7 +16113,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 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__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 = 1809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__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 = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15532,7 +16130,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1943 +/* "sklearn/tree/_tree.pyx":2056 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -15543,7 +16141,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":1947 + /* "sklearn/tree/_tree.pyx":2060 * """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, # <<<<<<<<<<<<<< @@ -15553,7 +16151,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":1943 + /* "sklearn/tree/_tree.pyx":2056 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -15566,7 +16164,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1962 +/* "sklearn/tree/_tree.pyx":2075 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -15613,31 +16211,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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __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 = 1962; __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 = 2075; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; @@ -15650,21 +16248,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 = 1962; __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 = 1963; __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 = 1964; __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 = 1965; __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 = 1966; __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 = 2075; __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 = 2076; __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 = 2077; __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 = 2078; __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 = 2079; __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 = 1962; __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 = 2075; __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 = 1962; __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 = 2075; __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 */ @@ -15681,7 +16279,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1967 + /* "sklearn/tree/_tree.pyx":2080 * SIZE_t max_depth, * SIZE_t max_leaf_nodes): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -15694,7 +16292,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":1968 + /* "sklearn/tree/_tree.pyx":2081 * SIZE_t max_leaf_nodes): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -15703,7 +16301,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":1969 + /* "sklearn/tree/_tree.pyx":2082 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -15712,7 +16310,7 @@ 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":1970 + /* "sklearn/tree/_tree.pyx":2083 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf # <<<<<<<<<<<<<< @@ -15721,7 +16319,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc */ __pyx_v_self->__pyx_base.min_weight_leaf = __pyx_v_min_weight_leaf; - /* "sklearn/tree/_tree.pyx":1971 + /* "sklearn/tree/_tree.pyx":2084 * self.min_samples_leaf = min_samples_leaf * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -15730,7 +16328,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":1972 + /* "sklearn/tree/_tree.pyx":2085 * self.min_weight_leaf = min_weight_leaf * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes # <<<<<<<<<<<<<< @@ -15739,7 +16337,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":1962 + /* "sklearn/tree/_tree.pyx":2075 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -15753,7 +16351,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1974 +/* "sklearn/tree/_tree.pyx":2087 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15764,7 +16362,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, PyArrayObject *__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":1975 + /* "sklearn/tree/_tree.pyx":2088 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -15816,7 +16414,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":1974 + /* "sklearn/tree/_tree.pyx":2087 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15827,11 +16425,11 @@ 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 = 1974; __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 = 2087; __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); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_tree)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_tree)); @@ -15845,7 +16443,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -15856,82 +16454,82 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "sklearn/tree/_tree.pyx":1978 + /* "sklearn/tree/_tree.pyx":2091 * """Build a decision tree from the training set (X, y).""" * # Check if dtype is correct * if X.dtype != DTYPE: # <<<<<<<<<<<<<< * # since we have to copy we will make it fortran for efficiency * X = np.asfortranarray(X, dtype=DTYPE) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_X), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __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 = 2091; __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 = 1978; __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 = 2091; __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_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1980 + /* "sklearn/tree/_tree.pyx":2093 * if 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 = 1980; __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 = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 1980; __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 = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_X)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_X)); __Pyx_GIVEREF(((PyObject *)__pyx_v_X)); - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DTYPE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 1980; __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 = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_X, ((PyArrayObject *)__pyx_t_5)); __pyx_t_5 = 0; goto __pyx_L3; } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1982 + /* "sklearn/tree/_tree.pyx":2095 * X = np.asfortranarray(X, dtype=DTYPE) * * if y.dtype != DOUBLE or not y.flags.contiguous: # <<<<<<<<<<<<<< * y = np.ascontiguousarray(y, dtype=DOUBLE) * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_y), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __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 = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) { - __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 = 1982; __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 = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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 = 1982; __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 = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); __pyx_t_6 = __pyx_t_7; @@ -15940,42 +16538,42 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1983 + /* "sklearn/tree/_tree.pyx":2096 * * if y.dtype != DOUBLE or not y.flags.contiguous: * y = np.ascontiguousarray(y, dtype=DOUBLE) # <<<<<<<<<<<<<< * * cdef DOUBLE_t* sample_weight_ptr = NULL */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __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 = 1983; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_y)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_y)); __Pyx_GIVEREF(((PyObject *)__pyx_v_y)); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 1983; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_y, ((PyArrayObject *)__pyx_t_3)); __pyx_t_3 = 0; goto __pyx_L4; } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":1985 + /* "sklearn/tree/_tree.pyx":2098 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -15984,7 +16582,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1986 + /* "sklearn/tree/_tree.pyx":2099 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -15995,37 +16593,37 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = (__pyx_t_6 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1987 + /* "sklearn/tree/_tree.pyx":2100 * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: * if ((sample_weight.dtype != DOUBLE) or # <<<<<<<<<<<<<< * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1988 + /* "sklearn/tree/_tree.pyx":2101 * if sample_weight is not None: * if ((sample_weight.dtype != DOUBLE) or * (not sample_weight.flags.contiguous)): # <<<<<<<<<<<<<< * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sample_weight), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_contiguous); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = (!__pyx_t_6); __pyx_t_6 = __pyx_t_7; @@ -16034,59 +16632,59 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1989 + /* "sklearn/tree/_tree.pyx":2102 * if ((sample_weight.dtype != DOUBLE) or * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, # <<<<<<<<<<<<<< * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __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 = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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 = 1989; __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 = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_sample_weight)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_sample_weight)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sample_weight)); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1990 + /* "sklearn/tree/_tree.pyx":2103 * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") # <<<<<<<<<<<<<< * sample_weight_ptr = sample_weight.data * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __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 = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1989 + /* "sklearn/tree/_tree.pyx":2102 * if ((sample_weight.dtype != DOUBLE) or * (not sample_weight.flags.contiguous)): * sample_weight = np.asarray(sample_weight, # <<<<<<<<<<<<<< * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __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 = 1989; __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 = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_2)); __pyx_t_2 = 0; goto __pyx_L6; } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":1991 + /* "sklearn/tree/_tree.pyx":2104 * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -16098,7 +16696,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1994 + /* "sklearn/tree/_tree.pyx":2107 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -16110,7 +16708,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_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1995 + /* "sklearn/tree/_tree.pyx":2108 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes # <<<<<<<<<<<<<< @@ -16120,7 +16718,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_8 = __pyx_v_self->max_leaf_nodes; __pyx_v_max_leaf_nodes = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1996 + /* "sklearn/tree/_tree.pyx":2109 * 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 # <<<<<<<<<<<<<< @@ -16130,7 +16728,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_8 = __pyx_v_self->__pyx_base.min_samples_leaf; __pyx_v_min_samples_leaf = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1997 + /* "sklearn/tree/_tree.pyx":2110 * 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 # <<<<<<<<<<<<<< @@ -16140,7 +16738,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_9 = __pyx_v_self->__pyx_base.min_weight_leaf; __pyx_v_min_weight_leaf = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1998 + /* "sklearn/tree/_tree.pyx":2111 * 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 # <<<<<<<<<<<<<< @@ -16150,7 +16748,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_8 = __pyx_v_self->__pyx_base.min_samples_split; __pyx_v_min_samples_split = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2001 + /* "sklearn/tree/_tree.pyx":2114 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< @@ -16159,27 +16757,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ ((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); - /* "sklearn/tree/_tree.pyx":2003 + /* "sklearn/tree/_tree.pyx":2116 * splitter.init(X, y, sample_weight_ptr) * * cdef PriorityHeap frontier = PriorityHeap(INITIAL_STACK_SIZE) # <<<<<<<<<<<<<< * cdef PriorityHeapRecord record * cdef PriorityHeapRecord split_node_left */ - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __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 = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_frontier = ((struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2008 + /* "sklearn/tree/_tree.pyx":2121 * cdef PriorityHeapRecord split_node_right * * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -16189,7 +16787,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_8 = __pyx_v_splitter->n_samples; __pyx_v_n_node_samples = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2009 + /* "sklearn/tree/_tree.pyx":2122 * * cdef SIZE_t n_node_samples = splitter.n_samples * cdef int max_split_nodes = max_leaf_nodes - 1 # <<<<<<<<<<<<<< @@ -16198,7 +16796,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":2011 + /* "sklearn/tree/_tree.pyx":2124 * cdef int max_split_nodes = max_leaf_nodes - 1 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -16207,7 +16805,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":2012 + /* "sklearn/tree/_tree.pyx":2125 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -16216,7 +16814,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":2016 + /* "sklearn/tree/_tree.pyx":2129 * * # Initial capacity * cdef int init_capacity = max_split_nodes + max_leaf_nodes # <<<<<<<<<<<<<< @@ -16225,7 +16823,7 @@ 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":2017 + /* "sklearn/tree/_tree.pyx":2130 * # Initial capacity * cdef int init_capacity = max_split_nodes + max_leaf_nodes * tree._resize(init_capacity) # <<<<<<<<<<<<<< @@ -16234,7 +16832,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_tree->__pyx_vtab)->_resize(__pyx_v_tree, __pyx_v_init_capacity); - /* "sklearn/tree/_tree.pyx":2019 + /* "sklearn/tree/_tree.pyx":2132 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -16248,7 +16846,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2021 + /* "sklearn/tree/_tree.pyx":2134 * with nogil: * # add root to frontier * rc = self._add_split_node(splitter, tree, 0, n_node_samples, # <<<<<<<<<<<<<< @@ -16257,7 +16855,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":2024 + /* "sklearn/tree/_tree.pyx":2137 * INFINITY, IS_FIRST, IS_LEFT, NULL, 0, * &split_node_left) * if rc >= 0: # <<<<<<<<<<<<<< @@ -16267,7 +16865,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_6 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2025 + /* "sklearn/tree/_tree.pyx":2138 * &split_node_left) * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -16280,7 +16878,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":2019 + /* "sklearn/tree/_tree.pyx":2132 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -16298,7 +16896,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":2026 + /* "sklearn/tree/_tree.pyx":2139 * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -16308,17 +16906,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_6 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2027 + /* "sklearn/tree/_tree.pyx":2140 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2029 + /* "sklearn/tree/_tree.pyx":2142 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -16332,7 +16930,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2030 + /* "sklearn/tree/_tree.pyx":2143 * * with nogil: * while not frontier.is_empty(): # <<<<<<<<<<<<<< @@ -16343,7 +16941,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_6 = ((!(((struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *)__pyx_v_frontier->__pyx_vtab)->is_empty(__pyx_v_frontier) != 0)) != 0); if (!__pyx_t_6) break; - /* "sklearn/tree/_tree.pyx":2031 + /* "sklearn/tree/_tree.pyx":2144 * with nogil: * while not frontier.is_empty(): * frontier.pop(&record) # <<<<<<<<<<<<<< @@ -16352,7 +16950,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":2033 + /* "sklearn/tree/_tree.pyx":2146 * frontier.pop(&record) * * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -16361,7 +16959,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":2034 + /* "sklearn/tree/_tree.pyx":2147 * * node = &tree.nodes[record.node_id] * is_leaf = (record.is_leaf or max_split_nodes <= 0) # <<<<<<<<<<<<<< @@ -16376,7 +16974,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_v_is_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2036 + /* "sklearn/tree/_tree.pyx":2149 * is_leaf = (record.is_leaf or max_split_nodes <= 0) * * if is_leaf: # <<<<<<<<<<<<<< @@ -16386,7 +16984,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = (__pyx_v_is_leaf != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2038 + /* "sklearn/tree/_tree.pyx":2151 * if is_leaf: * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -16395,7 +16993,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":2039 + /* "sklearn/tree/_tree.pyx":2152 * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -16404,7 +17002,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":2040 + /* "sklearn/tree/_tree.pyx":2153 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -16413,7 +17011,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":2041 + /* "sklearn/tree/_tree.pyx":2154 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -16425,7 +17023,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2047 + /* "sklearn/tree/_tree.pyx":2160 * * # Decrement number of split nodes available * max_split_nodes -= 1 # <<<<<<<<<<<<<< @@ -16434,7 +17032,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":2050 + /* "sklearn/tree/_tree.pyx":2163 * * # Compute left split node * rc = self._add_split_node(splitter, tree, # <<<<<<<<<<<<<< @@ -16443,7 +17041,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":2056 + /* "sklearn/tree/_tree.pyx":2169 * record.depth + 1, * &split_node_left) * if rc == -1: # <<<<<<<<<<<<<< @@ -16453,7 +17051,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2057 + /* "sklearn/tree/_tree.pyx":2170 * &split_node_left) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16463,7 +17061,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L16_break; } - /* "sklearn/tree/_tree.pyx":2060 + /* "sklearn/tree/_tree.pyx":2173 * * # tree.nodes may have changed * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -16472,7 +17070,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":2063 + /* "sklearn/tree/_tree.pyx":2176 * * # Compute right split node * rc = self._add_split_node(splitter, tree, record.pos, # <<<<<<<<<<<<<< @@ -16481,7 +17079,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":2069 + /* "sklearn/tree/_tree.pyx":2182 * record.depth + 1, * &split_node_right) * if rc == -1: # <<<<<<<<<<<<<< @@ -16491,7 +17089,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2070 + /* "sklearn/tree/_tree.pyx":2183 * &split_node_right) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16501,7 +17099,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L16_break; } - /* "sklearn/tree/_tree.pyx":2073 + /* "sklearn/tree/_tree.pyx":2186 * * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -16510,7 +17108,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":2074 + /* "sklearn/tree/_tree.pyx":2187 * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -16520,7 +17118,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2075 + /* "sklearn/tree/_tree.pyx":2188 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16530,7 +17128,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L16_break; } - /* "sklearn/tree/_tree.pyx":2077 + /* "sklearn/tree/_tree.pyx":2190 * break * * rc = _add_to_frontier(&split_node_right, frontier) # <<<<<<<<<<<<<< @@ -16539,7 +17137,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":2078 + /* "sklearn/tree/_tree.pyx":2191 * * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -16549,7 +17147,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2079 + /* "sklearn/tree/_tree.pyx":2192 * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16561,7 +17159,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L17:; - /* "sklearn/tree/_tree.pyx":2081 + /* "sklearn/tree/_tree.pyx":2194 * break * * if record.depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -16571,7 +17169,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_record.depth > __pyx_v_max_depth_seen) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2082 + /* "sklearn/tree/_tree.pyx":2195 * * if record.depth > max_depth_seen: * max_depth_seen = record.depth # <<<<<<<<<<<<<< @@ -16586,7 +17184,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L16_break:; - /* "sklearn/tree/_tree.pyx":2084 + /* "sklearn/tree/_tree.pyx":2197 * max_depth_seen = record.depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -16596,7 +17194,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2085 + /* "sklearn/tree/_tree.pyx":2198 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -16611,7 +17209,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L23:; - /* "sklearn/tree/_tree.pyx":2087 + /* "sklearn/tree/_tree.pyx":2200 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -16621,7 +17219,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc >= 0) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2088 + /* "sklearn/tree/_tree.pyx":2201 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -16634,7 +17232,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L24:; } - /* "sklearn/tree/_tree.pyx":2029 + /* "sklearn/tree/_tree.pyx":2142 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -16652,7 +17250,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":2090 + /* "sklearn/tree/_tree.pyx":2203 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -16662,17 +17260,17 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_t_4 = ((__pyx_v_rc == -1) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2091 + /* "sklearn/tree/_tree.pyx":2204 * * 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 = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1974 + /* "sklearn/tree/_tree.pyx":2087 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -16719,7 +17317,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":1975 + /* "sklearn/tree/_tree.pyx":2088 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -16746,12 +17344,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 = 1974; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __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 = 1974; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -16760,7 +17358,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 = 1974; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -16779,19 +17377,19 @@ 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 = 1974; __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 = 2087; __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 = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1974; __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 = 1974; __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 = 1975; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2087; __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 = 2087; __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 = 2088; __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":1974 + /* "sklearn/tree/_tree.pyx":2087 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -16820,7 +17418,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 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__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 = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->__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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16837,7 +17435,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2093 +/* "sklearn/tree/_tree.pyx":2206 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -16864,7 +17462,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a ptrdiff_t __pyx_t_8; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2102 + /* "sklearn/tree/_tree.pyx":2215 * cdef SIZE_t node_id * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 # <<<<<<<<<<<<<< @@ -16873,7 +17471,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_constant_features = 0; - /* "sklearn/tree/_tree.pyx":2103 + /* "sklearn/tree/_tree.pyx":2216 * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 * cdef double weighted_n_samples = splitter.weighted_n_samples # <<<<<<<<<<<<<< @@ -16883,7 +17481,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":2109 + /* "sklearn/tree/_tree.pyx":2222 * cdef double imp_diff * * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -16892,7 +17490,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":2111 + /* "sklearn/tree/_tree.pyx":2224 * splitter.node_reset(start, end, &weighted_n_node_samples) * * if is_first: # <<<<<<<<<<<<<< @@ -16902,7 +17500,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":2112 + /* "sklearn/tree/_tree.pyx":2225 * * if is_first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -16914,7 +17512,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2114 + /* "sklearn/tree/_tree.pyx":2227 * impurity = splitter.node_impurity() * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -16923,7 +17521,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":2115 + /* "sklearn/tree/_tree.pyx":2228 * * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or # <<<<<<<<<<<<<< @@ -16933,7 +17531,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = (__pyx_v_depth > __pyx_v_self->__pyx_base.max_depth); if (!__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2116 + /* "sklearn/tree/_tree.pyx":2229 * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or # <<<<<<<<<<<<<< @@ -16943,7 +17541,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_3 = (__pyx_v_n_node_samples < __pyx_v_self->__pyx_base.min_samples_split); if (!__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2117 + /* "sklearn/tree/_tree.pyx":2230 * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or # <<<<<<<<<<<<<< @@ -16953,7 +17551,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_4 = (__pyx_v_n_node_samples < (2 * __pyx_v_self->__pyx_base.min_samples_leaf)); if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2118 + /* "sklearn/tree/_tree.pyx":2231 * (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 # <<<<<<<<<<<<<< @@ -16963,7 +17561,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_5 = (__pyx_v_weighted_n_node_samples < __pyx_v_self->__pyx_base.min_weight_leaf); if (!__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2119 + /* "sklearn/tree/_tree.pyx":2232 * (n_node_samples < 2 * self.min_samples_leaf) or * (weighted_n_node_samples < self.min_weight_leaf) or * (impurity <= MIN_IMPURITY_SPLIT)) # <<<<<<<<<<<<<< @@ -16989,7 +17587,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_v_is_leaf = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":2121 + /* "sklearn/tree/_tree.pyx":2234 * (impurity <= MIN_IMPURITY_SPLIT)) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -16999,7 +17597,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_3 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2122 + /* "sklearn/tree/_tree.pyx":2235 * * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) # <<<<<<<<<<<<<< @@ -17008,7 +17606,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":2123 + /* "sklearn/tree/_tree.pyx":2236 * if not is_leaf: * splitter.node_split(impurity, &split, &n_constant_features) * is_leaf = is_leaf or (split.pos >= end) # <<<<<<<<<<<<<< @@ -17026,7 +17624,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":2126 + /* "sklearn/tree/_tree.pyx":2239 * * node_id = tree._add_node(parent - tree.nodes * if parent != NULL # <<<<<<<<<<<<<< @@ -17035,7 +17633,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ if (((__pyx_v_parent != NULL) != 0)) { - /* "sklearn/tree/_tree.pyx":2125 + /* "sklearn/tree/_tree.pyx":2238 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -17045,7 +17643,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_8 = (__pyx_v_parent - __pyx_v_tree->nodes); } else { - /* "sklearn/tree/_tree.pyx":2127 + /* "sklearn/tree/_tree.pyx":2240 * node_id = tree._add_node(parent - tree.nodes * if parent != NULL * else _TREE_UNDEFINED, # <<<<<<<<<<<<<< @@ -17055,7 +17653,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_8 = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; } - /* "sklearn/tree/_tree.pyx":2125 + /* "sklearn/tree/_tree.pyx":2238 * is_leaf = is_leaf or (split.pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -17064,7 +17662,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_8, __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":2131 + /* "sklearn/tree/_tree.pyx":2244 * split.feature, split.threshold, impurity, n_node_samples, * weighted_n_node_samples) * if node_id == (-1): # <<<<<<<<<<<<<< @@ -17074,7 +17672,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":2132 + /* "sklearn/tree/_tree.pyx":2245 * weighted_n_node_samples) * if node_id == (-1): * return -1 # <<<<<<<<<<<<<< @@ -17085,7 +17683,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2135 + /* "sklearn/tree/_tree.pyx":2248 * * # compute values also for split nodes (might become leafs later). * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -17094,7 +17692,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":2137 + /* "sklearn/tree/_tree.pyx":2250 * splitter.node_value(tree.value + node_id * tree.value_stride) * * res.node_id = node_id # <<<<<<<<<<<<<< @@ -17103,7 +17701,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":2138 + /* "sklearn/tree/_tree.pyx":2251 * * res.node_id = node_id * res.start = start # <<<<<<<<<<<<<< @@ -17112,7 +17710,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2139 + /* "sklearn/tree/_tree.pyx":2252 * res.node_id = node_id * res.start = start * res.end = end # <<<<<<<<<<<<<< @@ -17121,7 +17719,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2140 + /* "sklearn/tree/_tree.pyx":2253 * res.start = start * res.end = end * res.depth = depth # <<<<<<<<<<<<<< @@ -17130,7 +17728,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->depth = __pyx_v_depth; - /* "sklearn/tree/_tree.pyx":2141 + /* "sklearn/tree/_tree.pyx":2254 * res.end = end * res.depth = depth * res.impurity = impurity # <<<<<<<<<<<<<< @@ -17139,7 +17737,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":2143 + /* "sklearn/tree/_tree.pyx":2256 * res.impurity = impurity * * if not is_leaf: # <<<<<<<<<<<<<< @@ -17149,7 +17747,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":2145 + /* "sklearn/tree/_tree.pyx":2258 * if not is_leaf: * # is split node * res.pos = split.pos # <<<<<<<<<<<<<< @@ -17159,7 +17757,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_9 = __pyx_v_split.pos; __pyx_v_res->pos = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2146 + /* "sklearn/tree/_tree.pyx":2259 * # is split node * res.pos = split.pos * res.is_leaf = 0 # <<<<<<<<<<<<<< @@ -17168,7 +17766,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 0; - /* "sklearn/tree/_tree.pyx":2147 + /* "sklearn/tree/_tree.pyx":2260 * res.pos = split.pos * res.is_leaf = 0 * res.improvement = split.improvement # <<<<<<<<<<<<<< @@ -17178,7 +17776,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":2148 + /* "sklearn/tree/_tree.pyx":2261 * res.is_leaf = 0 * res.improvement = split.improvement * res.impurity_left = split.impurity_left # <<<<<<<<<<<<<< @@ -17188,7 +17786,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":2149 + /* "sklearn/tree/_tree.pyx":2262 * res.improvement = split.improvement * res.impurity_left = split.impurity_left * res.impurity_right = split.impurity_right # <<<<<<<<<<<<<< @@ -17201,7 +17799,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } /*else*/ { - /* "sklearn/tree/_tree.pyx":2153 + /* "sklearn/tree/_tree.pyx":2266 * else: * # is leaf => 0 improvement * res.pos = end # <<<<<<<<<<<<<< @@ -17210,7 +17808,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2154 + /* "sklearn/tree/_tree.pyx":2267 * # is leaf => 0 improvement * res.pos = end * res.is_leaf = 1 # <<<<<<<<<<<<<< @@ -17219,7 +17817,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->is_leaf = 1; - /* "sklearn/tree/_tree.pyx":2155 + /* "sklearn/tree/_tree.pyx":2268 * res.pos = end * res.is_leaf = 1 * res.improvement = 0.0 # <<<<<<<<<<<<<< @@ -17228,7 +17826,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->improvement = 0.0; - /* "sklearn/tree/_tree.pyx":2156 + /* "sklearn/tree/_tree.pyx":2269 * res.is_leaf = 1 * res.improvement = 0.0 * res.impurity_left = impurity # <<<<<<<<<<<<<< @@ -17237,7 +17835,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":2157 + /* "sklearn/tree/_tree.pyx":2270 * res.improvement = 0.0 * res.impurity_left = impurity * res.impurity_right = impurity # <<<<<<<<<<<<<< @@ -17248,7 +17846,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":2159 + /* "sklearn/tree/_tree.pyx":2272 * res.impurity_right = impurity * * return 0 # <<<<<<<<<<<<<< @@ -17258,7 +17856,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2093 + /* "sklearn/tree/_tree.pyx":2206 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -17271,7 +17869,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2225 +/* "sklearn/tree/_tree.pyx":2338 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -17302,7 +17900,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":2227 + /* "sklearn/tree/_tree.pyx":2340 * def __get__(self): * # it's small; copy for memory safety * return sizet_ptr_to_ndarray(self.n_classes, self.n_outputs).copy() # <<<<<<<<<<<<<< @@ -17310,19 +17908,19 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct * property children_left: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __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_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; __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":2225 + /* "sklearn/tree/_tree.pyx":2338 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -17342,7 +17940,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2230 +/* "sklearn/tree/_tree.pyx":2343 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -17373,7 +17971,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":2231 + /* "sklearn/tree/_tree.pyx":2344 * property children_left: * def __get__(self): * return self._get_node_ndarray()['left_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -17381,19 +17979,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 = 2231; __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 = 2344; __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 = 2231; __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 = 2344; __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 = 2231; __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 = 2344; __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":2230 + /* "sklearn/tree/_tree.pyx":2343 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -17413,7 +18011,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2234 +/* "sklearn/tree/_tree.pyx":2347 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -17444,7 +18042,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":2235 + /* "sklearn/tree/_tree.pyx":2348 * property children_right: * def __get__(self): * return self._get_node_ndarray()['right_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -17452,19 +18050,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 = 2235; __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 = 2348; __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 = 2235; __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 = 2348; __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 = 2235; __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 = 2348; __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":2234 + /* "sklearn/tree/_tree.pyx":2347 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -17484,7 +18082,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2238 +/* "sklearn/tree/_tree.pyx":2351 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -17515,7 +18113,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":2239 + /* "sklearn/tree/_tree.pyx":2352 * property feature: * def __get__(self): * return self._get_node_ndarray()['feature'][:self.node_count] # <<<<<<<<<<<<<< @@ -17523,19 +18121,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 = 2239; __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 = 2352; __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 = 2239; __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 = 2352; __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 = 2239; __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 = 2352; __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":2238 + /* "sklearn/tree/_tree.pyx":2351 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -17555,7 +18153,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2242 +/* "sklearn/tree/_tree.pyx":2355 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -17586,7 +18184,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":2243 + /* "sklearn/tree/_tree.pyx":2356 * property threshold: * def __get__(self): * return self._get_node_ndarray()['threshold'][:self.node_count] # <<<<<<<<<<<<<< @@ -17594,19 +18192,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 = 2243; __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 = 2356; __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 = 2243; __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 = 2356; __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 = 2243; __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 = 2356; __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":2242 + /* "sklearn/tree/_tree.pyx":2355 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -17626,7 +18224,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2246 +/* "sklearn/tree/_tree.pyx":2359 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -17657,7 +18255,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":2247 + /* "sklearn/tree/_tree.pyx":2360 * property impurity: * def __get__(self): * return self._get_node_ndarray()['impurity'][:self.node_count] # <<<<<<<<<<<<<< @@ -17665,19 +18263,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 = 2247; __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 = 2360; __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 = 2247; __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 = 2360; __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 = 2247; __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 = 2360; __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":2246 + /* "sklearn/tree/_tree.pyx":2359 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -17697,7 +18295,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2250 +/* "sklearn/tree/_tree.pyx":2363 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -17728,7 +18326,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":2251 + /* "sklearn/tree/_tree.pyx":2364 * property n_node_samples: * def __get__(self): * return self._get_node_ndarray()['n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -17736,19 +18334,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 = 2251; __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 = 2364; __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 = 2251; __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 = 2364; __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 = 2251; __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 = 2364; __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":2250 + /* "sklearn/tree/_tree.pyx":2363 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -17768,7 +18366,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2254 +/* "sklearn/tree/_tree.pyx":2367 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -17799,7 +18397,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":2255 + /* "sklearn/tree/_tree.pyx":2368 * property weighted_n_node_samples: * def __get__(self): * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< @@ -17807,19 +18405,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 = 2255; __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 = 2368; __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 = 2255; __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 = 2368; __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 = 2255; __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 = 2368; __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":2254 + /* "sklearn/tree/_tree.pyx":2367 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< @@ -17839,7 +18437,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2258 +/* "sklearn/tree/_tree.pyx":2371 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -17870,7 +18468,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":2259 + /* "sklearn/tree/_tree.pyx":2372 * property value: * def __get__(self): * return self._get_value_ndarray()[:self.node_count] # <<<<<<<<<<<<<< @@ -17878,16 +18476,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 = 2259; __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 = 2372; __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 = 2259; __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 = 2372; __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":2258 + /* "sklearn/tree/_tree.pyx":2371 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -17907,7 +18505,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2261 +/* "sklearn/tree/_tree.pyx":2374 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -17948,16 +18546,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 = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __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 = 2261; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; __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 = 2261; __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 = 2374; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -17966,19 +18564,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 = 2261; __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 = 2374; __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 = 2262; __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 = 2375; __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 = 2261; __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 = 2374; __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 = 2261; __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 = 2374; __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 */ @@ -18013,11 +18611,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 = 2261; __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 = 2374; __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":2265 + /* "sklearn/tree/_tree.pyx":2378 * """Constructor.""" * # Input/Output layout * self.n_features = n_features # <<<<<<<<<<<<<< @@ -18026,7 +18624,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":2266 + /* "sklearn/tree/_tree.pyx":2379 * # Input/Output layout * self.n_features = n_features * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -18035,7 +18633,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":2267 + /* "sklearn/tree/_tree.pyx":2380 * self.n_features = n_features * self.n_outputs = n_outputs * self.n_classes = NULL # <<<<<<<<<<<<<< @@ -18044,41 +18642,41 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_classes = NULL; - /* "sklearn/tree/_tree.pyx":2268 + /* "sklearn/tree/_tree.pyx":2381 * 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_t_1 = __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 = 2268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __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 = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2270 + /* "sklearn/tree/_tree.pyx":2383 * 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 = 2270; __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 = 2383; __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 = 2270; __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 = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 2270; __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 = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_n_classes)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_n_classes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n_classes)); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->max_n_classes = __pyx_t_5; - /* "sklearn/tree/_tree.pyx":2271 + /* "sklearn/tree/_tree.pyx":2384 * * self.max_n_classes = np.max(n_classes) * self.value_stride = n_outputs * self.max_n_classes # <<<<<<<<<<<<<< @@ -18087,7 +18685,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":2274 + /* "sklearn/tree/_tree.pyx":2387 * * cdef SIZE_t k * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -18098,7 +18696,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":2275 + /* "sklearn/tree/_tree.pyx":2388 * cdef SIZE_t k * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -18109,7 +18707,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":2278 + /* "sklearn/tree/_tree.pyx":2391 * * # Inner structures * self.max_depth = 0 # <<<<<<<<<<<<<< @@ -18118,7 +18716,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":2279 + /* "sklearn/tree/_tree.pyx":2392 * # Inner structures * self.max_depth = 0 * self.node_count = 0 # <<<<<<<<<<<<<< @@ -18127,7 +18725,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":2280 + /* "sklearn/tree/_tree.pyx":2393 * self.max_depth = 0 * self.node_count = 0 * self.capacity = 0 # <<<<<<<<<<<<<< @@ -18136,7 +18734,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->capacity = 0; - /* "sklearn/tree/_tree.pyx":2281 + /* "sklearn/tree/_tree.pyx":2394 * self.node_count = 0 * self.capacity = 0 * self.value = NULL # <<<<<<<<<<<<<< @@ -18145,7 +18743,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value = NULL; - /* "sklearn/tree/_tree.pyx":2282 + /* "sklearn/tree/_tree.pyx":2395 * self.capacity = 0 * self.value = NULL * self.nodes = NULL # <<<<<<<<<<<<<< @@ -18154,7 +18752,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->nodes = NULL; - /* "sklearn/tree/_tree.pyx":2261 + /* "sklearn/tree/_tree.pyx":2374 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -18183,7 +18781,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2284 +/* "sklearn/tree/_tree.pyx":2397 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -18206,7 +18804,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":2287 + /* "sklearn/tree/_tree.pyx":2400 * """Destructor.""" * # Free all inner structures * free(self.n_classes) # <<<<<<<<<<<<<< @@ -18215,7 +18813,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":2288 + /* "sklearn/tree/_tree.pyx":2401 * # Free all inner structures * free(self.n_classes) * free(self.value) # <<<<<<<<<<<<<< @@ -18224,7 +18822,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":2289 + /* "sklearn/tree/_tree.pyx":2402 * free(self.n_classes) * free(self.value) * free(self.nodes) # <<<<<<<<<<<<<< @@ -18233,7 +18831,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":2284 + /* "sklearn/tree/_tree.pyx":2397 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -18245,7 +18843,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2291 +/* "sklearn/tree/_tree.pyx":2404 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -18279,7 +18877,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":2293 + /* "sklearn/tree/_tree.pyx":2406 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< @@ -18287,37 +18885,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 = 2293; __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 = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2294 + /* "sklearn/tree/_tree.pyx":2407 * """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 = 2294; __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 = 2407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2295 + /* "sklearn/tree/_tree.pyx":2408 * 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 = 2295; __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 = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2293 + /* "sklearn/tree/_tree.pyx":2406 * 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 = 2293; __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 = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -18329,27 +18927,27 @@ 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":2295 + /* "sklearn/tree/_tree.pyx":2408 * 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_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __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 = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/tree/_tree.pyx":2293 + /* "sklearn/tree/_tree.pyx":2406 * 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __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 = 2406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_Tree))); @@ -18364,7 +18962,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o __pyx_t_3 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2291 + /* "sklearn/tree/_tree.pyx":2404 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -18386,7 +18984,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2297 +/* "sklearn/tree/_tree.pyx":2410 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -18418,55 +19016,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":2299 + /* "sklearn/tree/_tree.pyx":2412 * 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 = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __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":2300 + /* "sklearn/tree/_tree.pyx":2413 * """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 = 2300; __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 = 2413; __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 = 2300; __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 = 2413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2301 + /* "sklearn/tree/_tree.pyx":2414 * 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 = 2301; __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 = 2414; __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 = 2301; __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 = 2414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2302 + /* "sklearn/tree/_tree.pyx":2415 * 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 = 2302; __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 = 2415; __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 = 2302; __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 = 2415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2303 + /* "sklearn/tree/_tree.pyx":2416 * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() * return d # <<<<<<<<<<<<<< @@ -18478,7 +19076,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":2297 + /* "sklearn/tree/_tree.pyx":2410 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -18498,7 +19096,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2305 +/* "sklearn/tree/_tree.pyx":2418 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -18547,101 +19145,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":2307 + /* "sklearn/tree/_tree.pyx":2420 * 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 = 2307; __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 = 2420; __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 = 2307; __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 = 2420; __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":2309 + /* "sklearn/tree/_tree.pyx":2422 * 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 = 2309; __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 = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2310 + /* "sklearn/tree/_tree.pyx":2423 * * 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_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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 = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2313 + /* "sklearn/tree/_tree.pyx":2426 * '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 = 2313; __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 = 2426; __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":2314 + /* "sklearn/tree/_tree.pyx":2427 * * 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 = 2314; __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 = 2427; __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":2316 + /* "sklearn/tree/_tree.pyx":2429 * 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 = 2316; __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 = 2429; __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 = 2316; __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 = 2429; __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 = 2316; __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 = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2317 + /* "sklearn/tree/_tree.pyx":2430 * * 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 = 2317; __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 = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":2316 + /* "sklearn/tree/_tree.pyx":2429 * 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 = 2316; __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 = 2429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -18655,106 +19253,106 @@ 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":2318 + /* "sklearn/tree/_tree.pyx":2431 * 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 = 2318; __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 = 2431; __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 = 2318; __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 = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2319 + /* "sklearn/tree/_tree.pyx":2432 * 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 = 2319; __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 = 2432; __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 = 2319; __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 = 2432; __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 = 2319; __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 = 2432; __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 = 2319; __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 = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2320 + /* "sklearn/tree/_tree.pyx":2433 * 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 = 2320; __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 = 2433; __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 = 2320; __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 = 2433; __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 = 2320; __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 = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = (!__pyx_t_8); if (!__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":2321 + /* "sklearn/tree/_tree.pyx":2434 * 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 = 2321; __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 = 2434; __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 = 2321; __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 = 2434; __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 = 2321; __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 = 2434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":2322 + /* "sklearn/tree/_tree.pyx":2435 * 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 = 2322; __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 = 2435; __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 = 2322; __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 = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = (!__pyx_t_10); if (!__pyx_t_11) { - /* "sklearn/tree/_tree.pyx":2323 + /* "sklearn/tree/_tree.pyx":2436 * 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 = 2323; __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 = 2436; __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 = 2323; __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 = 2436; __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 = 2323; __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 = 2436; __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 = 2323; __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 = 2436; __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_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __pyx_t_10; } else { @@ -18778,37 +19376,37 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx } if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2324 + /* "sklearn/tree/_tree.pyx":2437 * 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__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2437; __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 = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2326 + /* "sklearn/tree/_tree.pyx":2439 * 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 = 2326; __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 = 2439; __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 = 2326; __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 = 2439; __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 = 2326; __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 = 2439; __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":2327 + /* "sklearn/tree/_tree.pyx":2440 * * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: # <<<<<<<<<<<<<< @@ -18821,32 +19419,32 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx __pyx_t_3 = ((__pyx_t_13 != 0) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2328 + /* "sklearn/tree/_tree.pyx":2441 * 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 = 2328; __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 = 2441; __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 = 2328; __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 = 2441; __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 = 2328; __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 = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__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 = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2441; __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 = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2329 + /* "sklearn/tree/_tree.pyx":2442 * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) * nodes = memcpy(self.nodes, ( node_ndarray).data, # <<<<<<<<<<<<<< @@ -18855,7 +19453,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":2331 + /* "sklearn/tree/_tree.pyx":2444 * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) * value = memcpy(self.value, ( value_ndarray).data, # <<<<<<<<<<<<<< @@ -18864,7 +19462,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":2305 + /* "sklearn/tree/_tree.pyx":2418 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -18891,7 +19489,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2334 +/* "sklearn/tree/_tree.pyx":2447 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -18909,7 +19507,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":2337 + /* "sklearn/tree/_tree.pyx":2450 * """Resize all inner arrays to `capacity`, if `capacity` == -1, then * double the size of the inner arrays.""" * if self._resize_c(capacity)!= 0: # <<<<<<<<<<<<<< @@ -18922,17 +19520,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":2338 + /* "sklearn/tree/_tree.pyx":2451 * 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 = 2338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2334 + /* "sklearn/tree/_tree.pyx":2447 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity) except *: # <<<<<<<<<<<<<< @@ -18948,7 +19546,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2342 +/* "sklearn/tree/_tree.pyx":2455 * # 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: # <<<<<<<<<<<<<< @@ -18969,7 +19567,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } } - /* "sklearn/tree/_tree.pyx":2344 + /* "sklearn/tree/_tree.pyx":2457 * 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: # <<<<<<<<<<<<<< @@ -18985,7 +19583,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2345 + /* "sklearn/tree/_tree.pyx":2458 * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: * return 0 # <<<<<<<<<<<<<< @@ -18996,7 +19594,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2347 + /* "sklearn/tree/_tree.pyx":2460 * return 0 * * if capacity == (-1): # <<<<<<<<<<<<<< @@ -19006,7 +19604,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_3 = ((__pyx_v_capacity == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2348 + /* "sklearn/tree/_tree.pyx":2461 * * if capacity == (-1): * if self.capacity == 0: # <<<<<<<<<<<<<< @@ -19016,7 +19614,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_3 = ((__pyx_v_self->capacity == 0) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2349 + /* "sklearn/tree/_tree.pyx":2462 * if capacity == (-1): * if self.capacity == 0: * capacity = 3 # default initial value # <<<<<<<<<<<<<< @@ -19028,7 +19626,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":2351 + /* "sklearn/tree/_tree.pyx":2464 * capacity = 3 # default initial value * else: * capacity = 2 * self.capacity # <<<<<<<<<<<<<< @@ -19042,7 +19640,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":2354 + /* "sklearn/tree/_tree.pyx":2467 * * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) # <<<<<<<<<<<<<< @@ -19051,7 +19649,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":2355 + /* "sklearn/tree/_tree.pyx":2468 * # XXX no safe_realloc here because we need to grab the GIL * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -19061,7 +19659,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_3 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2356 + /* "sklearn/tree/_tree.pyx":2469 * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -19072,7 +19670,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2357 + /* "sklearn/tree/_tree.pyx":2470 * if ptr == NULL: * return -1 * self.nodes = ptr # <<<<<<<<<<<<<< @@ -19081,7 +19679,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":2358 + /* "sklearn/tree/_tree.pyx":2471 * return -1 * self.nodes = ptr * ptr = realloc(self.value, # <<<<<<<<<<<<<< @@ -19090,7 +19688,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":2360 + /* "sklearn/tree/_tree.pyx":2473 * ptr = realloc(self.value, * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -19100,7 +19698,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_3 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2361 + /* "sklearn/tree/_tree.pyx":2474 * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -19111,7 +19709,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2362 + /* "sklearn/tree/_tree.pyx":2475 * if ptr == NULL: * return -1 * self.value = ptr # <<<<<<<<<<<<<< @@ -19120,7 +19718,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":2365 + /* "sklearn/tree/_tree.pyx":2478 * * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: # <<<<<<<<<<<<<< @@ -19130,7 +19728,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_3 = ((__pyx_v_capacity > __pyx_v_self->capacity) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2366 + /* "sklearn/tree/_tree.pyx":2479 * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: * memset((self.value + self.capacity * self.value_stride), 0, # <<<<<<<<<<<<<< @@ -19142,7 +19740,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":2371 + /* "sklearn/tree/_tree.pyx":2484 * * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: # <<<<<<<<<<<<<< @@ -19152,7 +19750,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea __pyx_t_3 = ((__pyx_v_capacity < __pyx_v_self->node_count) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2372 + /* "sklearn/tree/_tree.pyx":2485 * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: * self.node_count = capacity # <<<<<<<<<<<<<< @@ -19164,7 +19762,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":2374 + /* "sklearn/tree/_tree.pyx":2487 * self.node_count = capacity * * self.capacity = capacity # <<<<<<<<<<<<<< @@ -19173,7 +19771,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":2375 + /* "sklearn/tree/_tree.pyx":2488 * * self.capacity = capacity * return 0 # <<<<<<<<<<<<<< @@ -19183,7 +19781,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":2342 + /* "sklearn/tree/_tree.pyx":2455 * # 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: # <<<<<<<<<<<<<< @@ -19196,7 +19794,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2377 +/* "sklearn/tree/_tree.pyx":2490 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -19211,7 +19809,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":2386 + /* "sklearn/tree/_tree.pyx":2499 * Returns (size_t)(-1) on error. * """ * cdef SIZE_t node_id = self.node_count # <<<<<<<<<<<<<< @@ -19221,7 +19819,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":2388 + /* "sklearn/tree/_tree.pyx":2501 * cdef SIZE_t node_id = self.node_count * * if node_id >= self.capacity: # <<<<<<<<<<<<<< @@ -19231,7 +19829,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":2389 + /* "sklearn/tree/_tree.pyx":2502 * * if node_id >= self.capacity: * if self._resize_c() != 0: # <<<<<<<<<<<<<< @@ -19241,7 +19839,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":2390 + /* "sklearn/tree/_tree.pyx":2503 * if node_id >= self.capacity: * if self._resize_c() != 0: * return (-1) # <<<<<<<<<<<<<< @@ -19255,7 +19853,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2392 + /* "sklearn/tree/_tree.pyx":2505 * return (-1) * * cdef Node* node = &self.nodes[node_id] # <<<<<<<<<<<<<< @@ -19264,7 +19862,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":2393 + /* "sklearn/tree/_tree.pyx":2506 * * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity # <<<<<<<<<<<<<< @@ -19273,7 +19871,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":2394 + /* "sklearn/tree/_tree.pyx":2507 * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity * node.n_node_samples = n_node_samples # <<<<<<<<<<<<<< @@ -19282,7 +19880,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":2395 + /* "sklearn/tree/_tree.pyx":2508 * node.impurity = impurity * node.n_node_samples = n_node_samples * node.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -19291,7 +19889,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":2397 + /* "sklearn/tree/_tree.pyx":2510 * node.weighted_n_node_samples = weighted_n_node_samples * * if parent != _TREE_UNDEFINED: # <<<<<<<<<<<<<< @@ -19301,7 +19899,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":2398 + /* "sklearn/tree/_tree.pyx":2511 * * if parent != _TREE_UNDEFINED: * if is_left: # <<<<<<<<<<<<<< @@ -19311,7 +19909,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":2399 + /* "sklearn/tree/_tree.pyx":2512 * if parent != _TREE_UNDEFINED: * if is_left: * self.nodes[parent].left_child = node_id # <<<<<<<<<<<<<< @@ -19323,7 +19921,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":2401 + /* "sklearn/tree/_tree.pyx":2514 * self.nodes[parent].left_child = node_id * else: * self.nodes[parent].right_child = node_id # <<<<<<<<<<<<<< @@ -19337,7 +19935,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2403 + /* "sklearn/tree/_tree.pyx":2516 * self.nodes[parent].right_child = node_id * * if is_leaf: # <<<<<<<<<<<<<< @@ -19347,7 +19945,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":2404 + /* "sklearn/tree/_tree.pyx":2517 * * if is_leaf: * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -19356,7 +19954,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":2405 + /* "sklearn/tree/_tree.pyx":2518 * if is_leaf: * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -19365,7 +19963,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":2406 + /* "sklearn/tree/_tree.pyx":2519 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -19374,7 +19972,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":2407 + /* "sklearn/tree/_tree.pyx":2520 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -19386,7 +19984,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":2411 + /* "sklearn/tree/_tree.pyx":2524 * else: * # left_child and right_child will be set later * node.feature = feature # <<<<<<<<<<<<<< @@ -19395,7 +19993,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":2412 + /* "sklearn/tree/_tree.pyx":2525 * # left_child and right_child will be set later * node.feature = feature * node.threshold = threshold # <<<<<<<<<<<<<< @@ -19406,7 +20004,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":2414 + /* "sklearn/tree/_tree.pyx":2527 * node.threshold = threshold * * self.node_count += 1 # <<<<<<<<<<<<<< @@ -19415,7 +20013,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":2416 + /* "sklearn/tree/_tree.pyx":2529 * self.node_count += 1 * * return node_id # <<<<<<<<<<<<<< @@ -19425,7 +20023,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":2377 + /* "sklearn/tree/_tree.pyx":2490 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< @@ -19438,7 +20036,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2418 +/* "sklearn/tree/_tree.pyx":2531 * return node_id * * cpdef np.ndarray predict(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19468,26 +20066,26 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; /* Check if called by wrapper */ 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 = 2418; __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 = 2531; __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)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __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 = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_X)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_X)); __Pyx_GIVEREF(((PyObject *)__pyx_v_X)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2418; __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 = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19496,30 +20094,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":2420 + /* "sklearn/tree/_tree.pyx":2533 * cpdef np.ndarray predict(self, np.ndarray[DTYPE_t, ndim=2] 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 = 2420; __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 = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_take); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_take); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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, ((PyArrayObject *)__pyx_v_X), 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __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, ((PyArrayObject *)__pyx_v_X), 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __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 = 2420; __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 = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __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 = 2420; __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 = 2420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; __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 = 2533; __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 = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -19527,7 +20125,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_v_out = __pyx_t_4; __pyx_t_4 = 0; - /* "sklearn/tree/_tree.pyx":2422 + /* "sklearn/tree/_tree.pyx":2535 * out = self._get_value_ndarray().take(self.apply(X), axis=0, * mode='clip') * if self.n_outputs == 1: # <<<<<<<<<<<<<< @@ -19537,20 +20135,20 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __pyx_t_5 = ((__pyx_v_self->n_outputs == 1) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":2423 + /* "sklearn/tree/_tree.pyx":2536 * mode='clip') * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) # <<<<<<<<<<<<<< * return out * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->max_n_classes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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 = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -19558,7 +20156,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19568,7 +20166,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2424 + /* "sklearn/tree/_tree.pyx":2537 * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) * return out # <<<<<<<<<<<<<< @@ -19576,12 +20174,12 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] 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 = 2424; __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 = 2537; __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":2418 + /* "sklearn/tree/_tree.pyx":2531 * return node_id * * cpdef np.ndarray predict(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19621,7 +20219,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_4Tree_11predict(PyObject *__pyx_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("predict (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(((struct __pyx_obj_7sklearn_4tree_5_tree_Tree *)__pyx_v_self), ((PyArrayObject *)__pyx_v_X)); /* function exit code */ @@ -19649,11 +20247,11 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->predict(__pyx_v_self, ((PyArrayObject *)__pyx_v_X), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->predict(__pyx_v_self, ((PyArrayObject *)__pyx_v_X), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19677,7 +20275,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2426 +/* "sklearn/tree/_tree.pyx":2539 * return out * * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19724,26 +20322,26 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; /* Check if called by wrapper */ 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 = 2426; __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 = 2539; __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)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __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 = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_X)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_X)); __Pyx_GIVEREF(((PyObject *)__pyx_v_X)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2426; __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 = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19752,7 +20350,7 @@ 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":2428 + /* "sklearn/tree/_tree.pyx":2541 * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] X): * """Finds the terminal region (=leaf node) for each sample in X.""" * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< @@ -19761,7 +20359,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj */ __pyx_v_n_samples = (__pyx_v_X->dimensions[0]); - /* "sklearn/tree/_tree.pyx":2429 + /* "sklearn/tree/_tree.pyx":2542 * """Finds the terminal region (=leaf node) for each sample in X.""" * cdef SIZE_t n_samples = X.shape[0] * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -19770,7 +20368,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":2430 + /* "sklearn/tree/_tree.pyx":2543 * cdef SIZE_t n_samples = X.shape[0] * cdef Node* node = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -19779,51 +20377,51 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":2432 + /* "sklearn/tree/_tree.pyx":2545 * cdef SIZE_t i = 0 * * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) # <<<<<<<<<<<<<< * cdef SIZE_t* out_data = out.data * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __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 = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __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 = 2432; __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 = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__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 = 2432; __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 = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __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 = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2432; __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 = 2545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_out.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__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 = 2432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; __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]; } } @@ -19831,7 +20429,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_v_out = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":2433 + /* "sklearn/tree/_tree.pyx":2546 * * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) * cdef SIZE_t* out_data = out.data # <<<<<<<<<<<<<< @@ -19840,7 +20438,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj */ __pyx_v_out_data = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)__pyx_v_out->data); - /* "sklearn/tree/_tree.pyx":2435 + /* "sklearn/tree/_tree.pyx":2548 * cdef SIZE_t* out_data = out.data * * with nogil: # <<<<<<<<<<<<<< @@ -19854,7 +20452,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2436 + /* "sklearn/tree/_tree.pyx":2549 * * with nogil: * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -19865,7 +20463,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":2437 + /* "sklearn/tree/_tree.pyx":2550 * with nogil: * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -19875,7 +20473,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_t_9 = __pyx_v_self->nodes; __pyx_v_node = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":2440 + /* "sklearn/tree/_tree.pyx":2553 * * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -19886,7 +20484,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_t_10 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (!__pyx_t_10) break; - /* "sklearn/tree/_tree.pyx":2442 + /* "sklearn/tree/_tree.pyx":2555 * while node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * if X[i, node.feature] <= node.threshold: # <<<<<<<<<<<<<< @@ -19898,7 +20496,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_t_10 = (((*__Pyx_BufPtrStrided2d(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *, __pyx_pybuffernd_X.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_X.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_X.diminfo[1].strides)) <= __pyx_v_node->threshold) != 0); if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":2443 + /* "sklearn/tree/_tree.pyx":2556 * # ... and node.right_child != _TREE_LEAF: * if X[i, node.feature] <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -19910,7 +20508,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } /*else*/ { - /* "sklearn/tree/_tree.pyx":2445 + /* "sklearn/tree/_tree.pyx":2558 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -19922,7 +20520,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":2447 + /* "sklearn/tree/_tree.pyx":2560 * node = &self.nodes[node.right_child] * * out_data[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -19933,7 +20531,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } - /* "sklearn/tree/_tree.pyx":2435 + /* "sklearn/tree/_tree.pyx":2548 * cdef SIZE_t* out_data = out.data * * with nogil: # <<<<<<<<<<<<<< @@ -19951,7 +20549,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } - /* "sklearn/tree/_tree.pyx":2449 + /* "sklearn/tree/_tree.pyx":2562 * out_data[i] = (node - self.nodes) # node offset * * return out # <<<<<<<<<<<<<< @@ -19963,7 +20561,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_r = ((PyArrayObject *)__pyx_v_out); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2426 + /* "sklearn/tree/_tree.pyx":2539 * return out * * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -20006,7 +20604,7 @@ static PyObject *__pyx_pw_7sklearn_4tree_5_tree_4Tree_13apply(PyObject *__pyx_v_ PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(((struct __pyx_obj_7sklearn_4tree_5_tree_Tree *)__pyx_v_self), ((PyArrayObject *)__pyx_v_X)); /* function exit code */ @@ -20034,11 +20632,11 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 __pyx_pybuffernd_X.rcbuffer = &__pyx_pybuffer_X; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_7sklearn_4tree_5_tree_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_X.diminfo[0].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_X.diminfo[0].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_X.diminfo[1].strides = __pyx_pybuffernd_X.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_X.diminfo[1].shape = __pyx_pybuffernd_X.rcbuffer->pybuffer.shape[1]; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->apply(__pyx_v_self, ((PyArrayObject *)__pyx_v_X), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __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, ((PyArrayObject *)__pyx_v_X), 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20062,7 +20660,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2451 +/* "sklearn/tree/_tree.pyx":2564 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -20113,16 +20711,16 @@ 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 = 2451; __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 = 2564; __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); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __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 = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_normalize); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_normalize); __Pyx_GIVEREF(__pyx_v_normalize); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -20133,7 +20731,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":2455 + /* "sklearn/tree/_tree.pyx":2568 * cdef Node* left * cdef Node* right * cdef Node* nodes = self.nodes # <<<<<<<<<<<<<< @@ -20143,7 +20741,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_4 = __pyx_v_self->nodes; __pyx_v_nodes = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2456 + /* "sklearn/tree/_tree.pyx":2569 * cdef Node* right * cdef Node* nodes = self.nodes * cdef Node* node = nodes # <<<<<<<<<<<<<< @@ -20152,7 +20750,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_node = __pyx_v_nodes; - /* "sklearn/tree/_tree.pyx":2457 + /* "sklearn/tree/_tree.pyx":2570 * cdef Node* nodes = self.nodes * cdef Node* node = nodes * cdef Node* end_node = node + self.node_count # <<<<<<<<<<<<<< @@ -20161,35 +20759,35 @@ 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":2460 + /* "sklearn/tree/_tree.pyx":2573 * * cdef np.ndarray[np.float64_t, ndim=1] importances * importances = np.zeros((self.n_features,)) # <<<<<<<<<<<<<< * * while node != end_node: */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __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 = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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 = 2460; __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 = 2573; __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 = 2460; __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 = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__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 = 2460; __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 = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __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; - if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __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 = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20205,13 +20803,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_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = 0; __pyx_v_importances = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2462 + /* "sklearn/tree/_tree.pyx":2575 * importances = np.zeros((self.n_features,)) * * while node != end_node: # <<<<<<<<<<<<<< @@ -20222,7 +20820,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_10 = ((__pyx_v_node != __pyx_v_end_node) != 0); if (!__pyx_t_10) break; - /* "sklearn/tree/_tree.pyx":2463 + /* "sklearn/tree/_tree.pyx":2576 * * while node != end_node: * if node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -20232,7 +20830,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_10 = ((__pyx_v_node->left_child != __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF) != 0); if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":2465 + /* "sklearn/tree/_tree.pyx":2578 * if node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] # <<<<<<<<<<<<<< @@ -20241,7 +20839,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":2466 + /* "sklearn/tree/_tree.pyx":2579 * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] * right = &nodes[node.right_child] # <<<<<<<<<<<<<< @@ -20250,7 +20848,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":2468 + /* "sklearn/tree/_tree.pyx":2581 * right = &nodes[node.right_child] * * importances[node.feature] += ( # <<<<<<<<<<<<<< @@ -20263,7 +20861,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2472 + /* "sklearn/tree/_tree.pyx":2585 * left.weighted_n_node_samples * left.impurity - * right.weighted_n_node_samples * right.impurity) * node += 1 # <<<<<<<<<<<<<< @@ -20273,19 +20871,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_v_node = (__pyx_v_node + 1); } - /* "sklearn/tree/_tree.pyx":2474 + /* "sklearn/tree/_tree.pyx":2587 * node += 1 * * importances = importances / nodes[0].weighted_n_node_samples # <<<<<<<<<<<<<< * cdef double normalizer * */ - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_node_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_node_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_importances), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_importances), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2474; __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 = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20301,48 +20899,48 @@ 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_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2477 + /* "sklearn/tree/_tree.pyx":2590 * cdef double normalizer * * if normalize: # <<<<<<<<<<<<<< * normalizer = np.sum(importances) * */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_normalize); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_normalize); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":2478 + /* "sklearn/tree/_tree.pyx":2591 * * 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 = 2478; __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 = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __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 = 2478; __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 = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_importances)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_importances)); __Pyx_GIVEREF(((PyObject *)__pyx_v_importances)); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_normalizer = __pyx_t_12; - /* "sklearn/tree/_tree.pyx":2480 + /* "sklearn/tree/_tree.pyx":2593 * normalizer = np.sum(importances) * * if normalizer > 0.0: # <<<<<<<<<<<<<< @@ -20352,19 +20950,19 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances __pyx_t_10 = ((__pyx_v_normalizer > 0.0) != 0); if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":2482 + /* "sklearn/tree/_tree.pyx":2595 * 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 = 2482; __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 = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_importances), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __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 = 2482; __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 = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20380,7 +20978,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_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_1)); @@ -20392,7 +20990,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":2484 + /* "sklearn/tree/_tree.pyx":2597 * importances /= normalizer * * return importances # <<<<<<<<<<<<<< @@ -20404,7 +21002,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":2451 + /* "sklearn/tree/_tree.pyx":2564 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -20465,7 +21063,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 = 2451; __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 = 2564; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20478,7 +21076,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 = 2451; __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 = 2564; __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(); @@ -20503,7 +21101,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 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->compute_feature_importances(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = ((struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *)__pyx_v_self->__pyx_vtab)->compute_feature_importances(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20520,7 +21118,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2486 +/* "sklearn/tree/_tree.pyx":2599 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -20539,7 +21137,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":2493 + /* "sklearn/tree/_tree.pyx":2606 * """ * cdef np.npy_intp shape[3] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -20548,7 +21146,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":2494 + /* "sklearn/tree/_tree.pyx":2607 * cdef np.npy_intp shape[3] * shape[0] = self.node_count * shape[1] = self.n_outputs # <<<<<<<<<<<<<< @@ -20557,7 +21155,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":2495 + /* "sklearn/tree/_tree.pyx":2608 * shape[0] = self.node_count * shape[1] = self.n_outputs * shape[2] = self.max_n_classes # <<<<<<<<<<<<<< @@ -20566,20 +21164,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":2497 + /* "sklearn/tree/_tree.pyx":2610 * 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 = 2497; __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 = 2610; __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 = 2497; __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 = 2610; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2498 + /* "sklearn/tree/_tree.pyx":2611 * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -20588,7 +21186,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":2499 + /* "sklearn/tree/_tree.pyx":2612 * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -20597,7 +21195,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":2500 + /* "sklearn/tree/_tree.pyx":2613 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -20609,7 +21207,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2486 + /* "sklearn/tree/_tree.pyx":2599 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -20629,7 +21227,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2502 +/* "sklearn/tree/_tree.pyx":2615 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -20650,7 +21248,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":2510 + /* "sklearn/tree/_tree.pyx":2623 * """ * cdef np.npy_intp shape[1] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -20659,7 +21257,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":2512 + /* "sklearn/tree/_tree.pyx":2625 * shape[0] = self.node_count * cdef np.npy_intp strides[1] * strides[0] = sizeof(Node) # <<<<<<<<<<<<<< @@ -20668,51 +21266,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":2514 + /* "sklearn/tree/_tree.pyx":2627 * 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 = 2514; __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 = 2627; __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":2515 + /* "sklearn/tree/_tree.pyx":2628 * 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 = 2515; __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 = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2517 + /* "sklearn/tree/_tree.pyx":2630 * 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 = 2515; __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 = 2628; __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":2515 + /* "sklearn/tree/_tree.pyx":2628 * 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 = 2515; __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 = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2518 + /* "sklearn/tree/_tree.pyx":2631 * strides, self.nodes, * np.NPY_DEFAULT, None) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -20721,7 +21319,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":2519 + /* "sklearn/tree/_tree.pyx":2632 * np.NPY_DEFAULT, None) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -20730,7 +21328,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":2520 + /* "sklearn/tree/_tree.pyx":2633 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -20742,7 +21340,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru __pyx_r = __pyx_v_arr; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2502 + /* "sklearn/tree/_tree.pyx":2615 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -20763,7 +21361,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":166 * * # Input/Output layout * cdef public SIZE_t n_features # Number of features in X # <<<<<<<<<<<<<< @@ -20793,7 +21391,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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20831,7 +21429,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 = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_features = __pyx_t_1; /* function exit code */ @@ -20845,7 +21443,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":168 * 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 # <<<<<<<<<<<<<< @@ -20875,7 +21473,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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20913,7 +21511,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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_outputs = __pyx_t_1; /* function exit code */ @@ -20927,7 +21525,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":169 * 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) # <<<<<<<<<<<<<< @@ -20957,7 +21555,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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20995,7 +21593,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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_n_classes = __pyx_t_1; /* function exit code */ @@ -21009,7 +21607,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":173 * # 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 # <<<<<<<<<<<<<< @@ -21039,7 +21637,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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21077,7 +21675,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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_depth = __pyx_t_1; /* function exit code */ @@ -21091,7 +21689,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":174 * # 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 # <<<<<<<<<<<<<< @@ -21121,7 +21719,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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21159,7 +21757,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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->node_count = __pyx_t_1; /* function exit code */ @@ -21173,7 +21771,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":175 * 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 # <<<<<<<<<<<<<< @@ -21203,7 +21801,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 = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21241,7 +21839,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 = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->capacity = __pyx_t_1; /* function exit code */ @@ -21255,7 +21853,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2538 +/* "sklearn/tree/_tree.pyx":2651 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t n) except *: # <<<<<<<<<<<<<< @@ -21275,7 +21873,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":2541 + /* "sklearn/tree/_tree.pyx":2654 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * n *= sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -21284,7 +21882,7 @@ static __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_fuse_0__pyx_f_7sklearn_4tree */ __pyx_v_n = (__pyx_v_n * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":2542 + /* "sklearn/tree/_tree.pyx":2655 * # 0.20.1 to crash. * n *= sizeof(p[0][0]) * cdef realloc_ptr tmp = realloc(p[0], n) # <<<<<<<<<<<<<< @@ -21293,7 +21891,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_n)); - /* "sklearn/tree/_tree.pyx":2543 + /* "sklearn/tree/_tree.pyx":2656 * n *= sizeof(p[0][0]) * cdef realloc_ptr tmp = realloc(p[0], n) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -21303,32 +21901,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":2544 + /* "sklearn/tree/_tree.pyx":2657 * cdef realloc_ptr tmp = realloc(p[0], n) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % n) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 2544; __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 = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2546 + /* "sklearn/tree/_tree.pyx":2659 * raise MemoryError("could not allocate %d bytes" % n) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -21337,7 +21935,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":2547 + /* "sklearn/tree/_tree.pyx":2660 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -21347,7 +21945,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":2538 + /* "sklearn/tree/_tree.pyx":2651 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t n) except *: # <<<<<<<<<<<<<< @@ -21378,7 +21976,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":2541 + /* "sklearn/tree/_tree.pyx":2654 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * n *= sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -21387,7 +21985,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_fuse_1__pyx_f_7sklearn_4tree_ */ __pyx_v_n = (__pyx_v_n * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":2542 + /* "sklearn/tree/_tree.pyx":2655 * # 0.20.1 to crash. * n *= sizeof(p[0][0]) * cdef realloc_ptr tmp = realloc(p[0], n) # <<<<<<<<<<<<<< @@ -21396,7 +21994,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_n)); - /* "sklearn/tree/_tree.pyx":2543 + /* "sklearn/tree/_tree.pyx":2656 * n *= sizeof(p[0][0]) * cdef realloc_ptr tmp = realloc(p[0], n) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -21406,32 +22004,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":2544 + /* "sklearn/tree/_tree.pyx":2657 * cdef realloc_ptr tmp = realloc(p[0], n) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % n) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 2544; __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 = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2546 + /* "sklearn/tree/_tree.pyx":2659 * raise MemoryError("could not allocate %d bytes" % n) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -21440,7 +22038,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":2547 + /* "sklearn/tree/_tree.pyx":2660 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -21450,7 +22048,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":2538 + /* "sklearn/tree/_tree.pyx":2651 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t n) except *: # <<<<<<<<<<<<<< @@ -21481,7 +22079,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":2541 + /* "sklearn/tree/_tree.pyx":2654 * # sizeof(realloc_ptr[0]) would be more like idiomatic C, but causes Cython * # 0.20.1 to crash. * n *= sizeof(p[0][0]) # <<<<<<<<<<<<<< @@ -21490,7 +22088,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns */ __pyx_v_n = (__pyx_v_n * (sizeof(((__pyx_v_p[0])[0])))); - /* "sklearn/tree/_tree.pyx":2542 + /* "sklearn/tree/_tree.pyx":2655 * # 0.20.1 to crash. * n *= sizeof(p[0][0]) * cdef realloc_ptr tmp = realloc(p[0], n) # <<<<<<<<<<<<<< @@ -21499,7 +22097,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_n)); - /* "sklearn/tree/_tree.pyx":2543 + /* "sklearn/tree/_tree.pyx":2656 * n *= sizeof(p[0][0]) * cdef realloc_ptr tmp = realloc(p[0], n) * if tmp == NULL: # <<<<<<<<<<<<<< @@ -21509,32 +22107,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":2544 + /* "sklearn/tree/_tree.pyx":2657 * cdef realloc_ptr tmp = realloc(p[0], n) * if tmp == NULL: * raise MemoryError("could not allocate %d bytes" % n) # <<<<<<<<<<<<<< * * p[0] = tmp */ - __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 2544; __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 = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2546 + /* "sklearn/tree/_tree.pyx":2659 * raise MemoryError("could not allocate %d bytes" % n) * * p[0] = tmp # <<<<<<<<<<<<<< @@ -21543,7 +22141,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":2547 + /* "sklearn/tree/_tree.pyx":2660 * * p[0] = tmp * return tmp # for convenience # <<<<<<<<<<<<<< @@ -21553,7 +22151,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":2538 + /* "sklearn/tree/_tree.pyx":2651 * (unsigned char*) * * cdef realloc_ptr safe_realloc(realloc_ptr* p, size_t n) except *: # <<<<<<<<<<<<<< @@ -21572,7 +22170,7 @@ static unsigned char *__pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc(uns return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2550 +/* "sklearn/tree/_tree.pyx":2663 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -21607,7 +22205,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":2552 + /* "sklearn/tree/_tree.pyx":2665 * def _realloc_test(): * # Helper for tests. Should raise an exception. * cdef unsigned char* p = NULL # <<<<<<<<<<<<<< @@ -21616,16 +22214,16 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ __pyx_v_p = NULL; - /* "sklearn/tree/_tree.pyx":2553 + /* "sklearn/tree/_tree.pyx":2666 * # Helper for tests. Should raise an exception. * cdef unsigned char* p = NULL * safe_realloc(&p, (-1)) # <<<<<<<<<<<<<< * if p != NULL: * free(p) */ - __pyx_t_1 = __pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_p), ((size_t)-1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __pyx_fuse_2__pyx_f_7sklearn_4tree_5_tree_safe_realloc((&__pyx_v_p), ((size_t)-1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2554 + /* "sklearn/tree/_tree.pyx":2667 * cdef unsigned char* p = NULL * safe_realloc(&p, (-1)) * if p != NULL: # <<<<<<<<<<<<<< @@ -21635,7 +22233,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb __pyx_t_2 = ((__pyx_v_p != NULL) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2555 + /* "sklearn/tree/_tree.pyx":2668 * safe_realloc(&p, (-1)) * if p != NULL: * free(p) # <<<<<<<<<<<<<< @@ -21644,7 +22242,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb */ free(__pyx_v_p); - /* "sklearn/tree/_tree.pyx":2556 + /* "sklearn/tree/_tree.pyx":2669 * if p != NULL: * free(p) * assert False, "we just allocated %d bytes!" % (-1) # <<<<<<<<<<<<<< @@ -21654,14 +22252,14 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!0)) { - __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)-1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)-1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_we_just_allocated_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_we_just_allocated_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif @@ -21669,7 +22267,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2550 + /* "sklearn/tree/_tree.pyx":2663 * * * def _realloc_test(): # <<<<<<<<<<<<<< @@ -21691,7 +22289,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree__realloc_test(CYTHON_UNUSED PyOb return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2561 +/* "sklearn/tree/_tree.pyx":2674 * # 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: # <<<<<<<<<<<<<< @@ -21703,7 +22301,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":2562 + /* "sklearn/tree/_tree.pyx":2675 * # 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) # <<<<<<<<<<<<<< @@ -21713,7 +22311,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":2563 + /* "sklearn/tree/_tree.pyx":2676 * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) # <<<<<<<<<<<<<< @@ -21723,7 +22321,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":2564 + /* "sklearn/tree/_tree.pyx":2677 * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) * seed[0] ^= (seed[0] << 5) # <<<<<<<<<<<<<< @@ -21733,7 +22331,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":2566 + /* "sklearn/tree/_tree.pyx":2679 * seed[0] ^= (seed[0] << 5) * * return seed[0] % (RAND_R_MAX + 1) # <<<<<<<<<<<<<< @@ -21743,7 +22341,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":2561 + /* "sklearn/tree/_tree.pyx":2674 * # 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: # <<<<<<<<<<<<<< @@ -21756,7 +22354,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2568 +/* "sklearn/tree/_tree.pyx":2681 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -21774,7 +22372,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":2571 + /* "sklearn/tree/_tree.pyx":2684 * """Encapsulate data into a 1D numpy array of intp's.""" * cdef np.npy_intp shape[1] * shape[0] = size # <<<<<<<<<<<<<< @@ -21783,7 +22381,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":2572 + /* "sklearn/tree/_tree.pyx":2685 * cdef np.npy_intp shape[1] * shape[0] = size * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) # <<<<<<<<<<<<<< @@ -21791,14 +22389,14 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n * cdef inline SIZE_t rand_int(SIZE_t end, UINT32_t* random_state) nogil: */ __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 = 2572; __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 = 2685; __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 = 2572; __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 = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2568 + /* "sklearn/tree/_tree.pyx":2681 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -21817,7 +22415,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2574 +/* "sklearn/tree/_tree.pyx":2687 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t end, UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21828,7 +22426,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_end, __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":2576 + /* "sklearn/tree/_tree.pyx":2689 * cdef inline SIZE_t rand_int(SIZE_t end, UINT32_t* random_state) nogil: * """Generate a random integer in [0; end).""" * return our_rand_r(random_state) % end # <<<<<<<<<<<<<< @@ -21838,7 +22436,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree __pyx_r = (__pyx_f_7sklearn_4tree_5_tree_our_rand_r(__pyx_v_random_state) % __pyx_v_end); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2574 + /* "sklearn/tree/_tree.pyx":2687 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t end, UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21851,7 +22449,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2578 +/* "sklearn/tree/_tree.pyx":2691 * return our_rand_r(random_state) % end * * cdef inline double rand_double(UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21862,7 +22460,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_double(__pyx_t_7sklearn_4tree_5_tree_UINT32_t *__pyx_v_random_state) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":2580 + /* "sklearn/tree/_tree.pyx":2693 * cdef inline double rand_double(UINT32_t* random_state) nogil: * """Generate a random double in [0; 1).""" * return our_rand_r(random_state) / RAND_R_MAX # <<<<<<<<<<<<<< @@ -21872,7 +22470,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_double(__pyx_t_7s __pyx_r = (((double)__pyx_f_7sklearn_4tree_5_tree_our_rand_r(__pyx_v_random_state)) / ((double)__pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX)); goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2578 + /* "sklearn/tree/_tree.pyx":2691 * return our_rand_r(random_state) % end * * cdef inline double rand_double(UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21885,7 +22483,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_double(__pyx_t_7s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2582 +/* "sklearn/tree/_tree.pyx":2695 * return our_rand_r(random_state) / RAND_R_MAX * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -21895,7 +22493,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_double(__pyx_t_7s static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) { double __pyx_r; - /* "sklearn/tree/_tree.pyx":2583 + /* "sklearn/tree/_tree.pyx":2696 * * cdef inline double log(double x) nogil: * return ln(x) / ln(2.0) # <<<<<<<<<<<<<< @@ -21903,7 +22501,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":2582 + /* "sklearn/tree/_tree.pyx":2695 * return our_rand_r(random_state) / RAND_R_MAX * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -21915,7 +22513,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -21967,7 +22565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -21980,7 +22578,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -21989,7 +22587,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204 * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -21998,7 +22596,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -22007,7 +22605,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -22017,7 +22615,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -22029,7 +22627,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -22040,7 +22638,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -22050,7 +22648,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); if (__pyx_t_1) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -22064,21 +22662,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_3) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 * 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") # <<<<<<<<<<<<<< * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 * raise ValueError(u"ndarray is not C contiguous") * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -22088,7 +22686,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); if (__pyx_t_3) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 * * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< @@ -22102,21 +22700,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_2) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 * 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") # <<<<<<<<<<<<<< * * info.buf = PyArray_DATA(self) */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -22125,7 +22723,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -22134,7 +22732,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -22144,7 +22742,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_2 = (__pyx_v_copy_shape != 0); if (__pyx_t_2) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 * # 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) # <<<<<<<<<<<<<< @@ -22153,7 +22751,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))); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227 * # This is allocated as one block, strides first. * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim # <<<<<<<<<<<<<< @@ -22162,7 +22760,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228 * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) * info.shape = info.strides + ndim * for i in range(ndim): # <<<<<<<<<<<<<< @@ -22173,7 +22771,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -22182,7 +22780,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]); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< @@ -22195,7 +22793,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -22204,7 +22802,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)); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -22215,7 +22813,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L7:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -22224,7 +22822,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -22233,7 +22831,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -22242,7 +22840,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -22251,7 +22849,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -22263,7 +22861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -22272,7 +22870,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -22288,7 +22886,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -22304,7 +22902,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -22319,7 +22917,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L10:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -22329,7 +22927,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -22339,7 +22937,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_5 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_5; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -22354,7 +22952,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (!__pyx_t_2) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -22374,21 +22972,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -22397,7 +22995,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< @@ -22408,7 +23006,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< @@ -22419,7 +23017,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 * if t == NPY_BYTE: f = "b" * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< @@ -22430,7 +23028,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 * elif t == NPY_UBYTE: f = "B" * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< @@ -22441,7 +23039,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 * elif t == NPY_SHORT: f = "h" * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< @@ -22452,7 +23050,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 * elif t == NPY_USHORT: f = "H" * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< @@ -22463,7 +23061,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 * elif t == NPY_INT: f = "i" * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< @@ -22474,7 +23072,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 * elif t == NPY_UINT: f = "I" * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< @@ -22485,7 +23083,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 * elif t == NPY_LONG: f = "l" * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< @@ -22496,7 +23094,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 * elif t == NPY_ULONG: f = "L" * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< @@ -22507,7 +23105,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 * elif t == NPY_LONGLONG: f = "q" * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< @@ -22518,7 +23116,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 * elif t == NPY_ULONGLONG: f = "Q" * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< @@ -22529,7 +23127,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 * elif t == NPY_FLOAT: f = "f" * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< @@ -22540,7 +23138,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 * elif t == NPY_DOUBLE: f = "d" * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< @@ -22551,7 +23149,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 * elif t == NPY_LONGDOUBLE: f = "g" * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< @@ -22562,7 +23160,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 * elif t == NPY_CFLOAT: f = "Zf" * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< @@ -22573,7 +23171,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 * elif t == NPY_CDOUBLE: f = "Zd" * elif t == NPY_CLONGDOUBLE: f = "Zg" * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< @@ -22585,7 +23183,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 * elif t == NPY_OBJECT: f = "O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -22602,7 +23200,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); @@ -22611,7 +23209,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -22620,7 +23218,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -22632,7 +23230,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -22641,7 +23239,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 * else: * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< @@ -22650,7 +23248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 * info.format = stdlib.malloc(_buffer_format_string_len) * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 # <<<<<<<<<<<<<< @@ -22659,7 +23257,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 * info.format[0] = c'^' # Native data types, manual alignment * offset = 0 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< @@ -22669,7 +23267,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_9 = __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_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -22679,7 +23277,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 * # experimental exception made for __getbuffer__ and __releasebuffer__ * # -- the details of this may change. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< @@ -22711,7 +23309,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -22735,7 +23333,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -22745,7 +23343,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -22757,7 +23355,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -22767,7 +23365,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -22779,7 +23377,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -22791,7 +23389,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22808,7 +23406,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -22822,7 +23420,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22841,7 +23439,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22858,7 +23456,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -22872,7 +23470,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22891,7 +23489,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22908,7 +23506,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -22922,7 +23520,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22941,7 +23539,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22958,7 +23556,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -22972,7 +23570,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22991,7 +23589,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -23008,7 +23606,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< @@ -23022,7 +23620,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 * return PyArray_MultiIterNew(4, a, b, c, d) * * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< @@ -23041,7 +23639,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -23075,7 +23673,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -23084,7 +23682,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -23093,7 +23691,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -23115,7 +23713,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; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -23128,7 +23726,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; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -23167,7 +23765,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; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -23184,21 +23782,21 @@ 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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< * * if ((child.byteorder == c'>' and little_endian) or */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __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[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") * * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -23213,7 +23811,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -23233,21 +23831,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< * # One could encode it in the format string and have Cython * # complain instead, BUT: < and > in format strings also imply */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __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[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -23263,7 +23861,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; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -23272,7 +23870,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -23281,7 +23879,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -23292,7 +23890,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -23302,7 +23900,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_10 = 0; (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -23312,7 +23910,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -23324,7 +23922,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; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -23334,21 +23932,21 @@ 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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< * * # Until ticket #99 is fixed, use integers to avoid warnings */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 * * # Until ticket #99 is fixed, use integers to avoid warnings * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< @@ -23366,7 +23964,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 * # 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" # <<<<<<<<<<<<<< @@ -23384,7 +23982,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 * if t == NPY_BYTE: f[0] = 98 #"b" * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< @@ -23402,7 +24000,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 * elif t == NPY_UBYTE: f[0] = 66 #"B" * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< @@ -23420,7 +24018,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 * elif t == NPY_SHORT: f[0] = 104 #"h" * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< @@ -23438,7 +24036,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 * elif t == NPY_USHORT: f[0] = 72 #"H" * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< @@ -23456,7 +24054,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 * elif t == NPY_INT: f[0] = 105 #"i" * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< @@ -23474,7 +24072,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 * elif t == NPY_UINT: f[0] = 73 #"I" * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< @@ -23492,7 +24090,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 * elif t == NPY_LONG: f[0] = 108 #"l" * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< @@ -23510,7 +24108,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 * elif t == NPY_ULONG: f[0] = 76 #"L" * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< @@ -23528,7 +24126,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 * elif t == NPY_LONGLONG: f[0] = 113 #"q" * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< @@ -23546,7 +24144,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< @@ -23564,7 +24162,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 * elif t == NPY_FLOAT: f[0] = 102 #"f" * elif t == NPY_DOUBLE: f[0] = 100 #"d" * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< @@ -23582,7 +24180,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 * 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 # <<<<<<<<<<<<<< @@ -23602,7 +24200,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 * 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 # <<<<<<<<<<<<<< @@ -23622,7 +24220,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 * 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 # <<<<<<<<<<<<<< @@ -23642,7 +24240,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 * 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" # <<<<<<<<<<<<<< @@ -23661,7 +24259,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 * elif t == NPY_OBJECT: f[0] = 79 #"O" * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< @@ -23675,7 +24273,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__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[2]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; __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); @@ -23684,7 +24282,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L11:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -23696,7 +24294,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 * # Cython ignores struct boundary information ("T{...}"), * # so don't output it * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< @@ -23710,7 +24308,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -23720,7 +24318,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 * return PyArray_MultiIterNew(5, a, b, c, d, e) * * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< @@ -23745,7 +24343,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -23760,7 +24358,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); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -23771,7 +24369,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -23783,7 +24381,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -23792,7 +24390,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -23803,7 +24401,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -23812,7 +24410,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -23821,7 +24419,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -23833,7 +24431,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -23847,7 +24445,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -23857,7 +24455,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) { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -23871,7 +24469,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -23882,7 +24480,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -23896,10 +24494,10 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion __pyx_vtable_7sklearn_4tree_5_tree_Criterion; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter __pyx_vtable_7sklearn_4tree_5_tree_Splitter; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Criterion(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *p; +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Splitter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); @@ -23907,103 +24505,20 @@ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Criterion(PyTypeObject *t, C o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)o); - p->__pyx_vtab = __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)o); + p->__pyx_vtab = __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; + p->criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)Py_None); Py_INCREF(Py_None); + p->random_state = Py_None; Py_INCREF(Py_None); + if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_8Splitter_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } return o; } -static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_Criterion(PyObject *o) { +static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter(PyObject *o) { + struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Criterion = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.Criterion"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_Criterion, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("Interface for impurity criteria."), /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_Criterion, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter __pyx_vtable_7sklearn_4tree_5_tree_Splitter; - -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Splitter(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)o); - p->__pyx_vtab = __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; - p->criterion = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)Py_None); Py_INCREF(Py_None); - p->random_state = Py_None; Py_INCREF(Py_None); - if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_8Splitter_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } - return o; -} - -static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter(PyObject *o) { - struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -24172,6 +24687,125 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Splitter = { 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter; + +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_Splitter(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter; + p->X_argsorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_1__cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_PresortBestSplitter(PyObject *o) { + struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_3__dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->X_argsorted); + PyObject_GC_Track(o); + __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter(o); +} + +static int __pyx_tp_traverse_7sklearn_4tree_5_tree_PresortBestSplitter(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o; + e = __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter(o, v, a); if (e) return e; + if (p->X_argsorted) { + e = (*v)(((PyObject*)p->X_argsorted), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_7sklearn_4tree_5_tree_PresortBestSplitter(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o; + __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter(o); + tmp = ((PyObject*)p->X_argsorted); + p->X_argsorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_PresortBestSplitter[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_5__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("sklearn.tree._tree.PresortBestSplitter"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Splitter for finding the best split, using presorting."), /*tp_doc*/ + __pyx_tp_traverse_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_traverse*/ + __pyx_tp_clear_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree __pyx_vtable_7sklearn_4tree_5_tree_Tree; static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Tree(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -24399,7 +25033,191 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Tree = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_Tree, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_Tree, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSplitter __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter; + +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_Splitter(t, a, k); + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter; + return o; +} + +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_RandomSplitter[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_14RandomSplitter_1__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_RandomSplitter = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("sklearn.tree._tree.RandomSplitter"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("Splitter for finding the best random split."), /*tp_doc*/ + __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter, /*tp_traverse*/ + __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7sklearn_4tree_5_tree_RandomSplitter, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif +}; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder; + +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o); + p->__pyx_vtab = __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; + p->splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)Py_None); Py_INCREF(Py_None); + return o; +} + +static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_TreeBuilder(PyObject *o) { + struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p = (struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o; + #if PY_VERSION_HEX >= 0x030400a1 + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->splitter); + (*Py_TYPE(o)->tp_free)(o); +} + +static int __pyx_tp_traverse_7sklearn_4tree_5_tree_TreeBuilder(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p = (struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o; + if (p->splitter) { + e = (*v)(((PyObject*)p->splitter), a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_7sklearn_4tree_5_tree_TreeBuilder(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p = (struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o; + tmp = ((PyObject*)p->splitter); + p->splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)Py_None); Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} + +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_TreeBuilder[] = { + {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_4tree_5_tree_11TreeBuilder_build)}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_TreeBuilder = { + PyVarObject_HEAD_INIT(0, 0) + __Pyx_NAMESTR("sklearn.tree._tree.TreeBuilder"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_TreeBuilder, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #else + 0, /*reserved*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + __Pyx_DOCSTR("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*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7sklearn_4tree_5_tree_TreeBuilder, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -24415,10 +25233,10 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Tree = { 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion __pyx_vtable_7sklearn_4tree_5_tree_Criterion; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p; +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Criterion(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); @@ -24426,53 +25244,26 @@ static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(PyTypeObject *t, o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o); - p->__pyx_vtab = __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; - p->splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)Py_None); Py_INCREF(Py_None); + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *)o); + p->__pyx_vtab = __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; return o; } -static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_TreeBuilder(PyObject *o) { - struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p = (struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o; +static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_Criterion(PyObject *o) { #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif - PyObject_GC_UnTrack(o); - Py_CLEAR(p->splitter); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_7sklearn_4tree_5_tree_TreeBuilder(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p = (struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o; - if (p->splitter) { - e = (*v)(((PyObject*)p->splitter), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_7sklearn_4tree_5_tree_TreeBuilder(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *p = (struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *)o; - tmp = ((PyObject*)p->splitter); - p->splitter = ((struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_TreeBuilder[] = { - {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_11TreeBuilder_1build, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_4tree_5_tree_11TreeBuilder_build)}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_TreeBuilder = { +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Criterion = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.TreeBuilder"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.tree._tree.Criterion"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_TreeBuilder, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_Criterion, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -24491,15 +25282,15 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_TreeBuilder = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("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*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + __Pyx_DOCSTR("Interface for impurity criteria."), /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_4tree_5_tree_TreeBuilder, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -24509,7 +25300,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_TreeBuilder = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_Criterion, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -24621,21 +25412,21 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion = { 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy __pyx_vtable_7sklearn_4tree_5_tree_Entropy; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini __pyx_vtable_7sklearn_4tree_5_tree_Gini; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Entropy(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_Entropy *p; +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Gini(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_Gini *p; PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_ClassificationCriterion(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Entropy *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion*)__pyx_vtabptr_7sklearn_4tree_5_tree_Entropy; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Gini *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion*)__pyx_vtabptr_7sklearn_4tree_5_tree_Gini; return o; } -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Entropy = { +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Gini = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.Entropy"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Entropy), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.tree._tree.Gini"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Gini), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7sklearn_4tree_5_tree_ClassificationCriterion, /*tp_dealloc*/ 0, /*tp_print*/ @@ -24657,7 +25448,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*/ - __Pyx_DOCSTR("Cross Entropy impurity criteria.\n\n Let the target be a classification outcome taking values in 0, 1, ..., K-1.\n If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The cross-entropy is then defined as\n\n cross-entropy = - \\sum_{k=0}^{K-1} pmk log(pmk)\n "), /*tp_doc*/ + __Pyx_DOCSTR("Gini Index impurity criteria.\n\n Let the target be a classification outcome taking values in 0, 1, ..., K-1.\n If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The Gini Index is then defined as:\n\n index = \\sum_{k=0}^{K-1} pmk (1 - pmk)\n = 1 - \\sum_{k=0}^{K-1} pmk ** 2\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -24674,7 +25465,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Entropy = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_Entropy, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_Gini, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -24690,21 +25481,21 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Entropy = { 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini __pyx_vtable_7sklearn_4tree_5_tree_Gini; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy __pyx_vtable_7sklearn_4tree_5_tree_Entropy; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Gini(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_Gini *p; +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_Entropy(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_Entropy *p; PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_ClassificationCriterion(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Gini *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion*)__pyx_vtabptr_7sklearn_4tree_5_tree_Gini; + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_Entropy *)o); + p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion*)__pyx_vtabptr_7sklearn_4tree_5_tree_Entropy; return o; } -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Gini = { +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Entropy = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.Gini"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Gini), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.tree._tree.Entropy"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Entropy), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7sklearn_4tree_5_tree_ClassificationCriterion, /*tp_dealloc*/ 0, /*tp_print*/ @@ -24726,7 +25517,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*/ - __Pyx_DOCSTR("Gini Index impurity criteria.\n\n Let the target be a classification outcome taking values in 0, 1, ..., K-1.\n If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The Gini Index is then defined as:\n\n index = \\sum_{k=0}^{K-1} pmk (1 - pmk)\n = 1 - \\sum_{k=0}^{K-1} pmk ** 2\n "), /*tp_doc*/ + __Pyx_DOCSTR("Cross Entropy impurity criteria.\n\n Let the target be a classification outcome taking values in 0, 1, ..., K-1.\n If node m represents a region Rm with Nm observations, then let\n\n pmk = 1/ Nm \\sum_{x_i in Rm} I(yi = k)\n\n be the proportion of class k observations in node m.\n\n The cross-entropy is then defined as\n\n cross-entropy = - \\sum_{k=0}^{K-1} pmk log(pmk)\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -24743,7 +25534,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Gini = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_Gini, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_Entropy, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -24959,163 +25750,15 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_FriedmanMSE = { 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("Mean squared error impurity criterion with improvement score by Friedman\n\n Uses the formula (35) in Friedmans original Gradient Boosting paper:\n\n diff = mean_left - mean_right\n improvement = n_left * n_right * diff^2 / (n_left + n_right)\n "), /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - 0, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_FriedmanMSE, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter; - -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter *p; - PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_Splitter(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter; - return o; -} - -static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_BestSplitter[] = { - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_12BestSplitter_1__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestSplitter = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.BestSplitter"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("Splitter for finding the best split."), /*tp_doc*/ - __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter, /*tp_traverse*/ - __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_7sklearn_4tree_5_tree_BestSplitter, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RandomSplitter __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter; - -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter *p; - PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_Splitter(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter; - return o; -} - -static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_RandomSplitter[] = { - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_14RandomSplitter_1__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_RandomSplitter = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.RandomSplitter"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("Splitter for finding the best random split."), /*tp_doc*/ - __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter, /*tp_traverse*/ - __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter, /*tp_clear*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + __Pyx_DOCSTR("Mean squared error impurity criterion with improvement score by Friedman\n\n Uses the formula (35) in Friedmans original Gradient Boosting paper:\n\n diff = mean_left - mean_right\n improvement = n_left * n_right * diff^2 / (n_left + n_right)\n "), /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_4tree_5_tree_RandomSplitter, /*tp_methods*/ + 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -25125,7 +25768,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_RandomSplitter = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_RandomSplitter, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_FriedmanMSE, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25141,73 +25784,31 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_RandomSplitter = { 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p; - PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_Splitter(t, a, k); +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter; - p->X_argsorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_1__cinit__(o, a, k) < 0)) { + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder*)__pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder; + if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_7sklearn_4tree_5_tree_PresortBestSplitter(PyObject *o) { - struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o; - #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_3__dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->X_argsorted); - PyObject_GC_Track(o); - __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter(o); -} - -static int __pyx_tp_traverse_7sklearn_4tree_5_tree_PresortBestSplitter(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o; - e = __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter(o, v, a); if (e) return e; - if (p->X_argsorted) { - e = (*v)(((PyObject*)p->X_argsorted), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_7sklearn_4tree_5_tree_PresortBestSplitter(PyObject *o) { - PyObject* tmp; - struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *p = (struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter *)o; - __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter(o); - tmp = ((PyObject*)p->X_argsorted); - p->X_argsorted = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_PresortBestSplitter[] = { - {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_5__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_BestFirstTreeBuilder[] = { + {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter = { +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.PresortBestSplitter"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.tree._tree.BestFirstTreeBuilder"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_TreeBuilder, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -25227,14 +25828,14 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter = { 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*/ - __Pyx_DOCSTR("Splitter for finding the best split, using presorting."), /*tp_doc*/ - __pyx_tp_traverse_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_traverse*/ - __pyx_tp_clear_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_clear*/ + __Pyx_DOCSTR("Build a decision tree in best-first fashion.\n\n The best node to expand is given by the node at the frontier that has the\n highest impurity improvement.\n\n NOTE: this TreeBuilder will ignore ``tree.max_depth`` .\n "), /*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*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_methods*/ + __pyx_methods_7sklearn_4tree_5_tree_BestFirstTreeBuilder, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -25244,7 +25845,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_PresortBestSplitter, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25337,31 +25938,28 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder = { 0, /*tp_finalize*/ #endif }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestFirstTreeBuilder __pyx_vtable_7sklearn_4tree_5_tree_BestFirstTreeBuilder; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter; -static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *p; - PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_TreeBuilder(t, a, k); +static PyObject *__pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter *p; + PyObject *o = __pyx_tp_new_7sklearn_4tree_5_tree_Splitter(t, a, k); if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder*)__pyx_vtabptr_7sklearn_4tree_5_tree_BestFirstTreeBuilder; - if (unlikely(__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } + p = ((struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter *)o); + p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter; return o; } -static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_BestFirstTreeBuilder[] = { - {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_3build, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build)}, +static PyMethodDef __pyx_methods_7sklearn_4tree_5_tree_BestSplitter[] = { + {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_7sklearn_4tree_5_tree_12BestSplitter_1__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder = { +static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestSplitter = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.tree._tree.BestFirstTreeBuilder"), /*tp_name*/ - sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.tree._tree.BestSplitter"), /*tp_name*/ + sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_7sklearn_4tree_5_tree_TreeBuilder, /*tp_dealloc*/ + __pyx_tp_dealloc_7sklearn_4tree_5_tree_Splitter, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -25381,14 +25979,14 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder = { 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*/ - __Pyx_DOCSTR("Build a decision tree in best-first fashion.\n\n The best node to expand is given by the node at the frontier that has the\n highest impurity improvement.\n\n NOTE: this TreeBuilder will ignore ``tree.max_depth`` .\n "), /*tp_doc*/ - __pyx_tp_traverse_7sklearn_4tree_5_tree_TreeBuilder, /*tp_traverse*/ - __pyx_tp_clear_7sklearn_4tree_5_tree_TreeBuilder, /*tp_clear*/ + __Pyx_DOCSTR("Splitter for finding the best split."), /*tp_doc*/ + __pyx_tp_traverse_7sklearn_4tree_5_tree_Splitter, /*tp_traverse*/ + __pyx_tp_clear_7sklearn_4tree_5_tree_Splitter, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_7sklearn_4tree_5_tree_BestFirstTreeBuilder, /*tp_methods*/ + __pyx_methods_7sklearn_4tree_5_tree_BestSplitter, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -25398,7 +25996,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_7sklearn_4tree_5_tree_BestFirstTreeBuilder, /*tp_new*/ + __pyx_tp_new_7sklearn_4tree_5_tree_BestSplitter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -25450,6 +26048,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_matthieu_Programmes_sciki, __pyx_k_Users_matthieu_Programmes_sciki, sizeof(__pyx_k_Users_matthieu_Programmes_sciki), 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_You_have_loaded_Tree_version_whi, __pyx_k_You_have_loaded_Tree_version_whi, sizeof(__pyx_k_You_have_loaded_Tree_version_whi), 0, 0, 1, 0}, @@ -25474,7 +26073,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, {&__pyx_n_s_formats, __pyx_k_formats, sizeof(__pyx_k_formats), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, - {&__pyx_kp_s_home_ndawe_workspace_sklearn_sk, __pyx_k_home_ndawe_workspace_sklearn_sk, sizeof(__pyx_k_home_ndawe_workspace_sklearn_sk), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_impurity, __pyx_k_impurity, sizeof(__pyx_k_impurity), 0, 0, 1, 1}, {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1}, @@ -25531,14 +26129,20 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_kp_s_we_just_allocated_d_bytes, __pyx_k_we_just_allocated_d_bytes, sizeof(__pyx_k_we_just_allocated_d_bytes), 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_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 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 = 178; __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 = 196; __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 = 2310; __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 = 194; __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #if PY_MAJOR_VERSION >= 3 + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #endif + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __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 = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; @@ -25549,29 +26153,29 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/tree/_tree.pyx":2310 + /* "sklearn/tree/_tree.pyx":2423 * * if 'nodes' not in d: * raise ValueError('You have loaded Tree version which ' # <<<<<<<<<<<<<< * 'cannot be imported') * */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_You_have_loaded_Tree_version_whi); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_You_have_loaded_Tree_version_whi); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "sklearn/tree/_tree.pyx":2324 + /* "sklearn/tree/_tree.pyx":2437 * 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__2 = PyTuple_Pack(1, __pyx_kp_s_Did_not_recognise_loaded_array_l); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Did_not_recognise_loaded_array_l); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 * 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") # <<<<<<<<<<<<<< @@ -25582,7 +26186,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 * 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") # <<<<<<<<<<<<<< @@ -25593,7 +26197,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 * if ((descr.byteorder == c'>' and little_endian) or * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -25604,7 +26208,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 * * if (end - f) - (new_offset - offset[0]) < 15: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< @@ -25615,7 +26219,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< @@ -25626,7 +26230,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -25637,17 +26241,17 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "sklearn/tree/_tree.pyx":2550 + /* "sklearn/tree/_tree.pyx":2663 * * * def _realloc_test(): # <<<<<<<<<<<<<< * # Helper for tests. Should raise an exception. * cdef unsigned char* p = NULL */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_p); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_ndawe_workspace_sklearn_sk, __pyx_n_s_realloc_test, 2550, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_matthieu_Programmes_sciki, __pyx_n_s_realloc_test, 2663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -25756,30 +26360,27 @@ PyMODINIT_FUNC PyInit__tree(void) /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion = &__pyx_vtable_7sklearn_4tree_5_tree_Criterion; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, 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_9Criterion_init; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.reset = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_reset; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.update = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_9Criterion_update; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value; - __pyx_vtable_7sklearn_4tree_5_tree_Criterion.impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double))__pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Criterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_5_tree_Criterion = &__pyx_type_7sklearn_4tree_5_tree_Criterion; __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter = &__pyx_vtable_7sklearn_4tree_5_tree_Splitter; __pyx_vtable_7sklearn_4tree_5_tree_Splitter.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyArrayObject *, PyArrayObject *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *))__pyx_f_7sklearn_4tree_5_tree_8Splitter_init; __pyx_vtable_7sklearn_4tree_5_tree_Splitter.node_reset = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double *))__pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset; __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 = 914; __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 = 930; __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 = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Splitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __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 = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Splitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Splitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __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_PresortBestSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter; + __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; + __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyArrayObject *, 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.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_Splitter; + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __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 = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PresortBestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __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_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; __pyx_vtable_7sklearn_4tree_5_tree_Tree._resize = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_4Tree__resize; @@ -25789,18 +26390,40 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_Tree.predict = (PyArrayObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_7sklearn_4tree_5_tree_4Tree_predict; __pyx_vtable_7sklearn_4tree_5_tree_Tree.apply = (PyArrayObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_7sklearn_4tree_5_tree_4Tree_apply; __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 = 2166; __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 = 2279; __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 = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Tree", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __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 = 2279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Tree", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Tree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2279; __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_RandomSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter; + __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; + __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter.__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_Splitter; + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __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 = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "RandomSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __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_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 *, PyArrayObject *, 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; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __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 = 1898; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __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_Criterion = &__pyx_vtable_7sklearn_4tree_5_tree_Criterion; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, 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_9Criterion_init; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.reset = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_reset; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.update = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_9Criterion_update; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.node_value = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *))__pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value; + __pyx_vtable_7sklearn_4tree_5_tree_Criterion.impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double))__pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement; + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Criterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Criterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_Criterion = &__pyx_type_7sklearn_4tree_5_tree_Criterion; __pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, 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_23ClassificationCriterion_init; @@ -25810,31 +26433,31 @@ 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 = 141; __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 = 157; __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 = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ClassificationCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __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 = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "ClassificationCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_ClassificationCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __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 = 359; __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 = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Entropy", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __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 = 450; __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 = 466; __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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Gini", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __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 = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Gini", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Gini) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __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_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 = 375; __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 = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "Entropy", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __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_RegressionCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *, 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_19RegressionCriterion_init; @@ -25844,77 +26467,58 @@ 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 = 544; __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 = 560; __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 = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "RegressionCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __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 = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "RegressionCriterion", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion = &__pyx_type_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtabptr_7sklearn_4tree_5_tree_MSE = &__pyx_vtable_7sklearn_4tree_5_tree_MSE; __pyx_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity; __pyx_vtable_7sklearn_4tree_5_tree_MSE.__pyx_base.__pyx_base.children_impurity = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *))__pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity; __pyx_type_7sklearn_4tree_5_tree_MSE.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_RegressionCriterion; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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 = 843; __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 = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "MSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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 = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "MSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_MSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_MSE = &__pyx_type_7sklearn_4tree_5_tree_MSE; __pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE = &__pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSE; __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSE.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_MSE; __pyx_vtable_7sklearn_4tree_5_tree_FriedmanMSE.__pyx_base.__pyx_base.__pyx_base.impurity_improvement = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double))__pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement; __pyx_type_7sklearn_4tree_5_tree_FriedmanMSE.tp_base = __pyx_ptype_7sklearn_4tree_5_tree_MSE; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __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 = 884; __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 = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "FriedmanMSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __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 = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "FriedmanMSE", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_FriedmanMSE) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __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_BestSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BestSplitter; - __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; - __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter.__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_Splitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __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 = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __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_Splitter; - __pyx_vtable_7sklearn_4tree_5_tree_RandomSplitter.__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_Splitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __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 = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "RandomSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __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_Splitter; - __pyx_vtable_7sklearn_4tree_5_tree_PresortBestSplitter.__pyx_base.init = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, PyArrayObject *, 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.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_Splitter; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __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 = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "PresortBestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __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_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 *, PyArrayObject *, 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 = 1796; __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 = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "DepthFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __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 *, PyArrayObject *, 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 = 1952; __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 = 2065; __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 = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "BestFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __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 = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BestFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestFirstTreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder; + __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 *, PyArrayObject *, 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 = 1909; __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 = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "DepthFirstTreeBuilder", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __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_BestSplitter = &__pyx_vtable_7sklearn_4tree_5_tree_BestSplitter; + __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; + __pyx_vtable_7sklearn_4tree_5_tree_BestSplitter.__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_Splitter; + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __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 = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "BestSplitter", (PyObject *)&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_BestSplitter = &__pyx_type_7sklearn_4tree_5_tree_BestSplitter; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", #if CYTHON_COMPILING_IN_PYPY @@ -25938,19 +26542,19 @@ PyMODINIT_FUNC PyInit__tree(void) /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "sklearn/tree/_tree.pyx":24 + /* "sklearn/tree/_tree.pyx":29 * from sklearn.tree._utils cimport PriorityHeap, PriorityHeapRecord * * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * np.import_array() */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":26 + /* "sklearn/tree/_tree.pyx":31 * import numpy as np * cimport numpy as np * np.import_array() # <<<<<<<<<<<<<< @@ -25959,109 +26563,109 @@ PyMODINIT_FUNC PyInit__tree(void) */ import_array(); - /* "sklearn/tree/_tree.pyx":39 + /* "sklearn/tree/_tree.pyx":44 * # ============================================================================= * * from numpy import float32 as DTYPE # <<<<<<<<<<<<<< * from numpy import float64 as DOUBLE * */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_float32); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_float32); __Pyx_GIVEREF(__pyx_n_s_float32); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":40 + /* "sklearn/tree/_tree.pyx":45 * * from numpy import float32 as DTYPE * from numpy import float64 as DOUBLE # <<<<<<<<<<<<<< * * cdef double INFINITY = np.inf */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_float64); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_float64); __Pyx_GIVEREF(__pyx_n_s_float64); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_DOUBLE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":42 + /* "sklearn/tree/_tree.pyx":47 * from numpy import float64 as DOUBLE * * cdef double INFINITY = np.inf # <<<<<<<<<<<<<< * TREE_LEAF = -1 * TREE_UNDEFINED = -2 */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __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_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7sklearn_4tree_5_tree_INFINITY = __pyx_t_3; - /* "sklearn/tree/_tree.pyx":43 + /* "sklearn/tree/_tree.pyx":48 * * cdef double INFINITY = np.inf * TREE_LEAF = -1 # <<<<<<<<<<<<<< * TREE_UNDEFINED = -2 * cdef SIZE_t _TREE_LEAF = TREE_LEAF */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_LEAF, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_LEAF, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":44 + /* "sklearn/tree/_tree.pyx":49 * cdef double INFINITY = np.inf * TREE_LEAF = -1 * TREE_UNDEFINED = -2 # <<<<<<<<<<<<<< * cdef SIZE_t _TREE_LEAF = TREE_LEAF * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_UNDEFINED, __pyx_int_neg_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_TREE_UNDEFINED, __pyx_int_neg_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":45 + /* "sklearn/tree/_tree.pyx":50 * TREE_LEAF = -1 * TREE_UNDEFINED = -2 * cdef SIZE_t _TREE_LEAF = TREE_LEAF # <<<<<<<<<<<<<< * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED * cdef SIZE_t INITIAL_STACK_SIZE = 10 */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_LEAF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_LEAF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __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 = 45; __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7sklearn_4tree_5_tree__TREE_LEAF = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":46 + /* "sklearn/tree/_tree.pyx":51 * TREE_UNDEFINED = -2 * cdef SIZE_t _TREE_LEAF = TREE_LEAF * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED # <<<<<<<<<<<<<< * cdef SIZE_t INITIAL_STACK_SIZE = 10 * */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_UNDEFINED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_TREE_UNDEFINED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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 = 46; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":47 + /* "sklearn/tree/_tree.pyx":52 * cdef SIZE_t _TREE_LEAF = TREE_LEAF * cdef SIZE_t _TREE_UNDEFINED = TREE_UNDEFINED * cdef SIZE_t INITIAL_STACK_SIZE = 10 # <<<<<<<<<<<<<< @@ -26070,7 +26674,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_INITIAL_STACK_SIZE = 10; - /* "sklearn/tree/_tree.pyx":49 + /* "sklearn/tree/_tree.pyx":54 * cdef SIZE_t INITIAL_STACK_SIZE = 10 * * cdef DTYPE_t MIN_IMPURITY_SPLIT = 1e-7 # <<<<<<<<<<<<<< @@ -26079,7 +26683,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_MIN_IMPURITY_SPLIT = 1e-7; - /* "sklearn/tree/_tree.pyx":52 + /* "sklearn/tree/_tree.pyx":57 * * # Mitigate precision differences between 32 bit and 64 bit * cdef DTYPE_t FEATURE_THRESHOLD = 1e-7 # <<<<<<<<<<<<<< @@ -26088,7 +26692,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD = 1e-7; - /* "sklearn/tree/_tree.pyx":55 + /* "sklearn/tree/_tree.pyx":60 * * # Some handy constants (BestFirstTreeBuilder) * cdef int IS_FIRST = 1 # <<<<<<<<<<<<<< @@ -26097,7 +26701,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_FIRST = 1; - /* "sklearn/tree/_tree.pyx":56 + /* "sklearn/tree/_tree.pyx":61 * # Some handy constants (BestFirstTreeBuilder) * cdef int IS_FIRST = 1 * cdef int IS_NOT_FIRST = 0 # <<<<<<<<<<<<<< @@ -26106,7 +26710,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_NOT_FIRST = 0; - /* "sklearn/tree/_tree.pyx":57 + /* "sklearn/tree/_tree.pyx":62 * cdef int IS_FIRST = 1 * cdef int IS_NOT_FIRST = 0 * cdef int IS_LEFT = 1 # <<<<<<<<<<<<<< @@ -26115,7 +26719,7 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_LEFT = 1; - /* "sklearn/tree/_tree.pyx":58 + /* "sklearn/tree/_tree.pyx":63 * cdef int IS_NOT_FIRST = 0 * cdef int IS_LEFT = 1 * cdef int IS_NOT_LEFT = 0 # <<<<<<<<<<<<<< @@ -26124,24 +26728,42 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_v_7sklearn_4tree_5_tree_IS_NOT_LEFT = 0; - /* "sklearn/tree/_tree.pyx":67 + /* "sklearn/tree/_tree.pyx":72 + * + * + * cdef int CONTINUOUS = 0 # <<<<<<<<<<<<<< + * cdef int CATEGORICAL = 1 + * + */ + __pyx_v_7sklearn_4tree_5_tree_CONTINUOUS = 0; + + /* "sklearn/tree/_tree.pyx":73 + * + * cdef int CONTINUOUS = 0 + * cdef int CATEGORICAL = 1 # <<<<<<<<<<<<<< + * + * # Repeat struct definition for numpy + */ + __pyx_v_7sklearn_4tree_5_tree_CATEGORICAL = 1; + + /* "sklearn/tree/_tree.pyx":76 * * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":68 + /* "sklearn/tree/_tree.pyx":77 * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', # <<<<<<<<<<<<<< * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, */ - __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_left_child); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_left_child); @@ -26164,68 +26786,68 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_INCREF(__pyx_n_s_weighted_n_node_samples); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_weighted_n_node_samples); __Pyx_GIVEREF(__pyx_n_s_weighted_n_node_samples); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_names, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_names, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":70 + /* "sklearn/tree/_tree.pyx":79 * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, # <<<<<<<<<<<<<< * np.float64], * 'offsets': [ */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __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 = 70; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __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 = 70; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __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 = 70; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __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 = 70; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __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 = 70; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":71 + /* "sklearn/tree/_tree.pyx":80 * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, * np.float64], # <<<<<<<<<<<<<< * 'offsets': [ * &( NULL).left_child, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __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 = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":70 + /* "sklearn/tree/_tree.pyx":79 * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, # <<<<<<<<<<<<<< * np.float64], * 'offsets': [ */ - __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -26248,87 +26870,87 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_formats, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_formats, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":73 + /* "sklearn/tree/_tree.pyx":82 * np.float64], * 'offsets': [ * &( NULL).left_child, # <<<<<<<<<<<<<< * &( NULL).right_child, * &( NULL).feature, */ - __pyx_t_1 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->left_child))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->left_child))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":74 + /* "sklearn/tree/_tree.pyx":83 * 'offsets': [ * &( NULL).left_child, * &( NULL).right_child, # <<<<<<<<<<<<<< * &( NULL).feature, * &( NULL).threshold, */ - __pyx_t_11 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->right_child))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->right_child))); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - /* "sklearn/tree/_tree.pyx":75 + /* "sklearn/tree/_tree.pyx":84 * &( NULL).left_child, * &( NULL).right_child, * &( NULL).feature, # <<<<<<<<<<<<<< * &( NULL).threshold, * &( NULL).impurity, */ - __pyx_t_10 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->feature))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->feature))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - /* "sklearn/tree/_tree.pyx":76 + /* "sklearn/tree/_tree.pyx":85 * &( NULL).right_child, * &( NULL).feature, * &( NULL).threshold, # <<<<<<<<<<<<<< * &( NULL).impurity, * &( NULL).n_node_samples, */ - __pyx_t_9 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->threshold))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->threshold))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - /* "sklearn/tree/_tree.pyx":77 + /* "sklearn/tree/_tree.pyx":86 * &( NULL).feature, * &( NULL).threshold, * &( NULL).impurity, # <<<<<<<<<<<<<< * &( NULL).n_node_samples, * &( NULL).weighted_n_node_samples */ - __pyx_t_8 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->impurity))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->impurity))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - /* "sklearn/tree/_tree.pyx":78 + /* "sklearn/tree/_tree.pyx":87 * &( NULL).threshold, * &( NULL).impurity, * &( NULL).n_node_samples, # <<<<<<<<<<<<<< * &( NULL).weighted_n_node_samples * ] */ - __pyx_t_7 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->n_node_samples))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->n_node_samples))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "sklearn/tree/_tree.pyx":79 + /* "sklearn/tree/_tree.pyx":88 * &( NULL).impurity, * &( NULL).n_node_samples, * &( NULL).weighted_n_node_samples # <<<<<<<<<<<<<< * ] * }) */ - __pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->weighted_n_node_samples))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)(&((struct __pyx_t_7sklearn_4tree_5_tree_Node *)NULL)->weighted_n_node_samples))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":72 + /* "sklearn/tree/_tree.pyx":81 * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, * np.float64], * 'offsets': [ # <<<<<<<<<<<<<< * &( NULL).left_child, * &( NULL).right_child, */ - __pyx_t_5 = PyList_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyList_New(7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -26351,28 +26973,28 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_offsets, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_offsets, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":67 + /* "sklearn/tree/_tree.pyx":76 * * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', * 'n_node_samples', 'weighted_n_node_samples'], */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NODE_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NODE_DTYPE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2342 + /* "sklearn/tree/_tree.pyx":2455 * # 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: # <<<<<<<<<<<<<< @@ -26381,16 +27003,16 @@ PyMODINIT_FUNC PyInit__tree(void) */ __pyx_k__3 = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1); - /* "sklearn/tree/_tree.pyx":2550 + /* "sklearn/tree/_tree.pyx":2663 * * * def _realloc_test(): # <<<<<<<<<<<<<< * # Helper for tests. Should raise an exception. * cdef unsigned char* p = NULL */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_4tree_5_tree_1_realloc_test, NULL, __pyx_n_s_sklearn_tree__tree); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_4tree_5_tree_1_realloc_test, NULL, __pyx_n_s_sklearn_tree__tree); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_realloc_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_realloc_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "sklearn/tree/_tree.pyx":1 @@ -26403,7 +27025,7 @@ PyMODINIT_FUNC PyInit__tree(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/ndawe/.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -26971,10 +27593,8 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; while (*ts && *ts != ')') { - switch (*ts) { - case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; - default: break; /* not a 'break' in the loop */ - } + if (isspace(*ts)) + continue; number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return NULL; if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) @@ -27014,10 +27634,10 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha __Pyx_BufFmt_RaiseExpected(ctx); return NULL; } - return ts; + return ts; case ' ': - case '\r': - case '\n': + case 10: + case 13: ++ts; break; case '<': @@ -27093,25 +27713,21 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha if (*ts != 'f' && *ts != 'd' && *ts != 'g') { __Pyx_BufFmt_RaiseUnexpectedChar('Z'); return NULL; - } + } /* fall through */ case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': case 'l': case 'L': case 'q': case 'Q': case 'f': case 'd': case 'g': - case 'O': case 'p': + case 'O': case 's': case 'p': if (ctx->enc_type == *ts && got_Z == ctx->is_complex && ctx->enc_packmode == ctx->new_packmode) { ctx->enc_count += ctx->new_count; - ctx->new_count = 1; - got_Z = 0; - ++ts; - break; - } - case 's': - if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; - ctx->enc_count = ctx->new_count; - ctx->enc_packmode = ctx->new_packmode; - ctx->enc_type = *ts; - ctx->is_complex = got_Z; + } else { + if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; + ctx->enc_count = ctx->new_count; + ctx->enc_packmode = ctx->new_packmode; + ctx->enc_type = *ts; + ctx->is_complex = got_Z; + } ++ts; ctx->new_count = 1; got_Z = 0; @@ -27211,29 +27827,6 @@ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyOb #endif } -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); -#if PY_VERSION_HEX >= 0x02060000 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; -#endif - result = (*call)(func, arg, kw); -#if PY_VERSION_HEX >= 0x02060000 - Py_LeaveRecursiveCall(); -#endif - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback) { @@ -28214,6 +28807,30 @@ static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) { } } +static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { + long t = b; + switch (e) { + case 3: + t *= b; + case 2: + t *= b; + case 1: + return t; + case 0: + return 1; + } + #if 1 + if (unlikely(e<0)) return 0; + #endif + t = 1; + while (likely(e)) { + t *= (b * (e&1)) | ((~e)&1); /* 1 or b */ + b *= b; + e >>= 1; + } + return t; +} + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -28240,28 +28857,104 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } -static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { - long t = b; - switch (e) { - case 3: - t *= b; - case 2: - t *= b; - case 1: - return t; - case 0: - return 1; - } - #if 1 - if (unlikely(e<0)) return 0; - #endif - t = 1; - while (likely(e)) { - t *= (b * (e&1)) | ((~e)&1); /* 1 or b */ - b *= b; - e >>= 1; +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + #include "longintrepr.h" + #endif +#endif +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(long) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; + } + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) + } else if (sizeof(long) <= sizeof(unsigned long long)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) + } + } else { +#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 + #if CYTHON_USE_PYLONG_INTERNALS + if (sizeof(digit) <= sizeof(long)) { + switch (Py_SIZE(x)) { + case 0: return 0; + case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; + case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; + } + } + #endif +#endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) + } else if (sizeof(long) <= sizeof(long long)) { + __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + long val; + PyObject *v = __Pyx_PyNumber_Int(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_Int(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; } - return t; } #if CYTHON_CCOMPLEX @@ -28504,106 +29197,6 @@ static CYTHON_INLINE long __Pyx_pow_long(long b, long e) { #endif #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 - #if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 - #if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } - #endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; - } - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) - } else if (sizeof(long) <= sizeof(unsigned long long)) { - __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) - } - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 - #if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } - #endif -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) - } else if (sizeof(long) <= sizeof(long long)) { - __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -} - static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); @@ -28771,7 +29364,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); + __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } @@ -28900,8 +29493,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { return 0; } -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); } static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; @@ -28937,7 +29530,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ if (PyUnicode_READY(o) == -1) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); + *length = PyUnicode_GET_DATA_SIZE(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); @@ -28949,13 +29542,11 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_ #endif /* PY_VERSION_HEX < 0x03030000 */ } else #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ -#if !CYTHON_COMPILING_IN_PYPY #if PY_VERSION_HEX >= 0x02060000 if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else -#endif #endif { char* result; diff --git a/sklearn/tree/_tree.pxd b/sklearn/tree/_tree.pxd index 35e7c72f0691e..37ab35982f168 100644 --- a/sklearn/tree/_tree.pxd +++ b/sklearn/tree/_tree.pxd @@ -74,6 +74,8 @@ cdef struct SplitRecord: double improvement # Impurity improvement given parent node. double impurity_left # Impurity of the left split. double impurity_right # Impurity of the right split. + int split_type # Type of split: continuous or categorical + int split_categories # If categorical, the categories of the left leaf cdef class Splitter: diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index e66dc228614bb..b798f482c76c7 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -13,10 +13,15 @@ # # Licence: BSD 3 clause -from libc.stdlib cimport calloc, free, realloc +#include + +from libc.stdlib cimport calloc, free, realloc, malloc from libc.string cimport memcpy, memset from libc.math cimport log as ln from cpython cimport Py_INCREF, PyObject +from libcpp.set cimport set as set_ +from libcpp.map cimport map as map_ +from libcpp.pair cimport pair from sklearn.tree._utils cimport Stack, StackRecord from sklearn.tree._utils cimport PriorityHeap, PriorityHeapRecord @@ -63,6 +68,10 @@ cdef enum: # particularly tiny on Windows/MSVC. RAND_R_MAX = 0x7FFFFFFF + +cdef int CONTINUOUS = 0 +cdef int CATEGORICAL = 1 + # Repeat struct definition for numpy NODE_DTYPE = np.dtype({ 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', @@ -80,6 +89,13 @@ NODE_DTYPE = np.dtype({ ] }) +cdef int is_left_var(DTYPE_t x, int split, + map_[DTYPE_t, SIZE_t] categories) nogil: + """Return whether the category belong to the left branch, according to a + split""" + cdef int i = categories[x] + return (split >> i) & 1 + # ============================================================================= # Criterion @@ -1061,8 +1077,16 @@ cdef class BestSplitter(Splitter): cdef SplitRecord best, current + cdef int n_categorical = 0 #TODO + cdef int n_categories + cdef DTYPE_t category + cdef int* outcome_by_cat + cdef set_[DTYPE_t] set_categories + cdef map_[DTYPE_t, SIZE_t] categories + cdef SIZE_t f_i = n_features - cdef SIZE_t f_j, p, tmp + cdef SIZE_t c_i = n_features - n_categorical + cdef SIZE_t f_j, p, tmp, right_p, i 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 @@ -1074,6 +1098,8 @@ cdef class BestSplitter(Splitter): cdef DTYPE_t current_feature_value cdef SIZE_t partition_end + cdef pair[DTYPE_t, SIZE_t] cat_pair + _init_split(&best, end) # Sample up to max_features without replacement using a @@ -1093,18 +1119,24 @@ cdef class BestSplitter(Splitter): n_visited_features += 1 + # TODO # Loop invariant: elements of features in # - [:n_drawn_constant[ holds drawn and known constant features; # - [n_drawn_constant:n_known_constant[ holds known constant # features that haven't been drawn yet; # - [n_known_constant:n_total_constant[ holds newly found constant # features; - # - [n_total_constant:f_i[ holds features that haven't been drawn - # yet and aren't constant apriori. - # - [f_i:n_features[ holds features that have been drawn - # and aren't constant. + # - [n_total_constant:c_i[ holds features that haven't been drawn + # yet and aren't constant apriori and are continuous + # - [c_i:f_i[ holds features that haven't been drawn + # yet and aren't constant apriori and are categorical + # - [f_i:n_features_continuous[ holds features that have been drawn + # and aren't constant and are continuous. + # - [n_features_continuous:n_features[ holds features that have been + # drawn and aren't constant and are continuous # Draw a feature at random + # f_j is in the interval [n_drawn_constant, f_i - n_found_constants[ f_j = rand_int(f_i - n_drawn_constants - n_found_constants, random_state) + n_drawn_constants @@ -1134,13 +1166,66 @@ cdef class BestSplitter(Splitter): sort(Xf + start, samples + start, end - start) if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: + # If f_j is constant so we add it to the constants features features[f_j] = features[n_total_constants] features[n_total_constants] = current.feature n_found_constants += 1 n_total_constants += 1 + elif f_j >= c_i: + # f_j is categorical and not constant + f_i -= 1 + features[f_i], features[f_j] = features[f_j], features[f_i] + + # We find the categories that are in the data + set_categories.clear() + for p in xrange(start, end): + set_categories.insert(Xf[p]) + n_categories = set_categories.size() + i = 0 + for category in set_categories: + cat_pair.first = category + cat_pair.second = i + categories.insert(cat_pair) + i += 1 + + # First we count the outcomes per category, so we don't + # have to iterate through all the data after that + #safe_realloc(&outcome_by_cat, + # self.n_features * self.n_categories) + outcome_by_cat = malloc( + sizeof(int) * n_features * n_categories) + p = start + while p < end: + i = categories[Xf[p]] + outcome_by_cat[p + i * n_features] += 1 + p += 1 + # We test all the combinations of categories. Not efficient + # if there is many dummies. + for split_categories in xrange(2**(n_categories-1)): + # The first category is always in the right branch. + # It doesn't change anything because of symmetry + # TODO how to calculate the impurities using + # outcome_by_cat ? + current.impurity_left = 0 + current.impurity_right = 0 + current.improvement = 0 + # Example loop through categories + # for i in xrange(n_categories): + # category = categories[i] #TODO check + # is_left = (split >> i) & 1 + if current.improvement > best.improvement: + best.impurity_left = current.impurity_left + best.impurity_right = current.impurity_right + best.improvement = current.improvement + best.feature = current.feature + best.split_categories = split_categories + best.split_type = CATEGORICAL + free(outcome_by_cat) + else: + # f_j is continuous and not constant f_i -= 1 features[f_i], features[f_j] = features[f_j], features[f_i] @@ -1179,15 +1264,22 @@ cdef class BestSplitter(Splitter): if current.improvement > best.improvement: self.criterion.children_impurity(¤t.impurity_left, ¤t.impurity_right) + best.impurity_left = current.impurity_left + best.impurity_right = current.impurity_right + best.improvement = current.improvement + best.pos = current.pos + best.feature = current.feature + current.threshold = (Xf[p - 1] + Xf[p]) / 2.0 if current.threshold == Xf[p]: current.threshold = Xf[p - 1] best = current # copy + best.split_type = CONTINUOUS # Reorganize into samples[start:best.pos] + samples[best.pos:end] - if best.pos < end: + if best.split_type == CONTINUOUS and best.pos < end: partition_end = end p = start @@ -1203,6 +1295,27 @@ cdef class BestSplitter(Splitter): samples[partition_end] = samples[p] samples[p] = tmp + # Reorganize into samples[start:best.pos] + samples[best.pos:end] + if best.split_type == CATEGORICAL: + p = start + right_p = end + while p < right_p: + if is_left_var( + X[X_sample_stride * samples[p] + + X_fx_stride * best.feature], + best.split_categories, categories): + p += 1 + else: + while not is_left_var( + X[X_sample_stride * samples[right_p] + + X_fx_stride * best.feature], + best.split_categories, categories) and p < right_p: + right_p -= 1 + tmp = samples[right_p] + samples[right_p] = samples[p] + samples[p] = tmp + p += 1 + # Respect invariant for constant features: the original order of # element in features[:n_known_constants] must be preserved for sibling # and child nodes