[scikit-learn] Changes in the classifier

aditya aggarwal adityaselfefficient at gmail.com
Thu Jan 9 01:22:06 EST 2020


Hello

I'm trying to change the entropy function which is used in sklearn for
DecisionTreeClassification locally on my system.
when I rerun the pip install --editable . command after updating the cython
file, I receive the following error message:

 Error compiling Cython file:
    ------------------------------------------------------------
    ...
            for k in range(self.n_outputs):
                for c in range(n_classes[k]):
                    count_k = sum_total[c]
                    if count_k > 0.0:
                        count_k /= self.weighted_n_node_samples
                        entropy -= count_k * np.log2(count_k)
                       ^
    ------------------------------------------------------------

    sklearn/tree/_criterion.pyx:537:20: Coercion from Python not allowed
without the GIL

This error is persisten with other errors as:

Operation not allowed without gil
Converting to Python object not allowed without gil
Converting to Python object not allowed without gil
Calling gil-requiring function not allowed without gil
Accessing Python attribute not allowed without gil
Accessing Python global or builtin not allowed without gil


I've tried looking up for solution on various sites, but could not resolve
the issue.
Any help would be appreciated.

Thanks and regards
Aditya Aggarwal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20200109/b2ad7886/attachment.html>


More information about the scikit-learn mailing list