I can no longer compile the changes since I'm now working on a Windows box
(cygwin) and haven't figured out how to configure it correctly. I resorted
to asking the mailing list to make the change (or an option to toggle the
feature) since I'm out of options until I figure out how to start building
libraries on cygwin.

Here is the output of git diff _tree.pyx; it's my best guess of how I
usually make the change but I'm not sure it will compile/run.

diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx
index a9d23ed..ab55dfa 100644
--- a/sklearn/tree/_tree.pyx
+++ b/sklearn/tree/_tree.pyx
@@ -1945,12 +1945,11 @@ cdef class DepthFirstTreeBuilder(TreeBuilder):
                                          threshold, impurity,
n_node_samples,
                                          weighted_n_node_samples)

-                if is_leaf:
-                    # Don't store value for internal nodes
-                    splitter.node_value(tree.value +
-                                        node_id * tree.value_stride)
+                # store value for all nodes
+                splitter.node_value(tree.value +
+                                    node_id * tree.value_stride)

-                else:
+                if not is_leaf:
                     # Push right child on stack
                     rc = stack.push(pos, end, depth + 1, node_id, 0,
                                     split_impurity_right,
n_constant_features)



---------- off-topic; for the cygwin pros out there: -----------------
Here's the type of errors that I get when I try to compile using cygwin:

John@Phobos ~/Scratch/sklearn/scikit-learn/sklearn/tree
$ python setup.py build_ext --inplace
Warning: Assuming default configuration (tests/{setup_tests,setup}.py was
not found)Appending tree.tests configuration to tree
Ignoring attempt to set 'name' (from 'tree' to 'tree.tests')
running build_ext
running build_src
build_src
building extension "tree._tree" sources
building extension "tree._utils" sources
build_src: building npy-pkg config files
Looking for python27.dll
Cannot build msvcr library: "msvcr90d.dll" not found
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
building 'tree._tree' extension
compiling C sources
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes

creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900
-IC:\Anaconda\lib\site-packages\numpy\core\include
-IC:\Anaconda\lib\site-packages\numpy\core\include -IC:\Anaconda\include
-IC:\Anaconda\PC -c'
extra options: '-O3'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x0900
-IC:\Anaconda\lib\site-packages\numpy\core\include
-IC:\Anaconda\lib\site-packages\numpy\core\include -IC:\Anaconda\include
-IC:\Anaconda\PC -c _tree.c -o build\temp.win-amd64-2.7\Release\_tree.o -O3
Found executable C:\cygwin64\bin\gcc.exe
In file included from C:\Anaconda\include/Python.h:58:0,
                 from _tree.c:16:
C:\Anaconda\include/pyport.h:171:33: error: expected ΓÇÿ=ΓÇÖ, ΓÇÿ,ΓÇÖ,
ΓÇÿ;ΓÇÖ, ΓÇÿasmΓÇÖ or ΓÇÿ__attribute__ΓÇÖ before ΓÇÿPy_uintptr_tΓÇÖ
 typedef unsigned PY_LONG_LONG   Py_uintptr_t;
                                 ^
C:\Anaconda\include/pyport.h:172:1: error: unknown type name ΓÇÿ__int64ΓÇÖ
 typedef PY_LONG_LONG            Py_intptr_t;
 ^



On Tue, Jun 3, 2014 at 4:55 PM, Zach Dwiel <z...@dwiel.net> wrote:

> I am the author of that branch.  Please let me know if there is anything I
> can do to help merge when it comes to be that time.
>
> Thanks
>
> zach
>
>
> On Mon, Jun 2, 2014 at 7:14 AM, Olivier Grisel <olivier.gri...@ensta.org>
> wrote:
>
>> 2014-06-02 9:25 GMT+02:00 Lars Buitinck <larsm...@gmail.com>:
>> > 2014-06-02 5:43 GMT+02:00 John Prior <john.w.pr...@gmail.com>:
>> >> Does the optimization really save that much time/space?
>> >
>> > Yes, it does. We can now use multithreading instead of separate worker
>> > processes with each a copy of X/y.
>>
>> The point that John mentions does not seem to be related to the GIL
>> release optim, is it?
>>
>> John, could you please give the exact diff (output of "git diff") of
>> the change you do renable the storage of internal node values?
>>
>> --
>> Olivier
>> http://twitter.com/ogrisel - http://github.com/ogrisel
>>
>>
>> ------------------------------------------------------------------------------
>> Learn Graph Databases - Download FREE O'Reilly Book
>> "Graph Databases" is the definitive new guide to graph databases and their
>> applications. Written by three acclaimed leaders in the field,
>> this first edition is now available. Download your free book today!
>> http://p.sf.net/sfu/NeoTech
>> _______________________________________________
>> Scikit-learn-general mailing list
>> Scikit-learn-general@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>
>


-- 
*Per aspera ad astra.*
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to