diff --git a/.travis.yml b/.travis.yml index bbadfa5d15251..d90d7396476a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,18 @@ language: python -env: - - COVERAGE=--with-coverage -python: - - "2.7" - - "2.6" - - "3.3" virtualenv: system_site_packages: true -before_install: - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then chmod +x miniconda.sh ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then ./miniconda.sh -b ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then export PATH=/home/travis/anaconda/bin:$PATH ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda update --yes conda ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda update --yes conda ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then source activate testenv ; fi - - if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then conda install --yes numpy scipy nose ; fi - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get update -qq ; fi - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then sudo apt-get install -qq python-scipy python-nose python-pip ; fi -install: - - python setup.py build_ext --inplace - - if [ "${COVERAGE}" == "--with-coverage" ]; then sudo pip install coverage; fi - - if [ "${COVERAGE}" == "--with-coverage" ]; then sudo pip install coveralls; fi -script: - - if [ "${COVERAGE}" == "--with-coverage" ]; then - - make test-coverage; - - else - - make test; - - fi +env: + matrix: + - DISTRIB="ubuntu" PYTHON_VERSION="2.7" INSTALL_ATLAS="true" + COVERAGE="true" + # This environment tests the oldest supported anaconda env + - DISTRIB="conda" PYTHON_VERSION="2.6" INSTALL_MKL="false" + NUMPY_VERSION="1.6.2" SCIPY_VERSION="0.11.0" + # This environment tests the newest supported anaconda env + - DISTRIB="conda" PYTHON_VERSION="3.4" INSTALL_MKL="true" + NUMPY_VERSION="1.8.1" SCIPY_VERSION="0.13.3" +install: source continuous_integration/install.sh +script: bash continuous_integration/test_script.sh after_success: - - if [ "${COVERAGE}" == "--with-coverage" ]; then coveralls; fi - + - if [[ "$COVERAGE" == "true" ]]; then coveralls; fi +cache: apt diff --git a/README.rst b/README.rst index 6ad2b3726f9d5..01f2fb41722ee 100644 --- a/README.rst +++ b/README.rst @@ -34,8 +34,10 @@ Important links Dependencies ============ -scikit-learn is tested to work under Python 2.6+ and Python 3.3+ -(using the same codebase thanks to an embedded copy of `six `_). +scikit-learn is tested to work under Python 2.6, Python 2.7, and Python 3.4. +(using the same codebase thanks to an embedded copy of +`six `_). It should also work against Python +3.3. The required dependencies to build the software NumPy >= 1.6.1, SciPy >= 0.9 and a working C/C++ compiler. diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh new file mode 100644 index 0000000000000..359b45c2cc08c --- /dev/null +++ b/continuous_integration/install.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# This script is meant to be called by the "install" step defined in +# .travis.yml. See http://docs.travis-ci.com/ for more details. +# The behavior of the script is controlled by environment variabled defined +# in the .travis.yml in the top level folder of the project. + +set -e + +sudo apt-get update -qq +if [[ "$INSTALL_ATLAS" == "true" ]]; then + sudo apt-get install -qq libatlas3gf-base libatlas-dev +fi + +if [[ "$DISTRIB" == "conda" ]]; then + # Deactivate the travis-provided virtual environment and setup a + # conda-based environment instead + deactivate + + # Use the miniconda installer for faster download / install of conda + # itself + wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh \ + -O miniconda.sh + chmod +x miniconda.sh && ./miniconda.sh -b + export PATH=/home/travis/anaconda/bin:$PATH + conda update --yes conda + + # Configure the conda environment and put it in the path using the + # provided versions + conda create -n testenv --yes python=$PYTHON_VERSION pip nose \ + numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION + source activate testenv + + if [[ "$INSTALL_MKL" == "true" ]]; then + # Make sure that MKL is used + conda install --yes mkl + else + # Make sure that MKL is not used + conda remove --yes --features mkl || echo "MKL not installed" + fi + +elif [[ "$DISTRIB" == "ubuntu" ]]; then + # Use standard ubuntu packages in their default version + sudo apt-get install -qq python-scipy python-nose python-pip +fi + +if [[ "$COVERAGE" == "true" ]]; then + pip install coverage coveralls +fi diff --git a/continuous_integration/test_script.sh b/continuous_integration/test_script.sh new file mode 100644 index 0000000000000..f25f45e4b222e --- /dev/null +++ b/continuous_integration/test_script.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# This script is meant to be called by the "script" step defined in +# .travis.yml. See http://docs.travis-ci.com/ for more details. +# The behavior of the script is controlled by environment variabled defined +# in the .travis.yml in the top level folder of the project. + +set -e + +python --version +python -c "import numpy; print('numpy %s' % numpy.__version__)" +python -c "import scipy; print('scipy %s' % scipy.__version__)" +python setup.py build_ext --inplace + +if [[ "$COVERAGE" == "true" ]]; then + export WITH_COVERAGE="--with-coverage" +else + export WITH_COVERAGE="" +fi +nosetests -s -v $WITH_COVERAGE sklearn diff --git a/doc/Makefile b/doc/Makefile index a59bc31ee0dd7..c9512c0f23015 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -12,7 +12,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex latexpdf changes linkcheck doctest +.PHONY: help clean html dirhtml pickle json latex latexpdf changes linkcheck doctest all: html-noplot @@ -22,8 +22,6 @@ help: @echo " dirhtml to make HTML files named index.html in directories" @echo " pickle to make pickle files" @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " changes to make an overview of all changed/added/deprecated items" @@ -65,21 +63,6 @@ json: @echo @echo "Build finished; now you can process the JSON files." -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/scikit-learn.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/scikit-learn.qhc" - latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo diff --git a/doc/developers/index.rst b/doc/developers/index.rst index 797fdab86080e..22ac0068e2d48 100644 --- a/doc/developers/index.rst +++ b/doc/developers/index.rst @@ -647,9 +647,11 @@ To summarize, a `__init__` should look like:: self.param1 = param1 self.param2 = param2 -There should be no logic, and the parameters should not be changed. -The corresponding logic should be put where the parameters are used. The -following is wrong:: +There should be no logic, not even input validation, +and the parameters should not be changed. +The corresponding logic should be put where the parameters are used, +typically in ``fit``. +The following is wrong:: def __init__(self, param1=1, param2=2, param3=3): # WRONG: parameters should not be modified @@ -660,8 +662,9 @@ following is wrong:: # the argument in the constructor self.param3 = param2 -Scikit-learn relies on this mechanism to introspect objects to set -their parameters by cross-validation. +The reason for postponing the validation is that the same validation +would have to be performed in ``set_params``, +which is used in algorithms like ``GridSearchCV``. Fitting ^^^^^^^ diff --git a/doc/index.rst b/doc/index.rst index fae3e68c36b73..c86fd5c7930e0 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -161,7 +161,7 @@ Applications: Visualization, Increased efficiency
Algorithms:  -:ref:`PCA`, :ref:`Isomap`, :ref:`non-negative matrix factorization`. +:ref:`PCA`, :ref:`feature selection`, :ref:`non-negative matrix factorization`. .. raw:: html diff --git a/doc/modules/clustering.rst b/doc/modules/clustering.rst index 83d032f5fa110..25b3bf4ec400a 100644 --- a/doc/modules/clustering.rst +++ b/doc/modules/clustering.rst @@ -118,15 +118,37 @@ K-means The :class:`KMeans` algorithm clusters data by trying to separate samples in n groups of equal variance, minimizing a criterion known as the -'inertia' of the groups. This algorithm requires the number of clusters to -be specified. It scales well to large number of samples and has been used -across a large range of application areas in many different fields. It is -also equivalent to the expectation-maximization algorithm when setting the -covariance matrix to be diagonal, equal and small. The K-means algorithm -aims to choose centroids :math:`C` that minimise the within cluster sum of -squares objective function with a dataset :math:`X` with :math:`n` samples: - -.. math:: J(X, C) = \sum_{i=0}^{n}\min_{\mu_j \in C}(||x_j - \mu_i||^2) +`inertia` or within-cluster sum-of-squares. +This algorithm requires the number of clusters to be specified. +It scales well to large number of samples and has been used +across a large range of application areas in many different fields. + +The k-means algorithm divides a set of :math:`N` samples :math:`X`: +into :math:`K` disjoint clusters :math:`C`, +each described by the mean :math:`\mu_j` of the samples in the cluster. +The means are commonly called the cluster "centroids"; +note that they are not, in general, points from :math:`X`, +although they live in the same space. +The K-means algorithm aims to choose centroids +that minimise the *inertia*, or within-cluster sum of squared criterion: + +.. math:: \sum_{i=0}^{n}\min_{\mu_j \in C}(||x_j - \mu_i||^2) + +Inertia, or the within-cluster sum of squares criterion, +can be recognized as a measure of how internally coherent clusters are. +It suffers from various drawbacks: + +- Inertia makes the assumption that clusters are convex and isotropic, + which is not always the case. It responds poorly to elongated clusters, + or manifolds with irregular shapes. + +- Inertia is not a normalized metric: we just know that lower values are + better and zero is optimal. But in very high-dimensional spaces, Euclidean + distances tend to become inflated + (this is an instance of the so-called "curse of dimensionality"). + Running a dimensionality reduction algorithm such as `PCA` + prior to k-means clustering can alleviate this problem + and speed up the computations. K-means is often referred to as Lloyd's algorithm. In basic terms, the algorithm has three steps. The first step chooses the initial centroids, with @@ -144,7 +166,10 @@ until the centroids do not move significantly. :align: right :scale: 35 -The algorithm can be understood through the concept of `Voronoi diagrams +K-means is equivalent to the expectation-maximization algorithm +with a small, all-equal, diagonal covariance matrix. + +The algorithm can also be understood through the concept of `Voronoi diagrams `_. First the Voronoi diagram of the points is calculated using the current centroids. Each segment in the Voronoi diagram becomes a separate cluster. Secondly, the centroids are updated @@ -753,33 +778,6 @@ classes according to some similarity metric. .. currentmodule:: sklearn.metrics -Inertia -------- - -Presentation and usage -~~~~~~~~~~~~~~~~~~~~~~ - -TODO: factorize inertia computation out of kmeans and then write me! - - -Advantages -~~~~~~~~~~ - -- No need for the ground truth knowledge of the "real" classes. - -Drawbacks -~~~~~~~~~ - -- Inertia makes the assumption that clusters are convex and isotropic - which is not always the case especially of the clusters are manifolds - with weird shapes: for instance inertia is a useless metrics to evaluate - clustering algorithm that tries to identify nested circles on a 2D plane. - -- Inertia is not a normalized metrics: we just know that lower values are - better and bounded by zero. One potential solution would be to adjust - inertia for random clustering (assuming the number of ground truth classes - is known). - Adjusted Rand index ------------------- diff --git a/doc/modules/linear_model.rst b/doc/modules/linear_model.rst index 193e03677db94..f54860c7d03fc 100644 --- a/doc/modules/linear_model.rst +++ b/doc/modules/linear_model.rst @@ -268,11 +268,11 @@ They also tend to break when the problem is badly conditioned Elastic Net =========== -:class:`ElasticNet` is a linear model trained with L1 and L2 prior as -regularizer. This combination allows for learning a sparse model where +:class:`ElasticNet` is a linear regression model trained with L1 and L2 prior +as regularizer. This combination allows for learning a sparse model where few of the weights are non-zero like :class:`Lasso`, while still maintaining -the regularization properties of :class:`Ridge`. We control this tradeoff -using the `l1_ratio` parameter. +the regularization properties of :class:`Ridge`. We control the convex +combination of L1 and L2 using the `l1_ratio` parameter. Elastic-net is useful when there are multiple features which are correlated with one another. Lasso is likely to pick one of these diff --git a/doc/tutorial/basic/tutorial.rst b/doc/tutorial/basic/tutorial.rst index d25ae62da3a68..90616b1c48b83 100644 --- a/doc/tutorial/basic/tutorial.rst +++ b/doc/tutorial/basic/tutorial.rst @@ -86,7 +86,7 @@ datasets for classification and the `boston house prices dataset A dataset is a dictionary-like object that holds all the data and some metadata about the data. This data is stored in the ``.data`` member, which is a ``n_samples, n_features`` array. In the case of supervised -problem, explanatory variables are stored in the ``.target`` member. More +problem, one or more response variables are stored in the ``.target`` member. More details on the different datasets can be found in the :ref:`dedicated section `. diff --git a/doc/tutorial/statistical_inference/index.rst b/doc/tutorial/statistical_inference/index.rst index 74d84dfdfe53b..95381a5d9cdeb 100644 --- a/doc/tutorial/statistical_inference/index.rst +++ b/doc/tutorial/statistical_inference/index.rst @@ -26,18 +26,6 @@ A tutorial on statistical-learning for scientific data processing .. include:: ../../includes/big_toc_css.rst -.. warning:: - - In scikit-learn release 0.9, the import path has changed from - `scikits.learn` to `sklearn`. To import with cross-version - compatibility, use:: - - try: - from sklearn import something - except ImportError: - from scikits.learn import something - - .. toctree:: :maxdepth: 2 @@ -47,4 +35,3 @@ A tutorial on statistical-learning for scientific data processing unsupervised_learning putting_together finding_help - diff --git a/doc/tutorial/text_analytics/working_with_text_data.rst b/doc/tutorial/text_analytics/working_with_text_data.rst index af769f6e4f401..3fe45fcbf597f 100644 --- a/doc/tutorial/text_analytics/working_with_text_data.rst +++ b/doc/tutorial/text_analytics/working_with_text_data.rst @@ -25,7 +25,7 @@ Tutorial setup -------------- To get started with this tutorial, you firstly must have the -*scikit-learn* and all of its requiered dependencies installed. +*scikit-learn* and all of its required dependencies installed. Please refer to the `scikit-learn install`_ page for more information and for per-system instructions. @@ -419,7 +419,7 @@ Instead of tweaking the parameters of the various components of the chain, it is possible to run an exhaustive search of the best parameters on a grid of possible values. We try out all classifiers on either words or bigrams, with or without idf, and with a penalty -parameter of either 100 or 1000 for the linear SVM:: +parameter of either 0.01 or 0.001 for the linear SVM:: >>> from sklearn.grid_search import GridSearchCV >>> parameters = {'vect__ngram_range': [(1, 1), (1, 2)], diff --git a/doc/whats_new.rst b/doc/whats_new.rst index 16864820288f4..28b67737ddcb2 100644 --- a/doc/whats_new.rst +++ b/doc/whats_new.rst @@ -182,6 +182,11 @@ Changelog :class:`cluster.WardAgglomeration` when no samples are given, rather than returning meaningless clustering. + - Grid search and cross validation allow NaNs in the input arrays so that + preprocessors such as :class:`preprocessing.Imputer + ` can be trained within the cross validation loop, + avoiding potentially skewed results. + API changes summary ------------------- diff --git a/examples/applications/face_recognition.py b/examples/applications/face_recognition.py index 06fb3199a3e2b..541bbcf4551b6 100644 --- a/examples/applications/face_recognition.py +++ b/examples/applications/face_recognition.py @@ -54,7 +54,7 @@ # introspect the images arrays to find the shapes (for plotting) n_samples, h, w = lfw_people.images.shape -# fot machine learning we use the 2 data directly (as relative pixel +# for machine learning we use the 2 data directly (as relative pixel # positions info is ignored by this model) X = lfw_people.data n_features = X.shape[1] diff --git a/examples/linear_model/plot_sgd_loss_functions.py b/examples/linear_model/plot_sgd_loss_functions.py index 14adec0144d9a..e7a8b226037f6 100644 --- a/examples/linear_model/plot_sgd_loss_functions.py +++ b/examples/linear_model/plot_sgd_loss_functions.py @@ -1,53 +1,41 @@ """ ========================== -SGD: Convex Loss Functions +SGD: convex loss functions ========================== -An example that compares various convex loss functions. - - -All of the above loss functions are supported by -:class:`sklearn.linear_model.stochastic_gradient` . +A plot that compares the various convex loss functions supported by +:class:`sklearn.linear_model.SGDClassifier` . """ print(__doc__) import numpy as np import pylab as pl -from sklearn.linear_model.sgd_fast import SquaredHinge -from sklearn.linear_model.sgd_fast import Hinge -from sklearn.linear_model.sgd_fast import ModifiedHuber -from sklearn.linear_model.sgd_fast import SquaredLoss -############################################################################### -# Define loss functions -xmin, xmax = -4, 4 -hinge = Hinge(1) -squared_hinge = SquaredHinge() -perceptron = Hinge(0) -log_loss = lambda z, p: np.log2(1.0 + np.exp(-z)) -modified_huber = ModifiedHuber() -squared_loss = SquaredLoss() +def modified_huber_loss(y_true, y_pred): + z = y_pred * y_true + loss = -4 * z + loss[z >= -1] = (1 - z[z >= -1]) ** 2 + loss[z >= 1.] = 0 + return loss -############################################################################### -# Plot loss funcitons + +xmin, xmax = -4, 4 xx = np.linspace(xmin, xmax, 100) pl.plot([xmin, 0, 0, xmax], [1, 1, 0, 0], 'k-', label="Zero-one loss") -pl.plot(xx, [hinge.loss(x, 1) for x in xx], 'g-', +pl.plot(xx, np.where(xx < 1, 1 - xx, 0), 'g-', label="Hinge loss") -pl.plot(xx, [perceptron.loss(x, 1) for x in xx], 'm-', +pl.plot(xx, -np.minimum(xx, 0), 'm-', label="Perceptron loss") -pl.plot(xx, [log_loss(x, 1) for x in xx], 'r-', +pl.plot(xx, np.log2(1 + np.exp(-xx)), 'r-', label="Log loss") -#pl.plot(xx, [2 * squared_loss.loss(x, 1) for x in xx], 'c-', -# label="Squared loss") -pl.plot(xx, [squared_hinge.loss(x, 1) for x in xx], 'b-', +pl.plot(xx, np.where(xx < 1, 1 - xx, 0) ** 2, 'b-', label="Squared hinge loss") -pl.plot(xx, [modified_huber.loss(x, 1) for x in xx], 'y--', - label="Modified huber loss") +pl.plot(xx, modified_huber_loss(xx, 1), 'y--', + label="Modified Huber loss") pl.ylim((0, 8)) pl.legend(loc="upper right") -pl.xlabel(r"$y \cdot f(x)$") +pl.xlabel(r"Decision function $f(x)$") pl.ylabel("$L(y, f(x))$") pl.show() diff --git a/setup.py b/setup.py index 9ffd06c2dcd48..9c538fa0a1b9a 100755 --- a/setup.py +++ b/setup.py @@ -120,6 +120,7 @@ def setup_package(): 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', ], cmdclass={'clean': CleanCommand}, **extra_setuptools_args) diff --git a/sklearn/cluster/affinity_propagation_.py b/sklearn/cluster/affinity_propagation_.py index 90c0ad8f54f1a..5c1d7de86d5ed 100644 --- a/sklearn/cluster/affinity_propagation_.py +++ b/sklearn/cluster/affinity_propagation_.py @@ -22,10 +22,10 @@ def affinity_propagation(S, preference=None, convergence_iter=15, max_iter=200, Parameters ---------- - S : array [n_samples, n_samples] + S : array-like, shape (n_samples, n_samples) Matrix of similarities between points - preference : array [n_samples,] or float, optional, default: None + preference : array-like, shape (n_samples,) or float, optional Preferences for each point - points with larger values of preferences are more likely to be chosen as exemplars. The number of exemplars, i.e. of clusters, is influenced by the input preferences @@ -54,10 +54,10 @@ def affinity_propagation(S, preference=None, convergence_iter=15, max_iter=200, Returns ------- - cluster_centers_indices : array [n_clusters] + cluster_centers_indices : array, shape (n_clusters,) index of clusters centers - labels : array [n_samples] + labels : array, shape (n_samples,) cluster labels for each point Notes @@ -191,7 +191,7 @@ class AffinityPropagation(BaseEstimator, ClusterMixin): copy : boolean, optional, default: True Make a copy of input data. - preference : array [n_samples,] or float, optional, default: None + preference : array-like, shape (n_samples,) or float, optional Preferences for each point - points with larger values of preferences are more likely to be chosen as exemplars. The number of exemplars, ie of clusters, is influenced by the input @@ -209,16 +209,16 @@ class AffinityPropagation(BaseEstimator, ClusterMixin): Attributes ---------- - `cluster_centers_indices_` : array, [n_clusters] + `cluster_centers_indices_` : array, shape (n_clusters,) Indices of cluster centers - `cluster_centers_` : array, [n_clusters, n_features] + `cluster_centers_` : array, shape (n_clusters, n_features) Cluster centers (if affinity != ``precomputed''). - `labels_` : array, [n_samples] + `labels_` : array, shape (n_samples,) Labels of each point - `affinity_matrix_` : array-like, [n_samples, n_samples] + `affinity_matrix_` : array, shape (n_samples, n_samples) Stores the affinity matrix used in ``fit``. Notes @@ -258,7 +258,7 @@ def fit(self, X): Parameters ---------- - X: array [n_samples, n_features] or [n_samples, n_samples] + X: array-like, shape (n_samples, n_features) or (n_samples, n_samples) Data matrix or, if affinity is ``precomputed``, matrix of similarities / affinities. """ @@ -287,12 +287,12 @@ def predict(self, X): Parameters ---------- - X : {array-like, sparse matrix}, shape = [n_samples, n_features] + X : {array-like, sparse matrix}, shape (n_samples, n_features) New data to predict. Returns ------- - labels : array, shape [n_samples,] + labels : array, shape (n_samples,) Index of the cluster each sample belongs to. """ if not hasattr(self, "cluster_centers_indices_"): diff --git a/sklearn/cluster/hierarchical.py b/sklearn/cluster/hierarchical.py index effe582b0dd9b..69a469838a747 100644 --- a/sklearn/cluster/hierarchical.py +++ b/sklearn/cluster/hierarchical.py @@ -13,7 +13,6 @@ import numpy as np from scipy import sparse -from scipy.cluster import hierarchy from ..base import BaseEstimator, ClusterMixin from ..externals.joblib import Memory @@ -150,6 +149,8 @@ def ward_tree(X, connectivity=None, n_components=None, copy=None, n_samples, n_features = X.shape if connectivity is None: + from scipy.cluster import hierarchy # imports PIL + if n_clusters is not None: warnings.warn('Partial build of the tree is implemented ' 'only for structured clustering (i.e. with ' @@ -332,6 +333,8 @@ def linkage_tree(X, connectivity=None, n_components=None, 'of %s, but %s was given' % (linkage_choices.keys(), linkage)) if connectivity is None: + from scipy.cluster import hierarchy # imports PIL + if n_clusters is not None: warnings.warn('Partial build of the tree is implemented ' 'only for structured clustering (i.e. with ' diff --git a/sklearn/cluster/mean_shift_.py b/sklearn/cluster/mean_shift_.py index 725298c8ed4a8..1993045dea4a4 100644 --- a/sklearn/cluster/mean_shift_.py +++ b/sklearn/cluster/mean_shift_.py @@ -1,6 +1,6 @@ -"""Mean Shift clustering algorithm +"""Mean shift clustering algorithm. -MeanShift clustering aims to discover *blobs* in a smooth density of +Mean shift clustering aims to discover *blobs* in a smooth density of samples. It is a centroid based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to eliminate @@ -31,7 +31,7 @@ def estimate_bandwidth(X, quantile=0.3, n_samples=None, random_state=0): Parameters ---------- - X : array [n_samples, n_features] + X : array-like, shape=[n_samples, n_features] Input points. quantile : float, default 0.3 @@ -66,20 +66,12 @@ def estimate_bandwidth(X, quantile=0.3, n_samples=None, random_state=0): def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, min_bin_freq=1, cluster_all=True, max_iterations=300): - """Perform MeanShift Clustering of data using a flat kernel - - MeanShift clustering aims to discover *blobs* in a smooth density of - samples. It is a centroid based algorithm, which works by updating candidates - for centroids to be the mean of the points within a given region. These - candidates are then filtered in a post-processing stage to eliminate - near-duplicates to form the final set of centroids. - - Seeding is performed using a binning technique for scalability. + """Perform mean shift clustering of data using a flat kernel. Parameters ---------- - X : array-like shape=[n_samples, n_features] + X : array-like, shape=[n_samples, n_features] Input data. bandwidth : float, optional @@ -90,7 +82,7 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, the number of samples. The sklearn.cluster.estimate_bandwidth function can be used to do this more efficiently. - seeds : array [n_seeds, n_features] + seeds : array-like, shape=[n_seeds, n_features] Point used as initial kernel locations. bin_seeding : boolean @@ -109,10 +101,10 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, Returns ------- - cluster_centers : array [n_clusters, n_features] + cluster_centers : array, shape=[n_clusters, n_features] Coordinates of cluster centers. - labels : array [n_samples] + labels : array, shape=[n_samples] Cluster labels for each point. Notes @@ -182,7 +174,7 @@ def mean_shift(X, bandwidth=None, seeds=None, bin_seeding=False, def get_bin_seeds(X, bin_size, min_bin_freq=1): - """Finds seeds for mean_shift + """Finds seeds for mean_shift. Finds seeds by first binning data onto a grid whose lines are spaced bin_size apart, and then choosing those bins with at least @@ -225,7 +217,15 @@ def get_bin_seeds(X, bin_size, min_bin_freq=1): class MeanShift(BaseEstimator, ClusterMixin): - """MeanShift clustering + """Mean shift clustering using a flat kernel. + + Mean shift clustering aims to discover "blobs" in a smooth density of + samples. It is a centroid-based algorithm, which works by updating + candidates for centroids to be the mean of the points within a given + region. These candidates are then filtered in a post-processing stage to + eliminate near-duplicates to form the final set of centroids. + + Seeding is performed using a binning technique for scalability. Parameters ---------- @@ -236,7 +236,7 @@ class MeanShift(BaseEstimator, ClusterMixin): sklearn.cluster.estimate_bandwidth; see the documentation for that function for hints on scalability (see also the Notes, below). - seeds : array [n_samples, n_features], optional + seeds : array, shape=[n_samples, n_features], optional Seeds used to initialize kernels. If not set, the seeds are calculated by clustering.get_bin_seeds with bandwidth as the grid size and default values for @@ -321,7 +321,7 @@ def predict(self, X): Parameters ---------- - X : {array-like, sparse matrix}, shape = [n_samples, n_features] + X : {array-like, sparse matrix}, shape=[n_samples, n_features] New data to predict. Returns diff --git a/sklearn/cluster/tests/test_hierarchical.py b/sklearn/cluster/tests/test_hierarchical.py index 063f9bcf6c900..2e9ff88fc53d8 100644 --- a/sklearn/cluster/tests/test_hierarchical.py +++ b/sklearn/cluster/tests/test_hierarchical.py @@ -33,11 +33,10 @@ def test_linkage_misc(): # Misc tests on linkage - X = np.ones((5, 5)) - assert_raises(ValueError, - AgglomerativeClustering(linkage='foobar').fit, - X) - assert_raises(ValueError, linkage_tree, X, linkage='foobar') + rnd = np.random.RandomState(42) + X = rnd.normal(size=(5, 5)) + assert_raises(ValueError, AgglomerativeClustering(linkage='foo').fit, X) + assert_raises(ValueError, linkage_tree, X, linkage='foo') assert_raises(ValueError, linkage_tree, X, connectivity=np.ones((4, 4))) # Smoke test FeatureAgglomeration @@ -96,10 +95,8 @@ def test_unstructured_linkage_tree(): # raising a warning and testing the warning code with warnings.catch_warnings(record=True) as warning_list: warnings.simplefilter("ignore", DeprecationWarning) - children, n_nodes, n_leaves, parent = assert_warns(UserWarning, - ward_tree, - this_X.T, - n_clusters=10) + children, n_nodes, n_leaves, parent = assert_warns( + UserWarning, ward_tree, this_X.T, n_clusters=10) n_nodes = 2 * X.shape[1] - 1 assert_equal(len(children) + n_leaves, n_nodes) @@ -156,8 +153,8 @@ def test_agglomerative_clustering(): labels = clustering.labels_ assert_true(np.size(np.unique(labels)) == 10) # Turn caching off now - clustering = AgglomerativeClustering(n_clusters=10, - connectivity=connectivity, linkage=linkage) + clustering = AgglomerativeClustering( + n_clusters=10, connectivity=connectivity, linkage=linkage) # Check that we obtain the same solution with early-stopping of the # tree building clustering.compute_full_tree = False @@ -212,8 +209,11 @@ def test_ward_agglomeration(): X = rnd.randn(50, 100) connectivity = grid_to_graph(*mask.shape) assert_warns(DeprecationWarning, WardAgglomeration) - ward = WardAgglomeration(n_clusters=5, connectivity=connectivity) - ward.fit(X) + with warnings.catch_warnings(record=True) as warning_list: + warnings.simplefilter("always", DeprecationWarning) + ward = WardAgglomeration(n_clusters=5, connectivity=connectivity) + ward.fit(X) + assert_equal(len(warning_list), 1) agglo = FeatureAgglomeration(n_clusters=5, connectivity=connectivity) agglo.fit(X) assert_array_equal(agglo.labels_, ward.labels_) @@ -283,7 +283,8 @@ def test_connectivity_popagation(): (.018, .152), (.018, .149), (.018, .144), ]) connectivity = kneighbors_graph(X, 10) - ward = Ward(n_clusters=4, connectivity=connectivity) + ward = AgglomerativeClustering( + n_clusters=4, connectivity=connectivity, linkage='ward') # If changes are not propagated correctly, fit crashes with an # IndexError ward.fit(X) @@ -299,7 +300,7 @@ def test_connectivity_fixing_non_lil(): # create a mask with several components to force connectivity fixing m = np.array([[True, False], [False, True]]) c = grid_to_graph(n_x=2, n_y=2, mask=m) - w = Ward(connectivity=c) + w = AgglomerativeClustering(connectivity=c, linkage='ward') assert_warns(UserWarning, w.fit, x) diff --git a/sklearn/cluster/tests/test_mean_shift.py b/sklearn/cluster/tests/test_mean_shift.py index a64a21775a071..debe9d469495a 100644 --- a/sklearn/cluster/tests/test_mean_shift.py +++ b/sklearn/cluster/tests/test_mean_shift.py @@ -18,13 +18,13 @@ n_clusters = 3 centers = np.array([[1, 1], [-1, -1], [1, -1]]) + 10 -X, _ = make_blobs(n_samples=500, n_features=2, centers=centers, - cluster_std=0.4, shuffle=True, random_state=0) +X, _ = make_blobs(n_samples=300, n_features=2, centers=centers, + cluster_std=0.4, shuffle=True, random_state=11) def test_estimate_bandwidth(): """Test estimate_bandwidth""" - bandwidth = estimate_bandwidth(X, n_samples=300) + bandwidth = estimate_bandwidth(X, n_samples=200) assert_true(0.9 <= bandwidth <= 1.5) diff --git a/sklearn/cluster/tests/test_spectral.py b/sklearn/cluster/tests/test_spectral.py index a79b19582b3ec..4c73713f1eff8 100644 --- a/sklearn/cluster/tests/test_spectral.py +++ b/sklearn/cluster/tests/test_spectral.py @@ -52,28 +52,6 @@ def test_spectral_clustering(): assert_array_equal(model_copy.labels_, model.labels_) -def test_spectral_lobpcg_mode(): - # Test the lobpcg mode of SpectralClustering - # We need a fairly big data matrix, as lobpcg does not work with - # small data matrices - centers = np.array([ - [0., 0.], - [10., 10.], - ]) - # The cluster_std parameter has been selected to have the blob close enough - # to get stable results both with the ATLAS and the reference - # implementations of LAPACK. - X, true_labels = make_blobs(n_samples=300, centers=centers, - cluster_std=20.0, random_state=42) - D = pairwise_distances(X) # Distance matrix - S = np.max(D) - D # Similarity matrix - labels = spectral_clustering(S, n_clusters=len(centers), - random_state=0, eigen_solver="lobpcg") - # We don't care too much that it's good, just that it *worked*. - # There does have to be some lower limit on the performance though. - assert_greater(np.mean(labels == true_labels), .3) - - def test_spectral_amg_mode(): # Test the amg mode of SpectralClustering centers = np.array([ diff --git a/sklearn/covariance/robust_covariance.py b/sklearn/covariance/robust_covariance.py index 435fc8a1de358..ae04e41c29f62 100644 --- a/sklearn/covariance/robust_covariance.py +++ b/sklearn/covariance/robust_covariance.py @@ -23,6 +23,8 @@ # (A Fast Algorithm for the Minimum Covariance Determinant Estimator, # 1999, American Statistical Association and the American Society # for Quality, TECHNOMETRICS) +# XXX Is this really a public function? It's not listed in the docs or +# exported by sklearn.covariance. Deprecate? def c_step(X, n_support, remaining_iterations=30, initial_estimates=None, verbose=False, cov_computation_method=empirical_covariance, random_state=None): @@ -76,16 +78,24 @@ def c_step(X, n_support, remaining_iterations=30, initial_estimates=None, Society for Quality, TECHNOMETRICS """ + X = np.asarray(X) random_state = check_random_state(random_state) + return _c_step(X, n_support, remaining_iterations=remaining_iterations, + initial_estimates=initial_estimates, verbose=verbose, + cov_computation_method=cov_computation_method, + random_state=random_state) + + +def _c_step(X, n_support, random_state, remaining_iterations=30, + initial_estimates=None, verbose=False, + cov_computation_method=empirical_covariance): n_samples, n_features = X.shape # Initialisation + support = np.zeros(n_samples, dtype=bool) if initial_estimates is None: # compute initial robust estimates from a random subset - support = np.zeros(n_samples).astype(bool) support[random_state.permutation(n_samples)[:n_support]] = True - location = X[support].mean(0) - covariance = cov_computation_method(X[support]) else: # get initial robust estimates from the function parameters location = initial_estimates[0] @@ -95,14 +105,15 @@ def c_step(X, n_support, remaining_iterations=30, initial_estimates=None, X_centered = X - location dist = (np.dot(X_centered, precision) * X_centered).sum(1) # compute new estimates - support = np.zeros(n_samples).astype(bool) support[np.argsort(dist)[:n_support]] = True - location = X[support].mean(0) - covariance = cov_computation_method(X[support]) - previous_det = np.inf + + X_support = X[support] + location = X_support.mean(0) + covariance = cov_computation_method(X_support) # Iterative procedure for Minimum Covariance Determinant computation det = fast_logdet(covariance) + previous_det = np.inf while (det < previous_det) and (remaining_iterations > 0): # save old estimates values previous_location = location @@ -114,10 +125,11 @@ def c_step(X, n_support, remaining_iterations=30, initial_estimates=None, X_centered = X - location dist = (np.dot(X_centered, precision) * X_centered).sum(axis=1) # compute new estimates - support = np.zeros(n_samples).astype(bool) + support = np.zeros(n_samples, dtype=bool) support[np.argsort(dist)[:n_support]] = True - location = X[support].mean(axis=0) - covariance = cov_computation_method(X[support]) + X_support = X[support] + location = X_support.mean(axis=0) + covariance = cov_computation_method(X_support) det = fast_logdet(covariance) # update remaining iterations for early stopping remaining_iterations -= 1 @@ -150,7 +162,6 @@ def c_step(X, n_support, remaining_iterations=30, initial_estimates=None, if remaining_iterations == 0: if verbose: print('Maximum number of iterations reached') - det = fast_logdet(covariance) results = location, covariance, det, support, dist return results @@ -247,7 +258,7 @@ def select_candidates(X, n_support, n_trials, select=1, n_iter=30, # perform `n_trials` computations from random initial supports for j in range(n_trials): all_estimates.append( - c_step( + _c_step( X, n_support, remaining_iterations=n_iter, verbose=verbose, cov_computation_method=cov_computation_method, random_state=random_state)) @@ -255,7 +266,7 @@ def select_candidates(X, n_support, n_trials, select=1, n_iter=30, # perform computations from every given initial estimates for j in range(n_trials): initial_estimates = (estimates_list[0][j], estimates_list[1][j]) - all_estimates.append(c_step( + all_estimates.append(_c_step( X, n_support, remaining_iterations=n_iter, initial_estimates=initial_estimates, verbose=verbose, cov_computation_method=cov_computation_method, @@ -361,7 +372,7 @@ def fast_mcd(X, support_fraction=None, + X_sorted[halves_start]).mean() support = np.zeros(n_samples, dtype=bool) X_centered = X - location - support[np.argsort(np.abs(X - location), 0)[:n_support]] = True + support[np.argsort(np.abs(X_centered), 0)[:n_support]] = True covariance = np.asarray([[np.var(X[support])]]) location = np.array([location]) # get precision matrix in an optimized way diff --git a/sklearn/cross_validation.py b/sklearn/cross_validation.py index 03952a2c6664f..b61be5ce46e83 100644 --- a/sklearn/cross_validation.py +++ b/sklearn/cross_validation.py @@ -1097,7 +1097,8 @@ def cross_val_score(estimator, X, y=None, scoring=None, cv=None, n_jobs=1, scores : array of float, shape=(len(list(cv)),) Array of scores of the estimator for each run of the cross validation. """ - X, y = check_arrays(X, y, sparse_format='csr', allow_lists=True) + X, y = check_arrays(X, y, sparse_format='csr', allow_lists=True, + allow_nans=True) if y is not None: y = np.asarray(y) @@ -1408,7 +1409,7 @@ def permutation_test_score(estimator, X, y, score_func=None, cv=None, vol. 11 """ - X, y = check_arrays(X, y, sparse_format='csr') + X, y = check_arrays(X, y, sparse_format='csr', allow_nans=True) cv = _check_cv(cv, X, y, classifier=is_classifier(estimator)) scorer = check_scoring(estimator, scoring=scoring, score_func=score_func) random_state = check_random_state(random_state) @@ -1505,6 +1506,7 @@ def train_test_split(*arrays, **options): train_size = options.pop('train_size', None) random_state = options.pop('random_state', None) options['sparse_format'] = 'csr' + options['allow_nans'] = True if test_size is None and train_size is None: test_size = 0.25 diff --git a/sklearn/decomposition/factor_analysis.py b/sklearn/decomposition/factor_analysis.py index 5bc06a23838f0..9bf10330f47bc 100644 --- a/sklearn/decomposition/factor_analysis.py +++ b/sklearn/decomposition/factor_analysis.py @@ -28,7 +28,7 @@ from ..base import BaseEstimator, TransformerMixin from ..externals.six.moves import xrange from ..utils import array2d, check_arrays, check_random_state -from ..utils.extmath import fast_logdet, fast_dot, randomized_svd +from ..utils.extmath import fast_logdet, fast_dot, randomized_svd, squared_norm from ..utils import ConvergenceWarning @@ -188,7 +188,7 @@ def fit(self, X, y=None): def my_svd(X): _, s, V = linalg.svd(X, full_matrices=False) return (s[:n_components], V[:n_components], - np.dot(s[n_components:].flat, s[n_components:].flat)) + squared_norm(s[n_components:])) elif self.svd_method == 'randomized': random_state = check_random_state(self.random_state) @@ -196,7 +196,7 @@ def my_svd(X): _, s, V = randomized_svd(X, n_components, random_state=random_state, n_iter=self.iterated_power) - return s, V, np.dot(X.flat, X.flat) - np.dot(s, s) + return s, V, squared_norm(X) - squared_norm(s) else: raise ValueError('SVD method %s is not supported. Please consider' ' the documentation' % self.svd_method) diff --git a/sklearn/decomposition/nmf.py b/sklearn/decomposition/nmf.py index 2ebdbb702fe32..2f6f12c9bb018 100644 --- a/sklearn/decomposition/nmf.py +++ b/sklearn/decomposition/nmf.py @@ -20,7 +20,7 @@ from ..base import BaseEstimator, TransformerMixin from ..utils import atleast2d_or_csr, check_random_state, check_arrays -from ..utils.extmath import randomized_svd, safe_sparse_dot +from ..utils.extmath import randomized_svd, safe_sparse_dot, squared_norm def safe_vstack(Xs): @@ -35,8 +35,7 @@ def norm(x): See: http://fseoane.net/blog/2011/computing-the-vector-norm/ """ - x = x.ravel() - return np.sqrt(np.dot(x, x)) + return sqrt(squared_norm(x)) def trace_dot(X, Y): diff --git a/sklearn/ensemble/_gradient_boosting.c b/sklearn/ensemble/_gradient_boosting.c index e7ce49f842778..5dc4e417a63d5 100644 --- a/sklearn/ensemble/_gradient_boosting.c +++ b/sklearn/ensemble/_gradient_boosting.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.20 on Thu Mar 20 14:03:19 2014 */ +/* Generated by Cython 0.20.1 on Sat Apr 12 13:35:30 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" +#define CYTHON_ABI "0_20_1" #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -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, 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) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" @@ -161,10 +161,16 @@ #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 @@ -231,7 +237,7 @@ #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif -#if PY_VERSION_HEX < 0x03020000 +#if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong @@ -645,7 +651,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #endif -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -654,7 +660,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int; */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -663,7 +669,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -672,7 +678,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -681,7 +687,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -690,7 +696,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -699,7 +705,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -708,7 +714,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -717,7 +723,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -726,7 +732,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -735,7 +741,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -744,7 +750,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -753,7 +759,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -762,7 +768,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -771,7 +777,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -780,7 +786,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -789,7 +795,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -798,7 +804,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -807,7 +813,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -816,7 +822,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -825,7 +831,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -945,16 +951,16 @@ typedef npy_intp __pyx_t_7sklearn_8ensemble_18_gradient_boosting_SIZE_t; /*--- Type declarations ---*/ -struct __pyx_MemviewEnum_obj; +struct __pyx_obj_7sklearn_4tree_5_tree_Criterion; +struct __pyx_obj_7sklearn_4tree_5_tree_Splitter; +struct __pyx_obj_7sklearn_4tree_5_tree_Tree; struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder; +struct __pyx_array_obj; +struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; -struct __pyx_obj_7sklearn_4tree_5_tree_Splitter; -struct __pyx_obj_7sklearn_4tree_5_tree_Criterion; struct __pyx_memoryviewslice_obj; -struct __pyx_array_obj; -struct __pyx_obj_7sklearn_4tree_5_tree_Tree; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -963,7 +969,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Tree; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -972,7 +978,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -981,7 +987,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -994,12 +1000,12 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree__resize_c; struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances; struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build; -/* "sklearn/tree/_tree.pxd":125 - * # Tree +/* "sklearn/tree/_tree.pxd":139 * # ============================================================================= + * * cdef struct Node: # <<<<<<<<<<<<<< - * # The main storage for Tree, excluding values at each node, which are - * # stored separately as their size is not known at compile time. + * # Base storage structure for the nodes in a Tree object + * */ struct __pyx_t_7sklearn_4tree_5_tree_Node { __pyx_t_7sklearn_4tree_5_tree_SIZE_t left_child; @@ -1007,11 +1013,11 @@ struct __pyx_t_7sklearn_4tree_5_tree_Node { __pyx_t_7sklearn_4tree_5_tree_SIZE_t feature; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t threshold; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t impurity; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_samples; - __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t weighted_n_samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_node_samples; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t weighted_n_node_samples; }; -/* "sklearn/tree/_tree.pxd":161 +/* "sklearn/tree/_tree.pxd":176 * double weighted_n_samples) nogil * cdef void _resize(self, SIZE_t capacity) * cdef int _resize_c(self, SIZE_t capacity=*) nogil # <<<<<<<<<<<<<< @@ -1023,7 +1029,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":168 +/* "sklearn/tree/_tree.pxd":183 * 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=*) # <<<<<<<<<<<<<< @@ -1035,7 +1041,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances { PyObject *normalize; }; -/* "sklearn/tree/_tree.pxd":181 +/* "sklearn/tree/_tree.pxd":204 * cdef SIZE_t max_depth # Maximal tree depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1046,65 +1052,38 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build { PyArrayObject *sample_weight; }; -/* "View.MemoryView":275 - * - * @cname('__pyx_MemviewEnum') - * cdef class Enum(object): # <<<<<<<<<<<<<< - * cdef object name - * def __init__(self, name): - */ -struct __pyx_MemviewEnum_obj { - PyObject_HEAD - PyObject *name; -}; - - -/* "sklearn/tree/_tree.pxd":174 - * # Tree builder +/* "sklearn/tree/_tree.pxd":25 * # ============================================================================= - * cdef class TreeBuilder: # <<<<<<<<<<<<<< - * cdef Splitter splitter # Splitting algorithm * + * 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_TreeBuilder { - PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtab; - struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *splitter; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t min_samples_split; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t min_samples_leaf; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_depth; -}; - - -/* "View.MemoryView":308 - * - * @cname('__pyx_memoryview') - * cdef class memoryview(object): # <<<<<<<<<<<<<< - * - * cdef object obj - */ -struct __pyx_memoryview_obj { +struct __pyx_obj_7sklearn_4tree_5_tree_Criterion { PyObject_HEAD - struct __pyx_vtabstruct_memoryview *__pyx_vtab; - PyObject *obj; - PyObject *_size; - PyObject *_array_interface; - PyThread_type_lock lock; - __pyx_atomic_int acquisition_count[2]; - __pyx_atomic_int *acquisition_count_aligned_p; - Py_buffer view; - int flags; - int dtype_is_object; - __Pyx_TypeInfo *typeinfo; + 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":60 +/* "sklearn/tree/_tree.pxd":67 * # ============================================================================= * * cdef class Splitter: # <<<<<<<<<<<<<< - * # Internal structures - * cdef public Criterion criterion # Impurity criterion + * # The splitter searches in the input space for a feature and a threshold + * # to split the samples samples[start:end]. */ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { PyObject_HEAD @@ -1116,6 +1095,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { __pyx_t_7sklearn_4tree_5_tree_UINT32_t rand_r_state; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_samples; + double weighted_n_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *features; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *constant_features; __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_features; @@ -1131,44 +1111,43 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { }; -/* "sklearn/tree/_tree.pxd":24 - * # Criterion - * # ============================================================================= - * cdef class Criterion: # <<<<<<<<<<<<<< - * # Internal structures - * cdef DOUBLE_t* y # Values of y +/* "sklearn/tree/_tree.pxd":150 + * DOUBLE_t weighted_n_node_samples # Weighted number of samples at the node + * + * cdef class Tree: # <<<<<<<<<<<<<< + * # The Tree object is a binary tree structure constructed by the + * # TreeBuilder. The tree structure is used for predictions and */ -struct __pyx_obj_7sklearn_4tree_5_tree_Criterion { +struct __pyx_obj_7sklearn_4tree_5_tree_Tree { 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; + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *__pyx_vtab; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_features; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t *n_classes; __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_outputs; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_node_samples; - double weighted_n_node_samples; - double weighted_n_left; - double weighted_n_right; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_n_classes; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_depth; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t node_count; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t capacity; + struct __pyx_t_7sklearn_4tree_5_tree_Node *nodes; + double *value; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t value_stride; }; -/* "View.MemoryView":930 - * - * @cname('__pyx_memoryviewslice') - * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< - * "Internal class for passing memoryview slices to Python" +/* "sklearn/tree/_tree.pxd":190 + * # ============================================================================= * + * cdef class TreeBuilder: # <<<<<<<<<<<<<< + * # The TreeBuilder recursively builds a Tree object from training samples, + * # using a Splitter object for splitting internal nodes and assigning */ -struct __pyx_memoryviewslice_obj { - struct __pyx_memoryview_obj __pyx_base; - __Pyx_memviewslice from_slice; - PyObject *from_object; - PyObject *(*to_object_func)(char *); - int (*to_dtype_func)(char *, PyObject *); +struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder { + PyObject_HEAD + struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtab; + struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *splitter; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t min_samples_split; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t min_samples_leaf; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_depth; }; @@ -1196,50 +1175,103 @@ struct __pyx_array_obj { }; -/* "sklearn/tree/_tree.pxd":139 +/* "View.MemoryView":275 + * + * @cname('__pyx_MemviewEnum') + * cdef class Enum(object): # <<<<<<<<<<<<<< + * cdef object name + * def __init__(self, name): + */ +struct __pyx_MemviewEnum_obj { + PyObject_HEAD + PyObject *name; +}; + + +/* "View.MemoryView":308 * + * @cname('__pyx_memoryview') + * cdef class memoryview(object): # <<<<<<<<<<<<<< * - * cdef class Tree: # <<<<<<<<<<<<<< - * # Input/Output layout - * cdef public SIZE_t n_features # Number of features in X + * cdef object obj */ -struct __pyx_obj_7sklearn_4tree_5_tree_Tree { +struct __pyx_memoryview_obj { PyObject_HEAD - struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree *__pyx_vtab; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_features; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t *n_classes; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_outputs; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_n_classes; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t max_depth; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t node_count; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t capacity; - struct __pyx_t_7sklearn_4tree_5_tree_Node *nodes; - double *value; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t value_stride; + struct __pyx_vtabstruct_memoryview *__pyx_vtab; + PyObject *obj; + PyObject *_size; + PyObject *_array_interface; + PyThread_type_lock lock; + __pyx_atomic_int acquisition_count[2]; + __pyx_atomic_int *acquisition_count_aligned_p; + Py_buffer view; + int flags; + int dtype_is_object; + __Pyx_TypeInfo *typeinfo; +}; + + +/* "View.MemoryView":930 + * + * @cname('__pyx_memoryviewslice') + * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< + * "Internal class for passing memoryview slices to Python" + * + */ +struct __pyx_memoryviewslice_obj { + struct __pyx_memoryview_obj __pyx_base; + __Pyx_memviewslice from_slice; + PyObject *from_object; + PyObject *(*to_object_func)(char *); + int (*to_dtype_func)(char *, PyObject *); }; -/* "sklearn/tree/_tree.pxd":174 - * # Tree builder +/* "sklearn/tree/_tree.pxd":25 * # ============================================================================= - * cdef class TreeBuilder: # <<<<<<<<<<<<<< - * cdef Splitter splitter # Splitting algorithm * + * 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_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_Criterion { + void (*init)(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); + void (*reset)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *); + void (*update)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); + double (*node_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *); + void (*children_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *); + void (*node_value)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *); + double (*impurity_improvement)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double); }; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; +static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; -/* "sklearn/tree/_tree.pxd":139 +/* "sklearn/tree/_tree.pxd":67 + * # ============================================================================= * + * cdef class Splitter: # <<<<<<<<<<<<<< + * # The splitter searches in the input space for a feature and a threshold + * # to split the samples samples[start:end]. + */ + +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, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, double *, double *, double *, double *, __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_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; + + +/* "sklearn/tree/_tree.pxd":150 + * DOUBLE_t weighted_n_node_samples # Weighted number of samples at the node * * cdef class Tree: # <<<<<<<<<<<<<< - * # Input/Output layout - * cdef public SIZE_t n_features # Number of features in X + * # The Tree object is a binary tree structure constructed by the + * # TreeBuilder. The tree structure is used for predictions and */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree { @@ -1255,6 +1287,20 @@ 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.pxd":190 + * # ============================================================================= + * + * cdef class TreeBuilder: # <<<<<<<<<<<<<< + * # The TreeBuilder recursively builds a Tree object from training samples, + * # using a Splitter object for splitting internal nodes and assigning + */ + +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; + + /* "View.MemoryView":308 * * @cname('__pyx_memoryview') @@ -1287,45 +1333,6 @@ struct __pyx_vtabstruct__memoryviewslice { struct __pyx_vtabstruct_memoryview __pyx_base; }; static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; - - - -/* "sklearn/tree/_tree.pxd":24 - * # Criterion - * # ============================================================================= - * cdef class Criterion: # <<<<<<<<<<<<<< - * # Internal structures - * cdef DOUBLE_t* y # Values of y - */ - -struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion { - void (*init)(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 *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); - void (*reset)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *); - void (*update)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); - double (*node_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *); - void (*children_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *, double *); - void (*node_value)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double *); - double (*impurity_improvement)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, double); -}; -static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; - - -/* "sklearn/tree/_tree.pxd":60 - * # ============================================================================= - * - * cdef class Splitter: # <<<<<<<<<<<<<< - * # Internal structures - * cdef public Criterion criterion # Impurity criterion - */ - -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, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, double *, double *, double *, double *, __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_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif @@ -1434,9 +1441,15 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ - -#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d +#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_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ + +#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d #define __Pyx_MEMVIEW_DIRECT 1 #define __Pyx_MEMVIEW_PTR 2 #define __Pyx_MEMVIEW_FULL 4 @@ -1838,9 +1851,9 @@ static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_Tree = 0; static PyTypeObject *__pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = 0; /* Module declarations from 'sklearn.ensemble._gradient_boosting' */ -static PyTypeObject *__pyx_memoryview_type = 0; static PyTypeObject *__pyx_array_type = 0; static PyTypeObject *__pyx_MemviewEnum_type = 0; +static PyTypeObject *__pyx_memoryview_type = 0; static PyTypeObject *__pyx_memoryviewslice_type = 0; static int __pyx_v_7sklearn_8ensemble_18_gradient_boosting_LEAF; static PyObject *generic = 0; @@ -1941,9 +1954,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ -static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static char __pyx_k_B[] = "B"; static char __pyx_k_H[] = "H"; @@ -2061,7 +2074,7 @@ static char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.ar static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static char __pyx_k_strided_and_direct_or_indirect[] = ""; -static char __pyx_k_Users_ajoly_git_scikit_learn_sk[] = "/Users/ajoly/git/scikit-learn/sklearn/ensemble/_gradient_boosting.pyx"; +static char __pyx_k_home_gilles_Sources_scikit_lear[] = "/home/gilles/Sources/scikit-learn/sklearn/ensemble/_gradient_boosting.pyx"; static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; static char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; @@ -2105,7 +2118,6 @@ static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_kp_s_Total_weight_should_be_1_0_but_w; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; -static PyObject *__pyx_kp_s_Users_ajoly_git_scikit_learn_sk; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_X; static PyObject *__pyx_n_s_allocate_buffer; @@ -2132,6 +2144,7 @@ static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_b_fortran; static PyObject *__pyx_n_s_fortran; static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; +static PyObject *__pyx_kp_s_home_gilles_Sources_scikit_lear; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_import; @@ -2778,7 +2791,7 @@ static PyObject *__pyx_pf_7sklearn_8ensemble_18_gradient_boosting_2predict_stage __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -3072,7 +3085,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -3132,7 +3145,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -3339,7 +3352,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend * # push left child * node_stack[stack_size] = root_node + current_node.left_child # <<<<<<<<<<<<<< * current_weight = weight_stack[stack_size] - * left_sample_frac = root_node[current_node.left_child].n_samples / \ + * left_sample_frac = root_node[current_node.left_child].n_node_samples / \ */ (__pyx_v_node_stack[__pyx_v_stack_size]) = (__pyx_v_root_node + __pyx_v_current_node->left_child); @@ -3347,8 +3360,8 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend * # push left child * node_stack[stack_size] = root_node + current_node.left_child * current_weight = weight_stack[stack_size] # <<<<<<<<<<<<<< - * left_sample_frac = root_node[current_node.left_child].n_samples / \ - * current_node.n_samples + * left_sample_frac = root_node[current_node.left_child].n_node_samples / \ + * current_node.n_node_samples */ __pyx_t_19 = __pyx_v_stack_size; __pyx_v_current_weight = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_weight_stack.data) + __pyx_t_19)) ))); @@ -3356,15 +3369,15 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend /* "sklearn/ensemble/_gradient_boosting.pyx":247 * node_stack[stack_size] = root_node + current_node.left_child * current_weight = weight_stack[stack_size] - * left_sample_frac = root_node[current_node.left_child].n_samples / \ # <<<<<<<<<<<<<< - * current_node.n_samples + * left_sample_frac = root_node[current_node.left_child].n_node_samples / \ # <<<<<<<<<<<<<< + * current_node.n_node_samples * if left_sample_frac <= 0.0 or left_sample_frac >= 1.0: */ - __pyx_v_left_sample_frac = ((__pyx_v_root_node[__pyx_v_current_node->left_child]).n_samples / ((double)__pyx_v_current_node->n_samples)); + __pyx_v_left_sample_frac = ((__pyx_v_root_node[__pyx_v_current_node->left_child]).n_node_samples / ((double)__pyx_v_current_node->n_node_samples)); /* "sklearn/ensemble/_gradient_boosting.pyx":249 - * left_sample_frac = root_node[current_node.left_child].n_samples / \ - * current_node.n_samples + * left_sample_frac = root_node[current_node.left_child].n_node_samples / \ + * current_node.n_node_samples * if left_sample_frac <= 0.0 or left_sample_frac >= 1.0: # <<<<<<<<<<<<<< * raise ValueError("left_sample_frac:%f, " * "n_samples current: %d, " @@ -3382,8 +3395,8 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend * "n_samples current: %d, " * "n_samples left: %d" * % (left_sample_frac, # <<<<<<<<<<<<<< - * current_node.n_samples, - * root_node[current_node.left_child].n_samples)) + * current_node.n_node_samples, + * root_node[current_node.left_child].n_node_samples)) */ __pyx_t_9 = PyFloat_FromDouble(__pyx_v_left_sample_frac); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); @@ -3391,29 +3404,29 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend /* "sklearn/ensemble/_gradient_boosting.pyx":254 * "n_samples left: %d" * % (left_sample_frac, - * current_node.n_samples, # <<<<<<<<<<<<<< - * root_node[current_node.left_child].n_samples)) + * current_node.n_node_samples, # <<<<<<<<<<<<<< + * root_node[current_node.left_child].n_node_samples)) * weight_stack[stack_size] = current_weight * left_sample_frac */ - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_current_node->n_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_current_node->n_node_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); /* "sklearn/ensemble/_gradient_boosting.pyx":255 * % (left_sample_frac, - * current_node.n_samples, - * root_node[current_node.left_child].n_samples)) # <<<<<<<<<<<<<< + * current_node.n_node_samples, + * root_node[current_node.left_child].n_node_samples)) # <<<<<<<<<<<<<< * weight_stack[stack_size] = current_weight * left_sample_frac * stack_size +=1 */ - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_root_node[__pyx_v_current_node->left_child]).n_samples); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_root_node[__pyx_v_current_node->left_child]).n_node_samples); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); /* "sklearn/ensemble/_gradient_boosting.pyx":253 * "n_samples current: %d, " * "n_samples left: %d" * % (left_sample_frac, # <<<<<<<<<<<<<< - * current_node.n_samples, - * root_node[current_node.left_child].n_samples)) + * current_node.n_node_samples, + * root_node[current_node.left_child].n_node_samples)) */ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); @@ -3431,7 +3444,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "sklearn/ensemble/_gradient_boosting.pyx":250 - * current_node.n_samples + * current_node.n_node_samples * if left_sample_frac <= 0.0 or left_sample_frac >= 1.0: * raise ValueError("left_sample_frac:%f, " # <<<<<<<<<<<<<< * "n_samples current: %d, " @@ -3442,7 +3455,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); @@ -3451,8 +3464,8 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend } /* "sklearn/ensemble/_gradient_boosting.pyx":256 - * current_node.n_samples, - * root_node[current_node.left_child].n_samples)) + * current_node.n_node_samples, + * root_node[current_node.left_child].n_node_samples)) * weight_stack[stack_size] = current_weight * left_sample_frac # <<<<<<<<<<<<<< * stack_size +=1 * @@ -3461,7 +3474,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_weight_stack.data) + __pyx_t_22)) )) = (__pyx_v_current_weight * __pyx_v_left_sample_frac); /* "sklearn/ensemble/_gradient_boosting.pyx":257 - * root_node[current_node.left_child].n_samples)) + * root_node[current_node.left_child].n_node_samples)) * weight_stack[stack_size] = current_weight * left_sample_frac * stack_size +=1 # <<<<<<<<<<<<<< * @@ -3541,7 +3554,7 @@ static PyObject *__pyx_f_7sklearn_8ensemble_18_gradient_boosting__partial_depend PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); @@ -3834,7 +3847,7 @@ static PyObject *__pyx_pf_7sklearn_8ensemble_18_gradient_boosting_6_random_sampl PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 291; __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; @@ -3879,7 +3892,7 @@ static PyObject *__pyx_pf_7sklearn_8ensemble_18_gradient_boosting_6_random_sampl __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 = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -3975,7 +3988,7 @@ static PyObject *__pyx_pf_7sklearn_8ensemble_18_gradient_boosting_6_random_sampl PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4016,7 +4029,7 @@ static PyObject *__pyx_pf_7sklearn_8ensemble_18_gradient_boosting_6_random_sampl return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -4068,7 +4081,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -4081,7 +4094,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -4090,7 +4103,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -4099,7 +4112,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -4108,7 +4121,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4118,7 +4131,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -4130,7 +4143,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -4141,7 +4154,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -4151,7 +4164,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -4165,21 +4178,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_3) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -4189,7 +4202,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -4203,21 +4216,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_2) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -4226,7 +4239,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -4235,7 +4248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -4245,7 +4258,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -4254,7 +4267,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))); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4263,7 +4276,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -4274,7 +4287,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -4283,7 +4296,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]); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "/usr/local/lib/python2.7/dist-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] # <<<<<<<<<<<<<< @@ -4296,7 +4309,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -4305,7 +4318,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)); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -4316,7 +4329,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L7:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -4325,7 +4338,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -4334,7 +4347,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -4343,7 +4356,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -4352,7 +4365,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -4364,7 +4377,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -4373,7 +4386,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -4389,7 +4402,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -4405,7 +4418,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -4420,7 +4433,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L10:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -4430,7 +4443,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -4440,7 +4453,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -4455,7 +4468,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (!__pyx_t_2) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -4475,21 +4488,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4498,7 +4511,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4509,7 +4522,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4520,7 +4533,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4531,7 +4544,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4542,7 +4555,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4553,7 +4566,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4564,7 +4577,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4575,7 +4588,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4586,7 +4599,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4597,7 +4610,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4608,7 +4621,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4619,7 +4632,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4630,7 +4643,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4641,7 +4654,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4652,7 +4665,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4663,7 +4676,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4674,7 +4687,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4686,7 +4699,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -4703,7 +4716,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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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); @@ -4712,7 +4725,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -4721,7 +4734,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -4733,7 +4746,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -4742,7 +4755,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4751,7 +4764,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4760,7 +4773,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "/usr/local/lib/python2.7/dist-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, # <<<<<<<<<<<<<< @@ -4770,7 +4783,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[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -4780,7 +4793,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -4812,7 +4825,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4836,7 +4849,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -4846,7 +4859,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -4858,7 +4871,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -4868,7 +4881,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -4880,7 +4893,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -4892,7 +4905,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4909,7 +4922,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -4923,7 +4936,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -4942,7 +4955,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4959,7 +4972,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -4973,7 +4986,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -4992,7 +5005,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5009,7 +5022,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -5023,7 +5036,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -5042,7 +5055,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5059,7 +5072,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -5073,7 +5086,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -5092,7 +5105,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -5109,7 +5122,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -5123,7 +5136,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -5142,7 +5155,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -5176,7 +5189,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5185,7 +5198,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -5194,7 +5207,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -5216,7 +5229,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -5229,7 +5242,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -5268,7 +5281,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -5285,21 +5298,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -5314,7 +5327,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -5334,21 +5347,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -5364,7 +5377,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -5373,7 +5386,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -5382,7 +5395,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -5393,7 +5406,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); } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -5403,7 +5416,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); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -5413,7 +5426,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -5425,7 +5438,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -5435,21 +5448,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5467,7 +5480,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5485,7 +5498,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5503,7 +5516,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5521,7 +5534,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5539,7 +5552,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5557,7 +5570,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5575,7 +5588,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5593,7 +5606,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5611,7 +5624,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5629,7 +5642,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5647,7 +5660,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5665,7 +5678,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5683,7 +5696,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -5703,7 +5716,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -5723,7 +5736,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -5743,7 +5756,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -5762,7 +5775,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -5776,7 +5789,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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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); @@ -5785,7 +5798,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L11:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -5797,7 +5810,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -5811,7 +5824,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -5821,7 +5834,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -5846,7 +5859,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5861,7 +5874,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); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -5872,7 +5885,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -5884,7 +5897,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -5893,7 +5906,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -5904,7 +5917,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -5913,7 +5926,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -5922,7 +5935,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -5934,7 +5947,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5948,7 +5961,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -5958,7 +5971,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -5972,7 +5985,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -5983,7 +5996,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -6192,7 +6205,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx * * if self.itemsize <= 0: */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __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; @@ -6216,7 +6229,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx * * encode = getattr(format, 'encode', None) */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 127; __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; @@ -6252,7 +6265,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx * self._format = format * self.format = self._format */ - __pyx_t_3 = PyObject_Call(__pyx_v_encode, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_encode, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); __pyx_t_3 = 0; @@ -6345,7 +6358,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx * * */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __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; @@ -6419,7 +6432,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); @@ -6457,16 +6470,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx */ __Pyx_INCREF(__pyx_v_mode); __pyx_t_3 = __pyx_v_mode; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_n_s_fortran, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (((int)__pyx_t_6)) { - __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_n_s_c, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_5 = ((int)__pyx_t_2); + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_fortran, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_6) { + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_c, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __pyx_t_2; } else { - __pyx_t_5 = ((int)__pyx_t_6); + __pyx_t_5 = __pyx_t_6; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (__pyx_t_5 != 0); @@ -6486,7 +6495,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); @@ -6565,7 +6574,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx * self.mode = mode * */ - __pyx_t_3 = PyObject_Call(__pyx_v_decode, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_decode, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_3); __pyx_t_3 = 0; @@ -6646,7 +6655,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx * * if self.dtype_is_object: */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __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; @@ -6867,7 +6876,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a * info.buf = self.data * info.len = self.len */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __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; @@ -7213,7 +7222,7 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; @@ -7498,7 +7507,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); @@ -7553,7 +7562,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize * allocate_buffer=False) * result.data = buf */ - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8772,7 +8781,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_ __Pyx_GIVEREF(__pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); @@ -9396,7 +9405,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_bytesitem); __Pyx_GIVEREF(__pyx_v_bytesitem); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9477,7 +9486,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview * else: * if len(self.view.format) == 1: */ - __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -9610,7 +9619,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -9640,7 +9649,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10248,7 +10257,7 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__ * * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10914,7 +10923,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py __Pyx_INCREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11419,7 +11428,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in __Pyx_GIVEREF(__pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); @@ -11694,7 +11703,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * seen_ellipsis = True * else: */ - __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_9 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11729,7 +11738,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * have_slices = True * else: */ - __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -11779,7 +11788,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); @@ -11843,7 +11852,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { * * return have_slices or nslices, tuple(result) */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -11971,7 +11980,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __ * * */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 668; __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; @@ -12457,6 +12466,15 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_ */ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + /* "View.MemoryView":744 + * return memoryview_fromslice(dst, new_ndim, + * memviewsliceobj.to_object_func, + * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< + * memview.dtype_is_object) + * else: + */ + if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + /* "View.MemoryView":742 * * if isinstance(memview, _memoryviewslice): @@ -13327,7 +13345,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); @@ -13365,7 +13383,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 896; __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); @@ -13917,7 +13935,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); @@ -15483,7 +15501,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1215; __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); @@ -15556,7 +15574,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1220; __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); @@ -15633,7 +15651,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_error, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); @@ -16628,10 +16646,9 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t /* function exit code */ } -static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; -static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_memoryview_obj *p; +static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_array_obj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); @@ -16639,74 +16656,35 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; - p = ((struct __pyx_memoryview_obj *)o); - p->__pyx_vtab = __pyx_vtabptr_memoryview; - p->obj = Py_None; Py_INCREF(Py_None); - p->_size = Py_None; Py_INCREF(Py_None); - p->_array_interface = Py_None; Py_INCREF(Py_None); - p->view.obj = NULL; - if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) { + p = ((struct __pyx_array_obj *)o); + p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); + p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); + if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) { Py_DECREF(o); o = 0; } return o; } -static void __pyx_tp_dealloc_memoryview(PyObject *o) { - struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; +static void __pyx_tp_dealloc_array(PyObject *o) { + struct __pyx_array_obj *p = (struct __pyx_array_obj *)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); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_memoryview___dealloc__(o); + __pyx_array___dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } - Py_CLEAR(p->obj); - Py_CLEAR(p->_size); - Py_CLEAR(p->_array_interface); + Py_CLEAR(p->mode); + Py_CLEAR(p->_format); (*Py_TYPE(o)->tp_free)(o); } - -static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; - if (p->obj) { - e = (*v)(p->obj, a); if (e) return e; - } - if (p->_size) { - e = (*v)(p->_size, a); if (e) return e; - } - if (p->_array_interface) { - e = (*v)(p->_array_interface, a); if (e) return e; - } - if (p->view.obj) { - e = (*v)(p->view.obj, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_memoryview(PyObject *o) { - PyObject* tmp; - struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; - tmp = ((PyObject*)p->obj); - p->obj = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_size); - p->_size = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_array_interface); - p->_array_interface = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - Py_CLEAR(p->view.obj); - return 0; -} -static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { +static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); @@ -16714,9 +16692,9 @@ static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { return r; } -static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { +static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { if (v) { - return __pyx_memoryview___setitem__(o, i, v); + return __pyx_array___setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, @@ -16725,68 +16703,34 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject } } -static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_transpose(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview__get__base(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_shape(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_strides(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_suboffsets(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_ndim(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_itemsize(o); -} - -static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_nbytes(o); +static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { + PyObject *v = PyObject_GenericGetAttr(o, n); + if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + v = __pyx_array___getattr__(o, n); + } + return v; } -static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_memoryview_get_size(o); +static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { + return get_memview(o); } -static PyMethodDef __pyx_methods_memoryview[] = { - {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_array[] = { + {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_memoryview[] = { - {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0}, - {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0}, - {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0}, - {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0}, - {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0}, - {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0}, - {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0}, - {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0}, - {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0}, +static struct PyGetSetDef __pyx_getsets_array[] = { + {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0}, {0, 0, 0, 0, 0} }; -static PySequenceMethods __pyx_tp_as_sequence_memoryview = { - __pyx_memoryview___len__, /*sq_length*/ +static PySequenceMethods __pyx_tp_as_sequence_array = { + 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ - __pyx_sq_item_memoryview, /*sq_item*/ + __pyx_sq_item_array, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ @@ -16795,13 +16739,13 @@ static PySequenceMethods __pyx_tp_as_sequence_memoryview = { 0, /*sq_inplace_repeat*/ }; -static PyMappingMethods __pyx_tp_as_mapping_memoryview = { - __pyx_memoryview___len__, /*mp_length*/ - __pyx_memoryview___getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +static PyMappingMethods __pyx_tp_as_mapping_array = { + 0, /*mp_length*/ + __pyx_array___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ }; -static PyBufferProcs __pyx_tp_as_buffer_memoryview = { +static PyBufferProcs __pyx_tp_as_buffer_array = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif @@ -16815,19 +16759,19 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = { 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 - __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + __pyx_array_getbuffer, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; -static PyTypeObject __pyx_type___pyx_memoryview = { +static PyTypeObject __pyx_type___pyx_array = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.ensemble._gradient_boosting.memoryview"), /*tp_name*/ - sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.ensemble._gradient_boosting.array"), /*tp_name*/ + sizeof(struct __pyx_array_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ + __pyx_tp_dealloc_array, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -16836,27 +16780,27 @@ static PyTypeObject __pyx_type___pyx_memoryview = { #else 0, /*reserved*/ #endif - __pyx_memoryview___repr__, /*tp_repr*/ + 0, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ + &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_memoryview___str__, /*tp_str*/ - 0, /*tp_getattro*/ + 0, /*tp_str*/ + __pyx_tp_getattro_array, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_memoryview, /*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_tp_as_buffer_array, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_memoryview, /*tp_traverse*/ - __pyx_tp_clear_memoryview, /*tp_clear*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_memoryview, /*tp_methods*/ + __pyx_methods_array, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_memoryview, /*tp_getset*/ + __pyx_getsets_array, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -16864,7 +16808,7 @@ static PyTypeObject __pyx_type___pyx_memoryview = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_memoryview, /*tp_new*/ + __pyx_tp_new_array, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -16881,8 +16825,8 @@ static PyTypeObject __pyx_type___pyx_memoryview = { #endif }; -static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_array_obj *p; +static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_MemviewEnum_obj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); @@ -16890,122 +16834,51 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; - p = ((struct __pyx_array_obj *)o); - p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); - p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); - if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) { - Py_DECREF(o); o = 0; - } + p = ((struct __pyx_MemviewEnum_obj *)o); + p->name = Py_None; Py_INCREF(Py_None); return o; } -static void __pyx_tp_dealloc_array(PyObject *o) { - struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; +static void __pyx_tp_dealloc_Enum(PyObject *o) { + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if PY_VERSION_HEX >= 0x030400a1 - if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_array___dealloc__(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->mode); - Py_CLEAR(p->_format); + PyObject_GC_UnTrack(o); + Py_CLEAR(p->name); (*Py_TYPE(o)->tp_free)(o); } -static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; -} -static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_array___setitem__(o, i, v); - } - else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); - return -1; - } -} - -static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { - PyObject *v = PyObject_GenericGetAttr(o, n); - if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Clear(); - v = __pyx_array___getattr__(o, n); +static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + if (p->name) { + e = (*v)(p->name, a); if (e) return e; } - return v; + return 0; } -static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { - return get_memview(o); +static int __pyx_tp_clear_Enum(PyObject *o) { + PyObject* tmp; + struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; + tmp = ((PyObject*)p->name); + p->name = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; } -static PyMethodDef __pyx_methods_array[] = { - {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)}, +static PyMethodDef __pyx_methods_Enum[] = { {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_array[] = { - {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_array = { - 0, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_array, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_array = { - 0, /*mp_length*/ - __pyx_array___getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ -}; - -static PyBufferProcs __pyx_tp_as_buffer_array = { - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - __pyx_array_getbuffer, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif -}; - -static PyTypeObject __pyx_type___pyx_array = { +static PyTypeObject __pyx_type___pyx_MemviewEnum = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.ensemble._gradient_boosting.array"), /*tp_name*/ - sizeof(struct __pyx_array_obj), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.ensemble._gradient_boosting.Enum"), /*tp_name*/ + sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_array, /*tp_dealloc*/ + __pyx_tp_dealloc_Enum, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -17014,35 +16887,35 @@ static PyTypeObject __pyx_type___pyx_array = { #else 0, /*reserved*/ #endif - 0, /*tp_repr*/ + __pyx_MemviewEnum___repr__, /*tp_repr*/ 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ - __pyx_tp_getattro_array, /*tp_getattro*/ + 0, /*tp_getattro*/ 0, /*tp_setattro*/ - &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_Enum, /*tp_traverse*/ + __pyx_tp_clear_Enum, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_array, /*tp_methods*/ + __pyx_methods_Enum, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_array, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - 0, /*tp_init*/ + __pyx_MemviewEnum___init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_array, /*tp_new*/ + __pyx_tp_new_Enum, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -17058,9 +16931,10 @@ static PyTypeObject __pyx_type___pyx_array = { 0, /*tp_finalize*/ #endif }; +static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; -static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_MemviewEnum_obj *p; +static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { + struct __pyx_memoryview_obj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); @@ -17068,51 +16942,195 @@ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, C o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; - p = ((struct __pyx_MemviewEnum_obj *)o); - p->name = Py_None; Py_INCREF(Py_None); + p = ((struct __pyx_memoryview_obj *)o); + p->__pyx_vtab = __pyx_vtabptr_memoryview; + p->obj = Py_None; Py_INCREF(Py_None); + p->_size = Py_None; Py_INCREF(Py_None); + p->_array_interface = Py_None; Py_INCREF(Py_None); + p->view.obj = NULL; + if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) { + Py_DECREF(o); o = 0; + } return o; } -static void __pyx_tp_dealloc_Enum(PyObject *o) { - struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; +static void __pyx_tp_dealloc_memoryview(PyObject *o) { + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)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->name); + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++Py_REFCNT(o); + __pyx_memoryview___dealloc__(o); + --Py_REFCNT(o); + PyErr_Restore(etype, eval, etb); + } + Py_CLEAR(p->obj); + Py_CLEAR(p->_size); + Py_CLEAR(p->_array_interface); (*Py_TYPE(o)->tp_free)(o); } -static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - if (p->name) { - e = (*v)(p->name, a); if (e) return e; + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + if (p->obj) { + e = (*v)(p->obj, a); if (e) return e; + } + if (p->_size) { + e = (*v)(p->_size, a); if (e) return e; + } + if (p->_array_interface) { + e = (*v)(p->_array_interface, a); if (e) return e; + } + if (p->view.obj) { + e = (*v)(p->view.obj, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_Enum(PyObject *o) { +static int __pyx_tp_clear_memoryview(PyObject *o) { PyObject* tmp; - struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; - tmp = ((PyObject*)p->name); - p->name = Py_None; Py_INCREF(Py_None); + struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; + tmp = ((PyObject*)p->obj); + p->obj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_size); + p->_size = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->_array_interface); + p->_array_interface = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); + Py_CLEAR(p->view.obj); return 0; } +static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { + PyObject *r; + PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; + r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} -static PyMethodDef __pyx_methods_Enum[] = { +static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { + if (v) { + return __pyx_memoryview___setitem__(o, i, v); + } + else { + PyErr_Format(PyExc_NotImplementedError, + "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); + return -1; + } +} + +static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_transpose(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview__get__base(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_shape(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_strides(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_suboffsets(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_ndim(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_itemsize(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_nbytes(o); +} + +static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_memoryview_get_size(o); +} + +static PyMethodDef __pyx_methods_memoryview[] = { + {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type___pyx_MemviewEnum = { +static struct PyGetSetDef __pyx_getsets_memoryview[] = { + {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0}, + {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0}, + {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0}, + {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0}, + {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0}, + {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0}, + {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0}, + {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0}, + {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PySequenceMethods __pyx_tp_as_sequence_memoryview = { + __pyx_memoryview___len__, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_memoryview, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_memoryview = { + __pyx_memoryview___len__, /*mp_length*/ + __pyx_memoryview___getitem__, /*mp_subscript*/ + __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_memoryview = { + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getreadbuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getwritebuffer*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getsegcount*/ + #endif + #if PY_MAJOR_VERSION < 3 + 0, /*bf_getcharbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + __pyx_memoryview_getbuffer, /*bf_getbuffer*/ + #endif + #if PY_VERSION_HEX >= 0x02060000 + 0, /*bf_releasebuffer*/ + #endif +}; + +static PyTypeObject __pyx_type___pyx_memoryview = { PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("sklearn.ensemble._gradient_boosting.Enum"), /*tp_name*/ - sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ + __Pyx_NAMESTR("sklearn.ensemble._gradient_boosting.memoryview"), /*tp_name*/ + sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_Enum, /*tp_dealloc*/ + __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -17121,35 +17139,35 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = { #else 0, /*reserved*/ #endif - __pyx_MemviewEnum___repr__, /*tp_repr*/ + __pyx_memoryview___repr__, /*tp_repr*/ 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - 0, /*tp_str*/ + __pyx_memoryview___str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ + &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_Enum, /*tp_traverse*/ - __pyx_tp_clear_Enum, /*tp_clear*/ + __pyx_tp_traverse_memoryview, /*tp_traverse*/ + __pyx_tp_clear_memoryview, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_Enum, /*tp_methods*/ + __pyx_methods_memoryview, /*tp_methods*/ 0, /*tp_members*/ - 0, /*tp_getset*/ + __pyx_getsets_memoryview, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_MemviewEnum___init__, /*tp_init*/ + 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_Enum, /*tp_new*/ + __pyx_tp_new_memoryview, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -17348,7 +17366,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_Total_weight_should_be_1_0_but_w, __pyx_k_Total_weight_should_be_1_0_but_w, sizeof(__pyx_k_Total_weight_should_be_1_0_but_w), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, - {&__pyx_kp_s_Users_ajoly_git_scikit_learn_sk, __pyx_k_Users_ajoly_git_scikit_learn_sk, sizeof(__pyx_k_Users_ajoly_git_scikit_learn_sk), 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_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, @@ -17375,6 +17392,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_b_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 0, 1}, {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, + {&__pyx_kp_s_home_gilles_Sources_scikit_lear, __pyx_k_home_gilles_Sources_scikit_lear, sizeof(__pyx_k_home_gilles_Sources_scikit_lear), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, @@ -17468,7 +17486,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -17479,7 +17497,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -17490,7 +17508,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -17501,7 +17519,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -17512,7 +17530,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -17523,7 +17541,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -17687,7 +17705,7 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__20 = PyTuple_Pack(9, __pyx_n_s_estimators, __pyx_n_s_X, __pyx_n_s_scale, __pyx_n_s_out, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_n_estimators, __pyx_n_s_K, __pyx_n_s_tree_2); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ajoly_git_scikit_learn_sk, __pyx_n_s_predict_stages, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gilles_Sources_scikit_lear, __pyx_n_s_predict_stages, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "sklearn/ensemble/_gradient_boosting.pyx":133 * @@ -17699,7 +17717,7 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__22 = PyTuple_Pack(5, __pyx_n_s_estimators, __pyx_n_s_stage, __pyx_n_s_X, __pyx_n_s_scale, __pyx_n_s_out); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ajoly_git_scikit_learn_sk, __pyx_n_s_predict_stage, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gilles_Sources_scikit_lear, __pyx_n_s_predict_stage, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "sklearn/ensemble/_gradient_boosting.pyx":270 * @@ -17711,7 +17729,7 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__24 = PyTuple_Pack(7, __pyx_n_s_n_total_samples, __pyx_n_s_n_total_in_bag, __pyx_n_s_random_state, __pyx_n_s_rand, __pyx_n_s_sample_mask, __pyx_n_s_n_bagged, __pyx_n_s_i); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ajoly_git_scikit_learn_sk, __pyx_n_s_random_sample_mask, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gilles_Sources_scikit_lear, __pyx_n_s_random_sample_mask, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "View.MemoryView":282 * return self.name @@ -17870,6 +17888,12 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) /*--- Variable export code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ + if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_array.tp_print = 0; + __pyx_array_type = &__pyx_type___pyx_array; + if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type___pyx_MemviewEnum.tp_print = 0; + __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; @@ -17882,12 +17906,6 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) __pyx_type___pyx_memoryview.tp_print = 0; if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_memoryview_type = &__pyx_type___pyx_memoryview; - if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_type___pyx_array.tp_print = 0; - __pyx_array_type = &__pyx_type___pyx_array; - if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_type___pyx_MemviewEnum.tp_print = 0; - __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; @@ -17910,14 +17928,14 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_5_tree_Criterion = __Pyx_ImportType("sklearn.tree._tree", "Criterion", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_Criterion->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_5_tree_Splitter = __Pyx_ImportType("sklearn.tree._tree", "Splitter", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_Splitter)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_Splitter->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_5_tree_Tree = __Pyx_ImportType("sklearn.tree._tree", "Tree", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Tree), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_Tree)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_5_tree_Tree = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_Tree->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_Tree)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = __Pyx_ImportType("sklearn.tree._tree", "TreeBuilder", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_Criterion = __Pyx_ImportType("sklearn.tree._tree", "Criterion", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_5_tree_Criterion = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_Criterion->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_Splitter = __Pyx_ImportType("sklearn.tree._tree", "Splitter", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_Splitter)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_5_tree_Splitter = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_Splitter->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_Tree = __Pyx_ImportType("sklearn.tree._tree", "Tree", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_Tree), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_Tree)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_5_tree_Tree = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Tree*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_Tree->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_Tree)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = __Pyx_ImportType("sklearn.tree._tree", "TreeBuilder", sizeof(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder = (struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -18201,7 +18219,7 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) * cdef strided = Enum("") # default * cdef indirect = Enum("") */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_2); @@ -18215,7 +18233,7 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) * cdef indirect = Enum("") * */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_2); @@ -18229,7 +18247,7 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) * * */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_2); @@ -18243,7 +18261,7 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) * cdef indirect_contiguous = Enum("") * */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_2); @@ -18257,7 +18275,7 @@ PyMODINIT_FUNC PyInit__gradient_boosting(void) * * */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2); @@ -18851,8 +18869,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; while (*ts && *ts != ')') { - if (isspace(*ts)) - continue; + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return NULL; if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) @@ -19211,6 +19231,29 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( return NULL; } +#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 + #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { @@ -21722,11 +21765,13 @@ 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/ensemble/_gradient_boosting.pyx b/sklearn/ensemble/_gradient_boosting.pyx index 2527c796ddc13..547b37e8417ef 100644 --- a/sklearn/ensemble/_gradient_boosting.pyx +++ b/sklearn/ensemble/_gradient_boosting.pyx @@ -244,15 +244,15 @@ cpdef _partial_dependence_tree(Tree tree, DTYPE_t[:, ::1] X, # push left child node_stack[stack_size] = root_node + current_node.left_child current_weight = weight_stack[stack_size] - left_sample_frac = root_node[current_node.left_child].n_samples / \ - current_node.n_samples + left_sample_frac = root_node[current_node.left_child].n_node_samples / \ + current_node.n_node_samples if left_sample_frac <= 0.0 or left_sample_frac >= 1.0: raise ValueError("left_sample_frac:%f, " "n_samples current: %d, " "n_samples left: %d" % (left_sample_frac, - current_node.n_samples, - root_node[current_node.left_child].n_samples)) + current_node.n_node_samples, + root_node[current_node.left_child].n_node_samples)) weight_stack[stack_size] = current_weight * left_sample_frac stack_size +=1 diff --git a/sklearn/ensemble/tests/test_bagging.py b/sklearn/ensemble/tests/test_bagging.py index 0f4db951bfd39..8053bc2c3e0a2 100644 --- a/sklearn/ensemble/tests/test_bagging.py +++ b/sklearn/ensemble/tests/test_bagging.py @@ -52,7 +52,7 @@ def test_classification(): iris.target, random_state=rng) grid = ParameterGrid({"max_samples": [0.5, 1.0], - "max_features": [1, 2, 3, 4], + "max_features": [1, 2, 4], "bootstrap": [True, False], "bootstrap_features": [True, False]}) @@ -71,8 +71,8 @@ def test_classification(): def test_regression(): """Check regression for various parameter settings.""" rng = check_random_state(0) - X_train, X_test, y_train, y_test = train_test_split(boston.data, - boston.target, + X_train, X_test, y_train, y_test = train_test_split(boston.data[:50], + boston.target[:50], random_state=rng) grid = ParameterGrid({"max_samples": [0.5, 1.0], "max_features": [0.5, 1.0], diff --git a/sklearn/feature_selection/__init__.py b/sklearn/feature_selection/__init__.py index 0d222534f5e93..acb03f6f24a9e 100644 --- a/sklearn/feature_selection/__init__.py +++ b/sklearn/feature_selection/__init__.py @@ -20,6 +20,8 @@ from .rfe import RFE from .rfe import RFECV +from .from_model import SelectFromModel + __all__ = ['GenericUnivariateSelect', 'RFE', 'RFECV', @@ -32,4 +34,5 @@ 'chi2', 'f_classif', 'f_oneway', - 'f_regression'] + 'f_regression', + 'SelectFromModel'] diff --git a/sklearn/feature_selection/from_model.py b/sklearn/feature_selection/from_model.py index a0f7759c06312..eceacf67e29ea 100644 --- a/sklearn/feature_selection/from_model.py +++ b/sklearn/feature_selection/from_model.py @@ -1,11 +1,73 @@ -# Authors: Gilles Louppe, Mathieu Blondel +# Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena # License: BSD 3 clause import numpy as np -from ..base import TransformerMixin +from ..base import TransformerMixin, BaseEstimator, clone from ..externals import six -from ..utils import safe_mask, atleast2d_or_csc +from ..utils import safe_mask, atleast2d_or_csc, deprecated +from .base import SelectorMixin + + +def _get_feature_importances(estimator, X): + """Retrieve or aggregate feature importances from estimator""" + if hasattr(estimator, "feature_importances_"): + importances = estimator.feature_importances_ + + elif hasattr(estimator, "coef_"): + if estimator.coef_.ndim == 1: + importances = np.abs(estimator.coef_) + + else: + importances = np.sum(np.abs(estimator.coef_), axis=0) + + else: + raise ValueError("Missing `feature_importances_` or `coef_`" + " attribute, did you forget to set the " + "estimator's parameter to compute it?") + if len(importances) != X.shape[1]: + raise ValueError("X has different number of features than" + " during model fitting.") + + return importances + + +def _calculate_threshold(estimator, importances, threshold): + """Interpret the threshold value""" + + if threshold is None: + # determine default from estimator + if hasattr(estimator, "penalty") and estimator.penalty == "l1": + # the natural default threshold is 0 when l1 penalty was used + threshold = 1e-5 + else: + threshold = "mean" + + if isinstance(threshold, six.string_types): + if "*" in threshold: + scale, reference = threshold.split("*") + scale = float(scale.strip()) + reference = reference.strip() + + if reference == "median": + reference = np.median(importances) + elif reference == "mean": + reference = np.mean(importances) + else: + raise ValueError("Unknown reference: " + reference) + + threshold = scale * reference + + elif threshold == "median": + threshold = np.median(importances) + + elif threshold == "mean": + threshold = np.mean(importances) + + else: + threshold = float(threshold) + + return threshold class _LearntSelectorMixin(TransformerMixin): @@ -17,6 +79,8 @@ class _LearntSelectorMixin(TransformerMixin): ``feature_importances_`` or ``coef_`` attribute to evaluate the relative importance of individual features for feature selection. """ + @deprecated('Support to use estimators as feature selectors will be ' + 'removed in version 0.17. Use SelectFromModel instead.') def transform(self, X, threshold=None): """Reduce X to its most important features. @@ -40,60 +104,11 @@ def transform(self, X, threshold=None): The input samples with only the selected features. """ X = atleast2d_or_csc(X) - # Retrieve importance vector - if hasattr(self, "feature_importances_"): - importances = self.feature_importances_ - if importances is None: - raise ValueError("Importance weights not computed. Please set" - " the compute_importances parameter before " - "fit.") - - elif hasattr(self, "coef_"): - if self.coef_.ndim == 1: - importances = np.abs(self.coef_) - - else: - importances = np.sum(np.abs(self.coef_), axis=0) + importances = _get_feature_importances(self, X) - else: - raise ValueError("Missing `feature_importances_` or `coef_`" - " attribute, did you forget to set the " - "estimator's parameter to compute it?") - if len(importances) != X.shape[1]: - raise ValueError("X has different number of features than" - " during model fitting.") - - # Retrieve threshold if threshold is None: - if hasattr(self, "penalty") and self.penalty == "l1": - # the natural default threshold is 0 when l1 penalty was used - threshold = getattr(self, "threshold", 1e-5) - else: - threshold = getattr(self, "threshold", "mean") - - if isinstance(threshold, six.string_types): - if "*" in threshold: - scale, reference = threshold.split("*") - scale = float(scale.strip()) - reference = reference.strip() - - if reference == "median": - reference = np.median(importances) - elif reference == "mean": - reference = np.mean(importances) - else: - raise ValueError("Unknown reference: " + reference) - - threshold = scale * reference - - elif threshold == "median": - threshold = np.median(importances) - - elif threshold == "mean": - threshold = np.mean(importances) - - else: - threshold = float(threshold) + threshold = getattr(self, 'threshold', None) + threshold = _calculate_threshold(self, importances, threshold) # Selection try: @@ -108,3 +123,121 @@ def transform(self, X, threshold=None): return X[:, mask] else: raise ValueError("Invalid threshold: all features are discarded.") + + +class SelectFromModel(BaseEstimator, SelectorMixin): + """Meta-transformer for selecting features based on importance + weights. + + Parameters + ---------- + estimator : object or None(default=None) + The base estimator from which the transformer is built. + If None, then a value error is raised. + + threshold : string, float or None, optional (default=None) + The threshold value to use for feature selection. Features whose + importance is greater or equal are kept while the others are + discarded. If "median" (resp. "mean"), then the threshold value is + the median (resp. the mean) of the feature importances. A scaling + factor (e.g., "1.25*mean") may also be used. If None and if + available, the object attribute ``threshold`` is used. Otherwise, + "mean" is used by default. + + warm_start : bool, optional + When set to True, reuse the solution of the previous call to fit as + initialization, otherwise, just erase the previous solution. + + Attributes + ---------- + `estimator_`: an estimator + The base estimator from which the transformer is built. + + `scores_`: array, shape=(n_features,) + The importance of each feature according to the fit model. + + `threshold_`: float + The threshold value used for feature selection. + + Examples + -------- + The following example shows how SelectFromModel meta-transformer can be + used to compute feature importances and discard irrelevant features + using the ExtraTreesClassifier as the base estimator. + + >>> from sklearn.feature_selection import SelectFromModel + >>> from sklearn.ensemble import ExtraTreesClassifier + >>> from sklearn.datasets import load_iris + >>> iris = load_iris() + >>> X, y = iris.data, iris.target + >>> X.shape + (150, 4) + >>> est = ExtraTreesClassifier() + >>> transformer = SelectFromModel(estimator=est) + >>> X_new = transformer.fit(X,y).transform(X) + >>> transformer.estimator_.feature_importances_ + array([ 0.10011014, 0.06735519, 0.56063362, 0.27190106]) + >>> X_new.shape + (150, 2) + """ + + def __init__(self, estimator, threshold=None, warm_start=False): + self.estimator = estimator + self.threshold = threshold + self.warm_start = warm_start + + def _get_support_mask(self): + self.threshold_ = _calculate_threshold(self.estimator, self.scores_, + self.threshold) + return self.scores_ >= self.threshold_ + + def fit(self, X, y, **fit_params): + """Fit the SelectFromModel meta-transformer. + + Parameters + ---------- + X : array-like of shape = [n_samples, n_features] + The training input samples. + + y : array-like, shape = [n_samples] + The target values (integers that correspond to classes in + classification, real numbers in regression). + + **fit_params : Other estimator specific parameters + + Returns + ------- + self : object + Returns self. + """ + if not (self.warm_start and hasattr(self, "estimator_")): + self.estimator_ = clone(self.estimator) + + self.estimator_.fit(X, y, **fit_params) + self.scores_ = _get_feature_importances(self.estimator_, X) + return self + + def partial_fit(self, X, y, **fit_params): + """Fit the SelectFromModel meta-transformer only once. + + Parameters + ---------- + X : array-like of shape = [n_samples, n_features] + The training input samples. + + y : array-like, shape = [n_samples] + The target values (integers that correspond to classes in + classification, real numbers in regression). + + **fit_params : Other estimator specific parameters + + Returns + ------- + self : object + Returns self. + """ + if not hasattr(self, "estimator_"): + self.estimator_ = clone(self.estimator) + self.estimator_.partial_fit(X, y, **fit_params) + self.scores_ = _get_feature_importances(self.estimator_, X) + return self diff --git a/sklearn/feature_selection/tests/test_from_model.py b/sklearn/feature_selection/tests/test_from_model.py index 8367ac65c56d3..1abbf15354426 100644 --- a/sklearn/feature_selection/tests/test_from_model.py +++ b/sklearn/feature_selection/tests/test_from_model.py @@ -5,13 +5,19 @@ from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_greater +from sklearn.utils.testing import assert_equal +from sklearn.utils.testing import assert_array_almost_equal +from sklearn.utils.testing import assert_almost_equal -from sklearn.datasets import load_iris +from sklearn import datasets from sklearn.linear_model import LogisticRegression from sklearn.linear_model import SGDClassifier from sklearn.svm import LinearSVC +from sklearn.feature_selection import SelectFromModel +from sklearn.ensemble import RandomForestClassifier +from sklearn.linear_model import PassiveAggressiveClassifier -iris = load_iris() +iris = datasets.load_iris() def test_transform_linear_model(): @@ -41,3 +47,72 @@ def test_invalid_input(): clf.fit(iris.data, iris.target) assert_raises(ValueError, clf.transform, iris.data, "gobbledigook") assert_raises(ValueError, clf.transform, iris.data, ".5 * gobbledigook") + + +def test_validate_estimator(): + est = RandomForestClassifier() + transformer = SelectFromModel(estimator=est) + transformer.fit(iris.data, iris.target) + assert_equal(transformer.estimator, est) + + +def test_feature_importances(): + X, y = datasets.make_classification(n_samples=1000, + n_features=10, + n_informative=3, + n_redundant=0, + n_repeated=0, + shuffle=False, + random_state=0) + + est = RandomForestClassifier(n_estimators=50, random_state=0) + transformer = SelectFromModel(estimator=est) + + transformer.fit(X, y) + assert_true(hasattr(transformer.estimator_, 'feature_importances_')) + + X_new = transformer.transform(X) + assert_less(X_new.shape[1], X.shape[1]) + + feature_mask = (transformer.estimator_.feature_importances_ > + transformer.estimator_.feature_importances_.mean()) + assert_array_almost_equal(X_new, X[:, feature_mask]) + + # Check with sample weights + sample_weight = np.ones(y.shape) + sample_weight[y == 1] *= 100 + + est = RandomForestClassifier(n_estimators=50, random_state=0) + transformer = SelectFromModel(estimator=est) + transformer.fit(X, y, sample_weight=sample_weight) + importances = transformer.estimator_.feature_importances_ + assert_less(importances[1], X.shape[1]) + + est = RandomForestClassifier(n_estimators=50, random_state=0) + transformer = SelectFromModel(estimator=est) + transformer.fit(X, y, sample_weight=3*sample_weight) + importances_bis = transformer.estimator_.feature_importances_ + assert_almost_equal(importances, importances_bis) + + +def test_partial_fit(): + est = PassiveAggressiveClassifier() + transformer = SelectFromModel(estimator=est) + transformer.partial_fit(iris.data, iris.target, + classes=np.unique(iris.target)) + id_1 = id(transformer.estimator_) + transformer.partial_fit(iris.data, iris.target, + classes=np.unique(iris.target)) + id_2 = id(transformer.estimator_) + assert_equal(id_1, id_2) + + +def test_warm_start(): + est = PassiveAggressiveClassifier() + transformer = SelectFromModel(estimator=est, + warm_start=True) + transformer.fit(iris.data, iris.target) + id_1 = id(transformer.estimator_) + transformer.fit(iris.data, iris.target) + id_2 = id(transformer.estimator_) + assert_equal(id_1, id_2) diff --git a/sklearn/grid_search.py b/sklearn/grid_search.py index aa91284a60ac0..e70209fc04ed6 100644 --- a/sklearn/grid_search.py +++ b/sklearn/grid_search.py @@ -349,7 +349,8 @@ def _fit(self, X, y, parameter_iterable): score_func=self.score_func) n_samples = _num_samples(X) - X, y = check_arrays(X, y, allow_lists=True, sparse_format='csr') + X, y = check_arrays(X, y, allow_lists=True, sparse_format='csr', + allow_nans=True) if y is not None: if len(y) != n_samples: diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index a8d084aa501ae..da1e53f8b6696 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -21,6 +21,7 @@ from ..externals import six from ..externals.six.moves import xrange from ..utils.extmath import safe_sparse_dot +from ..utils import ConvergenceWarning from . import cd_fast @@ -45,7 +46,7 @@ def _alpha_grid(X, y, Xy=None, l1_ratio=1.0, fit_intercept=True, Xy = np.dot(X.T, y) that can be precomputed. l1_ratio : float - The ElasticNet mixing parameter, with ``0 <= l1_ratio <= 1``. + The elastic net mixing parameter, with ``0 <= l1_ratio <= 1``. For ``l1_ratio = 0`` the penalty is an L2 penalty. ``For l1_ratio = 1`` it is an L1 penalty. For ``0 < l1_ratio < 1``, the penalty is a combination of L1 and L2. @@ -266,9 +267,9 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None, normalize=False, copy_X=True, coef_init=None, verbose=False, return_models=False, **params): - """Compute Elastic-Net path with coordinate descent + """Compute elastic net path with coordinate descent - The Elastic Net optimization function varies for mono and multi-outputs. + The elastic net optimization function varies for mono and multi-outputs. For mono-output tasks it is:: @@ -299,7 +300,7 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None, Target values l1_ratio : float, optional - float between 0 and 1 passed to ElasticNet (scaling between + float between 0 and 1 passed to elastic net (scaling between l1 and l2 penalties). ``l1_ratio=1`` corresponds to the Lasso eps : float @@ -478,7 +479,8 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None, if dual_gap_ > eps_: warnings.warn('Objective did not converge.' + ' You might want' + - ' to increase the number of iterations') + ' to increase the number of iterations', + ConvergenceWarning) if return_models: if not multi_output: @@ -516,7 +518,7 @@ def enet_path(X, y, l1_ratio=0.5, eps=1e-3, n_alphas=100, alphas=None, class ElasticNet(LinearModel, RegressorMixin): - """Linear Model trained with L1 and L2 prior as regularizer + """Linear regression with combined L1 and L2 priors as regularizer. Minimizes the objective function:: @@ -603,6 +605,12 @@ class ElasticNet(LinearModel, RegressorMixin): ----- To avoid unnecessary memory duplication the X argument of the fit method should be directly passed as a Fortran-contiguous numpy array. + + See also + -------- + SGDRegressor: implements elastic net regression with incremental training. + SGDClassifier: implements logistic regression with elastic net penalty + (``SGDClassifier(loss="log", penalty="elasticnet")``). """ path = staticmethod(enet_path) diff --git a/sklearn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py index 043ccbcdd0122..4d52580311db5 100644 --- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -23,6 +23,7 @@ from ..base import RegressorMixin from ..utils import array2d, arrayfuncs, as_float_array, check_arrays from ..cross_validation import _check_cv as check_cv +from ..utils import ConvergenceWarning from ..externals.joblib import Parallel, delayed from ..externals.six.moves import xrange @@ -265,7 +266,8 @@ def lars_path(X, y, Xy=None, Gram=None, max_iter=500, 'i.e. alpha=%.3e, ' 'with an active set of %i regressors, and ' 'the smallest cholesky pivot element being %.3e' - % (n_iter, alpha, n_active, diag)) + % (n_iter, alpha, n_active, diag), + ConvergenceWarning) # XXX: need to figure a 'drop for good' way Cov = Cov_not_shortened Cov[0] = 0 @@ -289,7 +291,8 @@ def lars_path(X, y, Xy=None, Gram=None, max_iter=500, 'longer well controlled. %i iterations, alpha=%.3e, ' 'previous alpha=%.3e, with an active set of %i ' 'regressors.' - % (n_iter, alpha, prev_alpha, n_active)) + % (n_iter, alpha, prev_alpha, n_active), + ConvergenceWarning) break # least squares solution diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index e347c37dc4deb..786b7e7311c14 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -78,7 +78,9 @@ class LogisticRegression(BaseLibLinear, LinearClassifierMixin, See also -------- - LinearSVC + SGDClassifier: incrementally trained logistic regression (when given + the parameter ``loss="log"``). + sklearn.svm.LinearSVC: learns SVM models using the same algorithm. Notes ----- diff --git a/sklearn/linear_model/ransac.py b/sklearn/linear_model/ransac.py index 3403d34de80d8..07e431e065f55 100644 --- a/sklearn/linear_model/ransac.py +++ b/sklearn/linear_model/ransac.py @@ -12,6 +12,43 @@ from .base import LinearRegression +_EPSILON = np.spacing(1) + + +def _dynamic_max_trials(n_inliers, n_samples, min_samples, probability): + """Determine number trials such that at least one outlier-free subset is + sampled for the given inlier/outlier ratio. + + Parameters + ---------- + n_inliers : int + Number of inliers in the data. + + n_samples : int + Total number of samples in the data. + + min_samples : int + Minimum number of samples chosen randomly from original data. + + probability : float + Probability (confidence) that one outlier-free sample is generated. + + Returns + ------- + trials : int + Number of trials. + + """ + inlier_ratio = n_inliers / float(n_samples) + nom = max(_EPSILON, 1 - probability) + denom = max(_EPSILON, 1 - inlier_ratio ** min_samples) + if nom == 1: + return 0 + if denom == 1: + return float('inf') + return abs(float(np.ceil(np.log(nom) / np.log(denom)))) + + class RANSACRegressor(BaseEstimator, MetaEstimatorMixin, RegressorMixin): """RANSAC (RANdom SAmple Consensus) algorithm. @@ -44,7 +81,8 @@ class RANSACRegressor(BaseEstimator, MetaEstimatorMixin, RegressorMixin): Minimum number of samples chosen randomly from original data. Treated as an absolute number of samples for `min_samples >= 1`, treated as a relative number `ceil(min_samples * X.shape[0]`) for - `min_samples < 1`. By default a + `min_samples < 1`. This is typically chosen as the minimal number of + samples necessary to estimate the given `base_estimator`. By default a ``sklearn.linear_model.LinearRegression()`` estimator is assumed and `min_samples` is chosen as ``X.shape[1] + 1``. @@ -75,6 +113,17 @@ class RANSACRegressor(BaseEstimator, MetaEstimatorMixin, RegressorMixin): stop_score : float, optional Stop iteration if score is greater equal than this threshold. + stop_probability : float in range [0, 1], optional + RANSAC iteration stops if at least one outlier-free set of the training + data is sampled in RANSAC. This requires to generate at least N + samples (iterations):: + + N >= log(1 - probability) / log(1 - e**m) + + where the probability (confidence) is typically set to high value such + as 0.99 (the default) and e is the current fraction of inliers w.r.t. + the total number of samples. + residual_metric : callable, optional Metric to reduce the dimensionality of the residuals to 1 for multi-dimensional target values ``y.shape[1] > 1``. By default the sum @@ -110,7 +159,8 @@ def __init__(self, base_estimator=None, min_samples=None, residual_threshold=None, is_data_valid=None, is_model_valid=None, max_trials=100, stop_n_inliers=np.inf, stop_score=np.inf, - residual_metric=None, random_state=None): + stop_probability=0.99, residual_metric=None, + random_state=None): self.base_estimator = base_estimator self.min_samples = min_samples @@ -120,6 +170,7 @@ def __init__(self, base_estimator=None, min_samples=None, self.max_trials = max_trials self.stop_n_inliers = stop_n_inliers self.stop_score = stop_score + self.stop_probability = stop_probability self.residual_metric = residual_metric self.random_state = random_state @@ -164,6 +215,9 @@ def fit(self, X, y): raise ValueError("`min_samples` may not be larger than number " "of samples ``X.shape[0]``.") + if self.stop_probability < 0 or self.stop_probability > 1: + raise ValueError("`stop_probability` must be in range [0, 1].") + if self.residual_threshold is None: # MAD (median absolute deviation) residual_threshold = np.median(np.abs(y - np.median(y))) @@ -258,7 +312,11 @@ def fit(self, X, y): # break if sufficient number of inliers or score is reached if (n_inliers_best >= self.stop_n_inliers - or score_best >= self.stop_score): + or score_best >= self.stop_score + or self.n_trials_ + >= _dynamic_max_trials(n_inliers_best, n_samples, + min_samples, + self.stop_probability)): break # if none of the iterations met the required criteria diff --git a/sklearn/linear_model/sgd_fast.c b/sklearn/linear_model/sgd_fast.c index 37a059303685e..e9d4071be77d4 100644 --- a/sklearn/linear_model/sgd_fast.c +++ b/sklearn/linear_model/sgd_fast.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.20.1 on Sat Mar 15 15:36:32 2014 */ +/* Generated by Cython 0.20.1 on Thu Apr 3 15:29:48 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -595,7 +595,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -604,7 +604,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -613,7 +613,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -622,7 +622,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -631,7 +631,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -640,7 +640,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -649,7 +649,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -658,7 +658,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -667,7 +667,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -676,7 +676,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -685,7 +685,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -694,7 +694,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -703,7 +703,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -712,7 +712,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -721,7 +721,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -730,7 +730,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -739,7 +739,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -748,7 +748,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -757,7 +757,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -766,7 +766,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -775,7 +775,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -821,7 +821,7 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_Huber; struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_EpsilonInsensitive; struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredEpsilonInsensitive; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -830,7 +830,7 @@ struct __pyx_obj_7sklearn_12linear_model_8sgd_fast_SquaredEpsilonInsensitive; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -839,7 +839,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -848,7 +848,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1791,16 +1791,17 @@ static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_sklearn_linear_model_sgd_fast[] = "sklearn.linear_model.sgd_fast"; static char __pyx_k_Total_training_time_2f_seconds[] = "Total training time: %.2f seconds."; -static char __pyx_k_home_larsb_src_scikit_learn_skl[] = "/home/larsb/src/scikit-learn/sklearn/linear_model/sgd_fast.pyx"; static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; +static char __pyx_k_volatile_ogrisel_code_scikit_le[] = "/volatile/ogrisel/code/scikit-learn/sklearn/linear_model/sgd_fast.pyx"; +static char __pyx_k_Floating_point_under_overflow_oc[] = "Floating-point under-/overflow occurred at epoch #%d. Scaling input data with StandardScaler or MinMaxScaler might help."; static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; static char __pyx_k_Norm_2f_NNZs_d_Bias_6f_T_d_Avg_l[] = "Norm: %.2f, NNZs: %d, Bias: %.6f, T: %d, Avg. loss: %.6f"; -static char __pyx_k_floating_point_under_overflow_oc[] = "floating-point under-/overflow occurred."; static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; static PyObject *__pyx_n_s_C; static PyObject *__pyx_kp_s_Epoch_d; +static PyObject *__pyx_kp_s_Floating_point_under_overflow_oc; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; @@ -1822,8 +1823,6 @@ static PyObject *__pyx_n_s_eta0; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_fit_intercept; static PyObject *__pyx_n_s_float64; -static PyObject *__pyx_kp_s_floating_point_under_overflow_oc; -static PyObject *__pyx_kp_s_home_larsb_src_scikit_learn_skl; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_infinity; @@ -1870,6 +1869,7 @@ static PyObject *__pyx_n_s_u; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_verbose; +static PyObject *__pyx_kp_s_volatile_ogrisel_code_scikit_le; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_weight_neg; static PyObject *__pyx_n_s_weight_pos; @@ -1886,8 +1886,7 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; -static PyObject *__pyx_tuple__8; -static PyObject *__pyx_codeobj__9; +static PyObject *__pyx_codeobj__8; /* "sklearn/linear_model/sgd_fast.pyx":49 * """Base class for convex loss functions""" @@ -5801,28 +5800,47 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(CYTHON_UNU * break * * if infinity: # <<<<<<<<<<<<<< - * raise ValueError("floating-point under-/overflow occurred.") - * + * raise ValueError(("Floating-point under-/overflow occurred at epoch" + * " #%d. Scaling input data with StandardScaler or" */ __pyx_t_20 = (__pyx_v_infinity != 0); if (__pyx_t_20) { + /* "sklearn/linear_model/sgd_fast.pyx":524 + * raise ValueError(("Floating-point under-/overflow occurred at epoch" + * " #%d. Scaling input data with StandardScaler or" + * " MinMaxScaler might help.") % (epoch + 1)) # <<<<<<<<<<<<<< + * + * w.reset_wscale() + */ + __pyx_t_18 = __Pyx_PyInt_From_long((__pyx_v_epoch + 1)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Floating_point_under_overflow_oc, __pyx_t_18); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + /* "sklearn/linear_model/sgd_fast.pyx":522 * * if infinity: - * raise ValueError("floating-point under-/overflow occurred.") # <<<<<<<<<<<<<< - * - * w.reset_wscale() + * raise ValueError(("Floating-point under-/overflow occurred at epoch" # <<<<<<<<<<<<<< + * " #%d. Scaling input data with StandardScaler or" + * " MinMaxScaler might help.") % (epoch + 1)) */ - __pyx_t_18 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_18); - __Pyx_Raise(__pyx_t_18, 0, 0, 0); + PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_18, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/linear_model/sgd_fast.pyx":524 - * raise ValueError("floating-point under-/overflow occurred.") + /* "sklearn/linear_model/sgd_fast.pyx":526 + * " MinMaxScaler might help.") % (epoch + 1)) * * w.reset_wscale() # <<<<<<<<<<<<<< * @@ -5830,7 +5848,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(CYTHON_UNU */ ((struct __pyx_vtabstruct_7sklearn_5utils_13weight_vector_WeightVector *)__pyx_v_w->__pyx_vtab)->reset_wscale(__pyx_v_w); - /* "sklearn/linear_model/sgd_fast.pyx":526 + /* "sklearn/linear_model/sgd_fast.pyx":528 * w.reset_wscale() * * return weights, intercept # <<<<<<<<<<<<<< @@ -5838,18 +5856,18 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(CYTHON_UNU * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_18 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_18); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_intercept); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); + __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_18); __Pyx_INCREF(((PyObject *)__pyx_v_weights)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_weights)); + PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_v_weights)); __Pyx_GIVEREF(((PyObject *)__pyx_v_weights)); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_18); - __Pyx_GIVEREF(__pyx_t_18); - __pyx_t_18 = 0; - __pyx_r = __pyx_t_7; + PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_r = __pyx_t_18; + __pyx_t_18 = 0; goto __pyx_L0; /* "sklearn/linear_model/sgd_fast.pyx":332 @@ -5888,7 +5906,7 @@ static PyObject *__pyx_pf_7sklearn_12linear_model_8sgd_fast_plain_sgd(CYTHON_UNU return __pyx_r; } -/* "sklearn/linear_model/sgd_fast.pyx":529 +/* "sklearn/linear_model/sgd_fast.pyx":531 * * * cdef bint any_nonfinite(double *w, int n) nogil: # <<<<<<<<<<<<<< @@ -5903,7 +5921,7 @@ static int __pyx_f_7sklearn_12linear_model_8sgd_fast_any_nonfinite(double *__pyx int __pyx_t_2; int __pyx_t_3; - /* "sklearn/linear_model/sgd_fast.pyx":530 + /* "sklearn/linear_model/sgd_fast.pyx":532 * * cdef bint any_nonfinite(double *w, int n) nogil: * for i in range(n): # <<<<<<<<<<<<<< @@ -5914,7 +5932,7 @@ static int __pyx_f_7sklearn_12linear_model_8sgd_fast_any_nonfinite(double *__pyx for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "sklearn/linear_model/sgd_fast.pyx":531 + /* "sklearn/linear_model/sgd_fast.pyx":533 * cdef bint any_nonfinite(double *w, int n) nogil: * for i in range(n): * if not isfinite(w[i]): # <<<<<<<<<<<<<< @@ -5924,7 +5942,7 @@ static int __pyx_f_7sklearn_12linear_model_8sgd_fast_any_nonfinite(double *__pyx __pyx_t_3 = ((!(npy_isfinite((__pyx_v_w[__pyx_v_i])) != 0)) != 0); if (__pyx_t_3) { - /* "sklearn/linear_model/sgd_fast.pyx":532 + /* "sklearn/linear_model/sgd_fast.pyx":534 * for i in range(n): * if not isfinite(w[i]): * return True # <<<<<<<<<<<<<< @@ -5936,7 +5954,7 @@ static int __pyx_f_7sklearn_12linear_model_8sgd_fast_any_nonfinite(double *__pyx } } - /* "sklearn/linear_model/sgd_fast.pyx":533 + /* "sklearn/linear_model/sgd_fast.pyx":535 * if not isfinite(w[i]): * return True * return 0 # <<<<<<<<<<<<<< @@ -5946,7 +5964,7 @@ static int __pyx_f_7sklearn_12linear_model_8sgd_fast_any_nonfinite(double *__pyx __pyx_r = 0; goto __pyx_L0; - /* "sklearn/linear_model/sgd_fast.pyx":529 + /* "sklearn/linear_model/sgd_fast.pyx":531 * * * cdef bint any_nonfinite(double *w, int n) nogil: # <<<<<<<<<<<<<< @@ -5959,7 +5977,7 @@ static int __pyx_f_7sklearn_12linear_model_8sgd_fast_any_nonfinite(double *__pyx return __pyx_r; } -/* "sklearn/linear_model/sgd_fast.pyx":536 +/* "sklearn/linear_model/sgd_fast.pyx":538 * * * cdef double sqnorm(double * x_data_ptr, int * x_ind_ptr, int xnnz) nogil: # <<<<<<<<<<<<<< @@ -5975,7 +5993,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x int __pyx_t_1; int __pyx_t_2; - /* "sklearn/linear_model/sgd_fast.pyx":537 + /* "sklearn/linear_model/sgd_fast.pyx":539 * * cdef double sqnorm(double * x_data_ptr, int * x_ind_ptr, int xnnz) nogil: * cdef double x_norm = 0.0 # <<<<<<<<<<<<<< @@ -5984,7 +6002,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x */ __pyx_v_x_norm = 0.0; - /* "sklearn/linear_model/sgd_fast.pyx":540 + /* "sklearn/linear_model/sgd_fast.pyx":542 * cdef int j * cdef double z * for j in range(xnnz): # <<<<<<<<<<<<<< @@ -5995,7 +6013,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_j = __pyx_t_2; - /* "sklearn/linear_model/sgd_fast.pyx":541 + /* "sklearn/linear_model/sgd_fast.pyx":543 * cdef double z * for j in range(xnnz): * z = x_data_ptr[j] # <<<<<<<<<<<<<< @@ -6004,7 +6022,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x */ __pyx_v_z = (__pyx_v_x_data_ptr[__pyx_v_j]); - /* "sklearn/linear_model/sgd_fast.pyx":542 + /* "sklearn/linear_model/sgd_fast.pyx":544 * for j in range(xnnz): * z = x_data_ptr[j] * x_norm += z * z # <<<<<<<<<<<<<< @@ -6014,7 +6032,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x __pyx_v_x_norm = (__pyx_v_x_norm + (__pyx_v_z * __pyx_v_z)); } - /* "sklearn/linear_model/sgd_fast.pyx":543 + /* "sklearn/linear_model/sgd_fast.pyx":545 * z = x_data_ptr[j] * x_norm += z * z * return x_norm # <<<<<<<<<<<<<< @@ -6024,7 +6042,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x __pyx_r = __pyx_v_x_norm; goto __pyx_L0; - /* "sklearn/linear_model/sgd_fast.pyx":536 + /* "sklearn/linear_model/sgd_fast.pyx":538 * * * cdef double sqnorm(double * x_data_ptr, int * x_ind_ptr, int xnnz) nogil: # <<<<<<<<<<<<<< @@ -6037,7 +6055,7 @@ static double __pyx_f_7sklearn_12linear_model_8sgd_fast_sqnorm(double *__pyx_v_x return __pyx_r; } -/* "sklearn/linear_model/sgd_fast.pyx":546 +/* "sklearn/linear_model/sgd_fast.pyx":548 * * * cdef void l1penalty(WeightVector w, double * q_data_ptr, # <<<<<<<<<<<<<< @@ -6060,7 +6078,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj double __pyx_t_7; int __pyx_t_8; - /* "sklearn/linear_model/sgd_fast.pyx":553 + /* "sklearn/linear_model/sgd_fast.pyx":555 * [Tsuruoka, Y., Tsujii, J., and Ananiadou, S., 2009]. * """ * cdef double z = 0.0 # <<<<<<<<<<<<<< @@ -6069,7 +6087,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj */ __pyx_v_z = 0.0; - /* "sklearn/linear_model/sgd_fast.pyx":554 + /* "sklearn/linear_model/sgd_fast.pyx":556 * """ * cdef double z = 0.0 * cdef int j = 0 # <<<<<<<<<<<<<< @@ -6078,7 +6096,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj */ __pyx_v_j = 0; - /* "sklearn/linear_model/sgd_fast.pyx":555 + /* "sklearn/linear_model/sgd_fast.pyx":557 * cdef double z = 0.0 * cdef int j = 0 * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -6087,7 +6105,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj */ __pyx_v_idx = 0; - /* "sklearn/linear_model/sgd_fast.pyx":556 + /* "sklearn/linear_model/sgd_fast.pyx":558 * cdef int j = 0 * cdef int idx = 0 * cdef double wscale = w.wscale # <<<<<<<<<<<<<< @@ -6097,7 +6115,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj __pyx_t_1 = __pyx_v_w->wscale; __pyx_v_wscale = __pyx_t_1; - /* "sklearn/linear_model/sgd_fast.pyx":557 + /* "sklearn/linear_model/sgd_fast.pyx":559 * cdef int idx = 0 * cdef double wscale = w.wscale * cdef double *w_data_ptr = w.w_data_ptr # <<<<<<<<<<<<<< @@ -6107,7 +6125,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj __pyx_t_2 = __pyx_v_w->w_data_ptr; __pyx_v_w_data_ptr = __pyx_t_2; - /* "sklearn/linear_model/sgd_fast.pyx":558 + /* "sklearn/linear_model/sgd_fast.pyx":560 * cdef double wscale = w.wscale * cdef double *w_data_ptr = w.w_data_ptr * for j in range(xnnz): # <<<<<<<<<<<<<< @@ -6118,7 +6136,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_j = __pyx_t_4; - /* "sklearn/linear_model/sgd_fast.pyx":559 + /* "sklearn/linear_model/sgd_fast.pyx":561 * cdef double *w_data_ptr = w.w_data_ptr * for j in range(xnnz): * idx = x_ind_ptr[j] # <<<<<<<<<<<<<< @@ -6127,7 +6145,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj */ __pyx_v_idx = (__pyx_v_x_ind_ptr[__pyx_v_j]); - /* "sklearn/linear_model/sgd_fast.pyx":560 + /* "sklearn/linear_model/sgd_fast.pyx":562 * for j in range(xnnz): * idx = x_ind_ptr[j] * z = w_data_ptr[idx] # <<<<<<<<<<<<<< @@ -6136,7 +6154,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj */ __pyx_v_z = (__pyx_v_w_data_ptr[__pyx_v_idx]); - /* "sklearn/linear_model/sgd_fast.pyx":561 + /* "sklearn/linear_model/sgd_fast.pyx":563 * idx = x_ind_ptr[j] * z = w_data_ptr[idx] * if wscale * w_data_ptr[idx] > 0.0: # <<<<<<<<<<<<<< @@ -6146,7 +6164,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj __pyx_t_5 = (((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_idx])) > 0.0) != 0); if (__pyx_t_5) { - /* "sklearn/linear_model/sgd_fast.pyx":563 + /* "sklearn/linear_model/sgd_fast.pyx":565 * if wscale * w_data_ptr[idx] > 0.0: * w_data_ptr[idx] = max( * 0.0, w_data_ptr[idx] - ((u + q_data_ptr[idx]) / wscale)) # <<<<<<<<<<<<<< @@ -6161,7 +6179,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj __pyx_t_7 = __pyx_t_6; } - /* "sklearn/linear_model/sgd_fast.pyx":562 + /* "sklearn/linear_model/sgd_fast.pyx":564 * z = w_data_ptr[idx] * if wscale * w_data_ptr[idx] > 0.0: * w_data_ptr[idx] = max( # <<<<<<<<<<<<<< @@ -6172,7 +6190,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj goto __pyx_L5; } - /* "sklearn/linear_model/sgd_fast.pyx":565 + /* "sklearn/linear_model/sgd_fast.pyx":567 * 0.0, w_data_ptr[idx] - ((u + q_data_ptr[idx]) / wscale)) * * elif wscale * w_data_ptr[idx] < 0.0: # <<<<<<<<<<<<<< @@ -6182,7 +6200,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj __pyx_t_5 = (((__pyx_v_wscale * (__pyx_v_w_data_ptr[__pyx_v_idx])) < 0.0) != 0); if (__pyx_t_5) { - /* "sklearn/linear_model/sgd_fast.pyx":567 + /* "sklearn/linear_model/sgd_fast.pyx":569 * elif wscale * w_data_ptr[idx] < 0.0: * w_data_ptr[idx] = min( * 0.0, w_data_ptr[idx] + ((u - q_data_ptr[idx]) / wscale)) # <<<<<<<<<<<<<< @@ -6197,7 +6215,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj __pyx_t_6 = __pyx_t_1; } - /* "sklearn/linear_model/sgd_fast.pyx":566 + /* "sklearn/linear_model/sgd_fast.pyx":568 * * elif wscale * w_data_ptr[idx] < 0.0: * w_data_ptr[idx] = min( # <<<<<<<<<<<<<< @@ -6209,7 +6227,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj } __pyx_L5:; - /* "sklearn/linear_model/sgd_fast.pyx":569 + /* "sklearn/linear_model/sgd_fast.pyx":571 * 0.0, w_data_ptr[idx] + ((u - q_data_ptr[idx]) / wscale)) * * q_data_ptr[idx] += wscale * (w_data_ptr[idx] - z) # <<<<<<<<<<<<<< @@ -6218,7 +6236,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj (__pyx_v_q_data_ptr[__pyx_t_8]) = ((__pyx_v_q_data_ptr[__pyx_t_8]) + (__pyx_v_wscale * ((__pyx_v_w_data_ptr[__pyx_v_idx]) - __pyx_v_z))); } - /* "sklearn/linear_model/sgd_fast.pyx":546 + /* "sklearn/linear_model/sgd_fast.pyx":548 * * * cdef void l1penalty(WeightVector w, double * q_data_ptr, # <<<<<<<<<<<<<< @@ -6229,7 +6247,7 @@ static void __pyx_f_7sklearn_12linear_model_8sgd_fast_l1penalty(struct __pyx_obj /* function exit code */ } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -6281,7 +6299,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -6294,7 +6312,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6303,7 +6321,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6312,7 +6330,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -6321,7 +6339,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6331,7 +6349,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -6343,7 +6361,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -6354,7 +6372,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -6364,7 +6382,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -6378,21 +6396,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_3) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6402,7 +6420,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -6416,21 +6434,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_2) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -6439,7 +6457,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6448,7 +6466,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -6458,7 +6476,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6467,7 +6485,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))); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6476,7 +6494,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -6487,7 +6505,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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] # <<<<<<<<<<<<<< @@ -6496,7 +6514,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]); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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] # <<<<<<<<<<<<<< @@ -6509,7 +6527,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -6518,7 +6536,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)); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -6529,7 +6547,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L7:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6538,7 +6556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -6547,7 +6565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -6556,7 +6574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6565,7 +6583,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -6577,7 +6595,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -6586,7 +6604,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -6602,7 +6620,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -6618,7 +6636,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -6633,7 +6651,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L10:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -6643,7 +6661,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -6653,7 +6671,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -6668,7 +6686,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (!__pyx_t_2) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -6688,21 +6706,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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__4, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6711,7 +6729,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6722,7 +6740,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6733,7 +6751,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6744,7 +6762,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6755,7 +6773,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6766,7 +6784,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6777,7 +6795,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6788,7 +6806,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6799,7 +6817,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6810,7 +6828,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6821,7 +6839,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6832,7 +6850,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6843,7 +6861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6854,7 +6872,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6865,7 +6883,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6876,7 +6894,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6887,7 +6905,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6899,7 +6917,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6925,7 +6943,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -6934,7 +6952,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -6946,7 +6964,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -6955,7 +6973,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6964,7 +6982,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6973,7 +6991,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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, # <<<<<<<<<<<<<< @@ -6983,7 +7001,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[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -6993,7 +7011,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -7025,7 +7043,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -7049,7 +7067,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -7059,7 +7077,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -7071,7 +7089,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -7081,7 +7099,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -7093,7 +7111,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -7105,7 +7123,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -7122,7 +7140,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -7136,7 +7154,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -7155,7 +7173,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -7172,7 +7190,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -7186,7 +7204,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -7205,7 +7223,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7222,7 +7240,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -7236,7 +7254,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7255,7 +7273,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7272,7 +7290,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -7286,7 +7304,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7305,7 +7323,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -7322,7 +7340,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -7336,7 +7354,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -7355,7 +7373,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -7389,7 +7407,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -7398,7 +7416,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7407,7 +7425,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -7429,7 +7447,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -7442,7 +7460,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -7481,7 +7499,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7498,21 +7516,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -7527,7 +7545,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7547,21 +7565,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7577,7 +7595,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7586,7 +7604,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -7595,7 +7613,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -7606,7 +7624,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); } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -7616,7 +7634,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); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -7626,7 +7644,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -7638,7 +7656,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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -7648,21 +7666,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7680,7 +7698,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7698,7 +7716,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7716,7 +7734,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7734,7 +7752,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7752,7 +7770,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7770,7 +7788,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7788,7 +7806,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7806,7 +7824,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7824,7 +7842,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7842,7 +7860,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7860,7 +7878,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7878,7 +7896,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7896,7 +7914,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -7916,7 +7934,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -7936,7 +7954,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -7956,7 +7974,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -7975,7 +7993,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -7998,7 +8016,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L11:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -8010,7 +8028,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -8024,7 +8042,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -8034,7 +8052,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -8059,7 +8077,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -8074,7 +8092,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); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -8085,7 +8103,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -8097,7 +8115,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -8106,7 +8124,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -8117,7 +8135,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -8126,7 +8144,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -8135,7 +8153,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -8147,7 +8165,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -8161,7 +8179,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -8171,7 +8189,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) { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -8185,7 +8203,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -8196,7 +8214,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -9054,6 +9072,7 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_kp_s_Epoch_d, __pyx_k_Epoch_d, sizeof(__pyx_k_Epoch_d), 0, 0, 1, 0}, + {&__pyx_kp_s_Floating_point_under_overflow_oc, __pyx_k_Floating_point_under_overflow_oc, sizeof(__pyx_k_Floating_point_under_overflow_oc), 0, 0, 1, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, @@ -9075,8 +9094,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_fit_intercept, __pyx_k_fit_intercept, sizeof(__pyx_k_fit_intercept), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, - {&__pyx_kp_s_floating_point_under_overflow_oc, __pyx_k_floating_point_under_overflow_oc, sizeof(__pyx_k_floating_point_under_overflow_oc), 0, 0, 1, 0}, - {&__pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_k_home_larsb_src_scikit_learn_skl, sizeof(__pyx_k_home_larsb_src_scikit_learn_skl), 0, 0, 1, 0}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_infinity, __pyx_k_infinity, sizeof(__pyx_k_infinity), 0, 0, 1, 1}, @@ -9123,6 +9140,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1}, + {&__pyx_kp_s_volatile_ogrisel_code_scikit_le, __pyx_k_volatile_ogrisel_code_scikit_le, sizeof(__pyx_k_volatile_ogrisel_code_scikit_le), 0, 0, 1, 0}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_weight_neg, __pyx_k_weight_neg, sizeof(__pyx_k_weight_neg), 0, 0, 1, 1}, {&__pyx_n_s_weight_pos, __pyx_k_weight_pos, sizeof(__pyx_k_weight_pos), 0, 0, 1, 1}, @@ -9147,82 +9165,71 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/linear_model/sgd_fast.pyx":522 - * - * if infinity: - * raise ValueError("floating-point under-/overflow occurred.") # <<<<<<<<<<<<<< - * - * w.reset_wscale() - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_floating_point_under_overflow_oc); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/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_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); /* "sklearn/linear_model/sgd_fast.pyx":332 * @@ -9231,10 +9238,10 @@ static int __Pyx_InitCachedConstants(void) { * double intercept, * LossFunction loss, */ - __pyx_tuple__8 = PyTuple_Pack(42, __pyx_n_s_weights, __pyx_n_s_intercept, __pyx_n_s_loss, __pyx_n_s_penalty_type, __pyx_n_s_alpha, __pyx_n_s_C, __pyx_n_s_l1_ratio, __pyx_n_s_dataset, __pyx_n_s_n_iter, __pyx_n_s_fit_intercept, __pyx_n_s_verbose, __pyx_n_s_shuffle, __pyx_n_s_seed, __pyx_n_s_weight_pos, __pyx_n_s_weight_neg, __pyx_n_s_learning_rate, __pyx_n_s_eta0, __pyx_n_s_power_t, __pyx_n_s_t, __pyx_n_s_intercept_decay, __pyx_n_s_n_samples, __pyx_n_s_n_features, __pyx_n_s_w, __pyx_n_s_x_data_ptr, __pyx_n_s_x_ind_ptr, __pyx_n_s_infinity, __pyx_n_s_xnnz, __pyx_n_s_eta, __pyx_n_s_p, __pyx_n_s_update, __pyx_n_s_sumloss, __pyx_n_s_y, __pyx_n_s_sample_weight, __pyx_n_s_class_weight, __pyx_n_s_count, __pyx_n_s_epoch, __pyx_n_s_i, __pyx_n_s_is_hinge, __pyx_n_s_q, __pyx_n_s_q_data_ptr, __pyx_n_s_u, __pyx_n_s_t_start); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(20, 0, 42, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_plain_sgd, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__7 = PyTuple_Pack(42, __pyx_n_s_weights, __pyx_n_s_intercept, __pyx_n_s_loss, __pyx_n_s_penalty_type, __pyx_n_s_alpha, __pyx_n_s_C, __pyx_n_s_l1_ratio, __pyx_n_s_dataset, __pyx_n_s_n_iter, __pyx_n_s_fit_intercept, __pyx_n_s_verbose, __pyx_n_s_shuffle, __pyx_n_s_seed, __pyx_n_s_weight_pos, __pyx_n_s_weight_neg, __pyx_n_s_learning_rate, __pyx_n_s_eta0, __pyx_n_s_power_t, __pyx_n_s_t, __pyx_n_s_intercept_decay, __pyx_n_s_n_samples, __pyx_n_s_n_features, __pyx_n_s_w, __pyx_n_s_x_data_ptr, __pyx_n_s_x_ind_ptr, __pyx_n_s_infinity, __pyx_n_s_xnnz, __pyx_n_s_eta, __pyx_n_s_p, __pyx_n_s_update, __pyx_n_s_sumloss, __pyx_n_s_y, __pyx_n_s_sample_weight, __pyx_n_s_class_weight, __pyx_n_s_count, __pyx_n_s_epoch, __pyx_n_s_i, __pyx_n_s_is_hinge, __pyx_n_s_q, __pyx_n_s_q_data_ptr, __pyx_n_s_u, __pyx_n_s_t_start); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(20, 0, 42, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_volatile_ogrisel_code_scikit_le, __pyx_n_s_plain_sgd, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -9539,7 +9546,7 @@ PyMODINIT_FUNC PyInit_sgd_fast(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; - /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/volatile/ogrisel/envs/py34/lib/python3.4/site-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< diff --git a/sklearn/linear_model/sgd_fast.pyx b/sklearn/linear_model/sgd_fast.pyx index 5a83a6def3355..9c2b0972103f1 100644 --- a/sklearn/linear_model/sgd_fast.pyx +++ b/sklearn/linear_model/sgd_fast.pyx @@ -519,7 +519,9 @@ def plain_sgd(np.ndarray[double, ndim=1, mode='c'] weights, break if infinity: - raise ValueError("floating-point under-/overflow occurred.") + raise ValueError(("Floating-point under-/overflow occurred at epoch" + " #%d. Scaling input data with StandardScaler or" + " MinMaxScaler might help.") % (epoch + 1)) w.reset_wscale() diff --git a/sklearn/linear_model/tests/test_bayes.py b/sklearn/linear_model/tests/test_bayes.py index e7299f8eae28e..100d50f6fcbf1 100644 --- a/sklearn/linear_model/tests/test_bayes.py +++ b/sklearn/linear_model/tests/test_bayes.py @@ -10,6 +10,8 @@ from sklearn.linear_model.bayes import BayesianRidge, ARDRegression from sklearn import datasets +from sklearn.utils.testing import assert_array_almost_equal + def test_bayesian_on_diabetes(): """ @@ -42,8 +44,10 @@ def test_toy_bayesian_ridge_object(): Y = np.array([1, 2, 6, 8, 10]) clf = BayesianRidge(compute_score=True) clf.fit(X, Y) - X_test = [[1], [3], [4]] - assert(np.abs(clf.predict(X_test) - [1, 3, 4]).sum() < 1.e-2) # identity + + # Check that the model could approximately learn the identity function + test = [[1], [3], [4]] + assert_array_almost_equal(clf.predict(test), [1, 3, 4], 2) def test_toy_ard_object(): @@ -54,5 +58,7 @@ def test_toy_ard_object(): Y = np.array([1, 2, 3]) clf = ARDRegression(compute_score=True) clf.fit(X, Y) + + # Check that the model could approximately learn the identity function test = [[1], [3], [4]] - assert(np.abs(clf.predict(test) - [1, 3, 4]).sum() < 1.e-3) # identity + assert_array_almost_equal(clf.predict(test), [1, 3, 4], 2) diff --git a/sklearn/linear_model/tests/test_least_angle.py b/sklearn/linear_model/tests/test_least_angle.py index 20fbb5854cefa..057a6a8cd2c76 100644 --- a/sklearn/linear_model/tests/test_least_angle.py +++ b/sklearn/linear_model/tests/test_least_angle.py @@ -9,6 +9,8 @@ from sklearn.utils.testing import assert_greater from sklearn.utils.testing import assert_raises from sklearn.utils.testing import ignore_warnings, assert_warns_message +from sklearn.utils.testing import assert_warns +from sklearn.utils import ConvergenceWarning from sklearn import linear_model, datasets diabetes = datasets.load_diabetes() @@ -187,7 +189,7 @@ def test_singular_matrix(): y1 = np.array([1, 1]) in_warn_message = 'Dropping a regressor' f = assert_warns_message - alphas, active, coef_path = f(UserWarning, in_warn_message, + alphas, active, coef_path = f(ConvergenceWarning, in_warn_message, linear_model.lars_path, X1, y1) assert_array_almost_equal(coef_path.T, [[0, 0], [1, 0]]) @@ -216,7 +218,7 @@ def test_rank_deficient_design(): coef_cd_ = coord_descent.fit(X, y).coef_ obj_cd = ((1. / (2. * 3.)) * linalg.norm(y - np.dot(X, coef_cd_)) ** 2 + .1 * linalg.norm(coef_cd_, 1)) - assert_array_almost_equal(obj_lars, obj_cd) + assert_less(obj_lars, obj_cd * (1. + 1e-8)) def test_lasso_lars_vs_lasso_cd(verbose=False): @@ -233,15 +235,15 @@ def test_lasso_lars_vs_lasso_cd(verbose=False): continue lasso_cd.alpha = a lasso_cd.fit(X, y) - error = np.linalg.norm(c - lasso_cd.coef_) + error = linalg.norm(c - lasso_cd.coef_) assert_less(error, 0.01) # similar test, with the classifiers - for alpha in np.linspace(1e-2, 1 - 1e-2): + for alpha in np.linspace(1e-2, 1 - 1e-2, 20): clf1 = linear_model.LassoLars(alpha=alpha, normalize=False).fit(X, y) clf2 = linear_model.Lasso(alpha=alpha, tol=1e-8, normalize=False).fit(X, y) - err = np.linalg.norm(clf1.coef_ - clf2.coef_) + err = linalg.norm(clf1.coef_ - clf2.coef_) assert_less(err, 1e-3) # same test, with normalized data @@ -254,7 +256,7 @@ def test_lasso_lars_vs_lasso_cd(verbose=False): continue lasso_cd.alpha = a lasso_cd.fit(X, y) - error = np.linalg.norm(c - lasso_cd.coef_) + error = linalg.norm(c - lasso_cd.coef_) assert_less(error, 0.01) @@ -271,7 +273,7 @@ def test_lasso_lars_vs_lasso_cd_early_stopping(verbose=False): lasso_cd = linear_model.Lasso(fit_intercept=False, tol=1e-8) lasso_cd.alpha = alphas[-1] lasso_cd.fit(X, y) - error = np.linalg.norm(lasso_path[:, -1] - lasso_cd.coef_) + error = linalg.norm(lasso_path[:, -1] - lasso_cd.coef_) assert_less(error, 0.01) alphas_min = [10, 0.9, 1e-4] @@ -283,7 +285,7 @@ def test_lasso_lars_vs_lasso_cd_early_stopping(verbose=False): tol=1e-8) lasso_cd.alpha = alphas[-1] lasso_cd.fit(X, y) - error = np.linalg.norm(lasso_path[:, -1] - lasso_cd.coef_) + error = linalg.norm(lasso_path[:, -1] - lasso_cd.coef_) assert_less(error, 0.01) @@ -308,7 +310,7 @@ def test_lasso_lars_vs_lasso_cd_ill_conditioned(): rng = np.random.RandomState(42) # Generate data - n, m = 80, 100 + n, m = 70, 100 k = 5 X = rng.randn(n, m) w = np.zeros((m, 1)) @@ -325,7 +327,7 @@ def test_lasso_lars_vs_lasso_cd_ill_conditioned(): def in_warn_message(msg): return 'Early stopping' in msg or 'Dropping regressor' in msg - lars_alphas, _, lars_coef = f(UserWarning, + lars_alphas, _, lars_coef = f(ConvergenceWarning, in_warn_message, linear_model.lars_path, X, y, method='lasso') @@ -353,27 +355,27 @@ def test_lars_drop_for_good(): # Create an ill-conditioned situation in which the LARS has to go # far in the path to converge, and check that LARS and coordinate # descent give the same answers - X = [[10, 10, 0], + X = [[1e20, 1e20, 0], [-1e-32, 0, 0], [1, 1, 1]] - y = [100, -100, 1] - alpha = .001 + y = [10, 10, 1] + alpha = .0001 def objective_function(coef): return (1. / (2. * len(X)) * linalg.norm(y - np.dot(X, coef)) ** 2 + alpha * linalg.norm(coef, 1)) - # TODO: raise a specific warning class when drop for good kicks in and - # catch it in this test lars = linear_model.LassoLars(alpha=alpha, normalize=False) - lars_coef_ = lars.fit(X, y).coef_ + assert_warns(ConvergenceWarning, lars.fit, X, y) + lars_coef_ = lars.coef_ lars_obj = objective_function(lars_coef_) coord_descent = linear_model.Lasso(alpha=alpha, tol=1e-10, normalize=False) - cd_coef_ = coord_descent.fit(X, y).coef_ - cd_obj = objective_function(cd_coef_) + with ignore_warnings(): + cd_coef_ = coord_descent.fit(X, y).coef_ + cd_obj = objective_function(cd_coef_) - assert_array_almost_equal(lars_obj / cd_obj, 1.0, decimal=3) + assert_less(lars_obj, cd_obj * (1. + 1e-8)) def test_lars_add_features(): diff --git a/sklearn/linear_model/tests/test_ransac.py b/sklearn/linear_model/tests/test_ransac.py index 6495aae779d4e..4eaf734cfcdad 100644 --- a/sklearn/linear_model/tests/test_ransac.py +++ b/sklearn/linear_model/tests/test_ransac.py @@ -4,6 +4,7 @@ from sklearn.utils.testing import assert_less from sklearn.linear_model import LinearRegression, RANSACRegressor +from sklearn.linear_model.ransac import _dynamic_max_trials # Generate coordinates of line @@ -84,7 +85,7 @@ def test_ransac_max_trials(): random_state=0) assert getattr(ransac_estimator, 'n_trials_', None) is None ransac_estimator.fit(X, y) - assert_equal(ransac_estimator.n_trials_, 11) + assert_equal(ransac_estimator.n_trials_, 2) def test_ransac_stop_n_inliers(): @@ -277,7 +278,6 @@ def test_ransac_residual_metric(): def test_ransac_default_residual_threshold(): - base_estimator = LinearRegression() ransac_estimator = RANSACRegressor(base_estimator, min_samples=2, random_state=0) @@ -293,5 +293,45 @@ def test_ransac_default_residual_threshold(): assert_equal(ransac_estimator.inlier_mask_, ref_inlier_mask) +def test_ransac_dynamic_max_trials(): + # Numbers hand-calculated and confirmed on page 119 (Table 4.3) in + # Hartley, R.~I. and Zisserman, A., 2004, + # Multiple View Geometry in Computer Vision, Second Edition, + # Cambridge University Press, ISBN: 0521540518 + + # e = 0%, min_samples = X + assert_equal(_dynamic_max_trials(100, 100, 2, 0.99), 1) + + # e = 5%, min_samples = 2 + assert_equal(_dynamic_max_trials(95, 100, 2, 0.99), 2) + # e = 10%, min_samples = 2 + assert_equal(_dynamic_max_trials(90, 100, 2, 0.99), 3) + # e = 30%, min_samples = 2 + assert_equal(_dynamic_max_trials(70, 100, 2, 0.99), 7) + # e = 50%, min_samples = 2 + assert_equal(_dynamic_max_trials(50, 100, 2, 0.99), 17) + + # e = 5%, min_samples = 8 + assert_equal(_dynamic_max_trials(95, 100, 8, 0.99), 5) + # e = 10%, min_samples = 8 + assert_equal(_dynamic_max_trials(90, 100, 8, 0.99), 9) + # e = 30%, min_samples = 8 + assert_equal(_dynamic_max_trials(70, 100, 8, 0.99), 78) + # e = 50%, min_samples = 8 + assert_equal(_dynamic_max_trials(50, 100, 8, 0.99), 1177) + + # e = 0%, min_samples = 10 + assert_equal(_dynamic_max_trials(1, 100, 10, 0), 0) + assert_equal(_dynamic_max_trials(1, 100, 10, 1), float('inf')) + + base_estimator = LinearRegression() + ransac_estimator = RANSACRegressor(base_estimator, min_samples=2, + stop_probability=-0.1) + assert_raises(ValueError, ransac_estimator.fit, X, y) + ransac_estimator = RANSACRegressor(base_estimator, min_samples=2, + stop_probability=1.1) + assert_raises(ValueError, ransac_estimator.fit, X, y) + + if __name__ == "__main__": np.testing.run_module_suite() diff --git a/sklearn/linear_model/tests/test_sgd.py b/sklearn/linear_model/tests/test_sgd.py index 04c7e92dda53c..39ea0b6ffd1da 100644 --- a/sklearn/linear_model/tests/test_sgd.py +++ b/sklearn/linear_model/tests/test_sgd.py @@ -13,6 +13,7 @@ from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_false, assert_true from sklearn.utils.testing import assert_equal +from sklearn.utils.testing import assert_raises_regexp from sklearn import linear_model, datasets, metrics from sklearn.base import clone @@ -829,3 +830,29 @@ def test_l1_ratio(): l1_ratio=0.0000000001).fit(X, y) est_l2 = SGDClassifier(alpha=0.001, penalty='l2').fit(X, y) assert_array_almost_equal(est_en.coef_, est_l2.coef_) + + +def test_underflow_or_overlow(): + # Generate some weird data with unscaled features + rng = np.random.RandomState(42) + n_samples = 100 + n_features = 10 + + X = rng.normal(size=(n_samples, n_features)) + X[:, 0] *= 100 + + # Define a ground truth on the scaled data + ground_truth = rng.normal(size=n_features) + y = (np.dot(scale(X), ground_truth) > 0.).astype(np.int32) + assert_array_equal(np.unique(y), [0, 1]) + + model = SGDClassifier(alpha=0.1, loss='squared_hinge', n_iter=500) + + # smoke test: model is stable on scaled data + model.fit(scale(X), y) + + # model is numerically unstable on unscaled data + msg_regxp = (r"Floating-point under-/overflow occurred at epoch #.*" + " Scaling input data with StandardScaler or MinMaxScaler" + " might help.") + assert_raises_regexp(ValueError, msg_regxp, model.fit, X, y) diff --git a/sklearn/linear_model/tests/test_sparse_coordinate_descent.py b/sklearn/linear_model/tests/test_sparse_coordinate_descent.py index 8cdbcc7281e05..7e78bacd90b80 100644 --- a/sklearn/linear_model/tests/test_sparse_coordinate_descent.py +++ b/sklearn/linear_model/tests/test_sparse_coordinate_descent.py @@ -249,20 +249,20 @@ def test_path_parameters(): def test_same_output_sparse_dense_lasso_and_enet_cv(): - X, y = make_sparse_data(n_samples=50, n_features=10) + X, y = make_sparse_data(n_samples=40, n_features=10) for normalize in [True, False]: - clfs = ElasticNetCV(max_iter=100, cv=10, normalize=normalize) + clfs = ElasticNetCV(max_iter=100, cv=5, normalize=normalize) ignore_warnings(clfs.fit)(X, y) - clfd = ElasticNetCV(max_iter=100, cv=10, normalize=normalize) + clfd = ElasticNetCV(max_iter=100, cv=5, normalize=normalize) ignore_warnings(clfd.fit)(X.todense(), y) assert_almost_equal(clfs.alpha_, clfd.alpha_, 7) assert_almost_equal(clfs.intercept_, clfd.intercept_, 7) assert_array_almost_equal(clfs.mse_path_, clfd.mse_path_) assert_array_almost_equal(clfs.alphas_, clfd.alphas_) - clfs = LassoCV(max_iter=100, cv=10, normalize=normalize) + clfs = LassoCV(max_iter=100, cv=4, normalize=normalize) ignore_warnings(clfs.fit)(X, y) - clfd = LassoCV(max_iter=100, cv=10, normalize=normalize) + clfd = LassoCV(max_iter=100, cv=4, normalize=normalize) ignore_warnings(clfd.fit)(X.todense(), y) assert_almost_equal(clfs.alpha_, clfd.alpha_, 7) assert_almost_equal(clfs.intercept_, clfd.intercept_, 7) diff --git a/sklearn/manifold/tests/test_locally_linear.py b/sklearn/manifold/tests/test_locally_linear.py index 07bbfee38c57c..0bb0821232bd6 100644 --- a/sklearn/manifold/tests/test_locally_linear.py +++ b/sklearn/manifold/tests/test_locally_linear.py @@ -1,8 +1,10 @@ from itertools import product -import numpy as np from nose.tools import assert_true +import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal +from scipy import linalg + from sklearn import neighbors, manifold from sklearn.manifold.locally_linear import barycenter_kneighbors_graph from sklearn.utils.testing import assert_less @@ -27,7 +29,7 @@ def test_barycenter_kneighbors_graph(): # check that columns sum to one assert_array_almost_equal(np.sum(A.todense(), 1), np.ones((3, 1))) pred = np.dot(A.todense(), X) - assert_less(np.linalg.norm(pred - X) / X.shape[0], 1) + assert_less(linalg.norm(pred - X) / X.shape[0], 1) #---------------------------------------------------------------------- @@ -49,14 +51,14 @@ def test_lle_simple_grid(): tol = 0.1 N = barycenter_kneighbors_graph(X, clf.n_neighbors).todense() - reconstruction_error = np.linalg.norm(np.dot(N, X) - X, 'fro') + reconstruction_error = linalg.norm(np.dot(N, X) - X, 'fro') assert_less(reconstruction_error, tol) for solver in eigen_solvers: clf.set_params(eigen_solver=solver) clf.fit(X) assert_true(clf.embedding_.shape[1] == n_components) - reconstruction_error = np.linalg.norm( + reconstruction_error = linalg.norm( np.dot(N, clf.embedding_) - clf.embedding_, 'fro') ** 2 assert_less(reconstruction_error, tol) @@ -66,14 +68,14 @@ def test_lle_simple_grid(): # re-embed a noisy version of X using the transform method noise = rng.randn(*X.shape) / 100 X_reembedded = clf.transform(X + noise) - assert_less(np.linalg.norm(X_reembedded - clf.embedding_), tol) + assert_less(linalg.norm(X_reembedded - clf.embedding_), tol) def test_lle_manifold(): rng = np.random.RandomState(0) # similar test on a slightly more complex manifold - X = np.array(list(product(np.arange(20), repeat=2))) - X = np.c_[X, X[:, 0] ** 2 / 20] + X = np.array(list(product(np.arange(18), repeat=2))) + X = np.c_[X, X[:, 0] ** 2 / 18] X = X + 1e-10 * rng.uniform(size=X.shape) n_components = 2 for method in ["standard", "hessian", "modified", "ltsa"]: @@ -83,14 +85,14 @@ def test_lle_manifold(): tol = 1.5 if method == "standard" else 3 N = barycenter_kneighbors_graph(X, clf.n_neighbors).toarray() - reconstruction_error = np.linalg.norm(np.dot(N, X) - X) + reconstruction_error = linalg.norm(np.dot(N, X) - X) assert_less(reconstruction_error, tol) for solver in eigen_solvers: clf.set_params(eigen_solver=solver) clf.fit(X) assert_true(clf.embedding_.shape[1] == n_components) - reconstruction_error = np.linalg.norm( + reconstruction_error = linalg.norm( np.dot(N, clf.embedding_) - clf.embedding_, 'fro') ** 2 details = ("solver: %s, method: %s" % (solver, method)) assert_less(reconstruction_error, tol, msg=details) diff --git a/sklearn/manifold/tests/test_spectral_embedding.py b/sklearn/manifold/tests/test_spectral_embedding.py index 288a1d069ad4b..d158dfdbb83f8 100644 --- a/sklearn/manifold/tests/test_spectral_embedding.py +++ b/sklearn/manifold/tests/test_spectral_embedding.py @@ -104,8 +104,6 @@ def test_spectral_embedding_callable_affinity(seed=36): random_state=np.random.RandomState(seed)) embed_rbf = se_rbf.fit_transform(S) embed_callable = se_callable.fit_transform(S) - embed_rbf = se_rbf.fit_transform(S) - embed_callable = se_callable.fit_transform(S) assert_array_almost_equal( se_callable.affinity_matrix_, se_rbf.affinity_matrix_) assert_array_almost_equal(kern, se_rbf.affinity_matrix_) diff --git a/sklearn/metrics/cluster/supervised.py b/sklearn/metrics/cluster/supervised.py index 086c5b7db25f3..30830a4d84471 100644 --- a/sklearn/metrics/cluster/supervised.py +++ b/sklearn/metrics/cluster/supervised.py @@ -596,8 +596,9 @@ def adjusted_mutual_info_score(labels_true, labels_pred): Returns ------- ami: float(upperlimited by 1.0) - The AMI takes a value of 1 when the two partitions - are identical and a value of 0 is expected for random partitions. + The AMI returns a value of 1 when the two partitions are identical + (ie perfectly matched). Random partitions (independent labellings) have + an expected AMI around 0 on average hence can be negative. See also -------- diff --git a/sklearn/metrics/metrics.py b/sklearn/metrics/metrics.py index 0a3eabe033c20..da8a6facab80e 100644 --- a/sklearn/metrics/metrics.py +++ b/sklearn/metrics/metrics.py @@ -746,7 +746,7 @@ def roc_curve(y_true, y_score, pos_label=None): y_score : array, shape = [n_samples] Target scores, can either be probability estimates of the positive - class, confidence values, or binary decisions. + class or confidence values. pos_label : int Label considered as positive and others are considered negative. @@ -1622,6 +1622,13 @@ def precision_recall_fscore_support(y_true, y_pred, beta=1.0, labels=None, ### Select labels to keep ### if y_type == 'binary' and average is not None and pos_label is not None: + if label_order is not None and len(label_order) == 2: + warnings.warn('In the future, providing two `labels` values, as ' + 'well as `average` will average over those ' + 'labels. For now, please use `labels=None` with ' + '`pos_label` to evaluate precision, recall and ' + 'F-score for the positive label only.', + FutureWarning) if pos_label not in labels: if len(labels) == 1: # Only negative labels diff --git a/sklearn/mixture/dpgmm.py b/sklearn/mixture/dpgmm.py index 32417d04ca067..ec3814a30108d 100644 --- a/sklearn/mixture/dpgmm.py +++ b/sklearn/mixture/dpgmm.py @@ -17,15 +17,11 @@ from ..externals.six.moves import xrange from ..utils import check_random_state, deprecated -from ..utils.extmath import norm, logsumexp, pinvh +from ..utils.extmath import logsumexp, pinvh, squared_norm from .. import cluster from .gmm import GMM -def sqnorm(v): - return norm(v) ** 2 - - def digamma(x): return _digamma(x + np.finfo(np.float32).eps) @@ -412,7 +408,7 @@ def _bound_concentration(self): def _bound_means(self): "The variational lower bound for the mean parameters" logprior = 0. - logprior -= 0.5 * sqnorm(self.means_) + logprior -= 0.5 * squared_norm(self.means_) logprior -= 0.5 * self.means_.shape[1] * self.n_components return logprior diff --git a/sklearn/neighbors/base.py b/sklearn/neighbors/base.py index de348b3a96d00..4f3b28a93418f 100644 --- a/sklearn/neighbors/base.py +++ b/sklearn/neighbors/base.py @@ -173,10 +173,7 @@ def _fit(self, X): self._fit_method = 'kd_tree' return self - X = safe_asarray(X) - - if X.ndim != 2: - raise ValueError("data type not understood") + X = atleast2d_or_csr(X, copy=False) n_samples = X.shape[0] if n_samples == 0: @@ -189,7 +186,7 @@ def _fit(self, X): if self.effective_metric_ not in VALID_METRICS_SPARSE['brute']: raise ValueError("metric '%s' not valid for sparse input" % self.effective_metric_) - self._fit_X = X.tocsr() + self._fit_X = X.copy() self._tree = None self._fit_method = 'brute' return self diff --git a/sklearn/neural_network/tests/test_rbm.py b/sklearn/neural_network/tests/test_rbm.py index eea3cf2b984c7..cf4fa8bc5d080 100644 --- a/sklearn/neural_network/tests/test_rbm.py +++ b/sklearn/neural_network/tests/test_rbm.py @@ -33,14 +33,13 @@ def test_fit(): def test_partial_fit(): X = Xdigits.copy() - n = 7 rbm = BernoulliRBM(n_components=64, learning_rate=0.1, - batch_size=10, random_state=9) + batch_size=20, random_state=9) n_samples = X.shape[0] n_batches = int(np.ceil(float(n_samples) / rbm.batch_size)) batch_slices = np.array_split(X, n_batches) - for i in range(n): + for i in range(7): for batch in batch_slices: rbm.partial_fit(batch) @@ -133,10 +132,10 @@ def test_fit_gibbs_sparse(): def test_gibbs_smoke(): - """ just seek if we don't get NaNs sampling the full digits dataset """ + """Check if we don't get NaNs sampling the full digits dataset.""" rng = np.random.RandomState(42) X = Xdigits - rbm1 = BernoulliRBM(n_components=42, batch_size=10, + rbm1 = BernoulliRBM(n_components=42, batch_size=40, n_iter=20, random_state=rng) rbm1.fit(X) X_sampled = rbm1.gibbs(X) diff --git a/sklearn/svm/base.py b/sklearn/svm/base.py index 215f1bd8db632..817f730dcbacf 100644 --- a/sklearn/svm/base.py +++ b/sklearn/svm/base.py @@ -219,7 +219,7 @@ def _dense_fit(self, X, y, sample_weight, solver_type, kernel, # we don't pass **self.get_params() to allow subclasses to # add other parameters to __init__ self.support_, self.support_vectors_, self.n_support_, \ - self.dual_coef_, self.intercept_, self._label, self.probA_, \ + self.dual_coef_, self.intercept_, self.probA_, \ self.probB_, self.fit_status_ = libsvm.fit( X, y, svm_type=solver_type, sample_weight=sample_weight, @@ -242,7 +242,7 @@ def _sparse_fit(self, X, y, sample_weight, solver_type, kernel, libsvm_sparse.set_verbosity_wrap(self.verbose) self.support_, self.support_vectors_, dual_coef_data, \ - self.intercept_, self._label, self.n_support_, \ + self.intercept_, self.n_support_, \ self.probA_, self.probB_, self.fit_status_ = \ libsvm_sparse.libsvm_sparse_train( X.shape[1], X.data, X.indices, X.indptr, y, solver_type, @@ -254,7 +254,10 @@ def _sparse_fit(self, X, y, sample_weight, solver_type, kernel, self._warn_from_fit_status() - n_class = len(self._label) - 1 + if hasattr(self, "classes_"): + n_class = len(self.classes_) - 1 + else: # regression + n_class = 1 n_SV = self.support_vectors_.shape[0] dual_coef_indices = np.tile(np.arange(n_SV), n_class) @@ -299,7 +302,7 @@ def _dense_predict(self, X): return libsvm.predict( X, self.support_, self.support_vectors_, self.n_support_, - self.dual_coef_, self._intercept_, self._label, + self.dual_coef_, self._intercept_, self.probA_, self.probB_, svm_type=svm_type, kernel=kernel, degree=self.degree, coef0=self.coef0, gamma=self._gamma, cache_size=self.cache_size) @@ -325,7 +328,7 @@ def _sparse_predict(self, X): self.degree, self._gamma, self.coef0, self.tol, C, self.class_weight_, self.nu, self.epsilon, self.shrinking, - self.probability, self.n_support_, self._label, + self.probability, self.n_support_, self.probA_, self.probB_) def _compute_kernel(self, X): @@ -365,7 +368,7 @@ def decision_function(self, X): dec_func = libsvm.decision_function( X, self.support_, self.support_vectors_, self.n_support_, - self.dual_coef_, self._intercept_, self._label, + self.dual_coef_, self._intercept_, self.probA_, self.probB_, svm_type=LIBSVM_IMPL.index(self._impl), kernel=kernel, degree=self.degree, cache_size=self.cache_size, @@ -551,7 +554,7 @@ def _dense_predict_proba(self, X): svm_type = LIBSVM_IMPL.index(self._impl) pprob = libsvm.predict_proba( X, self.support_, self.support_vectors_, self.n_support_, - self.dual_coef_, self._intercept_, self._label, + self.dual_coef_, self._intercept_, self.probA_, self.probB_, svm_type=svm_type, kernel=kernel, degree=self.degree, cache_size=self.cache_size, coef0=self.coef0, gamma=self._gamma) @@ -577,7 +580,7 @@ def _sparse_predict_proba(self, X): self.degree, self._gamma, self.coef0, self.tol, self.C, self.class_weight_, self.nu, self.epsilon, self.shrinking, - self.probability, self.n_support_, self._label, + self.probability, self.n_support_, self.probA_, self.probB_) diff --git a/sklearn/svm/classes.py b/sklearn/svm/classes.py index cf610429e5679..23329a940b0cf 100644 --- a/sklearn/svm/classes.py +++ b/sklearn/svm/classes.py @@ -125,12 +125,9 @@ class frequencies. sklearn.linear_model.SGDClassifier SGDClassifier can optimize the same cost function as LinearSVC - by adjusting the penalty and loss parameters. Furthermore - SGDClassifier is scalable to large number of samples as it uses - a Stochastic Gradient Descent optimizer. - - Finally SGDClassifier can fit both dense and sparse data without - memory copy if the input is C-contiguous or CSR. + by adjusting the penalty and loss parameters. In addition it requires + less memory, allows incremental (online) learning, and implements + various loss functions and regularization regimes. """ diff --git a/sklearn/svm/libsvm.c b/sklearn/svm/libsvm.c index a6cedb7381785..ee1a29c4638e6 100644 --- a/sklearn/svm/libsvm.c +++ b/sklearn/svm/libsvm.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.20 on Sat Jan 25 11:19:14 2014 */ +/* Generated by Cython 0.20.1 on Thu Apr 3 16:22:28 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" +#define CYTHON_ABI "0_20_1" #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -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, 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) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" @@ -161,10 +161,16 @@ #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 @@ -231,7 +237,7 @@ #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif -#if PY_VERSION_HEX < 0x03020000 +#if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong @@ -587,7 +593,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":723 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -596,7 +602,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":724 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -605,7 +611,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":725 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -614,7 +620,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":726 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -623,7 +629,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":730 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -632,7 +638,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":731 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -641,7 +647,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":732 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -650,7 +656,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":733 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -659,7 +665,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":737 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -668,7 +674,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":738 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -677,7 +683,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":747 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -686,7 +692,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":748 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -695,7 +701,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":749 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -704,7 +710,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":751 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -713,7 +719,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":752 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -722,7 +728,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":753 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -731,7 +737,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":755 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -740,7 +746,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":756 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -749,7 +755,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":758 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -758,7 +764,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":759 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -767,7 +773,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":760 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -798,7 +804,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /*--- Type declarations ---*/ -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":762 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -807,7 +813,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":763 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -816,7 +822,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":764 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -825,7 +831,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":766 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -930,6 +936,12 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info); static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*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 CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ static void __Pyx_RaiseBufferFallbackError(void); /*proto*/ @@ -1174,9 +1186,9 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_Y, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_tol, double __pyx_v_C, double __pyx_v_nu, double __pyx_v_epsilon, PyArrayObject *__pyx_v_class_weight, PyArrayObject *__pyx_v_sample_weight, int __pyx_v_shrinking, int __pyx_v_probability, double __pyx_v_cache_size, int __pyx_v_max_iter, int __pyx_v_random_seed); /* proto */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size); /* proto */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size); /* proto */ -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size); /* proto */ +static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size); /* proto */ +static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size); /* proto */ +static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size); /* proto */ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_Y, int __pyx_v_n_fold, PyObject *__pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_tol, double __pyx_v_C, double __pyx_v_nu, CYTHON_UNUSED double __pyx_v_epsilon, PyArrayObject *__pyx_v_class_weight, PyArrayObject *__pyx_v_sample_weight, int __pyx_v_shrinking, int __pyx_v_probability, double __pyx_v_cache_size, int __pyx_v_max_iter, int __pyx_v_random_seed); /* proto */ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_10set_verbosity_wrap(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_verbosity); /* proto */ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ @@ -1221,7 +1233,6 @@ static char __pyx_k_empty[] = "empty"; static char __pyx_k_gamma[] = "gamma"; static char __pyx_k_index[] = "index"; static char __pyx_k_int32[] = "int32"; -static char __pyx_k_label[] = "label"; static char __pyx_k_model[] = "model"; static char __pyx_k_numpy[] = "numpy"; static char __pyx_k_param[] = "param"; @@ -1280,7 +1291,7 @@ static char __pyx_k_We_ve_run_out_of_memory[] = "We've run out of memory"; static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_Seems_we_ve_run_out_of_memory[] = "Seems we've run out of memory"; static char __pyx_k_Binding_for_libsvm_skl_These_ar[] = "\nBinding for libsvm_skl\n----------------------\n\nThese are the bindings for libsvm_skl, which is a fork of libsvm[1]\nthat adds to libsvm some capabilities, like index of support vectors\nand efficient representation of dense matrices.\n\nThese are low-level routines, but can be used for flexibility or\nperformance reasons. See sklearn.svm for a higher-level API.\n\nLow-level memory management is done in libsvm_helper.c. If we happen\nto run out of memory a MemoryError will be raised. In practice this is\nnot very helpful since hight changes are malloc fails inside svm.cpp,\nwhere no sort of memory checks are done.\n\n[1] http://www.csie.ntu.edu.tw/~cjlin/libsvm/\n\nNotes\n-----\nMaybe we could speed it a bit further by decorating functions with\n@cython.boundscheck(False), but probably it is not worth since all\nwork is done in lisvm_helper.c\nAlso, the signature mode='c' is somewhat superficial, since we already\ncheck that arrays are C-contiguous in svm.py\n\nAuthors\n-------\n2010: Fabian Pedregosa \n Gael Varoquaux \n"; -static char __pyx_k_Users_Chen_Developer_scikit_lea[] = "/Users/Chen/Developer/scikit-learn/sklearn/svm/libsvm.pyx"; +static char __pyx_k_home_larsb_src_scikit_learn_skl[] = "/home/larsb/src/scikit-learn/sklearn/svm/libsvm.pyx"; static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; @@ -1300,7 +1311,6 @@ static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_SV; static PyObject *__pyx_n_s_SV_len; static PyObject *__pyx_kp_s_Seems_we_ve_run_out_of_memory; -static PyObject *__pyx_kp_s_Users_Chen_Developer_scikit_lea; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_s_We_ve_run_out_of_memory; static PyObject *__pyx_n_s_X; @@ -1324,13 +1334,13 @@ static PyObject *__pyx_n_s_fit; static PyObject *__pyx_n_s_fit_status; static PyObject *__pyx_n_s_float64; static PyObject *__pyx_n_s_gamma; +static PyObject *__pyx_kp_s_home_larsb_src_scikit_learn_skl; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_int32; static PyObject *__pyx_n_s_intercept; static PyObject *__pyx_n_s_kernel; static PyObject *__pyx_n_s_kernel_index; -static PyObject *__pyx_n_s_label; static PyObject *__pyx_n_s_linear; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_max_iter; @@ -1456,7 +1466,7 @@ static PyObject *__pyx_codeobj__62; /* Python wrapper */ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_1fit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_7sklearn_3svm_6libsvm_fit[] = "\n Train the model using libsvm (low-level method)\n\n Parameters\n ----------\n X : array-like, dtype=float64, size=[n_samples, n_features]\n\n Y : array, dtype=float64, size=[n_samples]\n target vector\n\n svm_type : {0, 1, 2, 3, 4}, optional\n Type of SVM: C_SVC, NuSVC, OneClassSVM, EpsilonSVR or NuSVR\n respectively. 0 by default.\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}, optional\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed. 'rbf' by default.\n\n degree : int32, optional\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial), 3 by default.\n\n gamma : float64, optional\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF). 0.1 by default.\n\n coef0 : float64, optional\n Independent parameter in poly/sigmoid kernel. 0 by default.\n\n tol : float64, optional\n Numeric stopping criterion (WRITEME). 1e-3 by default.\n\n C : float64, optional\n C parameter in C-Support Vector Classification. 1 by default.\n\n nu : float64, optional\n 0.5 by default.\n\n epsilon : double, optional\n 0.1 by default.\n\n class_weight : array, dtype float64, shape (n_classes,), optional\n np.empty(0) by default.\n\n sample_weight : array, dtype float64, shape (n_samples,), optional\n np.empty(0) by default.\n\n shrinking : int, optional\n 1 by default.\n\n probability : int, optional\n 0 by default.\n\n cache_size : float64, optional\n Cache size for gram matrix columns (in megabytes). 100 by default.\n\n max_iter : int (-1 for no limit), optional.\n Stop solver after this many iterations regardless of accuracy\n (XXX Currently there is no API to know whether this kicked in.)\n -1 by default.\n\n random_seed : int, optional\n Seed for the random number generator"" used for probability estimates.\n 0 by default.\n\n Returns\n -------\n support : array, shape=[n_support]\n index of support vectors\n\n support_vectors : array, shape=[n_support, n_features]\n support vectors (equivalent to X[support]). Will return an\n empty array in the case of precomputed kernel.\n\n n_class_SV : array\n number of support vectors in each class.\n\n sv_coef : array\n coefficients of support vectors in decision function.\n\n intercept : array\n intercept in decision function\n\n label : labels for different classes (only relevant in classification).\n\n probA, probB : array\n probability estimates, empty array for probability=False\n "; +static char __pyx_doc_7sklearn_3svm_6libsvm_fit[] = "\n Train the model using libsvm (low-level method)\n\n Parameters\n ----------\n X : array-like, dtype=float64, size=[n_samples, n_features]\n\n Y : array, dtype=float64, size=[n_samples]\n target vector\n\n svm_type : {0, 1, 2, 3, 4}, optional\n Type of SVM: C_SVC, NuSVC, OneClassSVM, EpsilonSVR or NuSVR\n respectively. 0 by default.\n\n kernel : {'linear', 'rbf', 'poly', 'sigmoid', 'precomputed'}, optional\n Kernel to use in the model: linear, polynomial, RBF, sigmoid\n or precomputed. 'rbf' by default.\n\n degree : int32, optional\n Degree of the polynomial kernel (only relevant if kernel is\n set to polynomial), 3 by default.\n\n gamma : float64, optional\n Gamma parameter in RBF kernel (only relevant if kernel is set\n to RBF). 0.1 by default.\n\n coef0 : float64, optional\n Independent parameter in poly/sigmoid kernel. 0 by default.\n\n tol : float64, optional\n Numeric stopping criterion (WRITEME). 1e-3 by default.\n\n C : float64, optional\n C parameter in C-Support Vector Classification. 1 by default.\n\n nu : float64, optional\n 0.5 by default.\n\n epsilon : double, optional\n 0.1 by default.\n\n class_weight : array, dtype float64, shape (n_classes,), optional\n np.empty(0) by default.\n\n sample_weight : array, dtype float64, shape (n_samples,), optional\n np.empty(0) by default.\n\n shrinking : int, optional\n 1 by default.\n\n probability : int, optional\n 0 by default.\n\n cache_size : float64, optional\n Cache size for gram matrix columns (in megabytes). 100 by default.\n\n max_iter : int (-1 for no limit), optional.\n Stop solver after this many iterations regardless of accuracy\n (XXX Currently there is no API to know whether this kicked in.)\n -1 by default.\n\n random_seed : int, optional\n Seed for the random number generator"" used for probability estimates.\n 0 by default.\n\n Returns\n -------\n support : array, shape=[n_support]\n index of support vectors\n\n support_vectors : array, shape=[n_support, n_features]\n support vectors (equivalent to X[support]). Will return an\n empty array in the case of precomputed kernel.\n\n n_class_SV : array\n number of support vectors in each class.\n\n sv_coef : array\n coefficients of support vectors in decision function.\n\n intercept : array\n intercept in decision function\n\n probA, probB : array\n probability estimates, empty array for probability=False\n "; static PyMethodDef __pyx_mdef_7sklearn_3svm_6libsvm_1fit = {__Pyx_NAMESTR("fit"), (PyCFunction)__pyx_pw_7sklearn_3svm_6libsvm_1fit, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_7sklearn_3svm_6libsvm_fit)}; static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_1fit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_X = 0; @@ -1743,7 +1753,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py PyArrayObject *__pyx_v_support = 0; PyArrayObject *__pyx_v_support_vectors = 0; PyArrayObject *__pyx_v_n_class_SV = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_X; @@ -1756,8 +1765,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __Pyx_Buffer __pyx_pybuffer_class_weight_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_intercept; __Pyx_Buffer __pyx_pybuffer_intercept; - __Pyx_LocalBuf_ND __pyx_pybuffernd_label; - __Pyx_Buffer __pyx_pybuffer_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_n_class_SV; __Pyx_Buffer __pyx_pybuffer_n_class_SV; __Pyx_LocalBuf_ND __pyx_pybuffernd_probA; @@ -1794,7 +1801,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py PyArrayObject *__pyx_t_18 = NULL; PyArrayObject *__pyx_t_19 = NULL; PyArrayObject *__pyx_t_20 = NULL; - PyArrayObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -1824,10 +1830,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_pybuffer_n_class_SV.refcount = 0; __pyx_pybuffernd_n_class_SV.data = NULL; __pyx_pybuffernd_n_class_SV.rcbuffer = &__pyx_pybuffer_n_class_SV; - __pyx_pybuffer_label.pybuffer.buf = NULL; - __pyx_pybuffer_label.refcount = 0; - __pyx_pybuffernd_label.data = NULL; - __pyx_pybuffernd_label.rcbuffer = &__pyx_pybuffer_label; __pyx_pybuffer_probA.pybuffer.buf = NULL; __pyx_pybuffer_probA.refcount = 0; __pyx_pybuffernd_probA.data = NULL; @@ -1873,51 +1875,51 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm.pyx":165 + /* "sklearn/svm/libsvm.pyx":163 * * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: */ - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":166 + /* "sklearn/svm/libsvm.pyx":164 * * if len(sample_weight) == 0: * sample_weight = np.ones(X.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< * else: * assert sample_weight.shape[0] == X.shape[0], \ */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __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_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1933,7 +1935,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_7)); @@ -1942,7 +1944,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } /*else*/ { - /* "sklearn/svm/libsvm.pyx":168 + /* "sklearn/svm/libsvm.pyx":166 * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: * assert sample_weight.shape[0] == X.shape[0], \ # <<<<<<<<<<<<<< @@ -1953,18 +1955,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_sample_weight->dimensions[0]) == (__pyx_v_X->dimensions[0])) != 0))) { - /* "sklearn/svm/libsvm.pyx":171 + /* "sklearn/svm/libsvm.pyx":169 * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], X.shape[0]) # <<<<<<<<<<<<<< * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) */ - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); @@ -1973,70 +1975,70 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_t_7 = 0; __pyx_t_3 = 0; - /* "sklearn/svm/libsvm.pyx":170 + /* "sklearn/svm/libsvm.pyx":168 * assert sample_weight.shape[0] == X.shape[0], \ * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ # <<<<<<<<<<<<<< * (sample_weight.shape[0], X.shape[0]) * */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_sample_weight_has_s_samples_whil, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_sample_weight_has_s_samples_whil, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":169 + /* "sklearn/svm/libsvm.pyx":167 * else: * assert sample_weight.shape[0] == X.shape[0], \ * "sample_weight and X have incompatible shapes: " + \ # <<<<<<<<<<<<<< * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], X.shape[0]) */ - __pyx_t_5 = PyNumber_Add(__pyx_kp_s_sample_weight_and_X_have_incompa, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_kp_s_sample_weight_and_X_have_incompa, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif } __pyx_L3:; - /* "sklearn/svm/libsvm.pyx":173 + /* "sklearn/svm/libsvm.pyx":171 * (sample_weight.shape[0], X.shape[0]) * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 173; __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 = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_kernel); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_kernel); __Pyx_GIVEREF(__pyx_v_kernel); - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_kernel_index = __pyx_t_7; __pyx_t_7 = 0; - /* "sklearn/svm/libsvm.pyx":175 + /* "sklearn/svm/libsvm.pyx":173 * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) # <<<<<<<<<<<<<< * if problem.x == NULL: * raise MemoryError("Seems we've run out of memory") */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":174 + /* "sklearn/svm/libsvm.pyx":172 * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_problem( # <<<<<<<<<<<<<< @@ -2045,7 +2047,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ set_problem((&__pyx_v_problem), __pyx_v_X->data, __pyx_v_Y->data, __pyx_v_sample_weight->data, __pyx_v_X->dimensions, __pyx_t_9); - /* "sklearn/svm/libsvm.pyx":176 + /* "sklearn/svm/libsvm.pyx":174 * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: # <<<<<<<<<<<<<< @@ -2055,60 +2057,60 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_t_2 = ((__pyx_v_problem.x == NULL) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":177 + /* "sklearn/svm/libsvm.pyx":175 * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: * raise MemoryError("Seems we've run out of memory") # <<<<<<<<<<<<<< * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) */ - __pyx_t_7 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm.pyx":179 + /* "sklearn/svm/libsvm.pyx":177 * raise MemoryError("Seems we've run out of memory") * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 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 = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -2116,16 +2118,16 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "sklearn/svm/libsvm.pyx":181 + /* "sklearn/svm/libsvm.pyx":179 * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, # <<<<<<<<<<<<<< * C, tol, epsilon, shrinking, probability, class_weight.shape[0], * class_weight_label.data, class_weight.data, max_iter, random_seed) */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":180 + /* "sklearn/svm/libsvm.pyx":178 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) * set_parameter( # <<<<<<<<<<<<<< @@ -2134,7 +2136,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ set_parameter((&__pyx_v_param), __pyx_v_svm_type, __pyx_t_9, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_epsilon, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data, __pyx_v_max_iter, __pyx_v_random_seed); - /* "sklearn/svm/libsvm.pyx":185 + /* "sklearn/svm/libsvm.pyx":183 * class_weight_label.data, class_weight.data, max_iter, random_seed) * * error_msg = svm_check_parameter(&problem, ¶m) # <<<<<<<<<<<<<< @@ -2143,7 +2145,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ __pyx_v_error_msg = svm_check_parameter((&__pyx_v_problem), (&__pyx_v_param)); - /* "sklearn/svm/libsvm.pyx":186 + /* "sklearn/svm/libsvm.pyx":184 * * error_msg = svm_check_parameter(&problem, ¶m) * if error_msg: # <<<<<<<<<<<<<< @@ -2153,42 +2155,42 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_t_2 = (__pyx_v_error_msg != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":188 + /* "sklearn/svm/libsvm.pyx":186 * if error_msg: * # for SVR: epsilon is called p in libsvm * error_repl = error_msg.decode('utf-8').replace("p < 0", "epsilon < 0") # <<<<<<<<<<<<<< * raise ValueError(error_repl) * */ - __pyx_t_6 = __Pyx_decode_c_string(__pyx_v_error_msg, 0, strlen(__pyx_v_error_msg), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_decode_c_string(__pyx_v_error_msg, 0, strlen(__pyx_v_error_msg), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyUnicode_Replace(((PyObject*)__pyx_t_6), __pyx_kp_s_p_0, __pyx_kp_s_epsilon_0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyUnicode_Replace(((PyObject*)__pyx_t_6), __pyx_kp_s_p_0, __pyx_kp_s_epsilon_0, -1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_error_repl = __pyx_t_7; __pyx_t_7 = 0; - /* "sklearn/svm/libsvm.pyx":189 + /* "sklearn/svm/libsvm.pyx":187 * # for SVR: epsilon is called p in libsvm * error_repl = error_msg.decode('utf-8').replace("p < 0", "epsilon < 0") * raise ValueError(error_repl) # <<<<<<<<<<<<<< * * # this does the real work */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_error_repl); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_error_repl); __Pyx_GIVEREF(__pyx_v_error_repl); - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm.pyx":192 + /* "sklearn/svm/libsvm.pyx":190 * * # this does the real work * cdef int fit_status = 0 # <<<<<<<<<<<<<< @@ -2197,7 +2199,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ __pyx_v_fit_status = 0; - /* "sklearn/svm/libsvm.pyx":193 + /* "sklearn/svm/libsvm.pyx":191 * # this does the real work * cdef int fit_status = 0 * with nogil: # <<<<<<<<<<<<<< @@ -2211,7 +2213,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py #endif /*try:*/ { - /* "sklearn/svm/libsvm.pyx":194 + /* "sklearn/svm/libsvm.pyx":192 * cdef int fit_status = 0 * with nogil: * model = svm_train(&problem, ¶m, &fit_status) # <<<<<<<<<<<<<< @@ -2221,7 +2223,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_v_model = svm_train((&__pyx_v_problem), (&__pyx_v_param), (&__pyx_v_fit_status)); } - /* "sklearn/svm/libsvm.pyx":193 + /* "sklearn/svm/libsvm.pyx":191 * # this does the real work * cdef int fit_status = 0 * with nogil: # <<<<<<<<<<<<<< @@ -2239,7 +2241,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } - /* "sklearn/svm/libsvm.pyx":198 + /* "sklearn/svm/libsvm.pyx":196 * # from here until the end, we just copy the data returned by * # svm_train * SV_len = get_l(model) # <<<<<<<<<<<<<< @@ -2248,35 +2250,35 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ __pyx_v_SV_len = get_l(__pyx_v_model); - /* "sklearn/svm/libsvm.pyx":199 + /* "sklearn/svm/libsvm.pyx":197 * # svm_train * SV_len = get_l(model) * n_class = get_nr(model) # <<<<<<<<<<<<<< * * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef */ - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(get_nr(__pyx_v_model)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(get_nr(__pyx_v_model)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_v_n_class = __pyx_t_6; __pyx_t_6 = 0; - /* "sklearn/svm/libsvm.pyx":202 + /* "sklearn/svm/libsvm.pyx":200 * * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef * sv_coef = np.empty((n_class-1, SV_len), dtype=np.float64) # <<<<<<<<<<<<<< * copy_sv_coef (sv_coef.data, model) * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -2284,26 +2286,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_t_3); __pyx_t_6 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_14 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2319,13 +2321,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_sv_coef.diminfo[0].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv_coef.diminfo[0].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sv_coef.diminfo[1].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sv_coef.diminfo[1].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_14 = 0; __pyx_v_sv_coef = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm.pyx":203 + /* "sklearn/svm/libsvm.pyx":201 * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef * sv_coef = np.empty((n_class-1, SV_len), dtype=np.float64) * copy_sv_coef (sv_coef.data, model) # <<<<<<<<<<<<<< @@ -2334,49 +2336,49 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ copy_sv_coef(__pyx_v_sv_coef->data, __pyx_v_model); - /* "sklearn/svm/libsvm.pyx":207 + /* "sklearn/svm/libsvm.pyx":205 * # the intercept is just model.rho but with sign changed * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] intercept * intercept = np.empty(int((n_class*(n_class-1))/2), dtype=np.float64) # <<<<<<<<<<<<<< * copy_intercept (intercept.data, model, intercept.shape) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_15 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2392,13 +2394,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_intercept.diminfo[0].strides = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intercept.diminfo[0].shape = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_15 = 0; __pyx_v_intercept = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "sklearn/svm/libsvm.pyx":208 + /* "sklearn/svm/libsvm.pyx":206 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] intercept * intercept = np.empty(int((n_class*(n_class-1))/2), dtype=np.float64) * copy_intercept (intercept.data, model, intercept.shape) # <<<<<<<<<<<<<< @@ -2407,40 +2409,40 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions); - /* "sklearn/svm/libsvm.pyx":211 + /* "sklearn/svm/libsvm.pyx":209 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] support * support = np.empty (SV_len, dtype=np.int32) # <<<<<<<<<<<<<< * copy_support (support.data, model) * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2456,13 +2458,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_support.diminfo[0].strides = __pyx_pybuffernd_support.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support.diminfo[0].shape = __pyx_pybuffernd_support.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_16 = 0; __pyx_v_support = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "sklearn/svm/libsvm.pyx":212 + /* "sklearn/svm/libsvm.pyx":210 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] support * support = np.empty (SV_len, dtype=np.int32) * copy_support (support.data, model) # <<<<<<<<<<<<<< @@ -2471,44 +2473,44 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ copy_support(__pyx_v_support->data, __pyx_v_model); - /* "sklearn/svm/libsvm.pyx":216 + /* "sklearn/svm/libsvm.pyx":214 * # copy model.SV * cdef np.ndarray[np.float64_t, ndim=2, mode='c'] support_vectors * if kernel_index == 4: # <<<<<<<<<<<<<< * # precomputed kernel * support_vectors = np.empty((0, 0), dtype=np.float64) */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_kernel_index, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_RichCompare(__pyx_v_kernel_index, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":218 + /* "sklearn/svm/libsvm.pyx":216 * if kernel_index == 4: * # precomputed kernel * support_vectors = np.empty((0, 0), dtype=np.float64) # <<<<<<<<<<<<<< * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __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 = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, __pyx_tuple__5, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 218; __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 = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2524,7 +2526,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_support_vectors.diminfo[0].strides = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support_vectors.diminfo[0].shape = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_support_vectors.diminfo[1].strides = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_support_vectors.diminfo[1].shape = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_17 = 0; __pyx_v_support_vectors = ((PyArrayObject *)__pyx_t_3); @@ -2533,23 +2535,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } /*else*/ { - /* "sklearn/svm/libsvm.pyx":220 + /* "sklearn/svm/libsvm.pyx":218 * support_vectors = np.empty((0, 0), dtype=np.float64) * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) # <<<<<<<<<<<<<< * copy_SV(support_vectors.data, model, support_vectors.shape) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __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 = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[1])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[1])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -2557,26 +2559,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __Pyx_GIVEREF(__pyx_t_6); __pyx_t_3 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __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 = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __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 = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __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_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 220; __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 = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_17 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2592,13 +2594,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_support_vectors.diminfo[0].strides = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support_vectors.diminfo[0].shape = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_support_vectors.diminfo[1].strides = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_support_vectors.diminfo[1].shape = __pyx_pybuffernd_support_vectors.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_17 = 0; __pyx_v_support_vectors = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":221 + /* "sklearn/svm/libsvm.pyx":219 * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) * copy_SV(support_vectors.data, model, support_vectors.shape) # <<<<<<<<<<<<<< @@ -2609,38 +2611,38 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } __pyx_L9:; - /* "sklearn/svm/libsvm.pyx":225 + /* "sklearn/svm/libsvm.pyx":223 * # TODO: do only in classification * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] n_class_SV * n_class_SV = np.empty(n_class, dtype=np.int32) # <<<<<<<<<<<<<< * copy_nSV(n_class_SV.data, model) * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __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 = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __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 = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_n_class); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_n_class); __Pyx_GIVEREF(__pyx_v_n_class); - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); 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); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_6); 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); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 225; __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 = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_18 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2656,84 +2658,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } } __pyx_pybuffernd_n_class_SV.diminfo[0].strides = __pyx_pybuffernd_n_class_SV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n_class_SV.diminfo[0].shape = __pyx_pybuffernd_n_class_SV.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_18 = 0; __pyx_v_n_class_SV = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/svm/libsvm.pyx":226 + /* "sklearn/svm/libsvm.pyx":224 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] n_class_SV * n_class_SV = np.empty(n_class, dtype=np.int32) * copy_nSV(n_class_SV.data, model) # <<<<<<<<<<<<<< * - * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label - */ - copy_nSV(__pyx_v_n_class_SV->data, __pyx_v_model); - - /* "sklearn/svm/libsvm.pyx":229 - * - * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label - * label = np.empty((n_class), dtype=np.int32) # <<<<<<<<<<<<<< - * copy_label(label.data, model) - * - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __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 = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_n_class); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n_class); - __Pyx_GIVEREF(__pyx_v_n_class); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_19 = ((PyArrayObject *)__pyx_t_7); - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); - if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); - __Pyx_RaiseBufferFallbackError(); - } else { - PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); - } - } - __pyx_pybuffernd_label.diminfo[0].strides = __pyx_pybuffernd_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_label.diminfo[0].shape = __pyx_pybuffernd_label.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_19 = 0; - __pyx_v_label = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; - - /* "sklearn/svm/libsvm.pyx":230 - * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label - * label = np.empty((n_class), dtype=np.int32) - * copy_label(label.data, model) # <<<<<<<<<<<<<< - * * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probA */ - copy_label(__pyx_v_label->data, __pyx_v_model); + copy_nSV(__pyx_v_n_class_SV->data, __pyx_v_model); - /* "sklearn/svm/libsvm.pyx":234 + /* "sklearn/svm/libsvm.pyx":228 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probA * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB * if probability != 0: # <<<<<<<<<<<<<< @@ -2743,7 +2683,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_t_2 = ((__pyx_v_probability != 0) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":235 + /* "sklearn/svm/libsvm.pyx":229 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB * if probability != 0: * if svm_type < 2: # SVC and NuSVC # <<<<<<<<<<<<<< @@ -2753,135 +2693,135 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __pyx_t_2 = ((__pyx_v_svm_type < 2) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":236 + /* "sklearn/svm/libsvm.pyx":230 * if probability != 0: * if svm_type < 2: # SVC and NuSVC * probA = np.empty(int(n_class*(n_class-1)/2), dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(int(n_class*(n_class-1)/2), dtype=np.float64) * copy_probB(probB.data, model, probB.shape) */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __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 = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_20 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); } } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_20 = 0; - __pyx_v_probA = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_19 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "sklearn/svm/libsvm.pyx":237 + /* "sklearn/svm/libsvm.pyx":231 * if svm_type < 2: # SVC and NuSVC * probA = np.empty(int(n_class*(n_class-1)/2), dtype=np.float64) * probB = np.empty(int(n_class*(n_class-1)/2), dtype=np.float64) # <<<<<<<<<<<<<< * copy_probB(probB.data, model, probB.shape) * else: */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Subtract(__pyx_v_n_class, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 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 = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Multiply(__pyx_v_n_class, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = ((PyArrayObject *)__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); } } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_21 = 0; - __pyx_v_probB = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_20 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; - /* "sklearn/svm/libsvm.pyx":238 + /* "sklearn/svm/libsvm.pyx":232 * probA = np.empty(int(n_class*(n_class-1)/2), dtype=np.float64) * probB = np.empty(int(n_class*(n_class-1)/2), dtype=np.float64) * copy_probB(probB.data, model, probB.shape) # <<<<<<<<<<<<<< @@ -2893,103 +2833,103 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } /*else*/ { - /* "sklearn/svm/libsvm.pyx":240 + /* "sklearn/svm/libsvm.pyx":234 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __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 = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_7, __pyx_tuple__6, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_20 = ((PyArrayObject *)__pyx_t_3); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __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_tuple__6, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __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_4); __pyx_t_4 = 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 = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); } } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_20 = 0; - __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_19 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":241 + /* "sklearn/svm/libsvm.pyx":235 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * copy_probA(probA.data, model, probA.shape) * else: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __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 = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_6, __pyx_tuple__7, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); } } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_21 = 0; - __pyx_v_probB = ((PyArrayObject *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_t_20 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; } __pyx_L11:; - /* "sklearn/svm/libsvm.pyx":242 + /* "sklearn/svm/libsvm.pyx":236 * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) # <<<<<<<<<<<<<< @@ -3001,103 +2941,103 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py } /*else*/ { - /* "sklearn/svm/libsvm.pyx":244 + /* "sklearn/svm/libsvm.pyx":238 * copy_probA(probA.data, model, probA.shape) * else: * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_tuple__8, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_20 = ((PyArrayObject *)__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__8, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_19 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); + Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); } } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_20 = 0; - __pyx_v_probA = ((PyArrayObject *)__pyx_t_7); - __pyx_t_7 = 0; + __pyx_t_19 = 0; + __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "sklearn/svm/libsvm.pyx":245 + /* "sklearn/svm/libsvm.pyx":239 * else: * probA = np.empty(0, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * * svm_free_and_destroy_model(&model) */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __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 = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_tuple__9, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__9, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_21 = ((PyArrayObject *)__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_20 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); - __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); + __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack); if (unlikely(__pyx_t_9 < 0)) { - PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10); + PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { - Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); + Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); __Pyx_RaiseBufferFallbackError(); } else { - PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10); + PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12); } } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_21 = 0; - __pyx_v_probB = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; + __pyx_t_20 = 0; + __pyx_v_probB = ((PyArrayObject *)__pyx_t_4); + __pyx_t_4 = 0; } __pyx_L10:; - /* "sklearn/svm/libsvm.pyx":247 + /* "sklearn/svm/libsvm.pyx":241 * probB = np.empty(0, dtype=np.float64) * * svm_free_and_destroy_model(&model) # <<<<<<<<<<<<<< @@ -3106,72 +3046,69 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py */ svm_free_and_destroy_model((&__pyx_v_model)); - /* "sklearn/svm/libsvm.pyx":248 + /* "sklearn/svm/libsvm.pyx":242 * * svm_free_and_destroy_model(&model) * free(problem.x) # <<<<<<<<<<<<<< * - * return (support, support_vectors, n_class_SV, sv_coef, intercept, label, + * return (support, support_vectors, n_class_SV, sv_coef, intercept, */ free(__pyx_v_problem.x); - /* "sklearn/svm/libsvm.pyx":250 + /* "sklearn/svm/libsvm.pyx":244 * free(problem.x) * - * return (support, support_vectors, n_class_SV, sv_coef, intercept, label, # <<<<<<<<<<<<<< + * return (support, support_vectors, n_class_SV, sv_coef, intercept, # <<<<<<<<<<<<<< * probA, probB, fit_status) * */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/svm/libsvm.pyx":251 + /* "sklearn/svm/libsvm.pyx":245 * - * return (support, support_vectors, n_class_SV, sv_coef, intercept, label, + * return (support, support_vectors, n_class_SV, sv_coef, intercept, * probA, probB, fit_status) # <<<<<<<<<<<<<< * * */ - __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_fit_status); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_fit_status); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); - /* "sklearn/svm/libsvm.pyx":250 + /* "sklearn/svm/libsvm.pyx":244 * free(problem.x) * - * return (support, support_vectors, n_class_SV, sv_coef, intercept, label, # <<<<<<<<<<<<<< + * return (support, support_vectors, n_class_SV, sv_coef, intercept, # <<<<<<<<<<<<<< * probA, probB, fit_status) * */ - __pyx_t_7 = PyTuple_New(9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_support)); - PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_support)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_support)); __Pyx_GIVEREF(((PyObject *)__pyx_v_support)); __Pyx_INCREF(((PyObject *)__pyx_v_support_vectors)); - PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_support_vectors)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_support_vectors)); __Pyx_GIVEREF(((PyObject *)__pyx_v_support_vectors)); __Pyx_INCREF(((PyObject *)__pyx_v_n_class_SV)); - PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_n_class_SV)); + PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_n_class_SV)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n_class_SV)); __Pyx_INCREF(((PyObject *)__pyx_v_sv_coef)); - PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_v_sv_coef)); + PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_sv_coef)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sv_coef)); __Pyx_INCREF(((PyObject *)__pyx_v_intercept)); - PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_intercept)); + PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_v_intercept)); __Pyx_GIVEREF(((PyObject *)__pyx_v_intercept)); - __Pyx_INCREF(((PyObject *)__pyx_v_label)); - PyTuple_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_v_label)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_label)); __Pyx_INCREF(((PyObject *)__pyx_v_probA)); - PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_v_probA)); + PyTuple_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_v_probA)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probA)); __Pyx_INCREF(((PyObject *)__pyx_v_probB)); - PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_v_probB)); + PyTuple_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_v_probB)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probB)); - PyTuple_SET_ITEM(__pyx_t_7, 8, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; + PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; /* "sklearn/svm/libsvm.pyx":54 @@ -3196,7 +3133,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n_class_SV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -3214,7 +3150,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n_class_SV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -3232,7 +3167,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF((PyObject *)__pyx_v_support); __Pyx_XDECREF((PyObject *)__pyx_v_support_vectors); __Pyx_XDECREF((PyObject *)__pyx_v_n_class_SV); - __Pyx_XDECREF((PyObject *)__pyx_v_label); __Pyx_XDECREF((PyObject *)__pyx_v_probA); __Pyx_XDECREF((PyObject *)__pyx_v_probB); __Pyx_XDECREF((PyObject *)__pyx_v_sample_weight); @@ -3241,7 +3175,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_fit(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "sklearn/svm/libsvm.pyx":254 +/* "sklearn/svm/libsvm.pyx":248 * * * cdef void set_predict_params( # <<<<<<<<<<<<<< @@ -3268,7 +3202,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_predict_params", 0); - /* "sklearn/svm/libsvm.pyx":261 + /* "sklearn/svm/libsvm.pyx":255 * * # training-time only parameters * cdef double C = .0 # <<<<<<<<<<<<<< @@ -3277,7 +3211,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_C = .0; - /* "sklearn/svm/libsvm.pyx":262 + /* "sklearn/svm/libsvm.pyx":256 * # training-time only parameters * cdef double C = .0 * cdef double epsilon = .1 # <<<<<<<<<<<<<< @@ -3286,7 +3220,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_epsilon = .1; - /* "sklearn/svm/libsvm.pyx":263 + /* "sklearn/svm/libsvm.pyx":257 * cdef double C = .0 * cdef double epsilon = .1 * cdef int max_iter = 0 # <<<<<<<<<<<<<< @@ -3295,7 +3229,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_max_iter = 0; - /* "sklearn/svm/libsvm.pyx":264 + /* "sklearn/svm/libsvm.pyx":258 * cdef double epsilon = .1 * cdef int max_iter = 0 * cdef double nu = .5 # <<<<<<<<<<<<<< @@ -3304,7 +3238,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_nu = .5; - /* "sklearn/svm/libsvm.pyx":265 + /* "sklearn/svm/libsvm.pyx":259 * cdef int max_iter = 0 * cdef double nu = .5 * cdef int shrinking = 0 # <<<<<<<<<<<<<< @@ -3313,7 +3247,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_shrinking = 0; - /* "sklearn/svm/libsvm.pyx":266 + /* "sklearn/svm/libsvm.pyx":260 * cdef double nu = .5 * cdef int shrinking = 0 * cdef double tol = .1 # <<<<<<<<<<<<<< @@ -3322,7 +3256,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_tol = .1; - /* "sklearn/svm/libsvm.pyx":267 + /* "sklearn/svm/libsvm.pyx":261 * cdef int shrinking = 0 * cdef double tol = .1 * cdef int random_seed = -1 # <<<<<<<<<<<<<< @@ -3331,40 +3265,40 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ __pyx_v_random_seed = -1; - /* "sklearn/svm/libsvm.pyx":269 + /* "sklearn/svm/libsvm.pyx":263 * cdef int random_seed = -1 * * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< * * set_parameter(param, svm_type, kernel_index, degree, gamma, coef0, nu, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __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 = 269; __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 = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_kernel); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_kernel); __Pyx_GIVEREF(__pyx_v_kernel); - __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 263; __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_v_kernel_index = __pyx_t_3; __pyx_t_3 = 0; - /* "sklearn/svm/libsvm.pyx":271 + /* "sklearn/svm/libsvm.pyx":265 * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * * set_parameter(param, svm_type, kernel_index, degree, gamma, coef0, nu, # <<<<<<<<<<<<<< * cache_size, C, tol, epsilon, shrinking, probability, * nr_weight, weight_label, weight, max_iter, random_seed) */ - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":273 + /* "sklearn/svm/libsvm.pyx":267 * set_parameter(param, svm_type, kernel_index, degree, gamma, coef0, nu, * cache_size, C, tol, epsilon, shrinking, probability, * nr_weight, weight_label, weight, max_iter, random_seed) # <<<<<<<<<<<<<< @@ -3373,7 +3307,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete */ set_parameter(__pyx_v_param, __pyx_v_svm_type, __pyx_t_4, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_epsilon, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nr_weight, __pyx_v_weight_label, __pyx_v_weight, __pyx_v_max_iter, __pyx_v_random_seed); - /* "sklearn/svm/libsvm.pyx":254 + /* "sklearn/svm/libsvm.pyx":248 * * * cdef void set_predict_params( # <<<<<<<<<<<<<< @@ -3393,7 +3327,7 @@ static void __pyx_f_7sklearn_3svm_6libsvm_set_predict_params(struct svm_paramete __Pyx_RefNannyFinishContext(); } -/* "sklearn/svm/libsvm.pyx":276 +/* "sklearn/svm/libsvm.pyx":270 * * * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< @@ -3412,7 +3346,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_3predict(PyObject *__pyx_self, P PyArrayObject *__pyx_v_nSV = 0; PyArrayObject *__pyx_v_sv_coef = 0; PyArrayObject *__pyx_v_intercept = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; int __pyx_v_svm_type; @@ -3430,18 +3363,17 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_3predict(PyObject *__pyx_self, P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("predict (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_support,&__pyx_n_s_SV,&__pyx_n_s_nSV,&__pyx_n_s_sv_coef,&__pyx_n_s_intercept,&__pyx_n_s_label,&__pyx_n_s_probA,&__pyx_n_s_probB,&__pyx_n_s_svm_type,&__pyx_n_s_kernel,&__pyx_n_s_degree,&__pyx_n_s_gamma,&__pyx_n_s_coef0,&__pyx_n_s_class_weight,&__pyx_n_s_sample_weight,&__pyx_n_s_cache_size,0}; - PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[7] = (PyObject *)__pyx_k__10; - values[8] = (PyObject *)__pyx_k__11; - values[10] = ((PyObject *)__pyx_n_s_rbf); - values[14] = (PyObject *)__pyx_k__12; - values[15] = (PyObject *)__pyx_k__13; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_support,&__pyx_n_s_SV,&__pyx_n_s_nSV,&__pyx_n_s_sv_coef,&__pyx_n_s_intercept,&__pyx_n_s_probA,&__pyx_n_s_probB,&__pyx_n_s_svm_type,&__pyx_n_s_kernel,&__pyx_n_s_degree,&__pyx_n_s_gamma,&__pyx_n_s_coef0,&__pyx_n_s_class_weight,&__pyx_n_s_sample_weight,&__pyx_n_s_cache_size,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + values[6] = (PyObject *)__pyx_k__10; + values[7] = (PyObject *)__pyx_k__11; + values[9] = ((PyObject *)__pyx_n_s_rbf); + values[13] = (PyObject *)__pyx_k__12; + values[14] = (PyObject *)__pyx_k__13; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); @@ -3469,90 +3401,84 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_3predict(PyObject *__pyx_self, P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_support)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict", 0, 6, 16, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_SV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict", 0, 6, 16, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict", 0, 6, 16, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sv_coef)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict", 0, 6, 16, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intercept)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict", 0, 6, 16, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA); + if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_svm_type); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_svm_type); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree); if (value) { values[10] = value; kw_args--; } } case 11: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gamma); if (value) { values[11] = value; kw_args--; } } case 12: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gamma); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coef0); if (value) { values[12] = value; kw_args--; } } case 13: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coef0); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_weight); if (value) { values[13] = value; kw_args--; } } case 14: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_weight); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_weight); if (value) { values[14] = value; kw_args--; } } case 15: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_weight); - if (value) { values[15] = value; kw_args--; } - } - case 16: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cache_size); - if (value) { values[16] = value; kw_args--; } + if (value) { values[15] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); @@ -3563,7 +3489,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_3predict(PyObject *__pyx_self, P case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -3579,58 +3505,56 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_3predict(PyObject *__pyx_self, P __pyx_v_nSV = ((PyArrayObject *)values[3]); __pyx_v_sv_coef = ((PyArrayObject *)values[4]); __pyx_v_intercept = ((PyArrayObject *)values[5]); - __pyx_v_label = ((PyArrayObject *)values[6]); - __pyx_v_probA = ((PyArrayObject *)values[7]); - __pyx_v_probB = ((PyArrayObject *)values[8]); - if (values[9]) { - __pyx_v_svm_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probA = ((PyArrayObject *)values[6]); + __pyx_v_probB = ((PyArrayObject *)values[7]); + if (values[8]) { + __pyx_v_svm_type = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = values[10]; - if (values[11]) { - __pyx_v_degree = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel = values[9]; + if (values[10]) { + __pyx_v_degree = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_degree = ((int)3); } - if (values[12]) { - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[11]) { + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_gamma = ((double)0.1); } - if (values[13]) { - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[12]) { + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_coef0 = ((double)0.); } - __pyx_v_class_weight = ((PyArrayObject *)values[14]); - __pyx_v_sample_weight = ((PyArrayObject *)values[15]); - if (values[16]) { - __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_class_weight = ((PyArrayObject *)values[13]); + __pyx_v_sample_weight = ((PyArrayObject *)values[14]); + if (values[15]) { + __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_cache_size = ((double)100.); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("predict", 0, 7, 17, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict", 0, 6, 16, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm.predict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_support), __pyx_ptype_5numpy_ndarray, 1, "support", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __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 = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_2predict(__pyx_self, __pyx_v_X, __pyx_v_support, __pyx_v_SV, __pyx_v_nSV, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_label, __pyx_v_probA, __pyx_v_probB, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_cache_size); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_support), __pyx_ptype_5numpy_ndarray, 1, "support", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __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 = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_2predict(__pyx_self, __pyx_v_X, __pyx_v_support, __pyx_v_SV, __pyx_v_nSV, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_probA, __pyx_v_probB, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_cache_size); /* function exit code */ goto __pyx_L0; @@ -3641,7 +3565,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_3predict(PyObject *__pyx_self, P return __pyx_r; } -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size) { +static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size) { PyArrayObject *__pyx_v_dec_values = 0; struct svm_parameter __pyx_v_param; struct svm_model *__pyx_v_model; @@ -3659,8 +3583,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __Pyx_Buffer __pyx_pybuffer_dec_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_intercept; __Pyx_Buffer __pyx_pybuffer_intercept; - __Pyx_LocalBuf_ND __pyx_pybuffernd_label; - __Pyx_Buffer __pyx_pybuffer_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_nSV; __Pyx_Buffer __pyx_pybuffer_nSV; __Pyx_LocalBuf_ND __pyx_pybuffernd_probA; @@ -3728,10 +3650,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_pybuffer_intercept.refcount = 0; __pyx_pybuffernd_intercept.data = NULL; __pyx_pybuffernd_intercept.rcbuffer = &__pyx_pybuffer_intercept; - __pyx_pybuffer_label.pybuffer.buf = NULL; - __pyx_pybuffer_label.refcount = 0; - __pyx_pybuffernd_label.data = NULL; - __pyx_pybuffernd_label.rcbuffer = &__pyx_pybuffer_label; __pyx_pybuffer_probA.pybuffer.buf = NULL; __pyx_pybuffer_probA.refcount = 0; __pyx_pybuffernd_probA.data = NULL; @@ -3750,100 +3668,95 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_pybuffernd_sample_weight.rcbuffer = &__pyx_pybuffer_sample_weight; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __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_support.rcbuffer->pybuffer, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_support.rcbuffer->pybuffer, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_support.diminfo[0].strides = __pyx_pybuffernd_support.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support.diminfo[0].shape = __pyx_pybuffernd_support.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV.diminfo[0].strides = __pyx_pybuffernd_SV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV.diminfo[0].shape = __pyx_pybuffernd_SV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_SV.diminfo[1].strides = __pyx_pybuffernd_SV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_SV.diminfo[1].shape = __pyx_pybuffernd_SV.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_nSV.diminfo[0].strides = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nSV.diminfo[0].shape = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sv_coef.diminfo[0].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv_coef.diminfo[0].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sv_coef.diminfo[1].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sv_coef.diminfo[1].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_intercept.diminfo[0].strides = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intercept.diminfo[0].shape = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_pybuffernd_label.diminfo[0].strides = __pyx_pybuffernd_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_label.diminfo[0].shape = __pyx_pybuffernd_label.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm.pyx":320 + /* "sklearn/svm/libsvm.pyx":313 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * * set_predict_params(¶m, svm_type, kernel, degree, gamma, coef0, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __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_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 313; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __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_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __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 = 320; __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 = 313; __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_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -3851,25 +3764,25 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":322 + /* "sklearn/svm/libsvm.pyx":315 * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) * * set_predict_params(¶m, svm_type, kernel, degree, gamma, coef0, # <<<<<<<<<<<<<< * cache_size, 0, class_weight.shape[0], * class_weight_label.data, class_weight.data) */ - __pyx_f_7sklearn_3svm_6libsvm_set_predict_params((&__pyx_v_param), __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_cache_size, 0, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_3svm_6libsvm_set_predict_params((&__pyx_v_param), __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_cache_size, 0, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":325 + /* "sklearn/svm/libsvm.pyx":318 * cache_size, 0, class_weight.shape[0], * class_weight_label.data, class_weight.data) * model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, # <<<<<<<<<<<<<< * support.data, support.shape, sv_coef.strides, - * sv_coef.data, intercept.data, nSV.data, + * sv_coef.data, intercept.data, nSV.data, probA.data, probB.data) */ - __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); + __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "sklearn/svm/libsvm.pyx":331 + /* "sklearn/svm/libsvm.pyx":323 * * #TODO: use check_model * try: # <<<<<<<<<<<<<< @@ -3878,30 +3791,30 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject */ /*try:*/ { - /* "sklearn/svm/libsvm.pyx":332 + /* "sklearn/svm/libsvm.pyx":324 * #TODO: use check_model * try: * dec_values = np.empty(X.shape[0]) # <<<<<<<<<<<<<< * with nogil: * rv = copy_predict(X.data, model, X.shape, dec_values.data) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 332; __pyx_clineno = __LINE__; goto __pyx_L4_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 = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3917,13 +3830,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject } } __pyx_pybuffernd_dec_values.diminfo[0].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dec_values.diminfo[0].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __pyx_t_7 = 0; __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":333 + /* "sklearn/svm/libsvm.pyx":325 * try: * dec_values = np.empty(X.shape[0]) * with nogil: # <<<<<<<<<<<<<< @@ -3937,7 +3850,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "sklearn/svm/libsvm.pyx":334 + /* "sklearn/svm/libsvm.pyx":326 * dec_values = np.empty(X.shape[0]) * with nogil: * rv = copy_predict(X.data, model, X.shape, dec_values.data) # <<<<<<<<<<<<<< @@ -3947,7 +3860,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_v_rv = copy_predict(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data); } - /* "sklearn/svm/libsvm.pyx":333 + /* "sklearn/svm/libsvm.pyx":325 * try: * dec_values = np.empty(X.shape[0]) * with nogil: # <<<<<<<<<<<<<< @@ -3965,7 +3878,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject } } - /* "sklearn/svm/libsvm.pyx":335 + /* "sklearn/svm/libsvm.pyx":327 * with nogil: * rv = copy_predict(X.data, model, X.shape, dec_values.data) * if rv < 0: # <<<<<<<<<<<<<< @@ -3975,22 +3888,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_t_12 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_12) { - /* "sklearn/svm/libsvm.pyx":336 + /* "sklearn/svm/libsvm.pyx":328 * rv = copy_predict(X.data, model, X.shape, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * finally: * free_model(model) */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } } - /* "sklearn/svm/libsvm.pyx":338 + /* "sklearn/svm/libsvm.pyx":330 * raise MemoryError("We've run out of memory") * finally: * free_model(model) # <<<<<<<<<<<<<< @@ -4039,7 +3952,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_L5:; } - /* "sklearn/svm/libsvm.pyx":340 + /* "sklearn/svm/libsvm.pyx":332 * free_model(model) * * return dec_values # <<<<<<<<<<<<<< @@ -4051,7 +3964,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_dec_values); goto __pyx_L0; - /* "sklearn/svm/libsvm.pyx":276 + /* "sklearn/svm/libsvm.pyx":270 * * * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< @@ -4074,7 +3987,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -4092,7 +4004,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -4107,7 +4018,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_2predict(CYTHON_UNUSED PyObject return __pyx_r; } -/* "sklearn/svm/libsvm.pyx":343 +/* "sklearn/svm/libsvm.pyx":335 * * * def predict_proba( # <<<<<<<<<<<<<< @@ -4126,7 +4037,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_5predict_proba(PyObject *__pyx_s PyArrayObject *__pyx_v_nSV = 0; PyArrayObject *__pyx_v_sv_coef = 0; PyArrayObject *__pyx_v_intercept = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; int __pyx_v_svm_type; @@ -4144,18 +4054,17 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_5predict_proba(PyObject *__pyx_s __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("predict_proba (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_support,&__pyx_n_s_SV,&__pyx_n_s_nSV,&__pyx_n_s_sv_coef,&__pyx_n_s_intercept,&__pyx_n_s_label,&__pyx_n_s_probA,&__pyx_n_s_probB,&__pyx_n_s_svm_type,&__pyx_n_s_kernel,&__pyx_n_s_degree,&__pyx_n_s_gamma,&__pyx_n_s_coef0,&__pyx_n_s_class_weight,&__pyx_n_s_sample_weight,&__pyx_n_s_cache_size,0}; - PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[7] = (PyObject *)__pyx_k__15; - values[8] = (PyObject *)__pyx_k__16; - values[10] = ((PyObject*)__pyx_n_s_rbf); - values[14] = (PyObject *)__pyx_k__17; - values[15] = (PyObject *)__pyx_k__18; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_support,&__pyx_n_s_SV,&__pyx_n_s_nSV,&__pyx_n_s_sv_coef,&__pyx_n_s_intercept,&__pyx_n_s_probA,&__pyx_n_s_probB,&__pyx_n_s_svm_type,&__pyx_n_s_kernel,&__pyx_n_s_degree,&__pyx_n_s_gamma,&__pyx_n_s_coef0,&__pyx_n_s_class_weight,&__pyx_n_s_sample_weight,&__pyx_n_s_cache_size,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + values[6] = (PyObject *)__pyx_k__15; + values[7] = (PyObject *)__pyx_k__16; + values[9] = ((PyObject*)__pyx_n_s_rbf); + values[13] = (PyObject *)__pyx_k__17; + values[14] = (PyObject *)__pyx_k__18; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); @@ -4183,90 +4092,84 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_5predict_proba(PyObject *__pyx_s case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_support)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 6, 16, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_SV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 6, 16, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 6, 16, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sv_coef)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 6, 16, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intercept)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 6, 16, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA); + if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_svm_type); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_svm_type); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree); if (value) { values[10] = value; kw_args--; } } case 11: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gamma); if (value) { values[11] = value; kw_args--; } } case 12: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gamma); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coef0); if (value) { values[12] = value; kw_args--; } } case 13: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coef0); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_weight); if (value) { values[13] = value; kw_args--; } } case 14: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_weight); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_weight); if (value) { values[14] = value; kw_args--; } } case 15: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_weight); - if (value) { values[15] = value; kw_args--; } - } - case 16: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cache_size); - if (value) { values[16] = value; kw_args--; } + if (value) { values[15] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_proba") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "predict_proba") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); @@ -4277,7 +4180,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_5predict_proba(PyObject *__pyx_s case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -4293,59 +4196,57 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_5predict_proba(PyObject *__pyx_s __pyx_v_nSV = ((PyArrayObject *)values[3]); __pyx_v_sv_coef = ((PyArrayObject *)values[4]); __pyx_v_intercept = ((PyArrayObject *)values[5]); - __pyx_v_label = ((PyArrayObject *)values[6]); - __pyx_v_probA = ((PyArrayObject *)values[7]); - __pyx_v_probB = ((PyArrayObject *)values[8]); - if (values[9]) { - __pyx_v_svm_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probA = ((PyArrayObject *)values[6]); + __pyx_v_probB = ((PyArrayObject *)values[7]); + if (values[8]) { + __pyx_v_svm_type = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = ((PyObject*)values[10]); - if (values[11]) { - __pyx_v_degree = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel = ((PyObject*)values[9]); + if (values[10]) { + __pyx_v_degree = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_degree = ((int)3); } - if (values[12]) { - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[11]) { + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_gamma = ((double)0.1); } - if (values[13]) { - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[12]) { + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_coef0 = ((double)0.); } - __pyx_v_class_weight = ((PyArrayObject *)values[14]); - __pyx_v_sample_weight = ((PyArrayObject *)values[15]); - if (values[16]) { - __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_class_weight = ((PyArrayObject *)values[13]); + __pyx_v_sample_weight = ((PyArrayObject *)values[14]); + if (values[15]) { + __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_cache_size = ((double)100.); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 7, 17, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("predict_proba", 0, 6, 16, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm.predict_proba", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_support), __pyx_ptype_5numpy_ndarray, 1, "support", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __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 = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(__pyx_self, __pyx_v_X, __pyx_v_support, __pyx_v_SV, __pyx_v_nSV, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_label, __pyx_v_probA, __pyx_v_probB, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_cache_size); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_support), __pyx_ptype_5numpy_ndarray, 1, "support", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __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 = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(__pyx_self, __pyx_v_X, __pyx_v_support, __pyx_v_SV, __pyx_v_nSV, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_probA, __pyx_v_probB, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_cache_size); /* function exit code */ goto __pyx_L0; @@ -4356,7 +4257,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_5predict_proba(PyObject *__pyx_s return __pyx_r; } -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size) { +static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size) { PyArrayObject *__pyx_v_dec_values = 0; struct svm_parameter __pyx_v_param; struct svm_model *__pyx_v_model; @@ -4375,8 +4276,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __Pyx_Buffer __pyx_pybuffer_dec_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_intercept; __Pyx_Buffer __pyx_pybuffer_intercept; - __Pyx_LocalBuf_ND __pyx_pybuffernd_label; - __Pyx_Buffer __pyx_pybuffer_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_nSV; __Pyx_Buffer __pyx_pybuffer_nSV; __Pyx_LocalBuf_ND __pyx_pybuffernd_probA; @@ -4444,10 +4343,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_pybuffer_intercept.refcount = 0; __pyx_pybuffernd_intercept.data = NULL; __pyx_pybuffernd_intercept.rcbuffer = &__pyx_pybuffer_intercept; - __pyx_pybuffer_label.pybuffer.buf = NULL; - __pyx_pybuffer_label.refcount = 0; - __pyx_pybuffernd_label.data = NULL; - __pyx_pybuffernd_label.rcbuffer = &__pyx_pybuffer_label; __pyx_pybuffer_probA.pybuffer.buf = NULL; __pyx_pybuffer_probA.refcount = 0; __pyx_pybuffernd_probA.data = NULL; @@ -4466,100 +4361,95 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_pybuffernd_sample_weight.rcbuffer = &__pyx_pybuffer_sample_weight; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __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_support.rcbuffer->pybuffer, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_support.rcbuffer->pybuffer, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_support.diminfo[0].strides = __pyx_pybuffernd_support.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support.diminfo[0].shape = __pyx_pybuffernd_support.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV.diminfo[0].strides = __pyx_pybuffernd_SV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV.diminfo[0].shape = __pyx_pybuffernd_SV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_SV.diminfo[1].strides = __pyx_pybuffernd_SV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_SV.diminfo[1].shape = __pyx_pybuffernd_SV.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_nSV.diminfo[0].strides = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nSV.diminfo[0].shape = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sv_coef.diminfo[0].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv_coef.diminfo[0].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sv_coef.diminfo[1].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sv_coef.diminfo[1].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_intercept.diminfo[0].strides = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intercept.diminfo[0].shape = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_pybuffernd_label.diminfo[0].strides = __pyx_pybuffernd_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_label.diminfo[0].shape = __pyx_pybuffernd_label.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm.pyx":387 + /* "sklearn/svm/libsvm.pyx":378 * cdef svm_model *model * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * cdef int rv * */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __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_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __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 = 378; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __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_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __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 = 387; __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 = 378; __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_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -4567,26 +4457,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":390 + /* "sklearn/svm/libsvm.pyx":381 * cdef int rv * * set_predict_params(¶m, svm_type, kernel, degree, gamma, coef0, # <<<<<<<<<<<<<< * cache_size, 1, class_weight.shape[0], * class_weight_label.data, class_weight.data) */ - __pyx_f_7sklearn_3svm_6libsvm_set_predict_params((&__pyx_v_param), __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_cache_size, 1, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_3svm_6libsvm_set_predict_params((&__pyx_v_param), __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_cache_size, 1, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":393 + /* "sklearn/svm/libsvm.pyx":384 * cache_size, 1, class_weight.shape[0], * class_weight_label.data, class_weight.data) * model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, # <<<<<<<<<<<<<< * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, */ - __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); + __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "sklearn/svm/libsvm.pyx":398 - * label.data, probA.data, probB.data) + /* "sklearn/svm/libsvm.pyx":389 + * probA.data, probB.data) * * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< * try: @@ -4594,7 +4484,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "sklearn/svm/libsvm.pyx":399 + /* "sklearn/svm/libsvm.pyx":390 * * cdef np.npy_intp n_class = get_nr(model) * try: # <<<<<<<<<<<<<< @@ -4603,23 +4493,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO */ /*try:*/ { - /* "sklearn/svm/libsvm.pyx":400 + /* "sklearn/svm/libsvm.pyx":391 * cdef np.npy_intp n_class = get_nr(model) * try: * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) # <<<<<<<<<<<<<< * with nogil: * rv = copy_predict_proba(X.data, model, X.shape, dec_values.data) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -4627,26 +4517,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __Pyx_GIVEREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4662,13 +4552,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO } } __pyx_pybuffernd_dec_values.diminfo[0].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dec_values.diminfo[0].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dec_values.diminfo[1].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dec_values.diminfo[1].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } __pyx_t_7 = 0; __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm.pyx":401 + /* "sklearn/svm/libsvm.pyx":392 * try: * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -4682,7 +4572,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO #endif /*try:*/ { - /* "sklearn/svm/libsvm.pyx":402 + /* "sklearn/svm/libsvm.pyx":393 * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * with nogil: * rv = copy_predict_proba(X.data, model, X.shape, dec_values.data) # <<<<<<<<<<<<<< @@ -4692,7 +4582,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_v_rv = copy_predict_proba(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data); } - /* "sklearn/svm/libsvm.pyx":401 + /* "sklearn/svm/libsvm.pyx":392 * try: * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -4710,7 +4600,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO } } - /* "sklearn/svm/libsvm.pyx":403 + /* "sklearn/svm/libsvm.pyx":394 * with nogil: * rv = copy_predict_proba(X.data, model, X.shape, dec_values.data) * if rv < 0: # <<<<<<<<<<<<<< @@ -4720,22 +4610,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_t_12 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_12) { - /* "sklearn/svm/libsvm.pyx":404 + /* "sklearn/svm/libsvm.pyx":395 * rv = copy_predict_proba(X.data, model, X.shape, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * finally: * free_model(model) */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L4_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[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L4_error;} } } - /* "sklearn/svm/libsvm.pyx":406 + /* "sklearn/svm/libsvm.pyx":397 * raise MemoryError("We've run out of memory") * finally: * free_model(model) # <<<<<<<<<<<<<< @@ -4784,7 +4674,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_L5:; } - /* "sklearn/svm/libsvm.pyx":408 + /* "sklearn/svm/libsvm.pyx":399 * free_model(model) * * return dec_values # <<<<<<<<<<<<<< @@ -4796,7 +4686,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __pyx_r = ((PyObject *)__pyx_v_dec_values); goto __pyx_L0; - /* "sklearn/svm/libsvm.pyx":343 + /* "sklearn/svm/libsvm.pyx":335 * * * def predict_proba( # <<<<<<<<<<<<<< @@ -4819,7 +4709,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -4837,7 +4726,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -4852,7 +4740,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_4predict_proba(CYTHON_UNUSED PyO return __pyx_r; } -/* "sklearn/svm/libsvm.pyx":411 +/* "sklearn/svm/libsvm.pyx":402 * * * def decision_function( # <<<<<<<<<<<<<< @@ -4871,7 +4759,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_7decision_function(PyObject *__p PyArrayObject *__pyx_v_nSV = 0; PyArrayObject *__pyx_v_sv_coef = 0; PyArrayObject *__pyx_v_intercept = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; int __pyx_v_svm_type; @@ -4889,18 +4776,17 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_7decision_function(PyObject *__p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decision_function (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_support,&__pyx_n_s_SV,&__pyx_n_s_nSV,&__pyx_n_s_sv_coef,&__pyx_n_s_intercept,&__pyx_n_s_label,&__pyx_n_s_probA,&__pyx_n_s_probB,&__pyx_n_s_svm_type,&__pyx_n_s_kernel,&__pyx_n_s_degree,&__pyx_n_s_gamma,&__pyx_n_s_coef0,&__pyx_n_s_class_weight,&__pyx_n_s_sample_weight,&__pyx_n_s_cache_size,0}; - PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - values[7] = (PyObject *)__pyx_k__20; - values[8] = (PyObject *)__pyx_k__21; - values[10] = ((PyObject *)__pyx_n_s_rbf); - values[14] = (PyObject *)__pyx_k__22; - values[15] = (PyObject *)__pyx_k__23; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_X,&__pyx_n_s_support,&__pyx_n_s_SV,&__pyx_n_s_nSV,&__pyx_n_s_sv_coef,&__pyx_n_s_intercept,&__pyx_n_s_probA,&__pyx_n_s_probB,&__pyx_n_s_svm_type,&__pyx_n_s_kernel,&__pyx_n_s_degree,&__pyx_n_s_gamma,&__pyx_n_s_coef0,&__pyx_n_s_class_weight,&__pyx_n_s_sample_weight,&__pyx_n_s_cache_size,0}; + PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + values[6] = (PyObject *)__pyx_k__20; + values[7] = (PyObject *)__pyx_k__21; + values[9] = ((PyObject *)__pyx_n_s_rbf); + values[13] = (PyObject *)__pyx_k__22; + values[14] = (PyObject *)__pyx_k__23; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); @@ -4928,90 +4814,84 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_7decision_function(PyObject *__p case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_support)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("decision_function", 0, 6, 16, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_SV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("decision_function", 0, 6, 16, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("decision_function", 0, 6, 16, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sv_coef)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("decision_function", 0, 6, 16, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_intercept)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("decision_function", 0, 6, 16, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (kw_args > 0) { + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA); + if (value) { values[6] = value; kw_args--; } } case 7: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB); if (value) { values[7] = value; kw_args--; } } case 8: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_svm_type); if (value) { values[8] = value; kw_args--; } } case 9: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_svm_type); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel); if (value) { values[9] = value; kw_args--; } } case 10: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree); if (value) { values[10] = value; kw_args--; } } case 11: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_degree); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gamma); if (value) { values[11] = value; kw_args--; } } case 12: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gamma); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coef0); if (value) { values[12] = value; kw_args--; } } case 13: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_coef0); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_weight); if (value) { values[13] = value; kw_args--; } } case 14: if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_class_weight); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_weight); if (value) { values[14] = value; kw_args--; } } case 15: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sample_weight); - if (value) { values[15] = value; kw_args--; } - } - case 16: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cache_size); - if (value) { values[16] = value; kw_args--; } + if (value) { values[15] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decision_function") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decision_function") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { - case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16); case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15); case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14); case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13); @@ -5022,7 +4902,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_7decision_function(PyObject *__p case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -5038,58 +4918,56 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_7decision_function(PyObject *__p __pyx_v_nSV = ((PyArrayObject *)values[3]); __pyx_v_sv_coef = ((PyArrayObject *)values[4]); __pyx_v_intercept = ((PyArrayObject *)values[5]); - __pyx_v_label = ((PyArrayObject *)values[6]); - __pyx_v_probA = ((PyArrayObject *)values[7]); - __pyx_v_probB = ((PyArrayObject *)values[8]); - if (values[9]) { - __pyx_v_svm_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probA = ((PyArrayObject *)values[6]); + __pyx_v_probB = ((PyArrayObject *)values[7]); + if (values[8]) { + __pyx_v_svm_type = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_svm_type = ((int)0); } - __pyx_v_kernel = values[10]; - if (values[11]) { - __pyx_v_degree = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel = values[9]; + if (values[10]) { + __pyx_v_degree = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_degree = ((int)3); } - if (values[12]) { - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[11]) { + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_gamma = ((double)0.1); } - if (values[13]) { - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (values[12]) { + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_coef0 = ((double)0.); } - __pyx_v_class_weight = ((PyArrayObject *)values[14]); - __pyx_v_sample_weight = ((PyArrayObject *)values[15]); - if (values[16]) { - __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_class_weight = ((PyArrayObject *)values[13]); + __pyx_v_sample_weight = ((PyArrayObject *)values[14]); + if (values[15]) { + __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_cache_size = ((double)100.); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("decision_function", 0, 7, 17, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("decision_function", 0, 6, 16, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm.decision_function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_support), __pyx_ptype_5numpy_ndarray, 1, "support", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __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 = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_6decision_function(__pyx_self, __pyx_v_X, __pyx_v_support, __pyx_v_SV, __pyx_v_nSV, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_label, __pyx_v_probA, __pyx_v_probB, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_cache_size); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_support), __pyx_ptype_5numpy_ndarray, 1, "support", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV), __pyx_ptype_5numpy_ndarray, 1, "SV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __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 = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_6decision_function(__pyx_self, __pyx_v_X, __pyx_v_support, __pyx_v_SV, __pyx_v_nSV, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_probA, __pyx_v_probB, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_cache_size); /* function exit code */ goto __pyx_L0; @@ -5100,7 +4978,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_7decision_function(PyObject *__p return __pyx_r; } -static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size) { +static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_X, PyArrayObject *__pyx_v_support, PyArrayObject *__pyx_v_SV, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB, int __pyx_v_svm_type, PyObject *__pyx_v_kernel, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, PyArrayObject *__pyx_v_class_weight, CYTHON_UNUSED PyArrayObject *__pyx_v_sample_weight, double __pyx_v_cache_size) { PyArrayObject *__pyx_v_dec_values = 0; struct svm_parameter __pyx_v_param; struct svm_model *__pyx_v_model; @@ -5119,8 +4997,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __Pyx_Buffer __pyx_pybuffer_dec_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_intercept; __Pyx_Buffer __pyx_pybuffer_intercept; - __Pyx_LocalBuf_ND __pyx_pybuffernd_label; - __Pyx_Buffer __pyx_pybuffer_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_nSV; __Pyx_Buffer __pyx_pybuffer_nSV; __Pyx_LocalBuf_ND __pyx_pybuffernd_probA; @@ -5188,10 +5064,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_pybuffer_intercept.refcount = 0; __pyx_pybuffernd_intercept.data = NULL; __pyx_pybuffernd_intercept.rcbuffer = &__pyx_pybuffer_intercept; - __pyx_pybuffer_label.pybuffer.buf = NULL; - __pyx_pybuffer_label.refcount = 0; - __pyx_pybuffernd_label.data = NULL; - __pyx_pybuffernd_label.rcbuffer = &__pyx_pybuffer_label; __pyx_pybuffer_probA.pybuffer.buf = NULL; __pyx_pybuffer_probA.refcount = 0; __pyx_pybuffernd_probA.data = NULL; @@ -5210,100 +5082,95 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_pybuffernd_sample_weight.rcbuffer = &__pyx_pybuffer_sample_weight; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __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_support.rcbuffer->pybuffer, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_support.rcbuffer->pybuffer, (PyObject*)__pyx_v_support, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_support.diminfo[0].strides = __pyx_pybuffernd_support.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support.diminfo[0].shape = __pyx_pybuffernd_support.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV.diminfo[0].strides = __pyx_pybuffernd_SV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV.diminfo[0].shape = __pyx_pybuffernd_SV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_SV.diminfo[1].strides = __pyx_pybuffernd_SV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_SV.diminfo[1].shape = __pyx_pybuffernd_SV.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_nSV.diminfo[0].strides = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nSV.diminfo[0].shape = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sv_coef.diminfo[0].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv_coef.diminfo[0].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_sv_coef.diminfo[1].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_sv_coef.diminfo[1].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_intercept.diminfo[0].strides = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intercept.diminfo[0].shape = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_pybuffernd_label.diminfo[0].strides = __pyx_pybuffernd_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_label.diminfo[0].shape = __pyx_pybuffernd_label.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm.pyx":440 + /* "sklearn/svm/libsvm.pyx":430 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * * cdef int rv */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __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 = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __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_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __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 = 430; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __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 = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __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_1, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __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 = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __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 = 440; __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 = 430; __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_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -5311,26 +5178,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":444 + /* "sklearn/svm/libsvm.pyx":434 * cdef int rv * * set_predict_params(¶m, svm_type, kernel, degree, gamma, coef0, # <<<<<<<<<<<<<< * cache_size, 0, class_weight.shape[0], * class_weight_label.data, class_weight.data) */ - __pyx_f_7sklearn_3svm_6libsvm_set_predict_params((&__pyx_v_param), __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_cache_size, 0, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_f_7sklearn_3svm_6libsvm_set_predict_params((&__pyx_v_param), __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_cache_size, 0, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":448 + /* "sklearn/svm/libsvm.pyx":438 * class_weight_label.data, class_weight.data) * * model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, # <<<<<<<<<<<<<< * support.data, support.shape, sv_coef.strides, * sv_coef.data, intercept.data, nSV.data, */ - __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); + __pyx_v_model = set_model((&__pyx_v_param), ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV->data, __pyx_v_SV->dimensions, __pyx_v_support->data, __pyx_v_support->dimensions, __pyx_v_sv_coef->strides, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "sklearn/svm/libsvm.pyx":453 - * label.data, probA.data, probB.data) + /* "sklearn/svm/libsvm.pyx":443 + * probA.data, probB.data) * * if svm_type > 1: # <<<<<<<<<<<<<< * n_class = 1 @@ -5339,7 +5206,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_t_7 = ((__pyx_v_svm_type > 1) != 0); if (__pyx_t_7) { - /* "sklearn/svm/libsvm.pyx":454 + /* "sklearn/svm/libsvm.pyx":444 * * if svm_type > 1: * n_class = 1 # <<<<<<<<<<<<<< @@ -5351,7 +5218,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED } /*else*/ { - /* "sklearn/svm/libsvm.pyx":456 + /* "sklearn/svm/libsvm.pyx":446 * n_class = 1 * else: * n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -5360,7 +5227,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "sklearn/svm/libsvm.pyx":457 + /* "sklearn/svm/libsvm.pyx":447 * else: * n_class = get_nr(model) * n_class = n_class * (n_class - 1) / 2 # <<<<<<<<<<<<<< @@ -5371,7 +5238,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED } __pyx_L3:; - /* "sklearn/svm/libsvm.pyx":459 + /* "sklearn/svm/libsvm.pyx":449 * n_class = n_class * (n_class - 1) / 2 * * try: # <<<<<<<<<<<<<< @@ -5380,23 +5247,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED */ /*try:*/ { - /* "sklearn/svm/libsvm.pyx":460 + /* "sklearn/svm/libsvm.pyx":450 * * try: * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) # <<<<<<<<<<<<<< * with nogil: * rv = copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -5404,26 +5271,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __Pyx_GIVEREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -5439,13 +5306,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED } } __pyx_pybuffernd_dec_values.diminfo[0].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dec_values.diminfo[0].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dec_values.diminfo[1].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dec_values.diminfo[1].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L5_error;} } __pyx_t_8 = 0; __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm.pyx":461 + /* "sklearn/svm/libsvm.pyx":451 * try: * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -5459,7 +5326,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED #endif /*try:*/ { - /* "sklearn/svm/libsvm.pyx":462 + /* "sklearn/svm/libsvm.pyx":452 * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * with nogil: * rv = copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) # <<<<<<<<<<<<<< @@ -5469,7 +5336,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_v_rv = copy_predict_values(__pyx_v_X->data, __pyx_v_model, __pyx_v_X->dimensions, __pyx_v_dec_values->data, __pyx_v_n_class); } - /* "sklearn/svm/libsvm.pyx":461 + /* "sklearn/svm/libsvm.pyx":451 * try: * dec_values = np.empty((X.shape[0], n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -5487,7 +5354,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED } } - /* "sklearn/svm/libsvm.pyx":463 + /* "sklearn/svm/libsvm.pyx":453 * with nogil: * rv = copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) * if rv < 0: # <<<<<<<<<<<<<< @@ -5497,22 +5364,22 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_t_7 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_7) { - /* "sklearn/svm/libsvm.pyx":464 + /* "sklearn/svm/libsvm.pyx":454 * rv = copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * finally: * free_model(model) */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L5_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[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L5_error;} } } - /* "sklearn/svm/libsvm.pyx":466 + /* "sklearn/svm/libsvm.pyx":456 * raise MemoryError("We've run out of memory") * finally: * free_model(model) # <<<<<<<<<<<<<< @@ -5561,7 +5428,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_L6:; } - /* "sklearn/svm/libsvm.pyx":468 + /* "sklearn/svm/libsvm.pyx":458 * free_model(model) * * return dec_values # <<<<<<<<<<<<<< @@ -5573,7 +5440,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __pyx_r = ((PyObject *)__pyx_v_dec_values); goto __pyx_L0; - /* "sklearn/svm/libsvm.pyx":411 + /* "sklearn/svm/libsvm.pyx":402 * * * def decision_function( # <<<<<<<<<<<<<< @@ -5596,7 +5463,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -5614,7 +5480,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -5629,7 +5494,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_6decision_function(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/svm/libsvm.pyx":471 +/* "sklearn/svm/libsvm.pyx":461 * * * def cross_validation( # <<<<<<<<<<<<<< @@ -5708,12 +5573,12 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_9cross_validation(PyObject *__py case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 19, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 19, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_fold)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 19, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 19, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -5797,7 +5662,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_9cross_validation(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cross_validation") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cross_validation") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5826,85 +5691,85 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_9cross_validation(PyObject *__py } __pyx_v_X = ((PyArrayObject *)values[0]); __pyx_v_Y = ((PyArrayObject *)values[1]); - __pyx_v_n_fold = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n_fold == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_fold = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_n_fold == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_svm_type = values[3]; __pyx_v_kernel = ((PyObject*)values[4]); if (values[5]) { - __pyx_v_degree = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_degree = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_degree = ((int)3); } if (values[6]) { - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_gamma = ((double)0.1); } if (values[7]) { - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_coef0 = ((double)0.); } if (values[8]) { - __pyx_v_tol = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_tol == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_tol = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_tol == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_tol = ((double)1e-3); } if (values[9]) { - __pyx_v_C = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_C = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_C = ((double)1.); } if (values[10]) { - __pyx_v_nu = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_nu = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_nu = ((double)0.5); } if (values[11]) { - __pyx_v_epsilon = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_epsilon == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_epsilon = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_epsilon == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_epsilon = ((double)0.1); } __pyx_v_class_weight = ((PyArrayObject *)values[12]); __pyx_v_sample_weight = ((PyArrayObject *)values[13]); if (values[14]) { - __pyx_v_shrinking = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_shrinking = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_shrinking = ((int)0); } if (values[15]) { - __pyx_v_probability = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probability = __Pyx_PyInt_As_int(values[15]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_probability = ((int)0); } if (values[16]) { - __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_cache_size = ((double)100.); } if (values[17]) { - __pyx_v_max_iter = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_max_iter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_iter = __Pyx_PyInt_As_int(values[17]); if (unlikely((__pyx_v_max_iter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_max_iter = ((int)-1); } if (values[18]) { - __pyx_v_random_seed = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_random_seed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_random_seed = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_random_seed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else { __pyx_v_random_seed = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 19, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("cross_validation", 0, 3, 19, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm.cross_validation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_5numpy_ndarray, 1, "X", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __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 = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __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 = 479; __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 = 462; __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 = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel), (&PyString_Type), 1, "kernel", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __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 = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(__pyx_self, __pyx_v_X, __pyx_v_Y, __pyx_v_n_fold, __pyx_v_svm_type, __pyx_v_kernel, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_tol, __pyx_v_C, __pyx_v_nu, __pyx_v_epsilon, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_cache_size, __pyx_v_max_iter, __pyx_v_random_seed); /* function exit code */ @@ -5987,70 +5852,70 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_pybuffernd_sample_weight.rcbuffer = &__pyx_pybuffer_sample_weight; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_X.rcbuffer->pybuffer, (PyObject*)__pyx_v_X, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __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_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm.pyx":540 + /* "sklearn/svm/libsvm.pyx":530 * cdef np.npy_intp nr * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: */ - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":541 + /* "sklearn/svm/libsvm.pyx":531 * * if len(sample_weight) == 0: * sample_weight = np.ones(X.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< * else: * assert sample_weight.shape[0] == X.shape[0], \ */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __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 = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __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_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __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 = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6066,7 +5931,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED } } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_sample_weight, ((PyArrayObject *)__pyx_t_7)); @@ -6075,7 +5940,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED } /*else*/ { - /* "sklearn/svm/libsvm.pyx":543 + /* "sklearn/svm/libsvm.pyx":533 * sample_weight = np.ones(X.shape[0], dtype=np.float64) * else: * assert sample_weight.shape[0] == X.shape[0], \ # <<<<<<<<<<<<<< @@ -6086,18 +5951,18 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_sample_weight->dimensions[0]) == (__pyx_v_X->dimensions[0])) != 0))) { - /* "sklearn/svm/libsvm.pyx":546 + /* "sklearn/svm/libsvm.pyx":536 * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], X.shape[0]) # <<<<<<<<<<<<<< * * if X.shape[0] < n_fold: */ - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); @@ -6106,37 +5971,37 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_t_7 = 0; __pyx_t_3 = 0; - /* "sklearn/svm/libsvm.pyx":545 + /* "sklearn/svm/libsvm.pyx":535 * assert sample_weight.shape[0] == X.shape[0], \ * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ # <<<<<<<<<<<<<< * (sample_weight.shape[0], X.shape[0]) * */ - __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_sample_weight_has_s_samples_whil, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_sample_weight_has_s_samples_whil, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm.pyx":544 + /* "sklearn/svm/libsvm.pyx":534 * else: * assert sample_weight.shape[0] == X.shape[0], \ * "sample_weight and X have incompatible shapes: " + \ # <<<<<<<<<<<<<< * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], X.shape[0]) */ - __pyx_t_5 = PyNumber_Add(__pyx_kp_s_sample_weight_and_X_have_incompa, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(__pyx_kp_s_sample_weight_and_X_have_incompa, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyErr_SetObject(PyExc_AssertionError, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } } #endif } __pyx_L3:; - /* "sklearn/svm/libsvm.pyx":548 + /* "sklearn/svm/libsvm.pyx":538 * (sample_weight.shape[0], X.shape[0]) * * if X.shape[0] < n_fold: # <<<<<<<<<<<<<< @@ -6146,54 +6011,54 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_t_2 = (((__pyx_v_X->dimensions[0]) < __pyx_v_n_fold) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":549 + /* "sklearn/svm/libsvm.pyx":539 * * if X.shape[0] < n_fold: * raise ValueError("Number of samples is less than number of folds") # <<<<<<<<<<<<<< * * # set problem */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm.pyx":552 + /* "sklearn/svm/libsvm.pyx":542 * * # set problem * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) # <<<<<<<<<<<<<< * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_LIBSVM_KERNEL_TYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __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 = 552; __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 = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_kernel); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_kernel); __Pyx_GIVEREF(__pyx_v_kernel); - __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_kernel_index = __pyx_t_7; __pyx_t_7 = 0; - /* "sklearn/svm/libsvm.pyx":554 + /* "sklearn/svm/libsvm.pyx":544 * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) # <<<<<<<<<<<<<< * if problem.x == NULL: * raise MemoryError("Seems we've run out of memory") */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":553 + /* "sklearn/svm/libsvm.pyx":543 * # set problem * kernel_index = LIBSVM_KERNEL_TYPES.index(kernel) * set_problem( # <<<<<<<<<<<<<< @@ -6202,7 +6067,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED */ set_problem((&__pyx_v_problem), __pyx_v_X->data, __pyx_v_Y->data, __pyx_v_sample_weight->data, __pyx_v_X->dimensions, __pyx_t_9); - /* "sklearn/svm/libsvm.pyx":555 + /* "sklearn/svm/libsvm.pyx":545 * set_problem( * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: # <<<<<<<<<<<<<< @@ -6212,60 +6077,60 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_t_2 = ((__pyx_v_problem.x == NULL) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":556 + /* "sklearn/svm/libsvm.pyx":546 * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: * raise MemoryError("Seems we've run out of memory") # <<<<<<<<<<<<<< * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) */ - __pyx_t_7 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm.pyx":558 + /* "sklearn/svm/libsvm.pyx":548 * raise MemoryError("Seems we've run out of memory") * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * * # set parameters */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __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 = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 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 = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __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 = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -6273,17 +6138,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "sklearn/svm/libsvm.pyx":562 + /* "sklearn/svm/libsvm.pyx":552 * # set parameters * set_parameter( * ¶m, svm_type, kernel_index, degree, gamma, coef0, nu, cache_size, # <<<<<<<<<<<<<< * C, tol, tol, shrinking, probability, * class_weight.shape[0], class_weight_label.data, */ - __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_svm_type); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_svm_type); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_kernel_index); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":561 + /* "sklearn/svm/libsvm.pyx":551 * * # set parameters * set_parameter( # <<<<<<<<<<<<<< @@ -6292,7 +6157,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED */ set_parameter((&__pyx_v_param), __pyx_t_9, __pyx_t_14, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_tol, __pyx_v_tol, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data, __pyx_v_max_iter, __pyx_v_random_seed); - /* "sklearn/svm/libsvm.pyx":567 + /* "sklearn/svm/libsvm.pyx":557 * class_weight.data, max_iter, random_seed) * * error_msg = svm_check_parameter(&problem, ¶m); # <<<<<<<<<<<<<< @@ -6301,7 +6166,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED */ __pyx_v_error_msg = svm_check_parameter((&__pyx_v_problem), (&__pyx_v_param)); - /* "sklearn/svm/libsvm.pyx":568 + /* "sklearn/svm/libsvm.pyx":558 * * error_msg = svm_check_parameter(&problem, ¶m); * if error_msg: # <<<<<<<<<<<<<< @@ -6311,29 +6176,29 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_t_2 = (__pyx_v_error_msg != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm.pyx":569 + /* "sklearn/svm/libsvm.pyx":559 * error_msg = svm_check_parameter(&problem, ¶m); * if error_msg: * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target */ - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm.pyx":572 + /* "sklearn/svm/libsvm.pyx":562 * * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target * try: # <<<<<<<<<<<<<< @@ -6342,40 +6207,40 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED */ /*try:*/ { - /* "sklearn/svm/libsvm.pyx":573 + /* "sklearn/svm/libsvm.pyx":563 * cdef np.ndarray[np.float64_t, ndim=1, mode='c'] target * try: * target = np.empty((X.shape[0]), dtype=np.float64) # <<<<<<<<<<<<<< * with nogil: * svm_cross_validation(&problem, ¶m, n_fold, target.data) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_6 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_X->dimensions[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} __pyx_t_15 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -6391,13 +6256,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED } } __pyx_pybuffernd_target.diminfo[0].strides = __pyx_pybuffernd_target.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_target.diminfo[0].shape = __pyx_pybuffernd_target.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L8_error;} } __pyx_t_15 = 0; __pyx_v_target = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm.pyx":574 + /* "sklearn/svm/libsvm.pyx":564 * try: * target = np.empty((X.shape[0]), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -6411,7 +6276,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED #endif /*try:*/ { - /* "sklearn/svm/libsvm.pyx":575 + /* "sklearn/svm/libsvm.pyx":565 * target = np.empty((X.shape[0]), dtype=np.float64) * with nogil: * svm_cross_validation(&problem, ¶m, n_fold, target.data) # <<<<<<<<<<<<<< @@ -6421,7 +6286,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED svm_cross_validation((&__pyx_v_problem), (&__pyx_v_param), __pyx_v_n_fold, ((double *)__pyx_v_target->data)); } - /* "sklearn/svm/libsvm.pyx":574 + /* "sklearn/svm/libsvm.pyx":564 * try: * target = np.empty((X.shape[0]), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -6440,7 +6305,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED } } - /* "sklearn/svm/libsvm.pyx":577 + /* "sklearn/svm/libsvm.pyx":567 * svm_cross_validation(&problem, ¶m, n_fold, target.data) * finally: * free(problem.x) # <<<<<<<<<<<<<< @@ -6489,7 +6354,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_L9:; } - /* "sklearn/svm/libsvm.pyx":579 + /* "sklearn/svm/libsvm.pyx":569 * free(problem.x) * * return target # <<<<<<<<<<<<<< @@ -6501,7 +6366,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED __pyx_r = ((PyObject *)__pyx_v_target); goto __pyx_L0; - /* "sklearn/svm/libsvm.pyx":471 + /* "sklearn/svm/libsvm.pyx":461 * * * def cross_validation( # <<<<<<<<<<<<<< @@ -6545,7 +6410,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_8cross_validation(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/svm/libsvm.pyx":582 +/* "sklearn/svm/libsvm.pyx":572 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -6566,7 +6431,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_6libsvm_11set_verbosity_wrap(PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_verbosity_wrap (wrapper)", 0); assert(__pyx_arg_verbosity); { - __pyx_v_verbosity = __Pyx_PyInt_As_int(__pyx_arg_verbosity); if (unlikely((__pyx_v_verbosity == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_verbosity = __Pyx_PyInt_As_int(__pyx_arg_verbosity); if (unlikely((__pyx_v_verbosity == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6586,14 +6451,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_10set_verbosity_wrap(CYTHON_UNUS __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_verbosity_wrap", 0); - /* "sklearn/svm/libsvm.pyx":586 + /* "sklearn/svm/libsvm.pyx":576 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< */ set_verbosity(__pyx_v_verbosity); - /* "sklearn/svm/libsvm.pyx":582 + /* "sklearn/svm/libsvm.pyx":572 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -6608,7 +6473,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_6libsvm_10set_verbosity_wrap(CYTHON_UNUS return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":194 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -6660,7 +6525,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":200 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -6673,7 +6538,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":203 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6682,7 +6547,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":204 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -6691,7 +6556,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":206 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -6700,7 +6565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":208 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -6710,7 +6575,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":209 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -6722,7 +6587,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":211 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -6733,7 +6598,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":213 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -6743,7 +6608,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":214 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -6757,21 +6622,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_3) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":217 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -6781,7 +6646,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":218 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -6795,21 +6660,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_2) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":221 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -6818,7 +6683,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":222 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -6827,7 +6692,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":223 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -6837,7 +6702,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":226 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -6846,7 +6711,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))); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":227 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -6855,7 +6720,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":228 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -6866,7 +6731,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":229 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -6875,7 +6740,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]); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":230 + /* "/usr/local/lib/python2.7/dist-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] # <<<<<<<<<<<<<< @@ -6888,7 +6753,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":232 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -6897,7 +6762,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)); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":233 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -6908,7 +6773,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L7:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":234 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -6917,7 +6782,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":235 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -6926,7 +6791,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":236 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -6935,7 +6800,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":239 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -6944,7 +6809,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":240 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -6956,7 +6821,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":244 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -6965,7 +6830,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":246 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -6981,7 +6846,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":248 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -6997,7 +6862,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":251 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -7012,7 +6877,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L10:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":253 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -7022,7 +6887,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":254 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -7032,7 +6897,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":255 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -7047,7 +6912,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (!__pyx_t_2) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":256 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -7067,21 +6932,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7090,7 +6955,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":258 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7101,7 +6966,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":259 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7112,7 +6977,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":260 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7123,7 +6988,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":261 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7134,7 +6999,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":262 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7145,7 +7010,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":263 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7156,7 +7021,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":264 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7167,7 +7032,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":265 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7178,7 +7043,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":266 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7189,7 +7054,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":267 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7200,7 +7065,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":268 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7211,7 +7076,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":269 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7222,7 +7087,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":270 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7233,7 +7098,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":271 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7244,7 +7109,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":272 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7255,7 +7120,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":273 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7266,7 +7131,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -7278,7 +7143,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":276 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -7295,7 +7160,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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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); @@ -7304,7 +7169,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":277 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -7313,7 +7178,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":278 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -7325,7 +7190,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":280 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -7334,7 +7199,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":281 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -7343,7 +7208,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":282 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -7352,7 +7217,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":283 + /* "/usr/local/lib/python2.7/dist-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, # <<<<<<<<<<<<<< @@ -7362,7 +7227,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[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":286 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -7372,7 +7237,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":194 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -7404,7 +7269,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":288 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -7428,7 +7293,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":289 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -7438,7 +7303,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":290 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -7450,7 +7315,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":291 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -7460,7 +7325,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":292 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -7472,7 +7337,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":288 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -7484,7 +7349,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":768 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -7501,7 +7366,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":769 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -7515,7 +7380,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":768 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -7534,7 +7399,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":771 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -7551,7 +7416,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":772 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -7565,7 +7430,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":771 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -7584,7 +7449,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":774 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7601,7 +7466,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":775 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -7615,7 +7480,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":774 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -7634,7 +7499,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":777 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7651,7 +7516,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":778 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -7665,7 +7530,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":777 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -7684,7 +7549,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":780 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -7701,7 +7566,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":781 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -7715,7 +7580,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":780 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -7734,7 +7599,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":783 +/* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -7768,7 +7633,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":790 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -7777,7 +7642,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":791 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -7786,7 +7651,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":794 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -7808,7 +7673,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":795 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -7821,7 +7686,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":796 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -7860,7 +7725,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":798 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -7877,21 +7742,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":801 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -7906,7 +7771,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":802 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -7926,21 +7791,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":813 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -7956,7 +7821,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":814 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -7965,7 +7830,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":815 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -7974,7 +7839,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":816 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -7985,7 +7850,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); } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":818 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -7995,7 +7860,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); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":820 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -8005,7 +7870,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":821 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -8017,7 +7882,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; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":822 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -8027,21 +7892,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":826 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8059,7 +7924,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":827 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8077,7 +7942,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":828 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8095,7 +7960,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":829 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8113,7 +7978,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":830 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8131,7 +7996,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":831 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8149,7 +8014,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":832 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8167,7 +8032,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":833 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8185,7 +8050,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":834 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8203,7 +8068,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":835 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8221,7 +8086,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":836 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8239,7 +8104,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":837 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8257,7 +8122,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":838 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8275,7 +8140,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":839 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -8295,7 +8160,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":840 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -8315,7 +8180,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":841 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -8335,7 +8200,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":842 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -8354,7 +8219,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":844 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -8368,7 +8233,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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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); @@ -8377,7 +8242,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L11:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":845 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -8389,7 +8254,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":849 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -8403,7 +8268,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":850 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -8413,7 +8278,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":783 + /* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -8438,7 +8303,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":966 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -8453,7 +8318,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); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":968 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -8464,7 +8329,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":969 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -8476,7 +8341,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":971 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -8485,7 +8350,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":972 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -8496,7 +8361,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":973 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -8505,7 +8370,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":974 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -8514,7 +8379,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":966 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -8526,7 +8391,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":976 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -8540,7 +8405,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":977 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -8550,7 +8415,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) { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":978 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -8564,7 +8429,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":980 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -8575,7 +8440,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -8624,7 +8489,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_SV, __pyx_k_SV, sizeof(__pyx_k_SV), 0, 0, 1, 1}, {&__pyx_n_s_SV_len, __pyx_k_SV_len, sizeof(__pyx_k_SV_len), 0, 0, 1, 1}, {&__pyx_kp_s_Seems_we_ve_run_out_of_memory, __pyx_k_Seems_we_ve_run_out_of_memory, sizeof(__pyx_k_Seems_we_ve_run_out_of_memory), 0, 0, 1, 0}, - {&__pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_k_Users_Chen_Developer_scikit_lea, sizeof(__pyx_k_Users_Chen_Developer_scikit_lea), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_s_We_ve_run_out_of_memory, __pyx_k_We_ve_run_out_of_memory, sizeof(__pyx_k_We_ve_run_out_of_memory), 0, 0, 1, 0}, {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1}, @@ -8648,13 +8512,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_fit_status, __pyx_k_fit_status, sizeof(__pyx_k_fit_status), 0, 0, 1, 1}, {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1}, + {&__pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_k_home_larsb_src_scikit_learn_skl, sizeof(__pyx_k_home_larsb_src_scikit_learn_skl), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1}, {&__pyx_n_s_intercept, __pyx_k_intercept, sizeof(__pyx_k_intercept), 0, 0, 1, 1}, {&__pyx_n_s_kernel, __pyx_k_kernel, sizeof(__pyx_k_kernel), 0, 0, 1, 1}, {&__pyx_n_s_kernel_index, __pyx_k_kernel_index, sizeof(__pyx_k_kernel_index), 0, 0, 1, 1}, - {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, {&__pyx_n_s_linear, __pyx_k_linear, sizeof(__pyx_k_linear), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_max_iter, __pyx_k_max_iter, sizeof(__pyx_k_max_iter), 0, 0, 1, 1}, @@ -8706,8 +8570,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __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 = 189; __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 = 175; __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 = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; @@ -8719,131 +8583,131 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/svm/libsvm.pyx":177 + /* "sklearn/svm/libsvm.pyx":175 * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: * raise MemoryError("Seems we've run out of memory") # <<<<<<<<<<<<<< * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Seems_we_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Seems_we_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "sklearn/svm/libsvm.pyx":218 + /* "sklearn/svm/libsvm.pyx":216 * if kernel_index == 4: * # precomputed kernel * support_vectors = np.empty((0, 0), dtype=np.float64) # <<<<<<<<<<<<<< * else: * support_vectors = np.empty((SV_len, X.shape[1]), dtype=np.float64) */ - __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_tuple__4); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_tuple__4); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "sklearn/svm/libsvm.pyx":240 + /* "sklearn/svm/libsvm.pyx":234 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "sklearn/svm/libsvm.pyx":241 + /* "sklearn/svm/libsvm.pyx":235 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * copy_probA(probA.data, model, probA.shape) * else: */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "sklearn/svm/libsvm.pyx":244 + /* "sklearn/svm/libsvm.pyx":238 * copy_probA(probA.data, model, probA.shape) * else: * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "sklearn/svm/libsvm.pyx":245 + /* "sklearn/svm/libsvm.pyx":239 * else: * probA = np.empty(0, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * * svm_free_and_destroy_model(&model) */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "sklearn/svm/libsvm.pyx":336 + /* "sklearn/svm/libsvm.pyx":328 * rv = copy_predict(X.data, model, X.shape, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * finally: * free_model(model) */ - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - /* "sklearn/svm/libsvm.pyx":404 + /* "sklearn/svm/libsvm.pyx":395 * rv = copy_predict_proba(X.data, model, X.shape, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * finally: * free_model(model) */ - __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - /* "sklearn/svm/libsvm.pyx":464 + /* "sklearn/svm/libsvm.pyx":454 * rv = copy_predict_values(X.data, model, X.shape, dec_values.data, n_class) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * finally: * free_model(model) */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - /* "sklearn/svm/libsvm.pyx":549 + /* "sklearn/svm/libsvm.pyx":539 * * if X.shape[0] < n_fold: * raise ValueError("Number of samples is less than number of folds") # <<<<<<<<<<<<<< * * # set problem */ - __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Number_of_samples_is_less_than_n); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Number_of_samples_is_less_than_n); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - /* "sklearn/svm/libsvm.pyx":556 + /* "sklearn/svm/libsvm.pyx":546 * &problem, X.data, Y.data, sample_weight.data, X.shape, kernel_index) * if problem.x == NULL: * raise MemoryError("Seems we've run out of memory") # <<<<<<<<<<<<<< * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) */ - __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Seems_we_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Seems_we_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -8854,7 +8718,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -8865,7 +8729,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -8876,7 +8740,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -8887,7 +8751,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -8898,7 +8762,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -8938,224 +8802,224 @@ static int __Pyx_InitCachedConstants(void) { * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ - __pyx_tuple__37 = PyTuple_Pack(37, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_tol, __pyx_n_s_C, __pyx_n_s_nu, __pyx_n_s_epsilon, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_shrinking, __pyx_n_s_probability, __pyx_n_s_cache_size, __pyx_n_s_max_iter, __pyx_n_s_random_seed, __pyx_n_s_param, __pyx_n_s_problem, __pyx_n_s_model, __pyx_n_s_error_msg, __pyx_n_s_SV_len, __pyx_n_s_nr, __pyx_n_s_kernel_index, __pyx_n_s_class_weight_label, __pyx_n_s_error_repl, __pyx_n_s_fit_status, __pyx_n_s_n_class, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_support, __pyx_n_s_support_vectors, __pyx_n_s_n_class_SV, __pyx_n_s_label, __pyx_n_s_probA, __pyx_n_s_probB); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__37 = PyTuple_Pack(36, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_tol, __pyx_n_s_C, __pyx_n_s_nu, __pyx_n_s_epsilon, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_shrinking, __pyx_n_s_probability, __pyx_n_s_cache_size, __pyx_n_s_max_iter, __pyx_n_s_random_seed, __pyx_n_s_param, __pyx_n_s_problem, __pyx_n_s_model, __pyx_n_s_error_msg, __pyx_n_s_SV_len, __pyx_n_s_nr, __pyx_n_s_kernel_index, __pyx_n_s_class_weight_label, __pyx_n_s_error_repl, __pyx_n_s_fit_status, __pyx_n_s_n_class, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_support, __pyx_n_s_support_vectors, __pyx_n_s_n_class_SV, __pyx_n_s_probA, __pyx_n_s_probB); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(18, 0, 37, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_n_s_fit, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(18, 0, 36, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_fit, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":283 + /* "sklearn/svm/libsvm.pyx":276 + * np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, kernel='rbf', int degree=3, */ - __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); - /* "sklearn/svm/libsvm.pyx":284 - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + /* "sklearn/svm/libsvm.pyx":277 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., */ - __pyx_tuple__40 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__40 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); - /* "sklearn/svm/libsvm.pyx":288 + /* "sklearn/svm/libsvm.pyx":281 * double gamma=0.1, double coef0=0., * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_tuple__41 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__41 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); - /* "sklearn/svm/libsvm.pyx":290 + /* "sklearn/svm/libsvm.pyx":283 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * double cache_size=100.): * """ */ - __pyx_tuple__42 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__42 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); - /* "sklearn/svm/libsvm.pyx":276 + /* "sklearn/svm/libsvm.pyx":270 * * * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< * np.ndarray[np.int32_t, ndim=1, mode='c'] support, * np.ndarray[np.float64_t, ndim=2, mode='c'] SV, */ - __pyx_tuple__43 = PyTuple_Pack(22, __pyx_n_s_X, __pyx_n_s_support, __pyx_n_s_SV, __pyx_n_s_nSV, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_label, __pyx_n_s_probA, __pyx_n_s_probB, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_cache_size, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_rv, __pyx_n_s_class_weight_label); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__43 = PyTuple_Pack(21, __pyx_n_s_X, __pyx_n_s_support, __pyx_n_s_SV, __pyx_n_s_nSV, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_probA, __pyx_n_s_probB, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_cache_size, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_rv, __pyx_n_s_class_weight_label); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(17, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_n_s_predict, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(16, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_predict, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":351 + /* "sklearn/svm/libsvm.pyx":342 + * np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, */ - __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); - /* "sklearn/svm/libsvm.pyx":352 - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + /* "sklearn/svm/libsvm.pyx":343 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., */ - __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__46 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); - /* "sklearn/svm/libsvm.pyx":356 + /* "sklearn/svm/libsvm.pyx":347 * double gamma=0.1, double coef0=0., * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); - /* "sklearn/svm/libsvm.pyx":358 + /* "sklearn/svm/libsvm.pyx":349 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * double cache_size=100.): * """ */ - __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); - /* "sklearn/svm/libsvm.pyx":343 + /* "sklearn/svm/libsvm.pyx":335 * * * def predict_proba( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ - __pyx_tuple__49 = PyTuple_Pack(23, __pyx_n_s_X, __pyx_n_s_support, __pyx_n_s_SV, __pyx_n_s_nSV, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_label, __pyx_n_s_probA, __pyx_n_s_probB, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_cache_size, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_class_weight_label, __pyx_n_s_rv, __pyx_n_s_n_class); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__49 = PyTuple_Pack(22, __pyx_n_s_X, __pyx_n_s_support, __pyx_n_s_SV, __pyx_n_s_nSV, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_probA, __pyx_n_s_probB, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_cache_size, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_class_weight_label, __pyx_n_s_rv, __pyx_n_s_n_class); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(17, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_n_s_predict_proba, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(16, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_predict_proba, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":419 + /* "sklearn/svm/libsvm.pyx":409 + * np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, kernel='rbf', int degree=3, */ - __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__51 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); - /* "sklearn/svm/libsvm.pyx":420 - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + /* "sklearn/svm/libsvm.pyx":410 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., */ - __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__52 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); - /* "sklearn/svm/libsvm.pyx":424 + /* "sklearn/svm/libsvm.pyx":414 * double gamma=0.1, double coef0=0., * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); - /* "sklearn/svm/libsvm.pyx":426 + /* "sklearn/svm/libsvm.pyx":416 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * double cache_size=100.): * """ */ - __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__54 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); - /* "sklearn/svm/libsvm.pyx":411 + /* "sklearn/svm/libsvm.pyx":402 * * * def decision_function( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ - __pyx_tuple__55 = PyTuple_Pack(23, __pyx_n_s_X, __pyx_n_s_support, __pyx_n_s_SV, __pyx_n_s_nSV, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_label, __pyx_n_s_probA, __pyx_n_s_probB, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_cache_size, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_n_class, __pyx_n_s_class_weight_label, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__55 = PyTuple_Pack(22, __pyx_n_s_X, __pyx_n_s_support, __pyx_n_s_SV, __pyx_n_s_nSV, __pyx_n_s_sv_coef, __pyx_n_s_intercept, __pyx_n_s_probA, __pyx_n_s_probB, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_cache_size, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_n_class, __pyx_n_s_class_weight_label, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(17, 0, 23, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_n_s_decision_function, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(16, 0, 22, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_decision_function, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":478 + /* "sklearn/svm/libsvm.pyx":468 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_tuple__57 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__57 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); - /* "sklearn/svm/libsvm.pyx":480 + /* "sklearn/svm/libsvm.pyx":470 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * int shrinking=0, int probability=0, double cache_size=100., * int max_iter=-1, */ - __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__58 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); - /* "sklearn/svm/libsvm.pyx":471 + /* "sklearn/svm/libsvm.pyx":461 * * * def cross_validation( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ - __pyx_tuple__59 = PyTuple_Pack(28, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_n_fold, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_tol, __pyx_n_s_C, __pyx_n_s_nu, __pyx_n_s_epsilon, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_shrinking, __pyx_n_s_probability, __pyx_n_s_cache_size, __pyx_n_s_max_iter, __pyx_n_s_random_seed, __pyx_n_s_param, __pyx_n_s_problem, __pyx_n_s_model, __pyx_n_s_error_msg, __pyx_n_s_SV_len, __pyx_n_s_nr, __pyx_n_s_kernel_index, __pyx_n_s_class_weight_label, __pyx_n_s_target); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__59 = PyTuple_Pack(28, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_n_fold, __pyx_n_s_svm_type, __pyx_n_s_kernel, __pyx_n_s_degree, __pyx_n_s_gamma, __pyx_n_s_coef0, __pyx_n_s_tol, __pyx_n_s_C, __pyx_n_s_nu, __pyx_n_s_epsilon, __pyx_n_s_class_weight, __pyx_n_s_sample_weight, __pyx_n_s_shrinking, __pyx_n_s_probability, __pyx_n_s_cache_size, __pyx_n_s_max_iter, __pyx_n_s_random_seed, __pyx_n_s_param, __pyx_n_s_problem, __pyx_n_s_model, __pyx_n_s_error_msg, __pyx_n_s_SV_len, __pyx_n_s_nr, __pyx_n_s_kernel_index, __pyx_n_s_class_weight_label, __pyx_n_s_target); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(19, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_n_s_cross_validation, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(19, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_cross_validation, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm.pyx":582 + /* "sklearn/svm/libsvm.pyx":572 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< * """ * Control verbosity of libsvm library */ - __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_verbosity, __pyx_n_s_verbosity); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_verbosity, __pyx_n_s_verbosity); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_Chen_Developer_scikit_lea, __pyx_n_s_set_verbosity_wrap, 582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_larsb_src_scikit_learn_skl, __pyx_n_s_set_verbosity_wrap, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -9344,7 +9208,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9364,7 +9228,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9384,344 +9248,344 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_fit, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":283 + /* "sklearn/svm/libsvm.pyx":276 + * np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, kernel='rbf', int degree=3, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __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 = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __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 = 283; __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 = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__10 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":284 - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + /* "sklearn/svm/libsvm.pyx":277 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __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 = 284; __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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__11 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":288 + /* "sklearn/svm/libsvm.pyx":281 * double gamma=0.1, double coef0=0., * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __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 = 288; __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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__12 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":290 + /* "sklearn/svm/libsvm.pyx":283 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * double cache_size=100.): * """ */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __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 = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __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 = 290; __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 = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__13 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":276 + /* "sklearn/svm/libsvm.pyx":270 * * * def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, # <<<<<<<<<<<<<< * np.ndarray[np.int32_t, ndim=1, mode='c'] support, * np.ndarray[np.float64_t, ndim=2, mode='c'] SV, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_3predict, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_3predict, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":351 + /* "sklearn/svm/libsvm.pyx":342 + * np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, str kernel='rbf', int degree=3, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __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 = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __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 = 351; __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 = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__15 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":352 - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + /* "sklearn/svm/libsvm.pyx":343 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, str kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __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 = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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 = 352; __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 = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__16 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":356 + /* "sklearn/svm/libsvm.pyx":347 * double gamma=0.1, double coef0=0., * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __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 = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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 = 356; __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 = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__17 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":358 + /* "sklearn/svm/libsvm.pyx":349 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * double cache_size=100.): * """ */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __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 = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __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 = 358; __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 = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__18 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":343 + /* "sklearn/svm/libsvm.pyx":335 * * * def predict_proba( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_5predict_proba, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_5predict_proba, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict_proba, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_predict_proba, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":419 + /* "sklearn/svm/libsvm.pyx":409 + * np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), * int svm_type=0, kernel='rbf', int degree=3, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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 = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __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 = 419; __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 = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__20 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":420 - * np.ndarray[np.int32_t, ndim=1, mode='c'] label, + /* "sklearn/svm/libsvm.pyx":410 + * np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, * np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), # <<<<<<<<<<<<<< * int svm_type=0, kernel='rbf', int degree=3, * double gamma=0.1, double coef0=0., */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __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 = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __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 = 420; __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 = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__21 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":424 + /* "sklearn/svm/libsvm.pyx":414 * double gamma=0.1, double coef0=0., * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __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 = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __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 = 424; __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 = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__22 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":426 + /* "sklearn/svm/libsvm.pyx":416 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * double cache_size=100.): * """ */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __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 = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __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 = 426; __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 = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__23 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":411 + /* "sklearn/svm/libsvm.pyx":402 * * * def decision_function( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.int32_t, ndim=1, mode='c'] support, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_7decision_function, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_7decision_function, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_decision_function, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_decision_function, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":478 + /* "sklearn/svm/libsvm.pyx":468 * double C=1., double nu=0.5, double epsilon=0.1, * np.ndarray[np.float64_t, ndim=1, mode='c'] * class_weight=np.empty(0), # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __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 = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __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 = 478; __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 = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__25 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":480 + /* "sklearn/svm/libsvm.pyx":470 * class_weight=np.empty(0), * np.ndarray[np.float64_t, ndim=1, mode='c'] * sample_weight=np.empty(0), # <<<<<<<<<<<<<< * int shrinking=0, int probability=0, double cache_size=100., * int max_iter=-1, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __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 = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __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 = 480; __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 = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_k__26 = ((PyArrayObject *)__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":471 + /* "sklearn/svm/libsvm.pyx":461 * * * def cross_validation( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=2, mode='c'] X, * np.ndarray[np.float64_t, ndim=1, mode='c'] Y, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_9cross_validation, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_9cross_validation, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cross_validation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cross_validation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm.pyx":582 + /* "sklearn/svm/libsvm.pyx":572 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< * """ * Control verbosity of libsvm library */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_11set_verbosity_wrap, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_6libsvm_11set_verbosity_wrap, NULL, __pyx_n_s_sklearn_svm_libsvm); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_verbosity_wrap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_verbosity_wrap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/svm/libsvm.pyx":1 @@ -9734,7 +9598,7 @@ PyMODINIT_FUNC PyInit_libsvm(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Cython-0.20-py3.3-macosx-10.9-x86_64.egg/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -10295,8 +10159,10 @@ __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; while (*ts && *ts != ')') { - if (isspace(*ts)) - continue; + switch (*ts) { + case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; + default: break; /* not a 'break' in the loop */ + } number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return NULL; if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) @@ -10515,6 +10381,29 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { return result; } +#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 CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); @@ -11909,11 +11798,13 @@ 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/svm/libsvm.pxd b/sklearn/svm/libsvm.pxd index 368f5decf8de0..2664a335a372f 100644 --- a/sklearn/svm/libsvm.pxd +++ b/sklearn/svm/libsvm.pxd @@ -50,7 +50,7 @@ cdef extern from "libsvm_helper.c": svm_model *set_model (svm_parameter *, int, char *, np.npy_intp *, char *, np.npy_intp *, np.npy_intp *, char *, - char *, char *, char *, char *, char *) + char *, char *, char *, char *) void copy_sv_coef (char *, svm_model *) void copy_intercept (char *, svm_model *, np.npy_intp *) @@ -60,7 +60,6 @@ cdef extern from "libsvm_helper.c": int copy_predict_proba (char *, svm_model *, np.npy_intp *, char *) nogil int copy_predict_values(char *, svm_model *, np.npy_intp *, char *, int) nogil void copy_nSV (char *, svm_model *) - void copy_label (char *, svm_model *) void copy_probA (char *, svm_model *, np.npy_intp *) void copy_probB (char *, svm_model *, np.npy_intp *) np.npy_intp get_l (svm_model *) diff --git a/sklearn/svm/libsvm.pyx b/sklearn/svm/libsvm.pyx index 129987598bcad..589cf1e8ac150 100644 --- a/sklearn/svm/libsvm.pyx +++ b/sklearn/svm/libsvm.pyx @@ -148,8 +148,6 @@ def fit( intercept : array intercept in decision function - label : labels for different classes (only relevant in classification). - probA, probB : array probability estimates, empty array for probability=False """ @@ -225,10 +223,6 @@ def fit( n_class_SV = np.empty(n_class, dtype=np.int32) copy_nSV(n_class_SV.data, model) - cdef np.ndarray[np.int32_t, ndim=1, mode='c'] label - label = np.empty((n_class), dtype=np.int32) - copy_label(label.data, model) - cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probA cdef np.ndarray[np.float64_t, ndim=1, mode='c'] probB if probability != 0: @@ -247,7 +241,7 @@ def fit( svm_free_and_destroy_model(&model) free(problem.x) - return (support, support_vectors, n_class_SV, sv_coef, intercept, label, + return (support, support_vectors, n_class_SV, sv_coef, intercept, probA, probB, fit_status) @@ -279,7 +273,6 @@ def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, np.ndarray[np.int32_t, ndim=1, mode='c'] nSV, np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - np.ndarray[np.int32_t, ndim=1, mode='c'] label, np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), int svm_type=0, kernel='rbf', int degree=3, @@ -324,8 +317,7 @@ def predict(np.ndarray[np.float64_t, ndim=2, mode='c'] X, class_weight_label.data, class_weight.data) model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, support.data, support.shape, sv_coef.strides, - sv_coef.data, intercept.data, nSV.data, - label.data, probA.data, probB.data) + sv_coef.data, intercept.data, nSV.data, probA.data, probB.data) #TODO: use check_model try: @@ -347,7 +339,6 @@ def predict_proba( np.ndarray[np.int32_t, ndim=1, mode='c'] nSV, np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - np.ndarray[np.int32_t, ndim=1, mode='c'] label, np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), int svm_type=0, str kernel='rbf', int degree=3, @@ -393,7 +384,7 @@ def predict_proba( model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, support.data, support.shape, sv_coef.strides, sv_coef.data, intercept.data, nSV.data, - label.data, probA.data, probB.data) + probA.data, probB.data) cdef np.npy_intp n_class = get_nr(model) try: @@ -415,7 +406,6 @@ def decision_function( np.ndarray[np.int32_t, ndim=1, mode='c'] nSV, np.ndarray[np.float64_t, ndim=2, mode='c'] sv_coef, np.ndarray[np.float64_t, ndim=1, mode='c'] intercept, - np.ndarray[np.int32_t, ndim=1, mode='c'] label, np.ndarray[np.float64_t, ndim=1, mode='c'] probA=np.empty(0), np.ndarray[np.float64_t, ndim=1, mode='c'] probB=np.empty(0), int svm_type=0, kernel='rbf', int degree=3, @@ -448,7 +438,7 @@ def decision_function( model = set_model(¶m, nSV.shape[0], SV.data, SV.shape, support.data, support.shape, sv_coef.strides, sv_coef.data, intercept.data, nSV.data, - label.data, probA.data, probB.data) + probA.data, probB.data) if svm_type > 1: n_class = 1 diff --git a/sklearn/svm/libsvm_sparse.c b/sklearn/svm/libsvm_sparse.c index 52a41417be9a0..6faa83f219704 100644 --- a/sklearn/svm/libsvm_sparse.c +++ b/sklearn/svm/libsvm_sparse.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.19 on Sat Jul 27 19:42:04 2013 */ +/* Generated by Cython 0.19.1 on Mon Jan 6 15:23:21 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -261,6 +261,17 @@ #define CYTHON_INLINE #endif #endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif #ifdef NAN #define __PYX_NAN() ((float) NAN) #else @@ -1131,8 +1142,8 @@ static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_n_features, PyArrayObject *__pyx_v_values, PyArrayObject *__pyx_v_indices, PyArrayObject *__pyx_v_indptr, PyArrayObject *__pyx_v_Y, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, PyArrayObject *__pyx_v_sample_weight, double __pyx_v_nu, double __pyx_v_cache_size, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, int __pyx_v_max_iter, int __pyx_v_random_seed); /* proto */ -static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB); /* proto */ -static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB); /* proto */ +static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB); /* proto */ +static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB); /* proto */ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6set_verbosity_wrap(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_verbosity); /* 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 */ @@ -1146,7 +1157,7 @@ static char __pyx_k_16[] = "Non-native byte order not supported"; static char __pyx_k_18[] = "unknown dtype code in numpy.pxd (%d)"; static char __pyx_k_19[] = "Format string allocated too short, see comment in numpy.pxd"; static char __pyx_k_22[] = "Format string allocated too short."; -static char __pyx_k_26[] = "/Users/vene/code/scikit-learn/sklearn/svm/libsvm_sparse.pyx"; +static char __pyx_k_26[] = "/home/andy/checkout/scikit-learn/sklearn/svm/libsvm_sparse.pyx"; static char __pyx_k_27[] = "sklearn.svm.libsvm_sparse"; static char __pyx_k_30[] = "libsvm_sparse_predict"; static char __pyx_k_33[] = "libsvm_sparse_predict_proba"; @@ -1181,7 +1192,6 @@ static char __pyx_k__dtype[] = "dtype"; static char __pyx_k__empty[] = "empty"; static char __pyx_k__gamma[] = "gamma"; static char __pyx_k__int32[] = "int32"; -static char __pyx_k__label[] = "label"; static char __pyx_k__model[] = "model"; static char __pyx_k__numpy[] = "numpy"; static char __pyx_k__param[] = "param"; @@ -1293,7 +1303,6 @@ static PyObject *__pyx_n_s__indptr; static PyObject *__pyx_n_s__int32; static PyObject *__pyx_n_s__intercept; static PyObject *__pyx_n_s__kernel_type; -static PyObject *__pyx_n_s__label; static PyObject *__pyx_n_s__libsvm_sparse_train; static PyObject *__pyx_n_s__max_iter; static PyObject *__pyx_n_s__model; @@ -1425,106 +1434,106 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_1libsvm_sparse_train(PyO case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__values)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__indptr)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__Y)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__svm_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kernel_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__degree)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gamma)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coef0)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eps)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 11: if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 12: if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__class_weight)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 13: if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sample_weight)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 14: if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nu)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 15: if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache_size)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 16: if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 17: if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shrinking)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 18: if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probability)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 19: if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_iter)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 20: if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__random_seed)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_train") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_train") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 21) { goto __pyx_L5_argtuple_error; @@ -1551,42 +1560,42 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_1libsvm_sparse_train(PyO values[19] = PyTuple_GET_ITEM(__pyx_args, 19); values[20] = PyTuple_GET_ITEM(__pyx_args, 20); } - __pyx_v_n_features = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_n_features == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_n_features = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_n_features == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_values = ((PyArrayObject *)values[1]); __pyx_v_indices = ((PyArrayObject *)values[2]); __pyx_v_indptr = ((PyArrayObject *)values[3]); __pyx_v_Y = ((PyArrayObject *)values[4]); - __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_degree = __Pyx_PyInt_AsInt(values[7]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_eps = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_C = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[6]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_degree = __Pyx_PyInt_AsInt(values[7]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_eps = __pyx_PyFloat_AsDouble(values[10]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_C = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_class_weight = ((PyArrayObject *)values[12]); __pyx_v_sample_weight = ((PyArrayObject *)values[13]); - __pyx_v_nu = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_p = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_p == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[17]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_probability = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_iter = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_max_iter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_random_seed = __Pyx_PyInt_AsInt(values[20]); if (unlikely((__pyx_v_random_seed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_nu = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_cache_size = __pyx_PyFloat_AsDouble(values[15]); if (unlikely((__pyx_v_cache_size == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_p = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_p == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[17]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probability = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_iter = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_max_iter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_random_seed = __Pyx_PyInt_AsInt(values[20]); if (unlikely((__pyx_v_random_seed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_train", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm_sparse.libsvm_sparse_train", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indptr), __pyx_ptype_5numpy_ndarray, 1, "indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_values), __pyx_ptype_5numpy_ndarray, 1, "values", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indices), __pyx_ptype_5numpy_ndarray, 1, "indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_indptr), __pyx_ptype_5numpy_ndarray, 1, "indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(__pyx_self, __pyx_v_n_features, __pyx_v_values, __pyx_v_indices, __pyx_v_indptr, __pyx_v_Y, __pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_eps, __pyx_v_C, __pyx_v_class_weight, __pyx_v_sample_weight, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_max_iter, __pyx_v_random_seed); goto __pyx_L0; __pyx_L1_error:; @@ -1596,7 +1605,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_1libsvm_sparse_train(PyO return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":68 +/* "sklearn/svm/libsvm_sparse.pyx":67 * * * def libsvm_sparse_train ( int n_features, # <<<<<<<<<<<<<< @@ -1622,7 +1631,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH PyArrayObject *__pyx_v_SV_indptr = 0; PyObject *__pyx_v_support_vectors_ = NULL; PyArrayObject *__pyx_v_n_class_SV = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_Y; @@ -1698,80 +1706,80 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __pyx_pybuffernd_sample_weight.rcbuffer = &__pyx_pybuffer_sample_weight; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_values.rcbuffer->pybuffer, (PyObject*)__pyx_v_values, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_values.diminfo[0].strides = __pyx_pybuffernd_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_values.diminfo[0].shape = __pyx_pybuffernd_values.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_indices.diminfo[0].strides = __pyx_pybuffernd_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indices.diminfo[0].shape = __pyx_pybuffernd_indices.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_indptr.diminfo[0].strides = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_indptr.diminfo[0].shape = __pyx_pybuffernd_indptr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Y.rcbuffer->pybuffer, (PyObject*)__pyx_v_Y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __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_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __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_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sample_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_sample_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm_sparse.pyx":108 + /* "sklearn/svm/libsvm_sparse.pyx":107 * cdef const_char_p error_msg * * if len(sample_weight) == 0: # <<<<<<<<<<<<<< * sample_weight = np.ones(Y.shape[0], dtype=np.float64) * else: */ - __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_1 == 0); + __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_v_sample_weight)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { - /* "sklearn/svm/libsvm_sparse.pyx":109 + /* "sklearn/svm/libsvm_sparse.pyx":108 * * if len(sample_weight) == 0: * sample_weight = np.ones(Y.shape[0], dtype=np.float64) # <<<<<<<<<<<<<< * else: * assert sample_weight.shape[0] == indptr.shape[0] - 1, \ */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ones); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __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_PyInt_to_py_Py_intptr_t((__pyx_v_Y->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_Y->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_7); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -1787,7 +1795,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH } } __pyx_pybuffernd_sample_weight.diminfo[0].strides = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sample_weight.diminfo[0].shape = __pyx_pybuffernd_sample_weight.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_sample_weight)); @@ -1797,7 +1805,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH } /*else*/ { - /* "sklearn/svm/libsvm_sparse.pyx":111 + /* "sklearn/svm/libsvm_sparse.pyx":110 * sample_weight = np.ones(Y.shape[0], dtype=np.float64) * else: * assert sample_weight.shape[0] == indptr.shape[0] - 1, \ # <<<<<<<<<<<<<< @@ -1805,20 +1813,20 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH * "sample_weight has %s samples while X has %s" % \ */ #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!((__pyx_v_sample_weight->dimensions[0]) == ((__pyx_v_indptr->dimensions[0]) - 1)))) { + if (unlikely(!(((__pyx_v_sample_weight->dimensions[0]) == ((__pyx_v_indptr->dimensions[0]) - 1)) != 0))) { - /* "sklearn/svm/libsvm_sparse.pyx":114 + /* "sklearn/svm/libsvm_sparse.pyx":113 * "sample_weight and X have incompatible shapes: " + \ * "sample_weight has %s samples while X has %s" % \ * (sample_weight.shape[0], indptr.shape[0] - 1) # <<<<<<<<<<<<<< * * # we should never end up here with a precomputed kernel matrix, */ - __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_sample_weight->dimensions[0])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyInt_FromLong(((__pyx_v_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(((__pyx_v_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); @@ -1826,21 +1834,21 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __Pyx_GIVEREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_5)); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #endif } __pyx_L3:; - /* "sklearn/svm/libsvm_sparse.pyx":118 + /* "sklearn/svm/libsvm_sparse.pyx":117 * # we should never end up here with a precomputed kernel matrix, * # as this is always dense. * assert(kernel_type != 4) # <<<<<<<<<<<<<< @@ -1848,13 +1856,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH * # set libsvm problem */ #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!(__pyx_v_kernel_type != 4))) { + if (unlikely(!((__pyx_v_kernel_type != 4) != 0))) { PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #endif - /* "sklearn/svm/libsvm_sparse.pyx":123 + /* "sklearn/svm/libsvm_sparse.pyx":122 * problem = csr_set_problem(values.data, indices.shape, indices.data, * indptr.shape, indptr.data, Y.data, * sample_weight.data, kernel_type) # <<<<<<<<<<<<<< @@ -1863,46 +1871,46 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_problem = csr_set_problem(__pyx_v_values->data, __pyx_v_indices->dimensions, __pyx_v_indices->data, __pyx_v_indptr->dimensions, __pyx_v_indptr->data, __pyx_v_Y->data, __pyx_v_sample_weight->data, __pyx_v_kernel_type); - /* "sklearn/svm/libsvm_sparse.pyx":126 + /* "sklearn/svm/libsvm_sparse.pyx":125 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * * # set parameters */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __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 = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__arange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __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); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __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 = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_13 = ((PyArrayObject *)__pyx_t_6); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -1910,7 +1918,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":133 + /* "sklearn/svm/libsvm_sparse.pyx":132 * probability, class_weight.shape[0], * class_weight_label.data, class_weight.data, max_iter, * random_seed) # <<<<<<<<<<<<<< @@ -1919,39 +1927,39 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, __pyx_v_cache_size, __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data, __pyx_v_max_iter, __pyx_v_random_seed); - /* "sklearn/svm/libsvm_sparse.pyx":136 + /* "sklearn/svm/libsvm_sparse.pyx":135 * * # check parameters * if (param == NULL or problem == NULL): # <<<<<<<<<<<<<< * raise MemoryError("Seems we've run out of memory") * error_msg = svm_csr_check_parameter(problem, param); */ - __pyx_t_2 = (__pyx_v_param == NULL); + __pyx_t_2 = ((__pyx_v_param == NULL) != 0); if (!__pyx_t_2) { - __pyx_t_14 = (__pyx_v_problem == NULL); + __pyx_t_14 = ((__pyx_v_problem == NULL) != 0); __pyx_t_15 = __pyx_t_14; } else { __pyx_t_15 = __pyx_t_2; } if (__pyx_t_15) { - /* "sklearn/svm/libsvm_sparse.pyx":137 + /* "sklearn/svm/libsvm_sparse.pyx":136 * # check parameters * if (param == NULL or problem == NULL): * raise MemoryError("Seems we've run out of memory") # <<<<<<<<<<<<<< * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: */ - __pyx_t_6 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; - /* "sklearn/svm/libsvm_sparse.pyx":138 + /* "sklearn/svm/libsvm_sparse.pyx":137 * if (param == NULL or problem == NULL): * raise MemoryError("Seems we've run out of memory") * error_msg = svm_csr_check_parameter(problem, param); # <<<<<<<<<<<<<< @@ -1960,7 +1968,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_error_msg = svm_csr_check_parameter(__pyx_v_problem, __pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":139 + /* "sklearn/svm/libsvm_sparse.pyx":138 * raise MemoryError("Seems we've run out of memory") * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: # <<<<<<<<<<<<<< @@ -1970,7 +1978,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __pyx_t_15 = (__pyx_v_error_msg != 0); if (__pyx_t_15) { - /* "sklearn/svm/libsvm_sparse.pyx":140 + /* "sklearn/svm/libsvm_sparse.pyx":139 * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: * free_problem(problem) # <<<<<<<<<<<<<< @@ -1979,7 +1987,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ free_problem(__pyx_v_problem); - /* "sklearn/svm/libsvm_sparse.pyx":141 + /* "sklearn/svm/libsvm_sparse.pyx":140 * if error_msg: * free_problem(problem) * free_param(param) # <<<<<<<<<<<<<< @@ -1988,31 +1996,31 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ free_param(__pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":142 + /* "sklearn/svm/libsvm_sparse.pyx":141 * free_problem(problem) * free_param(param) * raise ValueError(error_msg) # <<<<<<<<<<<<<< * * # call svm_train, this does the real work */ - __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error_msg); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __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 = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6)); __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "sklearn/svm/libsvm_sparse.pyx":145 + /* "sklearn/svm/libsvm_sparse.pyx":144 * * # call svm_train, this does the real work * cdef int fit_status = 0 # <<<<<<<<<<<<<< @@ -2021,7 +2029,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_fit_status = 0; - /* "sklearn/svm/libsvm_sparse.pyx":146 + /* "sklearn/svm/libsvm_sparse.pyx":145 * # call svm_train, this does the real work * cdef int fit_status = 0 * with nogil: # <<<<<<<<<<<<<< @@ -2035,7 +2043,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH #endif /*try:*/ { - /* "sklearn/svm/libsvm_sparse.pyx":147 + /* "sklearn/svm/libsvm_sparse.pyx":146 * cdef int fit_status = 0 * with nogil: * model = svm_csr_train(problem, param, &fit_status) # <<<<<<<<<<<<<< @@ -2045,7 +2053,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __pyx_v_model = svm_csr_train(__pyx_v_problem, __pyx_v_param, (&__pyx_v_fit_status)); } - /* "sklearn/svm/libsvm_sparse.pyx":146 + /* "sklearn/svm/libsvm_sparse.pyx":145 * # call svm_train, this does the real work * cdef int fit_status = 0 * with nogil: # <<<<<<<<<<<<<< @@ -2059,7 +2067,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH } } - /* "sklearn/svm/libsvm_sparse.pyx":149 + /* "sklearn/svm/libsvm_sparse.pyx":148 * model = svm_csr_train(problem, param, &fit_status) * * cdef np.npy_intp SV_len = get_l(model) # <<<<<<<<<<<<<< @@ -2068,7 +2076,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_SV_len = get_l(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":150 + /* "sklearn/svm/libsvm_sparse.pyx":149 * * cdef np.npy_intp SV_len = get_l(model) * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -2077,44 +2085,44 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":156 + /* "sklearn/svm/libsvm_sparse.pyx":155 * # it would not erase previous information * cdef np.ndarray sv_coef_data * sv_coef_data = np.empty((n_class-1)*SV_len, dtype=np.float64) # <<<<<<<<<<<<<< * copy_sv_coef (sv_coef_data.data, model) * */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(((__pyx_v_n_class - 1) * __pyx_v_SV_len)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(((__pyx_v_n_class - 1) * __pyx_v_SV_len)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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 = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_sv_coef_data = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":157 + /* "sklearn/svm/libsvm_sparse.pyx":156 * cdef np.ndarray sv_coef_data * sv_coef_data = np.empty((n_class-1)*SV_len, dtype=np.float64) * copy_sv_coef (sv_coef_data.data, model) # <<<<<<<<<<<<<< @@ -2123,40 +2131,40 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ copy_sv_coef(__pyx_v_sv_coef_data->data, __pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":160 + /* "sklearn/svm/libsvm_sparse.pyx":159 * * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] support * support = np.empty(SV_len, dtype=np.int32) # <<<<<<<<<<<<<< * copy_support(support.data, model) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 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 = 160; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_16 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -2172,13 +2180,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH } } __pyx_pybuffernd_support.diminfo[0].strides = __pyx_pybuffernd_support.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_support.diminfo[0].shape = __pyx_pybuffernd_support.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_16 = 0; __pyx_v_support = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":161 + /* "sklearn/svm/libsvm_sparse.pyx":160 * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] support * support = np.empty(SV_len, dtype=np.int32) * copy_support(support.data, model) # <<<<<<<<<<<<<< @@ -2187,44 +2195,44 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ copy_support(__pyx_v_support->data, __pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":166 + /* "sklearn/svm/libsvm_sparse.pyx":165 * # the intercept is just model.rho but with sign changed * cdef np.ndarray intercept * intercept = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< * copy_intercept (intercept.data, model, intercept.shape) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __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 = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__Pyx_div_long((__pyx_v_n_class * (__pyx_v_n_class - 1)), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__Pyx_div_long((__pyx_v_n_class * (__pyx_v_n_class - 1)), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 166; __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 = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_intercept = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":167 + /* "sklearn/svm/libsvm_sparse.pyx":166 * cdef np.ndarray intercept * intercept = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_intercept (intercept.data, model, intercept.shape) # <<<<<<<<<<<<<< @@ -2233,7 +2241,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ copy_intercept(__pyx_v_intercept->data, __pyx_v_model, __pyx_v_intercept->dimensions); - /* "sklearn/svm/libsvm_sparse.pyx":173 + /* "sklearn/svm/libsvm_sparse.pyx":172 * # TODO: custom kernel * cdef np.npy_intp nonzero_SV * nonzero_SV = get_nonzero_SV (model) # <<<<<<<<<<<<<< @@ -2242,118 +2250,118 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ __pyx_v_nonzero_SV = get_nonzero_SV(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":176 + /* "sklearn/svm/libsvm_sparse.pyx":175 * * cdef np.ndarray SV_data, SV_indices, SV_indptr * SV_data = np.empty(nonzero_SV, dtype=np.float64) # <<<<<<<<<<<<<< * SV_indices = np.empty(nonzero_SV, dtype=np.int32) * SV_indptr = np.empty(SV_len + 1, dtype=np.int32) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __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 = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __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); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __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 = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_SV_data = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":177 + /* "sklearn/svm/libsvm_sparse.pyx":176 * cdef np.ndarray SV_data, SV_indices, SV_indptr * SV_data = np.empty(nonzero_SV, dtype=np.float64) * SV_indices = np.empty(nonzero_SV, dtype=np.int32) # <<<<<<<<<<<<<< * SV_indptr = np.empty(SV_len + 1, dtype=np.int32) * csr_copy_SV(SV_data.data, SV_indices.shape, SV_indices.data, */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_nonzero_SV); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __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 = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_SV_indices = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":178 + /* "sklearn/svm/libsvm_sparse.pyx":177 * SV_data = np.empty(nonzero_SV, dtype=np.float64) * SV_indices = np.empty(nonzero_SV, dtype=np.int32) * SV_indptr = np.empty(SV_len + 1, dtype=np.int32) # <<<<<<<<<<<<<< * csr_copy_SV(SV_data.data, SV_indices.shape, SV_indices.data, * SV_indptr.shape, SV_indptr.data, model, n_features) */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromLong((((npy_intp)__pyx_v_SV_len) + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong((((npy_intp)__pyx_v_SV_len) + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 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 = 178; __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 = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_SV_indptr = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":180 + /* "sklearn/svm/libsvm_sparse.pyx":179 * SV_indptr = np.empty(SV_len + 1, dtype=np.int32) * csr_copy_SV(SV_data.data, SV_indices.shape, SV_indices.data, * SV_indptr.shape, SV_indptr.data, model, n_features) # <<<<<<<<<<<<<< @@ -2362,27 +2370,27 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ csr_copy_SV(__pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_model, __pyx_v_n_features); - /* "sklearn/svm/libsvm_sparse.pyx":181 + /* "sklearn/svm/libsvm_sparse.pyx":180 * csr_copy_SV(SV_data.data, SV_indices.shape, SV_indices.data, * SV_indptr.shape, SV_indptr.data, model, n_features) * support_vectors_ = sparse.csr_matrix( # <<<<<<<<<<<<<< * (SV_data, SV_indices, SV_indptr), (SV_len, n_features)) * */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__sparse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__sparse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__csr_matrix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__csr_matrix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":182 + /* "sklearn/svm/libsvm_sparse.pyx":181 * SV_indptr.shape, SV_indptr.data, model, n_features) * support_vectors_ = sparse.csr_matrix( * (SV_data, SV_indices, SV_indptr), (SV_len, n_features)) # <<<<<<<<<<<<<< * * # copy model.nSV */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __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 = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_SV_data)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_SV_data)); @@ -2393,11 +2401,11 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __Pyx_INCREF(((PyObject *)__pyx_v_SV_indptr)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_SV_indptr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_SV_indptr)); - __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_SV_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyInt_FromLong(__pyx_v_n_features); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_n_features); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); @@ -2405,7 +2413,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __Pyx_GIVEREF(__pyx_t_6); __pyx_t_7 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); @@ -2413,200 +2421,154 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_3 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_v_support_vectors_ = __pyx_t_5; __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":187 + /* "sklearn/svm/libsvm_sparse.pyx":186 * # TODO: do only in classification * cdef np.ndarray n_class_SV * n_class_SV = np.empty(n_class, dtype=np.int32) # <<<<<<<<<<<<<< * copy_nSV(n_class_SV.data, model) * */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_n_class_SV = ((PyArrayObject *)__pyx_t_7); __pyx_t_7 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":188 + /* "sklearn/svm/libsvm_sparse.pyx":187 * cdef np.ndarray n_class_SV * n_class_SV = np.empty(n_class, dtype=np.int32) * copy_nSV(n_class_SV.data, model) # <<<<<<<<<<<<<< * - * # # copy label - */ - copy_nSV(__pyx_v_n_class_SV->data, __pyx_v_model); - - /* "sklearn/svm/libsvm_sparse.pyx":192 - * # # copy label - * cdef np.ndarray label - * label = np.empty((n_class), dtype=np.int32) # <<<<<<<<<<<<<< - * copy_label(label.data, model) - * - */ - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__int32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_label = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "sklearn/svm/libsvm_sparse.pyx":193 - * cdef np.ndarray label - * label = np.empty((n_class), dtype=np.int32) - * copy_label(label.data, model) # <<<<<<<<<<<<<< - * * # # copy probabilities */ - copy_label(__pyx_v_label->data, __pyx_v_model); + copy_nSV(__pyx_v_n_class_SV->data, __pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":197 + /* "sklearn/svm/libsvm_sparse.pyx":191 * # # copy probabilities * cdef np.ndarray probA, probB * if probability != 0: # <<<<<<<<<<<<<< * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) */ - __pyx_t_15 = (__pyx_v_probability != 0); + __pyx_t_15 = ((__pyx_v_probability != 0) != 0); if (__pyx_t_15) { - /* "sklearn/svm/libsvm_sparse.pyx":198 + /* "sklearn/svm/libsvm_sparse.pyx":192 * cdef np.ndarray probA, probB * if probability != 0: * if svm_type < 2: # SVC and NuSVC # <<<<<<<<<<<<<< * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) */ - __pyx_t_15 = (__pyx_v_svm_type < 2); + __pyx_t_15 = ((__pyx_v_svm_type < 2) != 0); if (__pyx_t_15) { - /* "sklearn/svm/libsvm_sparse.pyx":199 + /* "sklearn/svm/libsvm_sparse.pyx":193 * if probability != 0: * if svm_type < 2: # SVC and NuSVC * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_probB(probB.data, model, probB.shape) */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyInt_FromLong(__Pyx_div_long((__pyx_v_n_class * (__pyx_v_n_class - 1)), 2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 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 = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 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 = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "sklearn/svm/libsvm_sparse.pyx":194 + * if svm_type < 2: # SVC and NuSVC + * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) + * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< + * copy_probB(probB.data, model, probB.shape) + * else: + */ + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromLong(__Pyx_div_long((__pyx_v_n_class * (__pyx_v_n_class - 1)), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__Pyx_div_long((__pyx_v_n_class * (__pyx_v_n_class - 1)), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __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 = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_probA = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "sklearn/svm/libsvm_sparse.pyx":200 - * if svm_type < 2: # SVC and NuSVC - * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) - * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) # <<<<<<<<<<<<<< - * copy_probB(probB.data, model, probB.shape) - * else: - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromLong(__Pyx_div_long((__pyx_v_n_class * (__pyx_v_n_class - 1)), 2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_probB = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_probB = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":201 + /* "sklearn/svm/libsvm_sparse.pyx":195 * probA = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * probB = np.empty(n_class*(n_class-1)/2, dtype=np.float64) * copy_probB(probB.data, model, probB.shape) # <<<<<<<<<<<<<< @@ -2618,67 +2580,67 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH } /*else*/ { - /* "sklearn/svm/libsvm_sparse.pyx":203 + /* "sklearn/svm/libsvm_sparse.pyx":197 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_5), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__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 = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_probA = ((PyArrayObject *)__pyx_t_7); + __pyx_t_7 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":204 + /* "sklearn/svm/libsvm_sparse.pyx":198 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * copy_probA(probA.data, model, probA.shape) * else: */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_6), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_k_tuple_6), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_probB = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L10:; - /* "sklearn/svm/libsvm_sparse.pyx":205 + /* "sklearn/svm/libsvm_sparse.pyx":199 * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) # <<<<<<<<<<<<<< @@ -2690,67 +2652,67 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH } /*else*/ { - /* "sklearn/svm/libsvm_sparse.pyx":207 + /* "sklearn/svm/libsvm_sparse.pyx":201 * copy_probA(probA.data, model, probA.shape) * else: * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __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 = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_7), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_probA = ((PyArrayObject *)__pyx_t_6); - __pyx_t_6 = 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 = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_probA = ((PyArrayObject *)__pyx_t_3); + __pyx_t_3 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":208 + /* "sklearn/svm/libsvm_sparse.pyx":202 * else: * probA = np.empty(0, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * * svm_csr_free_and_destroy_model (&model) */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_8), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 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 = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_probB = ((PyArrayObject *)__pyx_t_5); - __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_probB = ((PyArrayObject *)__pyx_t_6); + __pyx_t_6 = 0; } __pyx_L9:; - /* "sklearn/svm/libsvm_sparse.pyx":210 + /* "sklearn/svm/libsvm_sparse.pyx":204 * probB = np.empty(0, dtype=np.float64) * * svm_csr_free_and_destroy_model (&model) # <<<<<<<<<<<<<< @@ -2759,7 +2721,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ svm_csr_free_and_destroy_model((&__pyx_v_model)); - /* "sklearn/svm/libsvm_sparse.pyx":211 + /* "sklearn/svm/libsvm_sparse.pyx":205 * * svm_csr_free_and_destroy_model (&model) * free_problem(problem) # <<<<<<<<<<<<<< @@ -2768,64 +2730,61 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH */ free_problem(__pyx_v_problem); - /* "sklearn/svm/libsvm_sparse.pyx":212 + /* "sklearn/svm/libsvm_sparse.pyx":206 * svm_csr_free_and_destroy_model (&model) * free_problem(problem) * free_param(param) # <<<<<<<<<<<<<< * - * return (support, support_vectors_, sv_coef_data, intercept, label, n_class_SV, + * return (support, support_vectors_, sv_coef_data, intercept, n_class_SV, */ free_param(__pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":214 + /* "sklearn/svm/libsvm_sparse.pyx":208 * free_param(param) * - * return (support, support_vectors_, sv_coef_data, intercept, label, n_class_SV, # <<<<<<<<<<<<<< + * return (support, support_vectors_, sv_coef_data, intercept, n_class_SV, # <<<<<<<<<<<<<< * probA, probB, fit_status) * */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/svm/libsvm_sparse.pyx":215 + /* "sklearn/svm/libsvm_sparse.pyx":209 * - * return (support, support_vectors_, sv_coef_data, intercept, label, n_class_SV, + * return (support, support_vectors_, sv_coef_data, intercept, n_class_SV, * probA, probB, fit_status) # <<<<<<<<<<<<<< * * */ - __pyx_t_5 = PyInt_FromLong(__pyx_v_fit_status); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyInt_FromLong(__pyx_v_fit_status); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_support)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_support)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_support)); __Pyx_GIVEREF(((PyObject *)__pyx_v_support)); __Pyx_INCREF(__pyx_v_support_vectors_); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_support_vectors_); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_support_vectors_); __Pyx_GIVEREF(__pyx_v_support_vectors_); __Pyx_INCREF(((PyObject *)__pyx_v_sv_coef_data)); - PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_sv_coef_data)); + PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_sv_coef_data)); __Pyx_GIVEREF(((PyObject *)__pyx_v_sv_coef_data)); __Pyx_INCREF(((PyObject *)__pyx_v_intercept)); - PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_intercept)); + PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_intercept)); __Pyx_GIVEREF(((PyObject *)__pyx_v_intercept)); - __Pyx_INCREF(((PyObject *)__pyx_v_label)); - PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_label)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_label)); __Pyx_INCREF(((PyObject *)__pyx_v_n_class_SV)); - PyTuple_SET_ITEM(__pyx_t_6, 5, ((PyObject *)__pyx_v_n_class_SV)); + PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_v_n_class_SV)); __Pyx_GIVEREF(((PyObject *)__pyx_v_n_class_SV)); __Pyx_INCREF(((PyObject *)__pyx_v_probA)); - PyTuple_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_v_probA)); + PyTuple_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_v_probA)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probA)); __Pyx_INCREF(((PyObject *)__pyx_v_probB)); - PyTuple_SET_ITEM(__pyx_t_6, 7, ((PyObject *)__pyx_v_probB)); + PyTuple_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_v_probB)); __Pyx_GIVEREF(((PyObject *)__pyx_v_probB)); - PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_r = ((PyObject *)__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = ((PyObject *)__pyx_t_3); + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2869,7 +2828,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_libsvm_sparse_train(CYTH __Pyx_XDECREF((PyObject *)__pyx_v_SV_indptr); __Pyx_XDECREF(__pyx_v_support_vectors_); __Pyx_XDECREF((PyObject *)__pyx_v_n_class_SV); - __Pyx_XDECREF((PyObject *)__pyx_v_label); __Pyx_XDECREF((PyObject *)__pyx_v_probA); __Pyx_XDECREF((PyObject *)__pyx_v_probB); __Pyx_XDECREF((PyObject *)__pyx_v_sample_weight); @@ -2904,7 +2862,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P int __pyx_v_shrinking; int __pyx_v_probability; PyArrayObject *__pyx_v_nSV = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; int __pyx_lineno = 0; @@ -2914,13 +2871,12 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("libsvm_sparse_predict (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__T_data,&__pyx_n_s__T_indices,&__pyx_n_s__T_indptr,&__pyx_n_s__SV_data,&__pyx_n_s__SV_indices,&__pyx_n_s__SV_indptr,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__class_weight,&__pyx_n_s__nu,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__nSV,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,0}; - PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__T_data,&__pyx_n_s__T_indices,&__pyx_n_s__T_indptr,&__pyx_n_s__SV_data,&__pyx_n_s__SV_indices,&__pyx_n_s__SV_indptr,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__class_weight,&__pyx_n_s__nu,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__nSV,&__pyx_n_s__probA,&__pyx_n_s__probB,0}; + PyObject* values[23] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); @@ -2955,123 +2911,118 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__T_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__T_indptr)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV_indptr)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sv_coef)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intercept)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__svm_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kernel_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__degree)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 11: if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gamma)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 12: if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coef0)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 13: if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eps)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 14: if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 15: if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__class_weight)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 16: if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nu)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 17: if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 18: if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shrinking)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 19: if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probability)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 20: if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nSV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 21: - if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__label)) != 0)) kw_args--; + if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probA)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 22: - if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probA)) != 0)) kw_args--; + if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probB)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 23: - if (likely((values[23] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probB)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, 23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_predict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_predict") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - } else if (PyTuple_GET_SIZE(__pyx_args) != 24) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 23) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -3097,7 +3048,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P values[20] = PyTuple_GET_ITEM(__pyx_args, 20); values[21] = PyTuple_GET_ITEM(__pyx_args, 21); values[22] = PyTuple_GET_ITEM(__pyx_args, 22); - values[23] = PyTuple_GET_ITEM(__pyx_args, 23); } __pyx_v_T_data = ((PyArrayObject *)values[0]); __pyx_v_T_indices = ((PyArrayObject *)values[1]); @@ -3107,45 +3057,43 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P __pyx_v_SV_indptr = ((PyArrayObject *)values[5]); __pyx_v_sv_coef = ((PyArrayObject *)values[6]); __pyx_v_intercept = ((PyArrayObject *)values[7]); - __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_degree = __Pyx_PyInt_AsInt(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_eps = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_C = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_degree = __Pyx_PyInt_AsInt(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_eps = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_C = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_class_weight = ((PyArrayObject *)values[15]); - __pyx_v_nu = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_p = __pyx_PyFloat_AsDouble(values[17]); if (unlikely((__pyx_v_p == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_probability = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_nu = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_p = __pyx_PyFloat_AsDouble(values[17]); if (unlikely((__pyx_v_p == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probability = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_nSV = ((PyArrayObject *)values[20]); - __pyx_v_label = ((PyArrayObject *)values[21]); - __pyx_v_probA = ((PyArrayObject *)values[22]); - __pyx_v_probB = ((PyArrayObject *)values[23]); + __pyx_v_probA = ((PyArrayObject *)values[21]); + __pyx_v_probB = ((PyArrayObject *)values[22]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict", 1, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm_sparse.libsvm_sparse_predict", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_data), __pyx_ptype_5numpy_ndarray, 1, "T_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indices), __pyx_ptype_5numpy_ndarray, 1, "T_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indptr), __pyx_ptype_5numpy_ndarray, 1, "T_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_data), __pyx_ptype_5numpy_ndarray, 1, "SV_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indices), __pyx_ptype_5numpy_ndarray, 1, "SV_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indptr), __pyx_ptype_5numpy_ndarray, 1, "SV_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(__pyx_self, __pyx_v_T_data, __pyx_v_T_indices, __pyx_v_T_indptr, __pyx_v_SV_data, __pyx_v_SV_indices, __pyx_v_SV_indptr, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_eps, __pyx_v_C, __pyx_v_class_weight, __pyx_v_nu, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nSV, __pyx_v_label, __pyx_v_probA, __pyx_v_probB); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_data), __pyx_ptype_5numpy_ndarray, 1, "T_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indices), __pyx_ptype_5numpy_ndarray, 1, "T_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indptr), __pyx_ptype_5numpy_ndarray, 1, "T_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_data), __pyx_ptype_5numpy_ndarray, 1, "SV_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indices), __pyx_ptype_5numpy_ndarray, 1, "SV_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indptr), __pyx_ptype_5numpy_ndarray, 1, "SV_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(__pyx_self, __pyx_v_T_data, __pyx_v_T_indices, __pyx_v_T_indptr, __pyx_v_SV_data, __pyx_v_SV_indices, __pyx_v_SV_indptr, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_eps, __pyx_v_C, __pyx_v_class_weight, __pyx_v_nu, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nSV, __pyx_v_probA, __pyx_v_probB); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -3154,7 +3102,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":218 +/* "sklearn/svm/libsvm_sparse.pyx":212 * * * def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, # <<<<<<<<<<<<<< @@ -3162,7 +3110,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict(P * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indptr, */ -static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB) { +static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB) { PyArrayObject *__pyx_v_dec_values = 0; struct svm_parameter *__pyx_v_param; struct svm_csr_model *__pyx_v_model; @@ -3188,8 +3136,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __Pyx_Buffer __pyx_pybuffer_dec_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_intercept; __Pyx_Buffer __pyx_pybuffer_intercept; - __Pyx_LocalBuf_ND __pyx_pybuffernd_label; - __Pyx_Buffer __pyx_pybuffer_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_nSV; __Pyx_Buffer __pyx_pybuffer_nSV; __Pyx_LocalBuf_ND __pyx_pybuffernd_probA; @@ -3264,10 +3210,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __pyx_pybuffer_nSV.refcount = 0; __pyx_pybuffernd_nSV.data = NULL; __pyx_pybuffernd_nSV.rcbuffer = &__pyx_pybuffer_nSV; - __pyx_pybuffer_label.pybuffer.buf = NULL; - __pyx_pybuffer_label.refcount = 0; - __pyx_pybuffernd_label.data = NULL; - __pyx_pybuffernd_label.rcbuffer = &__pyx_pybuffer_label; __pyx_pybuffer_probA.pybuffer.buf = NULL; __pyx_pybuffer_probA.refcount = 0; __pyx_pybuffernd_probA.data = NULL; @@ -3278,110 +3220,105 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __pyx_pybuffernd_probB.rcbuffer = &__pyx_pybuffer_probB; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_T_data.diminfo[0].strides = __pyx_pybuffernd_T_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_T_data.diminfo[0].shape = __pyx_pybuffernd_T_data.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_T_indices.diminfo[0].strides = __pyx_pybuffernd_T_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_T_indices.diminfo[0].shape = __pyx_pybuffernd_T_indices.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_T_indptr.diminfo[0].strides = __pyx_pybuffernd_T_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_T_indptr.diminfo[0].shape = __pyx_pybuffernd_T_indptr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV_data.diminfo[0].strides = __pyx_pybuffernd_SV_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV_data.diminfo[0].shape = __pyx_pybuffernd_SV_data.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV_indices.diminfo[0].strides = __pyx_pybuffernd_SV_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV_indices.diminfo[0].shape = __pyx_pybuffernd_SV_indices.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV_indptr.diminfo[0].strides = __pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV_indptr.diminfo[0].shape = __pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sv_coef.diminfo[0].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv_coef.diminfo[0].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_intercept.diminfo[0].strides = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intercept.diminfo[0].shape = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_nSV.diminfo[0].strides = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nSV.diminfo[0].shape = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_pybuffernd_label.diminfo[0].strides = __pyx_pybuffernd_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_label.diminfo[0].shape = __pyx_pybuffernd_label.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm_sparse.pyx":262 + /* "sklearn/svm/libsvm_sparse.pyx":255 * cdef svm_csr_model *model * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * cdef int rv * param = set_parameter(svm_type, kernel_type, degree, gamma, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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 = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __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_PyInt_to_py_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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 = 255; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __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 = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __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_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__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 = 262; __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 = 255; __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_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -3389,7 +3326,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":269 + /* "sklearn/svm/libsvm_sparse.pyx":262 * C, eps, p, shrinking, * probability, class_weight.shape[0], class_weight_label.data, * class_weight.data, -1, # <<<<<<<<<<<<<< @@ -3398,39 +3335,39 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C */ __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, 100., __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data, -1, -1); - /* "sklearn/svm/libsvm_sparse.pyx":276 + /* "sklearn/svm/libsvm_sparse.pyx":269 * SV_indptr.shape, SV_indptr.data, * sv_coef.data, intercept.data, - * nSV.data, label.data, probA.data, probB.data) # <<<<<<<<<<<<<< + * nSV.data, probA.data, probB.data) # <<<<<<<<<<<<<< * #TODO: use check_model * dec_values = np.empty(T_indptr.shape[0]-1) */ - __pyx_v_model = csr_set_model(__pyx_v_param, ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); + __pyx_v_model = csr_set_model(__pyx_v_param, ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "sklearn/svm/libsvm_sparse.pyx":278 - * nSV.data, label.data, probA.data, probB.data) + /* "sklearn/svm/libsvm_sparse.pyx":271 + * nSV.data, probA.data, probB.data) * #TODO: use check_model * dec_values = np.empty(T_indptr.shape[0]-1) # <<<<<<<<<<<<<< * with nogil: * rv = csr_copy_predict(T_data.shape, T_data.data, */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __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 = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __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 = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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 = 278; __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 = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -3446,13 +3383,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C } } __pyx_pybuffernd_dec_values.diminfo[0].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dec_values.diminfo[0].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[0]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":279 + /* "sklearn/svm/libsvm_sparse.pyx":272 * #TODO: use check_model * dec_values = np.empty(T_indptr.shape[0]-1) * with nogil: # <<<<<<<<<<<<<< @@ -3466,7 +3403,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C #endif /*try:*/ { - /* "sklearn/svm/libsvm_sparse.pyx":283 + /* "sklearn/svm/libsvm_sparse.pyx":276 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) # <<<<<<<<<<<<<< @@ -3476,7 +3413,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __pyx_v_rv = csr_copy_predict(__pyx_v_T_data->dimensions, __pyx_v_T_data->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data); } - /* "sklearn/svm/libsvm_sparse.pyx":279 + /* "sklearn/svm/libsvm_sparse.pyx":272 * #TODO: use check_model * dec_values = np.empty(T_indptr.shape[0]-1) * with nogil: # <<<<<<<<<<<<<< @@ -3490,33 +3427,33 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C } } - /* "sklearn/svm/libsvm_sparse.pyx":284 + /* "sklearn/svm/libsvm_sparse.pyx":277 * T_indptr.shape, T_indptr.data, * model, dec_values.data) * if rv < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of memory") * # free model and param */ - __pyx_t_12 = (__pyx_v_rv < 0); + __pyx_t_12 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_12) { - /* "sklearn/svm/libsvm_sparse.pyx":285 + /* "sklearn/svm/libsvm_sparse.pyx":278 * model, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "sklearn/svm/libsvm_sparse.pyx":287 + /* "sklearn/svm/libsvm_sparse.pyx":280 * raise MemoryError("We've run out of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -3525,7 +3462,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C */ free_model_SV(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":288 + /* "sklearn/svm/libsvm_sparse.pyx":281 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -3534,7 +3471,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C */ free_model(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":289 + /* "sklearn/svm/libsvm_sparse.pyx":282 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -3543,7 +3480,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C */ free_param(__pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":290 + /* "sklearn/svm/libsvm_sparse.pyx":283 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -3575,7 +3512,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -3595,7 +3531,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -3634,7 +3569,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p int __pyx_v_shrinking; int __pyx_v_probability; PyArrayObject *__pyx_v_nSV = 0; - PyArrayObject *__pyx_v_label = 0; PyArrayObject *__pyx_v_probA = 0; PyArrayObject *__pyx_v_probB = 0; int __pyx_lineno = 0; @@ -3644,13 +3578,12 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("libsvm_sparse_predict_proba (wrapper)", 0); { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__T_data,&__pyx_n_s__T_indices,&__pyx_n_s__T_indptr,&__pyx_n_s__SV_data,&__pyx_n_s__SV_indices,&__pyx_n_s__SV_indptr,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__class_weight,&__pyx_n_s__nu,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__nSV,&__pyx_n_s__label,&__pyx_n_s__probA,&__pyx_n_s__probB,0}; - PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__T_data,&__pyx_n_s__T_indices,&__pyx_n_s__T_indptr,&__pyx_n_s__SV_data,&__pyx_n_s__SV_indices,&__pyx_n_s__SV_indptr,&__pyx_n_s__sv_coef,&__pyx_n_s__intercept,&__pyx_n_s__svm_type,&__pyx_n_s__kernel_type,&__pyx_n_s__degree,&__pyx_n_s__gamma,&__pyx_n_s__coef0,&__pyx_n_s__eps,&__pyx_n_s__C,&__pyx_n_s__class_weight,&__pyx_n_s__nu,&__pyx_n_s__p,&__pyx_n_s__shrinking,&__pyx_n_s__probability,&__pyx_n_s__nSV,&__pyx_n_s__probA,&__pyx_n_s__probB,0}; + PyObject* values[23] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { - case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23); case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22); case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21); case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20); @@ -3685,123 +3618,118 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__T_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__T_indptr)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV_data)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 5: if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__SV_indptr)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 6: if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sv_coef)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 7: if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__intercept)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 8: if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__svm_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 9: if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kernel_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 10: if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__degree)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 11: if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__gamma)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 12: if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__coef0)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 13: if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__eps)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 14: if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__C)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 15: if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__class_weight)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 16: if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nu)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 17: if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 18: if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shrinking)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 19: if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probability)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 20: if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nSV)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 21: - if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__label)) != 0)) kw_args--; + if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probA)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 22: - if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probA)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 23: - if (likely((values[23] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probB)) != 0)) kw_args--; + if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__probB)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, 23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_predict_proba") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_predict_proba") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } - } else if (PyTuple_GET_SIZE(__pyx_args) != 24) { + } else if (PyTuple_GET_SIZE(__pyx_args) != 23) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -3827,7 +3755,6 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p values[20] = PyTuple_GET_ITEM(__pyx_args, 20); values[21] = PyTuple_GET_ITEM(__pyx_args, 21); values[22] = PyTuple_GET_ITEM(__pyx_args, 22); - values[23] = PyTuple_GET_ITEM(__pyx_args, 23); } __pyx_v_T_data = ((PyArrayObject *)values[0]); __pyx_v_T_indices = ((PyArrayObject *)values[1]); @@ -3837,45 +3764,43 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p __pyx_v_SV_indptr = ((PyArrayObject *)values[5]); __pyx_v_sv_coef = ((PyArrayObject *)values[6]); __pyx_v_intercept = ((PyArrayObject *)values[7]); - __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_degree = __Pyx_PyInt_AsInt(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_eps = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_C = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_svm_type = __Pyx_PyInt_AsInt(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel_type = __Pyx_PyInt_AsInt(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_degree = __Pyx_PyInt_AsInt(values[10]); if (unlikely((__pyx_v_degree == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_gamma = __pyx_PyFloat_AsDouble(values[11]); if (unlikely((__pyx_v_gamma == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_coef0 = __pyx_PyFloat_AsDouble(values[12]); if (unlikely((__pyx_v_coef0 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_eps = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_eps == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_C = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_C == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_class_weight = ((PyArrayObject *)values[15]); - __pyx_v_nu = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_p = __pyx_PyFloat_AsDouble(values[17]); if (unlikely((__pyx_v_p == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_probability = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_nu = __pyx_PyFloat_AsDouble(values[16]); if (unlikely((__pyx_v_nu == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_p = __pyx_PyFloat_AsDouble(values[17]); if (unlikely((__pyx_v_p == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_shrinking = __Pyx_PyInt_AsInt(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probability = __Pyx_PyInt_AsInt(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_nSV = ((PyArrayObject *)values[20]); - __pyx_v_label = ((PyArrayObject *)values[21]); - __pyx_v_probA = ((PyArrayObject *)values[22]); - __pyx_v_probB = ((PyArrayObject *)values[23]); + __pyx_v_probA = ((PyArrayObject *)values[21]); + __pyx_v_probB = ((PyArrayObject *)values[22]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm_sparse.libsvm_sparse_predict_proba", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_data), __pyx_ptype_5numpy_ndarray, 1, "T_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indices), __pyx_ptype_5numpy_ndarray, 1, "T_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indptr), __pyx_ptype_5numpy_ndarray, 1, "T_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_data), __pyx_ptype_5numpy_ndarray, 1, "SV_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indices), __pyx_ptype_5numpy_ndarray, 1, "SV_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indptr), __pyx_ptype_5numpy_ndarray, 1, "SV_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_label), __pyx_ptype_5numpy_ndarray, 1, "label", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_proba(__pyx_self, __pyx_v_T_data, __pyx_v_T_indices, __pyx_v_T_indptr, __pyx_v_SV_data, __pyx_v_SV_indices, __pyx_v_SV_indptr, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_eps, __pyx_v_C, __pyx_v_class_weight, __pyx_v_nu, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nSV, __pyx_v_label, __pyx_v_probA, __pyx_v_probB); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_data), __pyx_ptype_5numpy_ndarray, 1, "T_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indices), __pyx_ptype_5numpy_ndarray, 1, "T_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_indptr), __pyx_ptype_5numpy_ndarray, 1, "T_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_data), __pyx_ptype_5numpy_ndarray, 1, "SV_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indices), __pyx_ptype_5numpy_ndarray, 1, "SV_indices", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_SV_indptr), __pyx_ptype_5numpy_ndarray, 1, "SV_indptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sv_coef), __pyx_ptype_5numpy_ndarray, 1, "sv_coef", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_intercept), __pyx_ptype_5numpy_ndarray, 1, "intercept", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_class_weight), __pyx_ptype_5numpy_ndarray, 1, "class_weight", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nSV), __pyx_ptype_5numpy_ndarray, 1, "nSV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probA), __pyx_ptype_5numpy_ndarray, 1, "probA", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_probB), __pyx_ptype_5numpy_ndarray, 1, "probB", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_r = __pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_proba(__pyx_self, __pyx_v_T_data, __pyx_v_T_indices, __pyx_v_T_indptr, __pyx_v_SV_data, __pyx_v_SV_indices, __pyx_v_SV_indptr, __pyx_v_sv_coef, __pyx_v_intercept, __pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_eps, __pyx_v_C, __pyx_v_class_weight, __pyx_v_nu, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, __pyx_v_nSV, __pyx_v_probA, __pyx_v_probB); goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; @@ -3884,7 +3809,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":295 +/* "sklearn/svm/libsvm_sparse.pyx":288 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< @@ -3892,7 +3817,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_p * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, */ -static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_label, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB) { +static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_proba(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_T_data, PyArrayObject *__pyx_v_T_indices, PyArrayObject *__pyx_v_T_indptr, PyArrayObject *__pyx_v_SV_data, PyArrayObject *__pyx_v_SV_indices, PyArrayObject *__pyx_v_SV_indptr, PyArrayObject *__pyx_v_sv_coef, PyArrayObject *__pyx_v_intercept, int __pyx_v_svm_type, int __pyx_v_kernel_type, int __pyx_v_degree, double __pyx_v_gamma, double __pyx_v_coef0, double __pyx_v_eps, double __pyx_v_C, PyArrayObject *__pyx_v_class_weight, double __pyx_v_nu, double __pyx_v_p, int __pyx_v_shrinking, int __pyx_v_probability, PyArrayObject *__pyx_v_nSV, PyArrayObject *__pyx_v_probA, PyArrayObject *__pyx_v_probB) { PyArrayObject *__pyx_v_dec_values = 0; struct svm_parameter *__pyx_v_param; struct svm_csr_model *__pyx_v_model; @@ -3919,8 +3844,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __Pyx_Buffer __pyx_pybuffer_dec_values; __Pyx_LocalBuf_ND __pyx_pybuffernd_intercept; __Pyx_Buffer __pyx_pybuffer_intercept; - __Pyx_LocalBuf_ND __pyx_pybuffernd_label; - __Pyx_Buffer __pyx_pybuffer_label; __Pyx_LocalBuf_ND __pyx_pybuffernd_nSV; __Pyx_Buffer __pyx_pybuffer_nSV; __Pyx_LocalBuf_ND __pyx_pybuffernd_probA; @@ -3995,10 +3918,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __pyx_pybuffer_nSV.refcount = 0; __pyx_pybuffernd_nSV.data = NULL; __pyx_pybuffernd_nSV.rcbuffer = &__pyx_pybuffer_nSV; - __pyx_pybuffer_label.pybuffer.buf = NULL; - __pyx_pybuffer_label.refcount = 0; - __pyx_pybuffernd_label.data = NULL; - __pyx_pybuffernd_label.rcbuffer = &__pyx_pybuffer_label; __pyx_pybuffer_probA.pybuffer.buf = NULL; __pyx_pybuffer_probA.refcount = 0; __pyx_pybuffernd_probA.data = NULL; @@ -4009,110 +3928,105 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __pyx_pybuffernd_probB.rcbuffer = &__pyx_pybuffer_probB; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_T_data.diminfo[0].strides = __pyx_pybuffernd_T_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_T_data.diminfo[0].shape = __pyx_pybuffernd_T_data.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_T_indices.diminfo[0].strides = __pyx_pybuffernd_T_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_T_indices.diminfo[0].shape = __pyx_pybuffernd_T_indices.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_T_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_T_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_T_indptr.diminfo[0].strides = __pyx_pybuffernd_T_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_T_indptr.diminfo[0].shape = __pyx_pybuffernd_T_indptr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV_data.diminfo[0].strides = __pyx_pybuffernd_SV_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV_data.diminfo[0].shape = __pyx_pybuffernd_SV_data.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indices, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV_indices.diminfo[0].strides = __pyx_pybuffernd_SV_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV_indices.diminfo[0].shape = __pyx_pybuffernd_SV_indices.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_SV_indptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_SV_indptr.diminfo[0].strides = __pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_SV_indptr.diminfo[0].shape = __pyx_pybuffernd_SV_indptr.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sv_coef.rcbuffer->pybuffer, (PyObject*)__pyx_v_sv_coef, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_sv_coef.diminfo[0].strides = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sv_coef.diminfo[0].shape = __pyx_pybuffernd_sv_coef.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer, (PyObject*)__pyx_v_intercept, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_intercept.diminfo[0].strides = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_intercept.diminfo[0].shape = __pyx_pybuffernd_intercept.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_class_weight.rcbuffer->pybuffer, (PyObject*)__pyx_v_class_weight, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_class_weight.diminfo[0].strides = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight.diminfo[0].shape = __pyx_pybuffernd_class_weight.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer, (PyObject*)__pyx_v_nSV, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_nSV.diminfo[0].strides = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_nSV.diminfo[0].shape = __pyx_pybuffernd_nSV.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_label.rcbuffer->pybuffer, (PyObject*)__pyx_v_label, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_pybuffernd_label.diminfo[0].strides = __pyx_pybuffernd_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_label.diminfo[0].shape = __pyx_pybuffernd_label.rcbuffer->pybuffer.shape[0]; - { - __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probA.rcbuffer->pybuffer, (PyObject*)__pyx_v_probA, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probA.diminfo[0].strides = __pyx_pybuffernd_probA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probA.diminfo[0].shape = __pyx_pybuffernd_probA.rcbuffer->pybuffer.shape[0]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_probB.rcbuffer->pybuffer, (PyObject*)__pyx_v_probB, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_probB.diminfo[0].strides = __pyx_pybuffernd_probB.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_probB.diminfo[0].shape = __pyx_pybuffernd_probB.rcbuffer->pybuffer.shape[0]; - /* "sklearn/svm/libsvm_sparse.pyx":320 + /* "sklearn/svm/libsvm_sparse.pyx":312 * cdef svm_csr_model *model * cdef np.ndarray[np.int32_t, ndim=1, mode='c'] \ * class_weight_label = np.arange(class_weight.shape[0], dtype=np.int32) # <<<<<<<<<<<<<< * param = set_parameter(svm_type, kernel_type, degree, gamma, * coef0, nu, */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __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_PyInt_to_py_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_to_py_Py_intptr_t((__pyx_v_class_weight->dimensions[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 312; __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); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __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_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__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 = 320; __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 = 312; __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_class_weight_label.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) { __pyx_v_class_weight_label = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.buf = NULL; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_class_weight_label.diminfo[0].strides = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_class_weight_label.diminfo[0].shape = __pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer.shape[0]; } } @@ -4120,7 +4034,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":326 + /* "sklearn/svm/libsvm_sparse.pyx":318 * C, eps, p, shrinking, * probability, class_weight.shape[0], class_weight_label.data, * class_weight.data, -1, # <<<<<<<<<<<<<< @@ -4129,17 +4043,17 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ __pyx_v_param = set_parameter(__pyx_v_svm_type, __pyx_v_kernel_type, __pyx_v_degree, __pyx_v_gamma, __pyx_v_coef0, __pyx_v_nu, 100., __pyx_v_C, __pyx_v_eps, __pyx_v_p, __pyx_v_shrinking, __pyx_v_probability, ((int)(__pyx_v_class_weight->dimensions[0])), __pyx_v_class_weight_label->data, __pyx_v_class_weight->data, -1, -1); - /* "sklearn/svm/libsvm_sparse.pyx":333 + /* "sklearn/svm/libsvm_sparse.pyx":325 * SV_indptr.shape, SV_indptr.data, * sv_coef.data, intercept.data, - * nSV.data, label.data, probA.data, probB.data) # <<<<<<<<<<<<<< + * nSV.data, probA.data, probB.data) # <<<<<<<<<<<<<< * #TODO: use check_model * cdef np.npy_intp n_class = get_nr(model) */ - __pyx_v_model = csr_set_model(__pyx_v_param, ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_label->data, __pyx_v_probA->data, __pyx_v_probB->data); + __pyx_v_model = csr_set_model(__pyx_v_param, ((int)(__pyx_v_nSV->dimensions[0])), __pyx_v_SV_data->data, __pyx_v_SV_indices->dimensions, __pyx_v_SV_indices->data, __pyx_v_SV_indptr->dimensions, __pyx_v_SV_indptr->data, __pyx_v_sv_coef->data, __pyx_v_intercept->data, __pyx_v_nSV->data, __pyx_v_probA->data, __pyx_v_probB->data); - /* "sklearn/svm/libsvm_sparse.pyx":335 - * nSV.data, label.data, probA.data, probB.data) + /* "sklearn/svm/libsvm_sparse.pyx":327 + * nSV.data, probA.data, probB.data) * #TODO: use check_model * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< * cdef int rv @@ -4147,23 +4061,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":337 + /* "sklearn/svm/libsvm_sparse.pyx":329 * cdef np.npy_intp n_class = get_nr(model) * cdef int rv * dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64) # <<<<<<<<<<<<<< * with nogil: * rv = csr_copy_predict_proba(T_data.shape, T_data.data, */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyInt_FromLong(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyInt_to_py_Py_intptr_t(__pyx_v_n_class); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); @@ -4171,26 +4085,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __Pyx_GIVEREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __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 = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4206,13 +4120,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p } } __pyx_pybuffernd_dec_values.diminfo[0].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dec_values.diminfo[0].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dec_values.diminfo[1].strides = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dec_values.diminfo[1].shape = __pyx_pybuffernd_dec_values.rcbuffer->pybuffer.shape[1]; - if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":338 + /* "sklearn/svm/libsvm_sparse.pyx":330 * cdef int rv * dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -4226,7 +4140,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p #endif /*try:*/ { - /* "sklearn/svm/libsvm_sparse.pyx":342 + /* "sklearn/svm/libsvm_sparse.pyx":334 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data) # <<<<<<<<<<<<<< @@ -4236,7 +4150,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __pyx_v_rv = csr_copy_predict_proba(__pyx_v_T_data->dimensions, __pyx_v_T_data->data, __pyx_v_T_indices->dimensions, __pyx_v_T_indices->data, __pyx_v_T_indptr->dimensions, __pyx_v_T_indptr->data, __pyx_v_model, __pyx_v_dec_values->data); } - /* "sklearn/svm/libsvm_sparse.pyx":338 + /* "sklearn/svm/libsvm_sparse.pyx":330 * cdef int rv * dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -4250,33 +4164,33 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p } } - /* "sklearn/svm/libsvm_sparse.pyx":343 + /* "sklearn/svm/libsvm_sparse.pyx":335 * T_indptr.shape, T_indptr.data, * model, dec_values.data) * if rv < 0: # <<<<<<<<<<<<<< * raise MemoryError("We've run out of memory") * # free model and param */ - __pyx_t_12 = (__pyx_v_rv < 0); + __pyx_t_12 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_12) { - /* "sklearn/svm/libsvm_sparse.pyx":344 + /* "sklearn/svm/libsvm_sparse.pyx":336 * model, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __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[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "sklearn/svm/libsvm_sparse.pyx":346 + /* "sklearn/svm/libsvm_sparse.pyx":338 * raise MemoryError("We've run out of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -4285,7 +4199,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ free_model_SV(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":347 + /* "sklearn/svm/libsvm_sparse.pyx":339 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -4294,7 +4208,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ free_model(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":348 + /* "sklearn/svm/libsvm_sparse.pyx":340 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -4303,7 +4217,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ free_param(__pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":349 + /* "sklearn/svm/libsvm_sparse.pyx":341 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -4335,7 +4249,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -4355,7 +4268,6 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_class_weight_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dec_values.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_intercept.rcbuffer->pybuffer); - __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_label.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_nSV.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probA.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_probB.rcbuffer->pybuffer); @@ -4381,7 +4293,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_7set_verbosity_wrap(PyOb __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_verbosity_wrap (wrapper)", 0); assert(__pyx_arg_verbosity); { - __pyx_v_verbosity = __Pyx_PyInt_AsInt(__pyx_arg_verbosity); if (unlikely((__pyx_v_verbosity == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_verbosity = __Pyx_PyInt_AsInt(__pyx_arg_verbosity); if (unlikely((__pyx_v_verbosity == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4394,7 +4306,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_7set_verbosity_wrap(PyOb return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":353 +/* "sklearn/svm/libsvm_sparse.pyx":345 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -4407,7 +4319,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6set_verbosity_wrap(CYTH __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_verbosity_wrap", 0); - /* "sklearn/svm/libsvm_sparse.pyx":357 + /* "sklearn/svm/libsvm_sparse.pyx":349 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< @@ -4477,7 +4389,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * * cdef int copy_shape, i, ndim */ - __pyx_t_1 = (__pyx_v_info == NULL); + __pyx_t_1 = ((__pyx_v_info == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; @@ -4519,7 +4431,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * copy_shape = 1 * else: */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { /* "numpy.pxd":209 @@ -4552,7 +4464,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): * raise ValueError(u"ndarray is not C contiguous") */ - __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS); + __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); if (__pyx_t_1) { /* "numpy.pxd":214 @@ -4562,7 +4474,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * raise ValueError(u"ndarray is not C contiguous") * */ - __pyx_t_2 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS)); + __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); __pyx_t_3 = __pyx_t_2; } else { __pyx_t_3 = __pyx_t_1; @@ -4592,7 +4504,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): * raise ValueError(u"ndarray is not Fortran contiguous") */ - __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS); + __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); if (__pyx_t_3) { /* "numpy.pxd":218 @@ -4602,7 +4514,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * raise ValueError(u"ndarray is not Fortran contiguous") * */ - __pyx_t_1 = (!PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS)); + __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); __pyx_t_2 = __pyx_t_1; } else { __pyx_t_2 = __pyx_t_3; @@ -4650,7 +4562,8 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * # Allocate new buffer for strides and shape info. * # This is allocated as one block, strides first. */ - if (__pyx_v_copy_shape) { + __pyx_t_2 = (__pyx_v_copy_shape != 0); + if (__pyx_t_2) { /* "numpy.pxd":226 * # Allocate new buffer for strides and shape info. @@ -4748,7 +4661,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * * cdef int t */ - __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(__pyx_v_self)); + __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); /* "numpy.pxd":239 * @@ -4787,9 +4700,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * # do not call releasebuffer * info.obj = None */ - __pyx_t_2 = (!__pyx_v_hasfields); + __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_2) { - __pyx_t_3 = (!__pyx_v_copy_shape); + __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); __pyx_t_1 = __pyx_t_3; } else { __pyx_t_1 = __pyx_t_2; @@ -4834,7 +4747,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or */ - __pyx_t_1 = (!__pyx_v_hasfields); + __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); if (__pyx_t_1) { /* "numpy.pxd":254 @@ -4854,9 +4767,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * (descr.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '>'); + __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); if (__pyx_t_1) { - __pyx_t_2 = __pyx_v_little_endian; + __pyx_t_2 = (__pyx_v_little_endian != 0); } else { __pyx_t_2 = __pyx_t_1; } @@ -4869,9 +4782,9 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P * raise ValueError(u"Non-native byte order not supported") * if t == NPY_BYTE: f = "b" */ - __pyx_t_1 = (__pyx_v_descr->byteorder == '<'); + __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); if (__pyx_t_1) { - __pyx_t_3 = (!__pyx_v_little_endian); + __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_7 = __pyx_t_3; } else { __pyx_t_7 = __pyx_t_1; @@ -5243,7 +5156,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): */ - __pyx_t_1 = PyArray_HASFIELDS(__pyx_v_self); + __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); if (__pyx_t_1) { /* "numpy.pxd":290 @@ -5265,7 +5178,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s * stdlib.free(info.strides) * # info.shape was stored after info.strides in the same block */ - __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t))); + __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); if (__pyx_t_1) { /* "numpy.pxd":292 @@ -5696,9 +5609,9 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * (child.byteorder == c'<' and not little_endian)): * raise ValueError(u"Non-native byte order not supported") */ - __pyx_t_7 = (__pyx_v_child->byteorder == '>'); + __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); if (__pyx_t_7) { - __pyx_t_8 = __pyx_v_little_endian; + __pyx_t_8 = (__pyx_v_little_endian != 0); } else { __pyx_t_8 = __pyx_t_7; } @@ -5711,9 +5624,9 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * raise ValueError(u"Non-native byte order not supported") * # One could encode it in the format string and have Cython */ - __pyx_t_7 = (__pyx_v_child->byteorder == '<'); + __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); if (__pyx_t_7) { - __pyx_t_9 = (!__pyx_v_little_endian); + __pyx_t_9 = ((!(__pyx_v_little_endian != 0)) != 0); __pyx_t_10 = __pyx_t_9; } else { __pyx_t_10 = __pyx_t_7; @@ -5802,7 +5715,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * t = child.type_num * if end - f < 5: */ - __pyx_t_7 = (!PyDataType_HASFIELDS(__pyx_v_child)); + __pyx_t_7 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); if (__pyx_t_7) { /* "numpy.pxd":821 @@ -5825,7 +5738,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx * raise RuntimeError(u"Format string allocated too short.") * */ - __pyx_t_7 = ((__pyx_v_end - __pyx_v_f) < 5); + __pyx_t_7 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_7) { /* "numpy.pxd":823 @@ -6247,6 +6160,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a PyObject *__pyx_v_baseptr; __Pyx_RefNannyDeclarations int __pyx_t_1; + int __pyx_t_2; __Pyx_RefNannySetupContext("set_array_base", 0); /* "numpy.pxd":967 @@ -6257,7 +6171,8 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a * else: */ __pyx_t_1 = (__pyx_v_base == Py_None); - if (__pyx_t_1) { + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { /* "numpy.pxd":968 * cdef PyObject* baseptr @@ -6333,7 +6248,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py * return None * else: */ - __pyx_t_1 = (__pyx_v_arr->base == NULL); + __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); if (__pyx_t_1) { /* "numpy.pxd":977 @@ -6445,7 +6360,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1}, {&__pyx_n_s__intercept, __pyx_k__intercept, sizeof(__pyx_k__intercept), 0, 0, 1, 1}, {&__pyx_n_s__kernel_type, __pyx_k__kernel_type, sizeof(__pyx_k__kernel_type), 0, 0, 1, 1}, - {&__pyx_n_s__label, __pyx_k__label, sizeof(__pyx_k__label), 0, 0, 1, 1}, {&__pyx_n_s__libsvm_sparse_train, __pyx_k__libsvm_sparse_train, sizeof(__pyx_k__libsvm_sparse_train), 0, 0, 1, 1}, {&__pyx_n_s__max_iter, __pyx_k__max_iter, sizeof(__pyx_k__max_iter), 0, 0, 1, 1}, {&__pyx_n_s__model, __pyx_k__model, sizeof(__pyx_k__model), 0, 0, 1, 1}, @@ -6484,8 +6398,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __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 = 142; __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 = 136; __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 = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; @@ -6497,80 +6411,80 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/svm/libsvm_sparse.pyx":137 + /* "sklearn/svm/libsvm_sparse.pyx":136 * # check parameters * if (param == NULL or problem == NULL): * raise MemoryError("Seems we've run out of memory") # <<<<<<<<<<<<<< * error_msg = svm_csr_check_parameter(problem, param); * if error_msg: */ - __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_4); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - /* "sklearn/svm/libsvm_sparse.pyx":203 + /* "sklearn/svm/libsvm_sparse.pyx":197 * copy_probB(probB.data, model, probB.shape) * else: * probA = np.empty(1, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * copy_probA(probA.data, model, probA.shape) */ - __pyx_k_tuple_5 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_5 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_5); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - /* "sklearn/svm/libsvm_sparse.pyx":204 + /* "sklearn/svm/libsvm_sparse.pyx":198 * else: * probA = np.empty(1, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * copy_probA(probA.data, model, probA.shape) * else: */ - __pyx_k_tuple_6 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_6 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_6); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - /* "sklearn/svm/libsvm_sparse.pyx":207 + /* "sklearn/svm/libsvm_sparse.pyx":201 * copy_probA(probA.data, model, probA.shape) * else: * probA = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * probB = np.empty(0, dtype=np.float64) * */ - __pyx_k_tuple_7 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_7 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_7); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); - /* "sklearn/svm/libsvm_sparse.pyx":208 + /* "sklearn/svm/libsvm_sparse.pyx":202 * else: * probA = np.empty(0, dtype=np.float64) * probB = np.empty(0, dtype=np.float64) # <<<<<<<<<<<<<< * * svm_csr_free_and_destroy_model (&model) */ - __pyx_k_tuple_8 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_8 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_8); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - /* "sklearn/svm/libsvm_sparse.pyx":285 + /* "sklearn/svm/libsvm_sparse.pyx":278 * model, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_10); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - /* "sklearn/svm/libsvm_sparse.pyx":344 + /* "sklearn/svm/libsvm_sparse.pyx":336 * model, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_9)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_9)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_11); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); @@ -6640,53 +6554,53 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_k_tuple_23); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); - /* "sklearn/svm/libsvm_sparse.pyx":68 + /* "sklearn/svm/libsvm_sparse.pyx":67 * * * def libsvm_sparse_train ( int n_features, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] values, * np.ndarray[np.int32_t, ndim=1, mode='c'] indices, */ - __pyx_k_tuple_24 = PyTuple_Pack(41, ((PyObject *)__pyx_n_s__n_features), ((PyObject *)__pyx_n_s__values), ((PyObject *)__pyx_n_s__indices), ((PyObject *)__pyx_n_s__indptr), ((PyObject *)__pyx_n_s__Y), ((PyObject *)__pyx_n_s__svm_type), ((PyObject *)__pyx_n_s__kernel_type), ((PyObject *)__pyx_n_s__degree), ((PyObject *)__pyx_n_s__gamma), ((PyObject *)__pyx_n_s__coef0), ((PyObject *)__pyx_n_s__eps), ((PyObject *)__pyx_n_s__C), ((PyObject *)__pyx_n_s__class_weight), ((PyObject *)__pyx_n_s__sample_weight), ((PyObject *)__pyx_n_s__nu), ((PyObject *)__pyx_n_s__cache_size), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__shrinking), ((PyObject *)__pyx_n_s__probability), ((PyObject *)__pyx_n_s__max_iter), ((PyObject *)__pyx_n_s__random_seed), ((PyObject *)__pyx_n_s__param), ((PyObject *)__pyx_n_s__problem), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__error_msg), ((PyObject *)__pyx_n_s__class_weight_label), ((PyObject *)__pyx_n_s__fit_status), ((PyObject *)__pyx_n_s__SV_len), ((PyObject *)__pyx_n_s__n_class), ((PyObject *)__pyx_n_s__sv_coef_data), ((PyObject *)__pyx_n_s__support), ((PyObject *)__pyx_n_s__intercept), ((PyObject *)__pyx_n_s__nonzero_SV), ((PyObject *)__pyx_n_s__SV_data), ((PyObject *)__pyx_n_s__SV_indices), ((PyObject *)__pyx_n_s__SV_indptr), ((PyObject *)__pyx_n_s__support_vectors_), ((PyObject *)__pyx_n_s__n_class_SV), ((PyObject *)__pyx_n_s__label), ((PyObject *)__pyx_n_s__probA), ((PyObject *)__pyx_n_s__probB)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_24 = PyTuple_Pack(40, ((PyObject *)__pyx_n_s__n_features), ((PyObject *)__pyx_n_s__values), ((PyObject *)__pyx_n_s__indices), ((PyObject *)__pyx_n_s__indptr), ((PyObject *)__pyx_n_s__Y), ((PyObject *)__pyx_n_s__svm_type), ((PyObject *)__pyx_n_s__kernel_type), ((PyObject *)__pyx_n_s__degree), ((PyObject *)__pyx_n_s__gamma), ((PyObject *)__pyx_n_s__coef0), ((PyObject *)__pyx_n_s__eps), ((PyObject *)__pyx_n_s__C), ((PyObject *)__pyx_n_s__class_weight), ((PyObject *)__pyx_n_s__sample_weight), ((PyObject *)__pyx_n_s__nu), ((PyObject *)__pyx_n_s__cache_size), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__shrinking), ((PyObject *)__pyx_n_s__probability), ((PyObject *)__pyx_n_s__max_iter), ((PyObject *)__pyx_n_s__random_seed), ((PyObject *)__pyx_n_s__param), ((PyObject *)__pyx_n_s__problem), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__error_msg), ((PyObject *)__pyx_n_s__class_weight_label), ((PyObject *)__pyx_n_s__fit_status), ((PyObject *)__pyx_n_s__SV_len), ((PyObject *)__pyx_n_s__n_class), ((PyObject *)__pyx_n_s__sv_coef_data), ((PyObject *)__pyx_n_s__support), ((PyObject *)__pyx_n_s__intercept), ((PyObject *)__pyx_n_s__nonzero_SV), ((PyObject *)__pyx_n_s__SV_data), ((PyObject *)__pyx_n_s__SV_indices), ((PyObject *)__pyx_n_s__SV_indptr), ((PyObject *)__pyx_n_s__support_vectors_), ((PyObject *)__pyx_n_s__n_class_SV), ((PyObject *)__pyx_n_s__probA), ((PyObject *)__pyx_n_s__probB)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_24); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - __pyx_k_codeobj_25 = (PyObject*)__Pyx_PyCode_New(21, 0, 41, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__libsvm_sparse_train, 68, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_25 = (PyObject*)__Pyx_PyCode_New(21, 0, 40, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__libsvm_sparse_train, 67, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm_sparse.pyx":218 + /* "sklearn/svm/libsvm_sparse.pyx":212 * * * def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, # <<<<<<<<<<<<<< * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indptr, */ - __pyx_k_tuple_28 = PyTuple_Pack(29, ((PyObject *)__pyx_n_s__T_data), ((PyObject *)__pyx_n_s__T_indices), ((PyObject *)__pyx_n_s__T_indptr), ((PyObject *)__pyx_n_s__SV_data), ((PyObject *)__pyx_n_s__SV_indices), ((PyObject *)__pyx_n_s__SV_indptr), ((PyObject *)__pyx_n_s__sv_coef), ((PyObject *)__pyx_n_s__intercept), ((PyObject *)__pyx_n_s__svm_type), ((PyObject *)__pyx_n_s__kernel_type), ((PyObject *)__pyx_n_s__degree), ((PyObject *)__pyx_n_s__gamma), ((PyObject *)__pyx_n_s__coef0), ((PyObject *)__pyx_n_s__eps), ((PyObject *)__pyx_n_s__C), ((PyObject *)__pyx_n_s__class_weight), ((PyObject *)__pyx_n_s__nu), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__shrinking), ((PyObject *)__pyx_n_s__probability), ((PyObject *)__pyx_n_s__nSV), ((PyObject *)__pyx_n_s__label), ((PyObject *)__pyx_n_s__probA), ((PyObject *)__pyx_n_s__probB), ((PyObject *)__pyx_n_s__dec_values), ((PyObject *)__pyx_n_s__param), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__class_weight_label), ((PyObject *)__pyx_n_s__rv)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_28 = PyTuple_Pack(28, ((PyObject *)__pyx_n_s__T_data), ((PyObject *)__pyx_n_s__T_indices), ((PyObject *)__pyx_n_s__T_indptr), ((PyObject *)__pyx_n_s__SV_data), ((PyObject *)__pyx_n_s__SV_indices), ((PyObject *)__pyx_n_s__SV_indptr), ((PyObject *)__pyx_n_s__sv_coef), ((PyObject *)__pyx_n_s__intercept), ((PyObject *)__pyx_n_s__svm_type), ((PyObject *)__pyx_n_s__kernel_type), ((PyObject *)__pyx_n_s__degree), ((PyObject *)__pyx_n_s__gamma), ((PyObject *)__pyx_n_s__coef0), ((PyObject *)__pyx_n_s__eps), ((PyObject *)__pyx_n_s__C), ((PyObject *)__pyx_n_s__class_weight), ((PyObject *)__pyx_n_s__nu), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__shrinking), ((PyObject *)__pyx_n_s__probability), ((PyObject *)__pyx_n_s__nSV), ((PyObject *)__pyx_n_s__probA), ((PyObject *)__pyx_n_s__probB), ((PyObject *)__pyx_n_s__dec_values), ((PyObject *)__pyx_n_s__param), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__class_weight_label), ((PyObject *)__pyx_n_s__rv)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_28); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); - __pyx_k_codeobj_29 = (PyObject*)__Pyx_PyCode_New(24, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s_30, 218, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_29 = (PyObject*)__Pyx_PyCode_New(23, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s_30, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm_sparse.pyx":295 + /* "sklearn/svm/libsvm_sparse.pyx":288 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, */ - __pyx_k_tuple_31 = PyTuple_Pack(30, ((PyObject *)__pyx_n_s__T_data), ((PyObject *)__pyx_n_s__T_indices), ((PyObject *)__pyx_n_s__T_indptr), ((PyObject *)__pyx_n_s__SV_data), ((PyObject *)__pyx_n_s__SV_indices), ((PyObject *)__pyx_n_s__SV_indptr), ((PyObject *)__pyx_n_s__sv_coef), ((PyObject *)__pyx_n_s__intercept), ((PyObject *)__pyx_n_s__svm_type), ((PyObject *)__pyx_n_s__kernel_type), ((PyObject *)__pyx_n_s__degree), ((PyObject *)__pyx_n_s__gamma), ((PyObject *)__pyx_n_s__coef0), ((PyObject *)__pyx_n_s__eps), ((PyObject *)__pyx_n_s__C), ((PyObject *)__pyx_n_s__class_weight), ((PyObject *)__pyx_n_s__nu), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__shrinking), ((PyObject *)__pyx_n_s__probability), ((PyObject *)__pyx_n_s__nSV), ((PyObject *)__pyx_n_s__label), ((PyObject *)__pyx_n_s__probA), ((PyObject *)__pyx_n_s__probB), ((PyObject *)__pyx_n_s__dec_values), ((PyObject *)__pyx_n_s__param), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__class_weight_label), ((PyObject *)__pyx_n_s__n_class), ((PyObject *)__pyx_n_s__rv)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_31 = PyTuple_Pack(29, ((PyObject *)__pyx_n_s__T_data), ((PyObject *)__pyx_n_s__T_indices), ((PyObject *)__pyx_n_s__T_indptr), ((PyObject *)__pyx_n_s__SV_data), ((PyObject *)__pyx_n_s__SV_indices), ((PyObject *)__pyx_n_s__SV_indptr), ((PyObject *)__pyx_n_s__sv_coef), ((PyObject *)__pyx_n_s__intercept), ((PyObject *)__pyx_n_s__svm_type), ((PyObject *)__pyx_n_s__kernel_type), ((PyObject *)__pyx_n_s__degree), ((PyObject *)__pyx_n_s__gamma), ((PyObject *)__pyx_n_s__coef0), ((PyObject *)__pyx_n_s__eps), ((PyObject *)__pyx_n_s__C), ((PyObject *)__pyx_n_s__class_weight), ((PyObject *)__pyx_n_s__nu), ((PyObject *)__pyx_n_s__p), ((PyObject *)__pyx_n_s__shrinking), ((PyObject *)__pyx_n_s__probability), ((PyObject *)__pyx_n_s__nSV), ((PyObject *)__pyx_n_s__probA), ((PyObject *)__pyx_n_s__probB), ((PyObject *)__pyx_n_s__dec_values), ((PyObject *)__pyx_n_s__param), ((PyObject *)__pyx_n_s__model), ((PyObject *)__pyx_n_s__class_weight_label), ((PyObject *)__pyx_n_s__n_class), ((PyObject *)__pyx_n_s__rv)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_31); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); - __pyx_k_codeobj_32 = (PyObject*)__Pyx_PyCode_New(24, 0, 30, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s_33, 295, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_32 = (PyObject*)__Pyx_PyCode_New(23, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s_33, 288, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm_sparse.pyx":353 + /* "sklearn/svm/libsvm_sparse.pyx":345 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< * """ * Control verbosity of libsvm library */ - __pyx_k_tuple_34 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__verbosity), ((PyObject *)__pyx_n_s__verbosity)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_tuple_34 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__verbosity), ((PyObject *)__pyx_n_s__verbosity)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_34); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34)); - __pyx_k_codeobj_35 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__set_verbosity_wrap, 353, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_k_codeobj_35 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__set_verbosity_wrap, 345, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -6865,7 +6779,7 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(void) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":65 + /* "sklearn/svm/libsvm_sparse.pyx":64 * * * np.import_array() # <<<<<<<<<<<<<< @@ -6874,52 +6788,52 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(void) */ import_array(); - /* "sklearn/svm/libsvm_sparse.pyx":68 + /* "sklearn/svm/libsvm_sparse.pyx":67 * * * def libsvm_sparse_train ( int n_features, # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] values, * np.ndarray[np.int32_t, ndim=1, mode='c'] indices, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_1libsvm_sparse_train, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_1libsvm_sparse_train, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__libsvm_sparse_train, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__libsvm_sparse_train, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":218 + /* "sklearn/svm/libsvm_sparse.pyx":212 * * * def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, # <<<<<<<<<<<<<< * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indptr, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_3libsvm_sparse_predict, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_30, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_30, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":295 + /* "sklearn/svm/libsvm_sparse.pyx":288 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_proba, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_5libsvm_sparse_predict_proba, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_33, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_33, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":353 + /* "sklearn/svm/libsvm_sparse.pyx":345 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< * """ * Control verbosity of libsvm library */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_7set_verbosity_wrap, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_7set_verbosity_wrap, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_verbosity_wrap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_verbosity_wrap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/svm/libsvm_sparse.pyx":1 diff --git a/sklearn/svm/libsvm_sparse.pyx b/sklearn/svm/libsvm_sparse.pyx index 5f5d0e62c6e35..590dbb03808e0 100644 --- a/sklearn/svm/libsvm_sparse.pyx +++ b/sklearn/svm/libsvm_sparse.pyx @@ -27,7 +27,7 @@ cdef extern from "libsvm_sparse_helper.c": char *SV_data, np.npy_intp *SV_indices_dims, char *SV_indices, np.npy_intp *SV_intptr_dims, char *SV_intptr, - char *sv_coef, char *rho, char *nSV, char *label, + char *sv_coef, char *rho, char *nSV, char *probA, char *probB) svm_parameter *set_parameter (int , int , int , double, double , double , double , double , double, @@ -50,7 +50,6 @@ cdef extern from "libsvm_sparse_helper.c": svm_csr_model *model, int n_features) np.npy_intp get_nonzero_SV ( svm_csr_model *) void copy_nSV (char *, svm_csr_model *) - void copy_label (char *, svm_csr_model *) void copy_probA (char *, svm_csr_model *, np.npy_intp *) void copy_probB (char *, svm_csr_model *, np.npy_intp *) np.npy_intp get_l (svm_csr_model *) @@ -187,11 +186,6 @@ def libsvm_sparse_train ( int n_features, n_class_SV = np.empty(n_class, dtype=np.int32) copy_nSV(n_class_SV.data, model) - # # copy label - cdef np.ndarray label - label = np.empty((n_class), dtype=np.int32) - copy_label(label.data, model) - # # copy probabilities cdef np.ndarray probA, probB if probability != 0: @@ -211,7 +205,7 @@ def libsvm_sparse_train ( int n_features, free_problem(problem) free_param(param) - return (support, support_vectors_, sv_coef_data, intercept, label, n_class_SV, + return (support, support_vectors_, sv_coef_data, intercept, n_class_SV, probA, probB, fit_status) @@ -230,7 +224,6 @@ def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, double nu, double p, int shrinking, int probability, np.ndarray[np.int32_t, ndim=1, mode='c'] nSV, - np.ndarray[np.int32_t, ndim=1, mode='c'] label, np.ndarray[np.float64_t, ndim=1, mode='c'] probA, np.ndarray[np.float64_t, ndim=1, mode='c'] probB): """ @@ -273,7 +266,7 @@ def libsvm_sparse_predict (np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, SV_indices.shape, SV_indices.data, SV_indptr.shape, SV_indptr.data, sv_coef.data, intercept.data, - nSV.data, label.data, probA.data, probB.data) + nSV.data, probA.data, probB.data) #TODO: use check_model dec_values = np.empty(T_indptr.shape[0]-1) with nogil: @@ -307,7 +300,6 @@ def libsvm_sparse_predict_proba( np.ndarray[np.float64_t, ndim=1] class_weight, double nu, double p, int shrinking, int probability, np.ndarray[np.int32_t, ndim=1, mode='c'] nSV, - np.ndarray[np.int32_t, ndim=1, mode='c'] label, np.ndarray[np.float64_t, ndim=1, mode='c'] probA, np.ndarray[np.float64_t, ndim=1, mode='c'] probB): """ @@ -330,7 +322,7 @@ def libsvm_sparse_predict_proba( SV_indices.shape, SV_indices.data, SV_indptr.shape, SV_indptr.data, sv_coef.data, intercept.data, - nSV.data, label.data, probA.data, probB.data) + nSV.data, probA.data, probB.data) #TODO: use check_model cdef np.npy_intp n_class = get_nr(model) cdef int rv diff --git a/sklearn/svm/src/libsvm/libsvm_helper.c b/sklearn/svm/src/libsvm/libsvm_helper.c index 41fd2eada4aa2..b61cfd2c51b58 100644 --- a/sklearn/svm/src/libsvm/libsvm_helper.c +++ b/sklearn/svm/src/libsvm/libsvm_helper.c @@ -108,7 +108,7 @@ struct svm_model *set_model(struct svm_parameter *param, int nr_class, char *SV, npy_intp *SV_dims, char *support, npy_intp *support_dims, npy_intp *sv_coef_strides, - char *sv_coef, char *rho, char *nSV, char *label, + char *sv_coef, char *rho, char *nSV, char *probA, char *probB) { struct svm_model *model; @@ -148,7 +148,8 @@ struct svm_model *set_model(struct svm_parameter *param, int nr_class, */ if (param->svm_type < 2) { memcpy(model->nSV, nSV, model->nr_class * sizeof(int)); - memcpy(model->label, label, model->nr_class * sizeof(int)); + for(i=0; i < model->nr_class; i++) + model->label[i] = i; } for (i=0; i < model->nr_class-1; i++) { @@ -276,16 +277,6 @@ void copy_nSV(char *data, struct svm_model *model) memcpy(data, model->nSV, model->nr_class * sizeof(int)); } -/* - * same as above with model->label - * TODO: maybe merge into the previous? - */ -void copy_label(char *data, struct svm_model *model) -{ - if (model->label == NULL) return; - memcpy(data, model->label, model->nr_class * sizeof(int)); -} - void copy_probA(char *data, struct svm_model *model, npy_intp * dims) { memcpy(data, model->probA, dims[0] * sizeof(double)); diff --git a/sklearn/svm/src/libsvm/libsvm_sparse_helper.c b/sklearn/svm/src/libsvm/libsvm_sparse_helper.c index a68f349d17e38..cd769f2584762 100644 --- a/sklearn/svm/src/libsvm/libsvm_sparse_helper.c +++ b/sklearn/svm/src/libsvm/libsvm_sparse_helper.c @@ -102,7 +102,7 @@ struct svm_csr_model *csr_set_model(struct svm_parameter *param, int nr_class, char *SV_data, npy_intp *SV_indices_dims, char *SV_indices, npy_intp *SV_indptr_dims, char *SV_intptr, - char *sv_coef, char *rho, char *nSV, char *label, + char *sv_coef, char *rho, char *nSV, char *probA, char *probB) { struct svm_csr_model *model; @@ -136,7 +136,8 @@ struct svm_csr_model *csr_set_model(struct svm_parameter *param, int nr_class, */ if (param->svm_type < 2) { memcpy(model->nSV, nSV, model->nr_class * sizeof(int)); - memcpy(model->label, label, model->nr_class * sizeof(int)); + for(i=0; i < model->nr_class; i++) + model->label[i] = i; } for (i=0; i < model->nr_class-1; i++) { diff --git a/sklearn/tests/test_cross_validation.py b/sklearn/tests/test_cross_validation.py index a4a0f4358bb1b..4fc06c71349ab 100644 --- a/sklearn/tests/test_cross_validation.py +++ b/sklearn/tests/test_cross_validation.py @@ -35,6 +35,9 @@ from sklearn.linear_model import Ridge from sklearn.svm import SVC +from sklearn.preprocessing import Imputer +from sklearn.pipeline import Pipeline + class MockListClassifier(BaseEstimator): """Dummy classifier to test the cross-validation. @@ -852,3 +855,35 @@ def test_safe_split_with_precomputed_kernel(): X_te, y_te = cval._safe_split(clf, X, y, te, tr) K_te, y_te2 = cval._safe_split(clfp, K, y, te, tr) assert_array_almost_equal(K_te, np.dot(X_te, X_tr.T)) + + +def test_cross_val_score_allow_nans(): + # Check that cross_val_score allows input data with NaNs + X = np.arange(200, dtype=np.float64).reshape(10, -1) + X[2, :] = np.nan + y = np.repeat([0, 1], X.shape[0]/2) + p = Pipeline([ + ('imputer', Imputer(strategy='mean', missing_values='NaN')), + ('classifier', MockClassifier()), + ]) + cval.cross_val_score(p, X, y, cv=5) + + +def test_train_test_split_allow_nans(): + # Check that train_test_split allows input data with NaNs + X = np.arange(200, dtype=np.float64).reshape(10, -1) + X[2, :] = np.nan + y = np.repeat([0, 1], X.shape[0]/2) + split = cval.train_test_split(X, y, test_size=0.2, random_state=42) + + +def test_permutation_test_score_allow_nans(): + # Check that permutation_test_score allows input data with NaNs + X = np.arange(200, dtype=np.float64).reshape(10, -1) + X[2, :] = np.nan + y = np.repeat([0, 1], X.shape[0]/2) + p = Pipeline([ + ('imputer', Imputer(strategy='mean', missing_values='NaN')), + ('classifier', MockClassifier()), + ]) + cval.permutation_test_score(p, X, y, cv=5) diff --git a/sklearn/tests/test_grid_search.py b/sklearn/tests/test_grid_search.py index c6c4130a88455..61f2389779e7f 100644 --- a/sklearn/tests/test_grid_search.py +++ b/sklearn/tests/test_grid_search.py @@ -39,6 +39,8 @@ from sklearn.metrics import make_scorer from sklearn.metrics import roc_auc_score from sklearn.cross_validation import KFold, StratifiedKFold +from sklearn.preprocessing import Imputer +from sklearn.pipeline import Pipeline # Neither of the following two estimators inherit from BaseEstimator, @@ -654,3 +656,15 @@ def test_predict_proba_disabled(): clf = SVC(probability=False) gs = GridSearchCV(clf, {}, cv=2).fit(X, y) assert_false(hasattr(gs, "predict_proba")) + + +def test_grid_search_allows_nans(): + """ Test GridSearchCV with Imputer """ + X = np.arange(20, dtype=np.float64).reshape(5, -1) + X[2, :] = np.nan + y = [0, 0, 1, 1, 1] + p = Pipeline([ + ('imputer', Imputer(strategy='mean', missing_values='NaN')), + ('classifier', MockClassifier()), + ]) + gs = GridSearchCV(p, {'classifier__foo_param': [1, 2, 3]}, cv=2).fit(X, y) diff --git a/sklearn/tree/_tree.c b/sklearn/tree/_tree.c index 9452f1b7d8875..016fb3469067e 100644 --- a/sklearn/tree/_tree.c +++ b/sklearn/tree/_tree.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.20.1 on Sun Mar 30 11:10:50 2014 */ +/* Generated by Cython 0.20.1 on Sun Apr 13 20:32:35 2014 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -597,7 +597,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -606,7 +606,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -615,7 +615,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -624,7 +624,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -633,7 +633,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -642,7 +642,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -651,7 +651,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -660,7 +660,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -669,7 +669,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -678,7 +678,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -687,7 +687,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -696,7 +696,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -705,7 +705,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -714,7 +714,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -723,7 +723,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -732,7 +732,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -741,7 +741,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -750,7 +750,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -759,7 +759,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -768,7 +768,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -777,7 +777,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -879,7 +879,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter; struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -888,7 +888,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestFirstTreeBuilder; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -897,7 +897,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -906,7 +906,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -949,6 +949,8 @@ struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord { __pyx_t_7sklearn_4tree_6_utils_SIZE_t depth; int is_leaf; double impurity; + double impurity_left; + double impurity_right; double improvement; }; struct __pyx_t_7sklearn_4tree_5_tree_Node; @@ -958,7 +960,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_11TreeBuilder_build; struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build; struct __pyx_opt_args_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build; -/* "sklearn/tree/_tree.pxd":136 +/* "sklearn/tree/_tree.pxd":139 * # ============================================================================= * * cdef struct Node: # <<<<<<<<<<<<<< @@ -971,11 +973,11 @@ struct __pyx_t_7sklearn_4tree_5_tree_Node { __pyx_t_7sklearn_4tree_5_tree_SIZE_t feature; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t threshold; __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t impurity; - __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_samples; - __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t weighted_n_samples; + __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_node_samples; + __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t weighted_n_node_samples; }; -/* "sklearn/tree/_tree.pxd":173 +/* "sklearn/tree/_tree.pxd":176 * double weighted_n_samples) nogil * cdef void _resize(self, SIZE_t capacity) * cdef int _resize_c(self, SIZE_t capacity=*) nogil # <<<<<<<<<<<<<< @@ -987,7 +989,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":180 +/* "sklearn/tree/_tree.pxd":183 * 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=*) # <<<<<<<<<<<<<< @@ -999,7 +1001,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_4Tree_compute_feature_importances { PyObject *normalize; }; -/* "sklearn/tree/_tree.pxd":201 +/* "sklearn/tree/_tree.pxd":204 * cdef SIZE_t max_depth # Maximal tree depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1021,7 +1023,7 @@ enum { __pyx_e_7sklearn_4tree_5_tree_RAND_R_MAX = 0x7FFFFFFF }; -/* "sklearn/tree/_tree.pyx":1844 +/* "sklearn/tree/_tree.pyx":1860 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1033,7 +1035,7 @@ struct __pyx_opt_args_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build { PyArrayObject *sample_weight; }; -/* "sklearn/tree/_tree.pyx":2010 +/* "sklearn/tree/_tree.pyx":2027 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -1061,7 +1063,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_Stack { }; -/* "sklearn/tree/_utils.pxd":56 +/* "sklearn/tree/_utils.pxd":58 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1096,13 +1098,14 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Criterion { __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":65 +/* "sklearn/tree/_tree.pxd":67 * # ============================================================================= * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1119,6 +1122,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { __pyx_t_7sklearn_4tree_5_tree_UINT32_t rand_r_state; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_samples; + double weighted_n_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *features; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *constant_features; __pyx_t_7sklearn_4tree_5_tree_SIZE_t n_features; @@ -1134,8 +1138,8 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Splitter { }; -/* "sklearn/tree/_tree.pxd":147 - * DOUBLE_t weighted_n_samples # Weighted number of samples at the node +/* "sklearn/tree/_tree.pxd":150 + * DOUBLE_t weighted_n_node_samples # Weighted number of samples at the node * * cdef class Tree: # <<<<<<<<<<<<<< * # The Tree object is a binary tree structure constructed by the @@ -1157,7 +1161,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Tree { }; -/* "sklearn/tree/_tree.pxd":187 +/* "sklearn/tree/_tree.pxd":190 * # ============================================================================= * * cdef class TreeBuilder: # <<<<<<<<<<<<<< @@ -1174,7 +1178,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder { }; -/* "sklearn/tree/_tree.pyx":136 +/* "sklearn/tree/_tree.pyx":141 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1191,7 +1195,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion { }; -/* "sklearn/tree/_tree.pyx":354 +/* "sklearn/tree/_tree.pyx":360 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1203,7 +1207,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Entropy { }; -/* "sklearn/tree/_tree.pyx":445 +/* "sklearn/tree/_tree.pyx":451 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1215,7 +1219,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_Gini { }; -/* "sklearn/tree/_tree.pyx":539 +/* "sklearn/tree/_tree.pyx":545 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1238,7 +1242,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion { }; -/* "sklearn/tree/_tree.pyx":820 +/* "sklearn/tree/_tree.pyx":828 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1250,7 +1254,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_MSE { }; -/* "sklearn/tree/_tree.pyx":861 +/* "sklearn/tree/_tree.pyx":869 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1262,7 +1266,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_FriedmanMSE { }; -/* "sklearn/tree/_tree.pyx":1020 +/* "sklearn/tree/_tree.pyx":1036 * * * cdef class BestSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1274,7 +1278,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_BestSplitter { }; -/* "sklearn/tree/_tree.pyx":1336 +/* "sklearn/tree/_tree.pyx":1352 * * * cdef class RandomSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1286,7 +1290,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_RandomSplitter { }; -/* "sklearn/tree/_tree.pyx":1555 +/* "sklearn/tree/_tree.pyx":1571 * * * cdef class PresortBestSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1304,7 +1308,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_PresortBestSplitter { }; -/* "sklearn/tree/_tree.pyx":1834 +/* "sklearn/tree/_tree.pyx":1850 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1316,7 +1320,7 @@ struct __pyx_obj_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { }; -/* "sklearn/tree/_tree.pyx":1991 +/* "sklearn/tree/_tree.pyx":2008 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1346,7 +1350,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "sklearn/tree/_utils.pxd":56 +/* "sklearn/tree/_utils.pxd":58 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -1356,7 +1360,7 @@ static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7skle 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); + 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; @@ -1371,7 +1375,7 @@ static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap *__pyx_vtabpt */ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Criterion { - void (*init)(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 *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); + void (*init)(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); void (*reset)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *); void (*update)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t); double (*node_impurity)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *); @@ -1382,7 +1386,7 @@ 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":898 +/* "sklearn/tree/_tree.pyx":906 * # ============================================================================= * * cdef class Splitter: # <<<<<<<<<<<<<< @@ -1400,7 +1404,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Splitter *__pyx_vtabptr_7sklearn_4tree_5_tree_Splitter; -/* "sklearn/tree/_tree.pyx":2199 +/* "sklearn/tree/_tree.pyx":2223 * # ============================================================================= * * cdef class Tree: # <<<<<<<<<<<<<< @@ -1421,7 +1425,7 @@ 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":1823 +/* "sklearn/tree/_tree.pyx":1839 * # Tree builders * # ============================================================================= * cdef class TreeBuilder: # <<<<<<<<<<<<<< @@ -1435,7 +1439,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_TreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder; -/* "sklearn/tree/_tree.pyx":136 +/* "sklearn/tree/_tree.pyx":141 * * * cdef class ClassificationCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1449,7 +1453,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion; -/* "sklearn/tree/_tree.pyx":354 +/* "sklearn/tree/_tree.pyx":360 * * * cdef class Entropy(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1463,7 +1467,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Entropy *__pyx_vtabptr_7sklearn_4tree_5_tree_Entropy; -/* "sklearn/tree/_tree.pyx":445 +/* "sklearn/tree/_tree.pyx":451 * * * cdef class Gini(ClassificationCriterion): # <<<<<<<<<<<<<< @@ -1477,7 +1481,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_Gini *__pyx_vtabptr_7sklearn_4tree_5_tree_Gini; -/* "sklearn/tree/_tree.pyx":539 +/* "sklearn/tree/_tree.pyx":545 * * * cdef class RegressionCriterion(Criterion): # <<<<<<<<<<<<<< @@ -1491,7 +1495,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion; -/* "sklearn/tree/_tree.pyx":820 +/* "sklearn/tree/_tree.pyx":828 * * * cdef class MSE(RegressionCriterion): # <<<<<<<<<<<<<< @@ -1505,7 +1509,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_MSE *__pyx_vtabptr_7sklearn_4tree_5_tree_MSE; -/* "sklearn/tree/_tree.pyx":861 +/* "sklearn/tree/_tree.pyx":869 * * * cdef class FriedmanMSE(MSE): # <<<<<<<<<<<<<< @@ -1519,7 +1523,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_FriedmanMSE *__pyx_vtabptr_7sklearn_4tree_5_tree_FriedmanMSE; -/* "sklearn/tree/_tree.pyx":1020 +/* "sklearn/tree/_tree.pyx":1036 * * * cdef class BestSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1533,7 +1537,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_BestSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter; -/* "sklearn/tree/_tree.pyx":1336 +/* "sklearn/tree/_tree.pyx":1352 * * * cdef class RandomSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1547,7 +1551,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":1555 +/* "sklearn/tree/_tree.pyx":1571 * * * cdef class PresortBestSplitter(Splitter): # <<<<<<<<<<<<<< @@ -1561,7 +1565,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_PresortBestSplitter *__pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter; -/* "sklearn/tree/_tree.pyx":1834 +/* "sklearn/tree/_tree.pyx":1850 * # Depth first builder --------------------------------------------------------- * * cdef class DepthFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -1575,7 +1579,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder { static struct __pyx_vtabstruct_7sklearn_4tree_5_tree_DepthFirstTreeBuilder *__pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder; -/* "sklearn/tree/_tree.pyx":1991 +/* "sklearn/tree/_tree.pyx":2008 * * * cdef class BestFirstTreeBuilder(TreeBuilder): # <<<<<<<<<<<<<< @@ -2226,7 +2230,6 @@ static char __pyx_k_criterion[] = "criterion"; static char __pyx_k_max_depth[] = "max_depth"; static char __pyx_k_n_classes[] = "n_classes"; static char __pyx_k_n_outputs[] = "n_outputs"; -static char __pyx_k_n_samples[] = "n_samples"; static char __pyx_k_normalize[] = "normalize"; static char __pyx_k_threshold[] = "threshold"; static char __pyx_k_NODE_DTYPE[] = "NODE_DTYPE"; @@ -2247,12 +2250,13 @@ static char __pyx_k_sample_weight[] = "sample_weight"; static char __pyx_k_TREE_UNDEFINED[] = "TREE_UNDEFINED"; static char __pyx_k_asfortranarray[] = "asfortranarray"; static char __pyx_k_max_leaf_nodes[] = "max_leaf_nodes"; +static char __pyx_k_n_node_samples[] = "n_node_samples"; static char __pyx_k_min_samples_leaf[] = "min_samples_leaf"; static char __pyx_k_ascontiguousarray[] = "ascontiguousarray"; static char __pyx_k_min_samples_split[] = "min_samples_split"; static char __pyx_k_pyx_releasebuffer[] = "__pyx_releasebuffer"; static char __pyx_k_resizing_tree_to_d[] = "resizing tree to %d"; -static char __pyx_k_weighted_n_samples[] = "weighted_n_samples"; +static char __pyx_k_weighted_n_node_samples[] = "weighted_n_node_samples"; static char __pyx_k_failed_to_allocate_d_bytes[] = "failed to 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"; @@ -2316,8 +2320,8 @@ static PyObject *__pyx_n_s_min_samples_split; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_n_classes; static PyObject *__pyx_n_s_n_features; +static PyObject *__pyx_n_s_n_node_samples; static PyObject *__pyx_n_s_n_outputs; -static PyObject *__pyx_n_s_n_samples; static PyObject *__pyx_n_s_names; static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; @@ -2349,7 +2353,7 @@ static PyObject *__pyx_n_s_threshold; static PyObject *__pyx_n_s_tree; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; static PyObject *__pyx_n_s_values; -static PyObject *__pyx_n_s_weighted_n_samples; +static PyObject *__pyx_n_s_weighted_n_node_samples; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_int_0; @@ -2370,16 +2374,16 @@ static PyObject *__pyx_tuple__9; * """Interface for impurity criteria.""" * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< - * SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: - * """Initialize the criterion at node samples[start:end] and + * double weighted_n_samples, SIZE_t* samples, SIZE_t start, + * SIZE_t end) nogil: */ -static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_init(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end) { +static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_init(CYTHON_UNUSED struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight, CYTHON_UNUSED double __pyx_v_weighted_n_samples, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, CYTHON_UNUSED __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end) { /* function exit code */ } -/* "sklearn/tree/_tree.pyx":97 +/* "sklearn/tree/_tree.pyx":98 * pass * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -2392,7 +2396,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_reset(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":101 +/* "sklearn/tree/_tree.pyx":102 * pass * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -2405,7 +2409,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_update(CYTHON_UNUSED struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":106 +/* "sklearn/tree/_tree.pyx":107 * pass * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -2421,7 +2425,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_impurity(CYTHON_UNUS return __pyx_r; } -/* "sklearn/tree/_tree.pyx":111 +/* "sklearn/tree/_tree.pyx":112 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -2434,7 +2438,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_children_impurity(CYTHON_UN /* function exit code */ } -/* "sklearn/tree/_tree.pyx":117 +/* "sklearn/tree/_tree.pyx":118 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -2447,12 +2451,12 @@ static void __pyx_f_7sklearn_4tree_5_tree_9Criterion_node_value(CYTHON_UNUSED st /* function exit code */ } -/* "sklearn/tree/_tree.pyx":121 +/* "sklearn/tree/_tree.pyx":122 * pass * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< - * """Impurity improvement, i.e. - * impurity - (left impurity + right impurity).""" + * """Weighted impurity improvement, i.e. + * */ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *__pyx_v_self, double __pyx_v_impurity) { @@ -2460,31 +2464,31 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru double __pyx_v_impurity_right; double __pyx_r; - /* "sklearn/tree/_tree.pyx":127 + /* "sklearn/tree/_tree.pyx":134 * cdef double impurity_right * * self.children_impurity(&impurity_left, &impurity_right) # <<<<<<<<<<<<<< * - * return (impurity - + * return ((self.weighted_n_node_samples / self.weighted_n_samples) * */ ((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":131 - * return (impurity - - * (self.weighted_n_right / self.weighted_n_node_samples * - * impurity_right) - # <<<<<<<<<<<<<< - * (self.weighted_n_left / self.weighted_n_node_samples * - * impurity_left)) + /* "sklearn/tree/_tree.pyx":136 + * self.children_impurity(&impurity_left, &impurity_right) + * + * return ((self.weighted_n_node_samples / self.weighted_n_samples) * # <<<<<<<<<<<<<< + * (impurity - self.weighted_n_right / self.weighted_n_node_samples * impurity_right + * - self.weighted_n_left / self.weighted_n_node_samples * impurity_left)) */ - __pyx_r = ((__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)); + __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":121 + /* "sklearn/tree/_tree.pyx":122 * pass * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< - * """Impurity improvement, i.e. - * impurity - (left impurity + right impurity).""" + * """Weighted impurity improvement, i.e. + * */ /* function exit code */ @@ -2492,7 +2496,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_9Criterion_impurity_improvement(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":144 +/* "sklearn/tree/_tree.pyx":149 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< @@ -2531,11 +2535,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 = 144; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __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 = 144; __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 = 149; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2543,18 +2547,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 = 144; __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 = 149; __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 = 144; __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 = 149; __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 = 145; __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 = 150; __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 */ @@ -2593,11 +2597,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 = 144; __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 = 149; __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":147 + /* "sklearn/tree/_tree.pyx":152 * np.ndarray[SIZE_t, ndim=1] n_classes): * # Default values * self.y = NULL # <<<<<<<<<<<<<< @@ -2606,7 +2610,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":148 + /* "sklearn/tree/_tree.pyx":153 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -2615,7 +2619,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":149 + /* "sklearn/tree/_tree.pyx":154 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -2624,7 +2628,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":151 + /* "sklearn/tree/_tree.pyx":156 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -2633,7 +2637,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":152 + /* "sklearn/tree/_tree.pyx":157 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -2642,7 +2646,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":153 + /* "sklearn/tree/_tree.pyx":158 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -2651,7 +2655,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":154 + /* "sklearn/tree/_tree.pyx":159 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -2660,7 +2664,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":156 + /* "sklearn/tree/_tree.pyx":161 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -2669,7 +2673,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":157 + /* "sklearn/tree/_tree.pyx":162 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -2678,7 +2682,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":158 + /* "sklearn/tree/_tree.pyx":163 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -2687,7 +2691,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":159 + /* "sklearn/tree/_tree.pyx":164 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -2696,7 +2700,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":160 + /* "sklearn/tree/_tree.pyx":165 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -2705,7 +2709,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":162 + /* "sklearn/tree/_tree.pyx":167 * self.weighted_n_right = 0.0 * * self.label_count_left = NULL # <<<<<<<<<<<<<< @@ -2714,7 +2718,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_left = NULL; - /* "sklearn/tree/_tree.pyx":163 + /* "sklearn/tree/_tree.pyx":168 * * self.label_count_left = NULL * self.label_count_right = NULL # <<<<<<<<<<<<<< @@ -2723,7 +2727,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_right = NULL; - /* "sklearn/tree/_tree.pyx":164 + /* "sklearn/tree/_tree.pyx":169 * self.label_count_left = NULL * self.label_count_right = NULL * self.label_count_total = NULL # <<<<<<<<<<<<<< @@ -2732,7 +2736,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->label_count_total = NULL; - /* "sklearn/tree/_tree.pyx":167 + /* "sklearn/tree/_tree.pyx":172 * * # Count labels for each output * self.n_classes = malloc(n_outputs * sizeof(SIZE_t)) # <<<<<<<<<<<<<< @@ -2741,7 +2745,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_self->n_classes = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)malloc((__pyx_v_n_outputs * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t))))); - /* "sklearn/tree/_tree.pyx":168 + /* "sklearn/tree/_tree.pyx":173 * # Count labels for each output * self.n_classes = malloc(n_outputs * sizeof(SIZE_t)) * if self.n_classes == NULL: # <<<<<<<<<<<<<< @@ -2751,17 +2755,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_1 = ((__pyx_v_self->n_classes == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":169 + /* "sklearn/tree/_tree.pyx":174 * self.n_classes = malloc(n_outputs * sizeof(SIZE_t)) * if self.n_classes == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef SIZE_t k = 0 */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":171 + /* "sklearn/tree/_tree.pyx":176 * raise MemoryError() * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -2770,7 +2774,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":172 + /* "sklearn/tree/_tree.pyx":177 * * cdef SIZE_t k = 0 * cdef SIZE_t label_count_stride = 0 # <<<<<<<<<<<<<< @@ -2779,7 +2783,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st */ __pyx_v_label_count_stride = 0; - /* "sklearn/tree/_tree.pyx":174 + /* "sklearn/tree/_tree.pyx":179 * cdef SIZE_t label_count_stride = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -2790,7 +2794,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":175 + /* "sklearn/tree/_tree.pyx":180 * * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -2800,7 +2804,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":177 + /* "sklearn/tree/_tree.pyx":182 * self.n_classes[k] = n_classes[k] * * if n_classes[k] > label_count_stride: # <<<<<<<<<<<<<< @@ -2811,7 +2815,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_1 = (((*__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_1) { - /* "sklearn/tree/_tree.pyx":178 + /* "sklearn/tree/_tree.pyx":183 * * if n_classes[k] > label_count_stride: * label_count_stride = n_classes[k] # <<<<<<<<<<<<<< @@ -2825,7 +2829,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_L6:; } - /* "sklearn/tree/_tree.pyx":180 + /* "sklearn/tree/_tree.pyx":185 * label_count_stride = n_classes[k] * * self.label_count_stride = label_count_stride # <<<<<<<<<<<<<< @@ -2834,7 +2838,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":183 + /* "sklearn/tree/_tree.pyx":188 * * # Allocate counters * cdef SIZE_t n_elements = n_outputs * label_count_stride # <<<<<<<<<<<<<< @@ -2843,7 +2847,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":184 + /* "sklearn/tree/_tree.pyx":189 * # Allocate counters * cdef SIZE_t n_elements = n_outputs * label_count_stride * self.label_count_left = calloc(n_elements, sizeof(double)) # <<<<<<<<<<<<<< @@ -2852,7 +2856,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":185 + /* "sklearn/tree/_tree.pyx":190 * 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)) # <<<<<<<<<<<<<< @@ -2861,7 +2865,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":186 + /* "sklearn/tree/_tree.pyx":191 * 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)) # <<<<<<<<<<<<<< @@ -2870,7 +2874,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":189 + /* "sklearn/tree/_tree.pyx":194 * * # Check for allocation errors * if (self.label_count_left == NULL or # <<<<<<<<<<<<<< @@ -2880,7 +2884,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_1 = ((__pyx_v_self->label_count_left == NULL) != 0); if (!__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":190 + /* "sklearn/tree/_tree.pyx":195 * # Check for allocation errors * if (self.label_count_left == NULL or * self.label_count_right == NULL or # <<<<<<<<<<<<<< @@ -2890,7 +2894,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st __pyx_t_7 = ((__pyx_v_self->label_count_right == NULL) != 0); if (!__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":191 + /* "sklearn/tree/_tree.pyx":196 * if (self.label_count_left == NULL or * self.label_count_right == NULL or * self.label_count_total == NULL): # <<<<<<<<<<<<<< @@ -2908,17 +2912,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st } if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":192 + /* "sklearn/tree/_tree.pyx":197 * 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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":144 + /* "sklearn/tree/_tree.pyx":149 * cdef double* label_count_total * * def __cinit__(self, SIZE_t n_outputs, # <<<<<<<<<<<<<< @@ -2944,7 +2948,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion___cinit__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":194 +/* "sklearn/tree/_tree.pyx":199 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2967,7 +2971,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":196 + /* "sklearn/tree/_tree.pyx":201 * def __dealloc__(self): * """Destructor.""" * free(self.n_classes) # <<<<<<<<<<<<<< @@ -2976,7 +2980,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->n_classes); - /* "sklearn/tree/_tree.pyx":197 + /* "sklearn/tree/_tree.pyx":202 * """Destructor.""" * free(self.n_classes) * free(self.label_count_left) # <<<<<<<<<<<<<< @@ -2985,7 +2989,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_left); - /* "sklearn/tree/_tree.pyx":198 + /* "sklearn/tree/_tree.pyx":203 * free(self.n_classes) * free(self.label_count_left) * free(self.label_count_right) # <<<<<<<<<<<<<< @@ -2994,7 +2998,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_right); - /* "sklearn/tree/_tree.pyx":199 + /* "sklearn/tree/_tree.pyx":204 * free(self.label_count_left) * free(self.label_count_right) * free(self.label_count_total) # <<<<<<<<<<<<<< @@ -3003,7 +3007,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ */ free(__pyx_v_self->label_count_total); - /* "sklearn/tree/_tree.pyx":194 + /* "sklearn/tree/_tree.pyx":199 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3015,7 +3019,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_2__dealloc_ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":201 +/* "sklearn/tree/_tree.pyx":206 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3047,7 +3051,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":202 + /* "sklearn/tree/_tree.pyx":207 * * def __reduce__(self): * return (ClassificationCriterion, # <<<<<<<<<<<<<< @@ -3056,34 +3060,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":203 + /* "sklearn/tree/_tree.pyx":208 * 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 = 203; __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 = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":204 + /* "sklearn/tree/_tree.pyx":209 * 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 = 204; __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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":203 + /* "sklearn/tree/_tree.pyx":208 * 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 = 203; __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 = 208; __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); @@ -3092,27 +3096,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":205 + /* "sklearn/tree/_tree.pyx":210 * (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 = 205; __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 = 210; __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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 210; __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":202 + /* "sklearn/tree/_tree.pyx":207 * * 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 = 202; __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 = 207; __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))); @@ -3127,7 +3131,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":201 + /* "sklearn/tree/_tree.pyx":206 * free(self.label_count_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -3148,7 +3152,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_4__red return __pyx_r; } -/* "sklearn/tree/_tree.pyx":207 +/* "sklearn/tree/_tree.pyx":212 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3178,7 +3182,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":208 + /* "sklearn/tree/_tree.pyx":213 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -3186,13 +3190,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 = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __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":207 + /* "sklearn/tree/_tree.pyx":212 * self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -3211,7 +3215,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_6__get return __pyx_r; } -/* "sklearn/tree/_tree.pyx":210 +/* "sklearn/tree/_tree.pyx":215 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -3244,15 +3248,15 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_23ClassificationCriterion_8__set return __pyx_r; } -/* "sklearn/tree/_tree.pyx":213 +/* "sklearn/tree/_tree.pyx":218 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< - * DOUBLE_t* sample_weight, SIZE_t* samples, - * SIZE_t start, SIZE_t end) nogil: + * DOUBLE_t* sample_weight, double weighted_n_samples, + * SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: */ -static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end) { +static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight, double __pyx_v_weighted_n_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end) { double __pyx_v_weighted_n_node_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_n_classes; @@ -3273,7 +3277,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":219 + /* "sklearn/tree/_tree.pyx":224 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -3282,7 +3286,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":220 + /* "sklearn/tree/_tree.pyx":225 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -3291,7 +3295,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":221 + /* "sklearn/tree/_tree.pyx":226 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -3300,7 +3304,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":222 + /* "sklearn/tree/_tree.pyx":227 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -3309,7 +3313,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":223 + /* "sklearn/tree/_tree.pyx":228 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -3318,34 +3322,43 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_self->__pyx_base.start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":224 + /* "sklearn/tree/_tree.pyx":229 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< * self.n_node_samples = end - start - * cdef double weighted_n_node_samples = 0.0 + * self.weighted_n_samples = weighted_n_samples */ __pyx_v_self->__pyx_base.end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":225 + /* "sklearn/tree/_tree.pyx":230 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< + * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0.0 - * */ __pyx_v_self->__pyx_base.n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":226 + /* "sklearn/tree/_tree.pyx":231 * self.end = end * self.n_node_samples = end - start + * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< + * cdef double weighted_n_node_samples = 0.0 + * + */ + __pyx_v_self->__pyx_base.weighted_n_samples = __pyx_v_weighted_n_samples; + + /* "sklearn/tree/_tree.pyx":232 + * self.n_node_samples = end - start + * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< * * # Initialize label_count_total and weighted_n_node_samples */ __pyx_v_weighted_n_node_samples = 0.0; - /* "sklearn/tree/_tree.pyx":229 + /* "sklearn/tree/_tree.pyx":235 * * # Initialize label_count_total and weighted_n_node_samples * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3355,7 +3368,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":230 + /* "sklearn/tree/_tree.pyx":236 * # 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 # <<<<<<<<<<<<<< @@ -3365,7 +3378,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":231 + /* "sklearn/tree/_tree.pyx":237 * 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 # <<<<<<<<<<<<<< @@ -3375,7 +3388,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":232 + /* "sklearn/tree/_tree.pyx":238 * 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 # <<<<<<<<<<<<<< @@ -3385,7 +3398,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":234 + /* "sklearn/tree/_tree.pyx":240 * cdef double* label_count_total = self.label_count_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -3394,7 +3407,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":235 + /* "sklearn/tree/_tree.pyx":241 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -3403,7 +3416,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":236 + /* "sklearn/tree/_tree.pyx":242 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3412,7 +3425,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":237 + /* "sklearn/tree/_tree.pyx":243 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 # <<<<<<<<<<<<<< @@ -3421,7 +3434,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_c = 0; - /* "sklearn/tree/_tree.pyx":238 + /* "sklearn/tree/_tree.pyx":244 * cdef SIZE_t k = 0 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -3430,7 +3443,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":239 + /* "sklearn/tree/_tree.pyx":245 * cdef SIZE_t c = 0 * cdef DOUBLE_t w = 1.0 * cdef SIZE_t offset = 0 # <<<<<<<<<<<<<< @@ -3439,7 +3452,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct */ __pyx_v_offset = 0; - /* "sklearn/tree/_tree.pyx":241 + /* "sklearn/tree/_tree.pyx":247 * cdef SIZE_t offset = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3450,7 +3463,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":242 + /* "sklearn/tree/_tree.pyx":248 * * for k in range(n_outputs): * memset(label_count_total + offset, 0, # <<<<<<<<<<<<<< @@ -3459,7 +3472,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":244 + /* "sklearn/tree/_tree.pyx":250 * memset(label_count_total + offset, 0, * n_classes[k] * sizeof(double)) * offset += label_count_stride # <<<<<<<<<<<<<< @@ -3469,7 +3482,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":246 + /* "sklearn/tree/_tree.pyx":252 * offset += label_count_stride * * for p in range(start, end): # <<<<<<<<<<<<<< @@ -3480,7 +3493,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":247 + /* "sklearn/tree/_tree.pyx":253 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -3489,7 +3502,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":249 + /* "sklearn/tree/_tree.pyx":255 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -3499,7 +3512,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":250 + /* "sklearn/tree/_tree.pyx":256 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -3511,7 +3524,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_init(struct } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":252 + /* "sklearn/tree/_tree.pyx":258 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3522,7 +3535,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":253 + /* "sklearn/tree/_tree.pyx":259 * * for k in range(n_outputs): * c = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -3531,7 +3544,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":254 + /* "sklearn/tree/_tree.pyx":260 * for k in range(n_outputs): * c = y[i * y_stride + k] * label_count_total[k * label_count_stride + c] += w # <<<<<<<<<<<<<< @@ -3542,7 +3555,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":256 + /* "sklearn/tree/_tree.pyx":262 * label_count_total[k * label_count_stride + c] += w * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -3552,7 +3565,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":258 + /* "sklearn/tree/_tree.pyx":264 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3561,7 +3574,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":261 + /* "sklearn/tree/_tree.pyx":267 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -3570,18 +3583,18 @@ 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":213 + /* "sklearn/tree/_tree.pyx":218 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, # <<<<<<<<<<<<<< - * DOUBLE_t* sample_weight, SIZE_t* samples, - * SIZE_t start, SIZE_t end) nogil: + * DOUBLE_t* sample_weight, double weighted_n_samples, + * SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":263 +/* "sklearn/tree/_tree.pyx":269 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3603,7 +3616,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":265 + /* "sklearn/tree/_tree.pyx":271 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" * self.pos = self.start # <<<<<<<<<<<<<< @@ -3613,7 +3626,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":267 + /* "sklearn/tree/_tree.pyx":273 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -3622,7 +3635,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":268 + /* "sklearn/tree/_tree.pyx":274 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -3632,7 +3645,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":270 + /* "sklearn/tree/_tree.pyx":276 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3642,7 +3655,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":271 + /* "sklearn/tree/_tree.pyx":277 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3652,7 +3665,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":272 + /* "sklearn/tree/_tree.pyx":278 * 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 # <<<<<<<<<<<<<< @@ -3662,7 +3675,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":273 + /* "sklearn/tree/_tree.pyx":279 * 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 # <<<<<<<<<<<<<< @@ -3672,7 +3685,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":274 + /* "sklearn/tree/_tree.pyx":280 * 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 # <<<<<<<<<<<<<< @@ -3682,7 +3695,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":275 + /* "sklearn/tree/_tree.pyx":281 * 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 # <<<<<<<<<<<<<< @@ -3692,7 +3705,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":277 + /* "sklearn/tree/_tree.pyx":283 * cdef double* label_count_right = self.label_count_right * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -3701,7 +3714,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":279 + /* "sklearn/tree/_tree.pyx":285 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3712,7 +3725,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":280 + /* "sklearn/tree/_tree.pyx":286 * * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -3721,7 +3734,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":281 + /* "sklearn/tree/_tree.pyx":287 * for k in range(n_outputs): * memset(label_count_left, 0, n_classes[k] * sizeof(double)) * memcpy(label_count_right, label_count_total, # <<<<<<<<<<<<<< @@ -3730,7 +3743,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":284 + /* "sklearn/tree/_tree.pyx":290 * n_classes[k] * sizeof(double)) * * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -3739,7 +3752,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":285 + /* "sklearn/tree/_tree.pyx":291 * * label_count_total += label_count_stride * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -3748,7 +3761,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":286 + /* "sklearn/tree/_tree.pyx":292 * label_count_total += label_count_stride * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -3758,7 +3771,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":263 + /* "sklearn/tree/_tree.pyx":269 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -3769,7 +3782,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset(struct /* function exit code */ } -/* "sklearn/tree/_tree.pyx":288 +/* "sklearn/tree/_tree.pyx":294 * label_count_right += label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -3805,7 +3818,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":291 + /* "sklearn/tree/_tree.pyx":297 * """Update the collected statistics by moving samples[pos:new_pos] from * the right child to the left child.""" * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< @@ -3815,7 +3828,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":292 + /* "sklearn/tree/_tree.pyx":298 * the right child to the left child.""" * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< @@ -3825,7 +3838,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":293 + /* "sklearn/tree/_tree.pyx":299 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -3835,7 +3848,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":295 + /* "sklearn/tree/_tree.pyx":301 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -3845,7 +3858,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":296 + /* "sklearn/tree/_tree.pyx":302 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -3855,7 +3868,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":298 + /* "sklearn/tree/_tree.pyx":304 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -3865,7 +3878,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":299 + /* "sklearn/tree/_tree.pyx":305 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -3875,7 +3888,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":300 + /* "sklearn/tree/_tree.pyx":306 * 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 # <<<<<<<<<<<<<< @@ -3885,7 +3898,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":301 + /* "sklearn/tree/_tree.pyx":307 * 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 # <<<<<<<<<<<<<< @@ -3895,7 +3908,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":302 + /* "sklearn/tree/_tree.pyx":308 * 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 # <<<<<<<<<<<<<< @@ -3905,7 +3918,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":303 + /* "sklearn/tree/_tree.pyx":309 * 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 # <<<<<<<<<<<<<< @@ -3915,7 +3928,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":309 + /* "sklearn/tree/_tree.pyx":315 * cdef SIZE_t k * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -3924,7 +3937,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":310 + /* "sklearn/tree/_tree.pyx":316 * cdef SIZE_t label_index * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -3933,7 +3946,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":314 + /* "sklearn/tree/_tree.pyx":320 * # Note: We assume start <= pos < new_pos <= end * * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -3944,7 +3957,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":315 + /* "sklearn/tree/_tree.pyx":321 * * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -3953,7 +3966,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":317 + /* "sklearn/tree/_tree.pyx":323 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -3963,7 +3976,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":318 + /* "sklearn/tree/_tree.pyx":324 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -3975,7 +3988,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":320 + /* "sklearn/tree/_tree.pyx":326 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -3986,7 +3999,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":321 + /* "sklearn/tree/_tree.pyx":327 * * for k in range(n_outputs): * label_index = (k * label_count_stride + # <<<<<<<<<<<<<< @@ -3995,7 +4008,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":323 + /* "sklearn/tree/_tree.pyx":329 * label_index = (k * label_count_stride + * y[i * y_stride + k]) * label_count_left[label_index] += w # <<<<<<<<<<<<<< @@ -4005,7 +4018,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":324 + /* "sklearn/tree/_tree.pyx":330 * y[i * y_stride + k]) * label_count_left[label_index] += w * label_count_right[label_index] -= w # <<<<<<<<<<<<<< @@ -4016,7 +4029,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":326 + /* "sklearn/tree/_tree.pyx":332 * label_count_right[label_index] -= w * * diff_w += w # <<<<<<<<<<<<<< @@ -4026,7 +4039,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":328 + /* "sklearn/tree/_tree.pyx":334 * diff_w += w * * self.weighted_n_left += diff_w # <<<<<<<<<<<<<< @@ -4035,7 +4048,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":329 + /* "sklearn/tree/_tree.pyx":335 * * self.weighted_n_left += diff_w * self.weighted_n_right -= diff_w # <<<<<<<<<<<<<< @@ -4044,7 +4057,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":331 + /* "sklearn/tree/_tree.pyx":337 * self.weighted_n_right -= diff_w * * self.pos = new_pos # <<<<<<<<<<<<<< @@ -4053,7 +4066,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":288 + /* "sklearn/tree/_tree.pyx":294 * label_count_right += label_count_stride * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -4064,7 +4077,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":333 +/* "sklearn/tree/_tree.pyx":339 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4080,7 +4093,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_impur return __pyx_r; } -/* "sklearn/tree/_tree.pyx":336 +/* "sklearn/tree/_tree.pyx":342 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4093,7 +4106,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_children_imp /* function exit code */ } -/* "sklearn/tree/_tree.pyx":340 +/* "sklearn/tree/_tree.pyx":346 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4112,7 +4125,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":342 + /* "sklearn/tree/_tree.pyx":348 * 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 # <<<<<<<<<<<<<< @@ -4122,7 +4135,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":343 + /* "sklearn/tree/_tree.pyx":349 * """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 # <<<<<<<<<<<<<< @@ -4132,7 +4145,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":344 + /* "sklearn/tree/_tree.pyx":350 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride # <<<<<<<<<<<<<< @@ -4142,7 +4155,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":345 + /* "sklearn/tree/_tree.pyx":351 * cdef SIZE_t* n_classes = self.n_classes * cdef SIZE_t label_count_stride = self.label_count_stride * cdef double* label_count_total = self.label_count_total # <<<<<<<<<<<<<< @@ -4152,7 +4165,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":348 + /* "sklearn/tree/_tree.pyx":354 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4163,7 +4176,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":349 + /* "sklearn/tree/_tree.pyx":355 * * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) # <<<<<<<<<<<<<< @@ -4172,7 +4185,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":350 + /* "sklearn/tree/_tree.pyx":356 * for k in range(n_outputs): * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride # <<<<<<<<<<<<<< @@ -4181,7 +4194,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":351 + /* "sklearn/tree/_tree.pyx":357 * memcpy(dest, label_count_total, n_classes[k] * sizeof(double)) * dest += label_count_stride * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4191,7 +4204,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":340 + /* "sklearn/tree/_tree.pyx":346 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -4202,7 +4215,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_value(s /* function exit code */ } -/* "sklearn/tree/_tree.pyx":368 +/* "sklearn/tree/_tree.pyx":374 * cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4231,7 +4244,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":371 + /* "sklearn/tree/_tree.pyx":377 * """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 # <<<<<<<<<<<<<< @@ -4241,7 +4254,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":373 + /* "sklearn/tree/_tree.pyx":379 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4251,7 +4264,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":374 + /* "sklearn/tree/_tree.pyx":380 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4261,7 +4274,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":375 + /* "sklearn/tree/_tree.pyx":381 * 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 # <<<<<<<<<<<<<< @@ -4271,7 +4284,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":376 + /* "sklearn/tree/_tree.pyx":382 * 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 # <<<<<<<<<<<<<< @@ -4281,7 +4294,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":378 + /* "sklearn/tree/_tree.pyx":384 * cdef double* label_count_total = self.label_count_total * * cdef double entropy = 0.0 # <<<<<<<<<<<<<< @@ -4290,7 +4303,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":379 + /* "sklearn/tree/_tree.pyx":385 * * cdef double entropy = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -4299,7 +4312,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":384 + /* "sklearn/tree/_tree.pyx":390 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4310,7 +4323,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":385 + /* "sklearn/tree/_tree.pyx":391 * * for k in range(n_outputs): * entropy = 0.0 # <<<<<<<<<<<<<< @@ -4319,7 +4332,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ */ __pyx_v_entropy = 0.0; - /* "sklearn/tree/_tree.pyx":387 + /* "sklearn/tree/_tree.pyx":393 * entropy = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -4330,7 +4343,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":388 + /* "sklearn/tree/_tree.pyx":394 * * for c in range(n_classes[k]): * tmp = label_count_total[c] # <<<<<<<<<<<<<< @@ -4339,7 +4352,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":389 + /* "sklearn/tree/_tree.pyx":395 * for c in range(n_classes[k]): * tmp = label_count_total[c] * if tmp > 0.0: # <<<<<<<<<<<<<< @@ -4349,7 +4362,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":390 + /* "sklearn/tree/_tree.pyx":396 * tmp = label_count_total[c] * if tmp > 0.0: * tmp /= weighted_n_node_samples # <<<<<<<<<<<<<< @@ -4358,7 +4371,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":391 + /* "sklearn/tree/_tree.pyx":397 * if tmp > 0.0: * tmp /= weighted_n_node_samples * entropy -= tmp * log(tmp) # <<<<<<<<<<<<<< @@ -4371,7 +4384,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ __pyx_L7:; } - /* "sklearn/tree/_tree.pyx":393 + /* "sklearn/tree/_tree.pyx":399 * entropy -= tmp * log(tmp) * * total += entropy # <<<<<<<<<<<<<< @@ -4380,7 +4393,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":394 + /* "sklearn/tree/_tree.pyx":400 * * total += entropy * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4390,7 +4403,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":396 + /* "sklearn/tree/_tree.pyx":402 * label_count_total += label_count_stride * * return total / n_outputs # <<<<<<<<<<<<<< @@ -4400,7 +4413,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":368 + /* "sklearn/tree/_tree.pyx":374 * cross-entropy = - \sum_{k=0}^{K-1} pmk log(pmk) * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4413,7 +4426,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_7Entropy_node_impurity(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":398 +/* "sklearn/tree/_tree.pyx":404 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4446,7 +4459,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":403 + /* "sklearn/tree/_tree.pyx":409 * 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 # <<<<<<<<<<<<<< @@ -4456,7 +4469,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":404 + /* "sklearn/tree/_tree.pyx":410 * (samples[pos:end]).""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -4466,7 +4479,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":405 + /* "sklearn/tree/_tree.pyx":411 * 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 # <<<<<<<<<<<<<< @@ -4476,7 +4489,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":407 + /* "sklearn/tree/_tree.pyx":413 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4486,7 +4499,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":408 + /* "sklearn/tree/_tree.pyx":414 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4496,7 +4509,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":409 + /* "sklearn/tree/_tree.pyx":415 * 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 # <<<<<<<<<<<<<< @@ -4506,7 +4519,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":410 + /* "sklearn/tree/_tree.pyx":416 * 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 # <<<<<<<<<<<<<< @@ -4516,7 +4529,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":411 + /* "sklearn/tree/_tree.pyx":417 * 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 # <<<<<<<<<<<<<< @@ -4526,7 +4539,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":413 + /* "sklearn/tree/_tree.pyx":419 * cdef double* label_count_right = self.label_count_right * * cdef double entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4535,7 +4548,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":414 + /* "sklearn/tree/_tree.pyx":420 * * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4544,7 +4557,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":415 + /* "sklearn/tree/_tree.pyx":421 * cdef double entropy_left = 0.0 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -4553,7 +4566,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_left = 0.0; - /* "sklearn/tree/_tree.pyx":416 + /* "sklearn/tree/_tree.pyx":422 * cdef double entropy_right = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -4562,7 +4575,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_total_right = 0.0; - /* "sklearn/tree/_tree.pyx":421 + /* "sklearn/tree/_tree.pyx":427 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4573,7 +4586,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":422 + /* "sklearn/tree/_tree.pyx":428 * * for k in range(n_outputs): * entropy_left = 0.0 # <<<<<<<<<<<<<< @@ -4582,7 +4595,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_left = 0.0; - /* "sklearn/tree/_tree.pyx":423 + /* "sklearn/tree/_tree.pyx":429 * for k in range(n_outputs): * entropy_left = 0.0 * entropy_right = 0.0 # <<<<<<<<<<<<<< @@ -4591,7 +4604,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py */ __pyx_v_entropy_right = 0.0; - /* "sklearn/tree/_tree.pyx":425 + /* "sklearn/tree/_tree.pyx":431 * entropy_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< @@ -4602,7 +4615,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":426 + /* "sklearn/tree/_tree.pyx":432 * * for c in range(n_classes[k]): * tmp = label_count_left[c] # <<<<<<<<<<<<<< @@ -4611,7 +4624,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":427 + /* "sklearn/tree/_tree.pyx":433 * for c in range(n_classes[k]): * tmp = label_count_left[c] * if tmp > 0.0: # <<<<<<<<<<<<<< @@ -4621,7 +4634,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":428 + /* "sklearn/tree/_tree.pyx":434 * tmp = label_count_left[c] * if tmp > 0.0: * tmp /= weighted_n_left # <<<<<<<<<<<<<< @@ -4630,7 +4643,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":429 + /* "sklearn/tree/_tree.pyx":435 * if tmp > 0.0: * tmp /= weighted_n_left * entropy_left -= tmp * log(tmp) # <<<<<<<<<<<<<< @@ -4642,7 +4655,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":431 + /* "sklearn/tree/_tree.pyx":437 * entropy_left -= tmp * log(tmp) * * tmp = label_count_right[c] # <<<<<<<<<<<<<< @@ -4651,7 +4664,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":432 + /* "sklearn/tree/_tree.pyx":438 * * tmp = label_count_right[c] * if tmp > 0.0: # <<<<<<<<<<<<<< @@ -4661,7 +4674,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":439 * tmp = label_count_right[c] * if tmp > 0.0: * tmp /= weighted_n_right # <<<<<<<<<<<<<< @@ -4670,7 +4683,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":434 + /* "sklearn/tree/_tree.pyx":440 * if tmp > 0.0: * tmp /= weighted_n_right * entropy_right -= tmp * log(tmp) # <<<<<<<<<<<<<< @@ -4683,7 +4696,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":436 + /* "sklearn/tree/_tree.pyx":442 * entropy_right -= tmp * log(tmp) * * total_left += entropy_left # <<<<<<<<<<<<<< @@ -4692,7 +4705,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":437 + /* "sklearn/tree/_tree.pyx":443 * * total_left += entropy_left * total_right += entropy_right # <<<<<<<<<<<<<< @@ -4701,7 +4714,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":438 + /* "sklearn/tree/_tree.pyx":444 * total_left += entropy_left * total_right += entropy_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -4710,7 +4723,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":439 + /* "sklearn/tree/_tree.pyx":445 * total_right += entropy_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -4720,7 +4733,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":441 + /* "sklearn/tree/_tree.pyx":447 * label_count_right += label_count_stride * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -4729,7 +4742,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":442 + /* "sklearn/tree/_tree.pyx":448 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -4738,7 +4751,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":398 + /* "sklearn/tree/_tree.pyx":404 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4749,7 +4762,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_7Entropy_children_impurity(struct __py /* function exit code */ } -/* "sklearn/tree/_tree.pyx":460 +/* "sklearn/tree/_tree.pyx":466 * = 1 - \sum_{k=0}^{K-1} pmk ** 2 * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4777,7 +4790,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":463 + /* "sklearn/tree/_tree.pyx":469 * """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 # <<<<<<<<<<<<<< @@ -4787,7 +4800,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":465 + /* "sklearn/tree/_tree.pyx":471 * cdef double weighted_n_node_samples = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -4797,7 +4810,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":466 + /* "sklearn/tree/_tree.pyx":472 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -4807,7 +4820,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":467 + /* "sklearn/tree/_tree.pyx":473 * 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 # <<<<<<<<<<<<<< @@ -4817,7 +4830,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":468 + /* "sklearn/tree/_tree.pyx":474 * 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 # <<<<<<<<<<<<<< @@ -4827,7 +4840,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":470 + /* "sklearn/tree/_tree.pyx":476 * cdef double* label_count_total = self.label_count_total * * cdef double gini = 0.0 # <<<<<<<<<<<<<< @@ -4836,7 +4849,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":471 + /* "sklearn/tree/_tree.pyx":477 * * cdef double gini = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -4845,7 +4858,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":476 + /* "sklearn/tree/_tree.pyx":482 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -4856,7 +4869,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":477 + /* "sklearn/tree/_tree.pyx":483 * * for k in range(n_outputs): * gini = 0.0 # <<<<<<<<<<<<<< @@ -4865,29 +4878,29 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj */ __pyx_v_gini = 0.0; - /* "sklearn/tree/_tree.pyx":479 + /* "sklearn/tree/_tree.pyx":485 * gini = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * tmp = label_count_total[c] # TODO: use weighted count instead + * tmp = label_count_total[c] * gini += tmp * tmp */ __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_c = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":480 + /* "sklearn/tree/_tree.pyx":486 * * for c in range(n_classes[k]): - * tmp = label_count_total[c] # TODO: use weighted count instead # <<<<<<<<<<<<<< + * tmp = label_count_total[c] # <<<<<<<<<<<<<< * gini += tmp * tmp * */ __pyx_v_tmp = (__pyx_v_label_count_total[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":481 + /* "sklearn/tree/_tree.pyx":487 * for c in range(n_classes[k]): - * tmp = label_count_total[c] # TODO: use weighted count instead + * tmp = label_count_total[c] * gini += tmp * tmp # <<<<<<<<<<<<<< * * gini = 1.0 - gini / (weighted_n_node_samples * @@ -4895,7 +4908,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":483 + /* "sklearn/tree/_tree.pyx":489 * gini += tmp * tmp * * gini = 1.0 - gini / (weighted_n_node_samples * # <<<<<<<<<<<<<< @@ -4904,7 +4917,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":486 + /* "sklearn/tree/_tree.pyx":492 * weighted_n_node_samples) * * total += gini # <<<<<<<<<<<<<< @@ -4913,7 +4926,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":487 + /* "sklearn/tree/_tree.pyx":493 * * total += gini * label_count_total += label_count_stride # <<<<<<<<<<<<<< @@ -4923,7 +4936,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":489 + /* "sklearn/tree/_tree.pyx":495 * label_count_total += label_count_stride * * return total / n_outputs # <<<<<<<<<<<<<< @@ -4933,7 +4946,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":460 + /* "sklearn/tree/_tree.pyx":466 * = 1 - \sum_{k=0}^{K-1} pmk ** 2 * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -4946,7 +4959,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_4Gini_node_impurity(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":491 +/* "sklearn/tree/_tree.pyx":497 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -4979,7 +4992,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":496 + /* "sklearn/tree/_tree.pyx":502 * 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 # <<<<<<<<<<<<<< @@ -4989,7 +5002,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":497 + /* "sklearn/tree/_tree.pyx":503 * (samples[pos:end]).""" * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -4999,7 +5012,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":498 + /* "sklearn/tree/_tree.pyx":504 * 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 # <<<<<<<<<<<<<< @@ -5009,7 +5022,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":500 + /* "sklearn/tree/_tree.pyx":506 * cdef double weighted_n_right = self.weighted_n_right * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -5019,7 +5032,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":501 + /* "sklearn/tree/_tree.pyx":507 * * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t* n_classes = self.n_classes # <<<<<<<<<<<<<< @@ -5029,7 +5042,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":502 + /* "sklearn/tree/_tree.pyx":508 * 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 # <<<<<<<<<<<<<< @@ -5039,7 +5052,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":503 + /* "sklearn/tree/_tree.pyx":509 * 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 # <<<<<<<<<<<<<< @@ -5049,7 +5062,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":504 + /* "sklearn/tree/_tree.pyx":510 * 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 # <<<<<<<<<<<<<< @@ -5059,7 +5072,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":506 + /* "sklearn/tree/_tree.pyx":512 * cdef double* label_count_right = self.label_count_right * * cdef double gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5068,7 +5081,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":507 + /* "sklearn/tree/_tree.pyx":513 * * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5077,7 +5090,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":508 + /* "sklearn/tree/_tree.pyx":514 * cdef double gini_left = 0.0 * cdef double gini_right = 0.0 * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -5086,7 +5099,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":509 + /* "sklearn/tree/_tree.pyx":515 * cdef double gini_right = 0.0 * cdef double total = 0.0 * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -5095,7 +5108,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":510 + /* "sklearn/tree/_tree.pyx":516 * cdef double total = 0.0 * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -5104,7 +5117,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":515 + /* "sklearn/tree/_tree.pyx":521 * cdef SIZE_t c * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -5115,7 +5128,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":516 + /* "sklearn/tree/_tree.pyx":522 * * for k in range(n_outputs): * gini_left = 0.0 # <<<<<<<<<<<<<< @@ -5124,7 +5137,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":517 + /* "sklearn/tree/_tree.pyx":523 * for k in range(n_outputs): * gini_left = 0.0 * gini_right = 0.0 # <<<<<<<<<<<<<< @@ -5133,37 +5146,37 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o */ __pyx_v_gini_right = 0.0; - /* "sklearn/tree/_tree.pyx":519 + /* "sklearn/tree/_tree.pyx":525 * gini_right = 0.0 * * for c in range(n_classes[k]): # <<<<<<<<<<<<<< - * tmp = label_count_left[c] # TODO: use weighted count instead + * tmp = label_count_left[c] * gini_left += tmp * tmp */ __pyx_t_6 = (__pyx_v_n_classes[__pyx_v_k]); for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_c = __pyx_t_7; - /* "sklearn/tree/_tree.pyx":520 + /* "sklearn/tree/_tree.pyx":526 * * for c in range(n_classes[k]): - * tmp = label_count_left[c] # TODO: use weighted count instead # <<<<<<<<<<<<<< + * tmp = label_count_left[c] # <<<<<<<<<<<<<< * gini_left += tmp * tmp * tmp = label_count_right[c] */ __pyx_v_tmp = (__pyx_v_label_count_left[__pyx_v_c]); - /* "sklearn/tree/_tree.pyx":521 + /* "sklearn/tree/_tree.pyx":527 * for c in range(n_classes[k]): - * tmp = label_count_left[c] # TODO: use weighted count instead + * tmp = label_count_left[c] * gini_left += tmp * tmp # <<<<<<<<<<<<<< * tmp = label_count_right[c] * gini_right += tmp * tmp */ __pyx_v_gini_left = (__pyx_v_gini_left + (__pyx_v_tmp * __pyx_v_tmp)); - /* "sklearn/tree/_tree.pyx":522 - * tmp = label_count_left[c] # TODO: use weighted count instead + /* "sklearn/tree/_tree.pyx":528 + * tmp = label_count_left[c] * gini_left += tmp * tmp * tmp = label_count_right[c] # <<<<<<<<<<<<<< * gini_right += tmp * tmp @@ -5171,7 +5184,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":523 + /* "sklearn/tree/_tree.pyx":529 * gini_left += tmp * tmp * tmp = label_count_right[c] * gini_right += tmp * tmp # <<<<<<<<<<<<<< @@ -5181,7 +5194,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":525 + /* "sklearn/tree/_tree.pyx":531 * gini_right += tmp * tmp * * gini_left = 1.0 - gini_left / (weighted_n_left * # <<<<<<<<<<<<<< @@ -5190,7 +5203,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":527 + /* "sklearn/tree/_tree.pyx":533 * gini_left = 1.0 - gini_left / (weighted_n_left * * weighted_n_left) * gini_right = 1.0 - gini_right / (weighted_n_right * # <<<<<<<<<<<<<< @@ -5199,7 +5212,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":530 + /* "sklearn/tree/_tree.pyx":536 * weighted_n_right) * * total_left += gini_left # <<<<<<<<<<<<<< @@ -5208,7 +5221,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":531 + /* "sklearn/tree/_tree.pyx":537 * * total_left += gini_left * total_right += gini_right # <<<<<<<<<<<<<< @@ -5217,7 +5230,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":532 + /* "sklearn/tree/_tree.pyx":538 * total_left += gini_left * total_right += gini_right * label_count_left += label_count_stride # <<<<<<<<<<<<<< @@ -5226,7 +5239,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":533 + /* "sklearn/tree/_tree.pyx":539 * total_right += gini_right * label_count_left += label_count_stride * label_count_right += label_count_stride # <<<<<<<<<<<<<< @@ -5236,7 +5249,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":535 + /* "sklearn/tree/_tree.pyx":541 * label_count_right += label_count_stride * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -5245,7 +5258,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":536 + /* "sklearn/tree/_tree.pyx":542 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -5254,7 +5267,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":491 + /* "sklearn/tree/_tree.pyx":497 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -5265,7 +5278,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Gini_children_impurity(struct __pyx_o /* function exit code */ } -/* "sklearn/tree/_tree.pyx":560 +/* "sklearn/tree/_tree.pyx":566 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< @@ -5301,18 +5314,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 = 560; __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 = 566; __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 = 560; __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 = 566; __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 = 560; __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 = 566; __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(); @@ -5345,7 +5358,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":562 + /* "sklearn/tree/_tree.pyx":568 * def __cinit__(self, SIZE_t n_outputs): * # Default values * self.y = NULL # <<<<<<<<<<<<<< @@ -5354,7 +5367,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y = NULL; - /* "sklearn/tree/_tree.pyx":563 + /* "sklearn/tree/_tree.pyx":569 * # Default values * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -5363,7 +5376,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.y_stride = 0; - /* "sklearn/tree/_tree.pyx":564 + /* "sklearn/tree/_tree.pyx":570 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -5372,7 +5385,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.sample_weight = NULL; - /* "sklearn/tree/_tree.pyx":566 + /* "sklearn/tree/_tree.pyx":572 * self.sample_weight = NULL * * self.samples = NULL # <<<<<<<<<<<<<< @@ -5381,7 +5394,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.samples = NULL; - /* "sklearn/tree/_tree.pyx":567 + /* "sklearn/tree/_tree.pyx":573 * * self.samples = NULL * self.start = 0 # <<<<<<<<<<<<<< @@ -5390,7 +5403,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.start = 0; - /* "sklearn/tree/_tree.pyx":568 + /* "sklearn/tree/_tree.pyx":574 * self.samples = NULL * self.start = 0 * self.pos = 0 # <<<<<<<<<<<<<< @@ -5399,7 +5412,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.pos = 0; - /* "sklearn/tree/_tree.pyx":569 + /* "sklearn/tree/_tree.pyx":575 * self.start = 0 * self.pos = 0 * self.end = 0 # <<<<<<<<<<<<<< @@ -5408,7 +5421,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->__pyx_base.end = 0; - /* "sklearn/tree/_tree.pyx":571 + /* "sklearn/tree/_tree.pyx":577 * self.end = 0 * * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -5417,7 +5430,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":572 + /* "sklearn/tree/_tree.pyx":578 * * self.n_outputs = n_outputs * self.n_node_samples = 0 # <<<<<<<<<<<<<< @@ -5426,7 +5439,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":573 + /* "sklearn/tree/_tree.pyx":579 * self.n_outputs = n_outputs * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 # <<<<<<<<<<<<<< @@ -5435,7 +5448,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":574 + /* "sklearn/tree/_tree.pyx":580 * self.n_node_samples = 0 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -5444,7 +5457,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":575 + /* "sklearn/tree/_tree.pyx":581 * self.weighted_n_node_samples = 0.0 * self.weighted_n_left = 0.0 * self.weighted_n_right = 0.0 # <<<<<<<<<<<<<< @@ -5453,7 +5466,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":579 + /* "sklearn/tree/_tree.pyx":585 * # Allocate accumulators. Make sure they are NULL, not uninitialized, * # before an exception can be raised (which triggers __dealloc__). * self.mean_left = NULL # <<<<<<<<<<<<<< @@ -5462,7 +5475,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_left = NULL; - /* "sklearn/tree/_tree.pyx":580 + /* "sklearn/tree/_tree.pyx":586 * # before an exception can be raised (which triggers __dealloc__). * self.mean_left = NULL * self.mean_right = NULL # <<<<<<<<<<<<<< @@ -5471,7 +5484,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_right = NULL; - /* "sklearn/tree/_tree.pyx":581 + /* "sklearn/tree/_tree.pyx":587 * self.mean_left = NULL * self.mean_right = NULL * self.mean_total = NULL # <<<<<<<<<<<<<< @@ -5480,7 +5493,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->mean_total = NULL; - /* "sklearn/tree/_tree.pyx":582 + /* "sklearn/tree/_tree.pyx":588 * self.mean_right = NULL * self.mean_total = NULL * self.sq_sum_left = NULL # <<<<<<<<<<<<<< @@ -5489,7 +5502,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_left = NULL; - /* "sklearn/tree/_tree.pyx":583 + /* "sklearn/tree/_tree.pyx":589 * self.mean_total = NULL * self.sq_sum_left = NULL * self.sq_sum_right = NULL # <<<<<<<<<<<<<< @@ -5498,7 +5511,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_right = NULL; - /* "sklearn/tree/_tree.pyx":584 + /* "sklearn/tree/_tree.pyx":590 * self.sq_sum_left = NULL * self.sq_sum_right = NULL * self.sq_sum_total = NULL # <<<<<<<<<<<<<< @@ -5507,7 +5520,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sq_sum_total = NULL; - /* "sklearn/tree/_tree.pyx":585 + /* "sklearn/tree/_tree.pyx":591 * self.sq_sum_right = NULL * self.sq_sum_total = NULL * self.var_left = NULL # <<<<<<<<<<<<<< @@ -5516,7 +5529,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_left = NULL; - /* "sklearn/tree/_tree.pyx":586 + /* "sklearn/tree/_tree.pyx":592 * self.sq_sum_total = NULL * self.var_left = NULL * self.var_right = NULL # <<<<<<<<<<<<<< @@ -5525,7 +5538,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->var_right = NULL; - /* "sklearn/tree/_tree.pyx":587 + /* "sklearn/tree/_tree.pyx":593 * self.var_left = NULL * self.var_right = NULL * self.sum_left = NULL # <<<<<<<<<<<<<< @@ -5534,7 +5547,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_left = NULL; - /* "sklearn/tree/_tree.pyx":588 + /* "sklearn/tree/_tree.pyx":594 * self.var_right = NULL * self.sum_left = NULL * self.sum_right = NULL # <<<<<<<<<<<<<< @@ -5543,7 +5556,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_right = NULL; - /* "sklearn/tree/_tree.pyx":589 + /* "sklearn/tree/_tree.pyx":595 * self.sum_left = NULL * self.sum_right = NULL * self.sum_total = NULL # <<<<<<<<<<<<<< @@ -5552,7 +5565,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct */ __pyx_v_self->sum_total = NULL; - /* "sklearn/tree/_tree.pyx":591 + /* "sklearn/tree/_tree.pyx":597 * self.sum_total = NULL * * self.mean_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5561,7 +5574,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":592 + /* "sklearn/tree/_tree.pyx":598 * * self.mean_left = calloc(n_outputs, sizeof(double)) * self.mean_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5570,7 +5583,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":593 + /* "sklearn/tree/_tree.pyx":599 * self.mean_left = calloc(n_outputs, sizeof(double)) * self.mean_right = calloc(n_outputs, sizeof(double)) * self.mean_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5579,7 +5592,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":594 + /* "sklearn/tree/_tree.pyx":600 * 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)) # <<<<<<<<<<<<<< @@ -5588,7 +5601,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":595 + /* "sklearn/tree/_tree.pyx":601 * 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)) # <<<<<<<<<<<<<< @@ -5597,7 +5610,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":596 + /* "sklearn/tree/_tree.pyx":602 * 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)) # <<<<<<<<<<<<<< @@ -5606,7 +5619,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":597 + /* "sklearn/tree/_tree.pyx":603 * 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)) # <<<<<<<<<<<<<< @@ -5615,7 +5628,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":598 + /* "sklearn/tree/_tree.pyx":604 * 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)) # <<<<<<<<<<<<<< @@ -5624,7 +5637,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":599 + /* "sklearn/tree/_tree.pyx":605 * self.var_left = calloc(n_outputs, sizeof(double)) * self.var_right = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5633,7 +5646,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":600 + /* "sklearn/tree/_tree.pyx":606 * self.var_right = calloc(n_outputs, sizeof(double)) * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5642,7 +5655,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":601 + /* "sklearn/tree/_tree.pyx":607 * self.sum_left = calloc(n_outputs, sizeof(double)) * self.sum_right = calloc(n_outputs, sizeof(double)) * self.sum_total = calloc(n_outputs, sizeof(double)) # <<<<<<<<<<<<<< @@ -5651,7 +5664,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":603 + /* "sklearn/tree/_tree.pyx":609 * self.sum_total = calloc(n_outputs, sizeof(double)) * * if (self.mean_left == NULL or # <<<<<<<<<<<<<< @@ -5661,7 +5674,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":604 + /* "sklearn/tree/_tree.pyx":610 * * if (self.mean_left == NULL or * self.mean_right == NULL or # <<<<<<<<<<<<<< @@ -5671,7 +5684,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":605 + /* "sklearn/tree/_tree.pyx":611 * if (self.mean_left == NULL or * self.mean_right == NULL or * self.mean_total == NULL or # <<<<<<<<<<<<<< @@ -5681,7 +5694,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":606 + /* "sklearn/tree/_tree.pyx":612 * self.mean_right == NULL or * self.mean_total == NULL or * self.sq_sum_left == NULL or # <<<<<<<<<<<<<< @@ -5691,7 +5704,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":607 + /* "sklearn/tree/_tree.pyx":613 * self.mean_total == NULL or * self.sq_sum_left == NULL or * self.sq_sum_right == NULL or # <<<<<<<<<<<<<< @@ -5701,7 +5714,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":608 + /* "sklearn/tree/_tree.pyx":614 * self.sq_sum_left == NULL or * self.sq_sum_right == NULL or * self.sq_sum_total == NULL or # <<<<<<<<<<<<<< @@ -5711,7 +5724,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":609 + /* "sklearn/tree/_tree.pyx":615 * self.sq_sum_right == NULL or * self.sq_sum_total == NULL or * self.var_left == NULL or # <<<<<<<<<<<<<< @@ -5721,7 +5734,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":610 + /* "sklearn/tree/_tree.pyx":616 * self.sq_sum_total == NULL or * self.var_left == NULL or * self.var_right == NULL or # <<<<<<<<<<<<<< @@ -5731,7 +5744,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":611 + /* "sklearn/tree/_tree.pyx":617 * self.var_left == NULL or * self.var_right == NULL or * self.sum_left == NULL or # <<<<<<<<<<<<<< @@ -5741,7 +5754,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":612 + /* "sklearn/tree/_tree.pyx":618 * self.var_right == NULL or * self.sum_left == NULL or * self.sum_right == NULL or # <<<<<<<<<<<<<< @@ -5751,7 +5764,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":613 + /* "sklearn/tree/_tree.pyx":619 * self.sum_left == NULL or * self.sum_right == NULL or * self.sum_total == NULL): # <<<<<<<<<<<<<< @@ -5801,17 +5814,17 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct } if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":614 + /* "sklearn/tree/_tree.pyx":620 * self.sum_right == NULL or * self.sum_total == NULL): * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":560 + /* "sklearn/tree/_tree.pyx":566 * cdef double* sum_total * * def __cinit__(self, SIZE_t n_outputs): # <<<<<<<<<<<<<< @@ -5830,7 +5843,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":616 +/* "sklearn/tree/_tree.pyx":622 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5853,7 +5866,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":618 + /* "sklearn/tree/_tree.pyx":624 * def __dealloc__(self): * """Destructor.""" * free(self.mean_left) # <<<<<<<<<<<<<< @@ -5862,7 +5875,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_left); - /* "sklearn/tree/_tree.pyx":619 + /* "sklearn/tree/_tree.pyx":625 * """Destructor.""" * free(self.mean_left) * free(self.mean_right) # <<<<<<<<<<<<<< @@ -5871,7 +5884,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_right); - /* "sklearn/tree/_tree.pyx":620 + /* "sklearn/tree/_tree.pyx":626 * free(self.mean_left) * free(self.mean_right) * free(self.mean_total) # <<<<<<<<<<<<<< @@ -5880,7 +5893,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->mean_total); - /* "sklearn/tree/_tree.pyx":621 + /* "sklearn/tree/_tree.pyx":627 * free(self.mean_right) * free(self.mean_total) * free(self.sq_sum_left) # <<<<<<<<<<<<<< @@ -5889,7 +5902,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_left); - /* "sklearn/tree/_tree.pyx":622 + /* "sklearn/tree/_tree.pyx":628 * free(self.mean_total) * free(self.sq_sum_left) * free(self.sq_sum_right) # <<<<<<<<<<<<<< @@ -5898,7 +5911,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_right); - /* "sklearn/tree/_tree.pyx":623 + /* "sklearn/tree/_tree.pyx":629 * free(self.sq_sum_left) * free(self.sq_sum_right) * free(self.sq_sum_total) # <<<<<<<<<<<<<< @@ -5907,7 +5920,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sq_sum_total); - /* "sklearn/tree/_tree.pyx":624 + /* "sklearn/tree/_tree.pyx":630 * free(self.sq_sum_right) * free(self.sq_sum_total) * free(self.var_left) # <<<<<<<<<<<<<< @@ -5916,7 +5929,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->var_left); - /* "sklearn/tree/_tree.pyx":625 + /* "sklearn/tree/_tree.pyx":631 * free(self.sq_sum_total) * free(self.var_left) * free(self.var_right) # <<<<<<<<<<<<<< @@ -5925,7 +5938,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->var_right); - /* "sklearn/tree/_tree.pyx":626 + /* "sklearn/tree/_tree.pyx":632 * free(self.var_left) * free(self.var_right) * free(self.sum_left) # <<<<<<<<<<<<<< @@ -5934,7 +5947,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_left); - /* "sklearn/tree/_tree.pyx":627 + /* "sklearn/tree/_tree.pyx":633 * free(self.var_right) * free(self.sum_left) * free(self.sum_right) # <<<<<<<<<<<<<< @@ -5943,7 +5956,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_right); - /* "sklearn/tree/_tree.pyx":628 + /* "sklearn/tree/_tree.pyx":634 * free(self.sum_left) * free(self.sum_right) * free(self.sum_total) # <<<<<<<<<<<<<< @@ -5952,7 +5965,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st */ free(__pyx_v_self->sum_total); - /* "sklearn/tree/_tree.pyx":616 + /* "sklearn/tree/_tree.pyx":622 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -5964,7 +5977,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_2__dealloc__(st __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":630 +/* "sklearn/tree/_tree.pyx":636 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -5996,7 +6009,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":631 + /* "sklearn/tree/_tree.pyx":637 * * def __reduce__(self): * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) # <<<<<<<<<<<<<< @@ -6004,19 +6017,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 = 631; __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 = 637; __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 = 631; __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 = 637; __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 = 631; __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 = 637; __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 = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 637; __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 = 631; __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 = 637; __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))); @@ -6031,7 +6044,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":630 + /* "sklearn/tree/_tree.pyx":636 * free(self.sum_total) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -6052,7 +6065,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":633 +/* "sklearn/tree/_tree.pyx":639 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6082,7 +6095,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getstate__", 0); - /* "sklearn/tree/_tree.pyx":634 + /* "sklearn/tree/_tree.pyx":640 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -6090,13 +6103,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 = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __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":633 + /* "sklearn/tree/_tree.pyx":639 * return (RegressionCriterion, (self.n_outputs,), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -6115,7 +6128,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_6__getstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":636 +/* "sklearn/tree/_tree.pyx":642 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -6148,15 +6161,15 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19RegressionCriterion_8__setstat return __pyx_r; } -/* "sklearn/tree/_tree.pyx":639 +/* "sklearn/tree/_tree.pyx":645 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< - * SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: - * """Initialize the criterion at node samples[start:end] and + * double weighted_n_samples, SIZE_t* samples, SIZE_t start, + * SIZE_t end) nogil: */ -static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end) { +static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __pyx_obj_7sklearn_4tree_5_tree_RegressionCriterion *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_y, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_y_stride, __pyx_t_7sklearn_4tree_5_tree_DOUBLE_t *__pyx_v_sample_weight, double __pyx_v_weighted_n_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_end) { double __pyx_v_weighted_n_node_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_outputs; double *__pyx_v_mean_left; @@ -6185,7 +6198,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":644 + /* "sklearn/tree/_tree.pyx":651 * children samples[start:start] and samples[start:end].""" * # Initialize fields * self.y = y # <<<<<<<<<<<<<< @@ -6194,7 +6207,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":645 + /* "sklearn/tree/_tree.pyx":652 * # Initialize fields * self.y = y * self.y_stride = y_stride # <<<<<<<<<<<<<< @@ -6203,7 +6216,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":646 + /* "sklearn/tree/_tree.pyx":653 * self.y = y * self.y_stride = y_stride * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -6212,7 +6225,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":647 + /* "sklearn/tree/_tree.pyx":654 * self.y_stride = y_stride * self.sample_weight = sample_weight * self.samples = samples # <<<<<<<<<<<<<< @@ -6221,7 +6234,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":648 + /* "sklearn/tree/_tree.pyx":655 * self.sample_weight = sample_weight * self.samples = samples * self.start = start # <<<<<<<<<<<<<< @@ -6230,34 +6243,43 @@ 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":649 + /* "sklearn/tree/_tree.pyx":656 * self.samples = samples * self.start = start * self.end = end # <<<<<<<<<<<<<< * self.n_node_samples = end - start - * cdef double weighted_n_node_samples = 0. + * self.weighted_n_samples = weighted_n_samples */ __pyx_v_self->__pyx_base.end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":650 + /* "sklearn/tree/_tree.pyx":657 * self.start = start * self.end = end * self.n_node_samples = end - start # <<<<<<<<<<<<<< + * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0. - * */ __pyx_v_self->__pyx_base.n_node_samples = (__pyx_v_end - __pyx_v_start); - /* "sklearn/tree/_tree.pyx":651 + /* "sklearn/tree/_tree.pyx":658 * self.end = end * self.n_node_samples = end - start + * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< + * cdef double weighted_n_node_samples = 0. + * + */ + __pyx_v_self->__pyx_base.weighted_n_samples = __pyx_v_weighted_n_samples; + + /* "sklearn/tree/_tree.pyx":659 + * self.n_node_samples = end - start + * self.weighted_n_samples = weighted_n_samples * cdef double weighted_n_node_samples = 0. # <<<<<<<<<<<<<< * * # Initialize accumulators */ __pyx_v_weighted_n_node_samples = 0.; - /* "sklearn/tree/_tree.pyx":654 + /* "sklearn/tree/_tree.pyx":662 * * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -6267,7 +6289,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":655 + /* "sklearn/tree/_tree.pyx":663 * # Initialize accumulators * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -6277,7 +6299,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":656 + /* "sklearn/tree/_tree.pyx":664 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -6287,7 +6309,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":657 + /* "sklearn/tree/_tree.pyx":665 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -6297,7 +6319,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":658 + /* "sklearn/tree/_tree.pyx":666 * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -6307,7 +6329,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":659 + /* "sklearn/tree/_tree.pyx":667 * 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 # <<<<<<<<<<<<<< @@ -6317,7 +6339,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":660 + /* "sklearn/tree/_tree.pyx":668 * 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 # <<<<<<<<<<<<<< @@ -6327,7 +6349,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":661 + /* "sklearn/tree/_tree.pyx":669 * 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 # <<<<<<<<<<<<<< @@ -6337,7 +6359,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":662 + /* "sklearn/tree/_tree.pyx":670 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -6347,7 +6369,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":663 + /* "sklearn/tree/_tree.pyx":671 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -6357,7 +6379,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":664 + /* "sklearn/tree/_tree.pyx":672 * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -6367,7 +6389,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":665 + /* "sklearn/tree/_tree.pyx":673 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< @@ -6377,7 +6399,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":667 + /* "sklearn/tree/_tree.pyx":675 * cdef double* sum_total = self.sum_total * * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -6386,7 +6408,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":668 + /* "sklearn/tree/_tree.pyx":676 * * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 # <<<<<<<<<<<<<< @@ -6395,7 +6417,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_p = 0; - /* "sklearn/tree/_tree.pyx":669 + /* "sklearn/tree/_tree.pyx":677 * cdef SIZE_t i = 0 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -6404,7 +6426,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":670 + /* "sklearn/tree/_tree.pyx":678 * cdef SIZE_t p = 0 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6413,7 +6435,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":671 + /* "sklearn/tree/_tree.pyx":679 * cdef SIZE_t k = 0 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 # <<<<<<<<<<<<<< @@ -6422,7 +6444,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w_y_ik = 0.0; - /* "sklearn/tree/_tree.pyx":672 + /* "sklearn/tree/_tree.pyx":680 * cdef DOUBLE_t y_ik = 0.0 * cdef DOUBLE_t w_y_ik = 0.0 * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -6431,7 +6453,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":674 + /* "sklearn/tree/_tree.pyx":682 * cdef DOUBLE_t w = 1.0 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) # <<<<<<<<<<<<<< @@ -6440,7 +6462,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":675 + /* "sklearn/tree/_tree.pyx":683 * * cdef SIZE_t n_bytes = n_outputs * sizeof(double) * memset(mean_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6449,7 +6471,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":676 + /* "sklearn/tree/_tree.pyx":684 * cdef SIZE_t n_bytes = n_outputs * sizeof(double) * memset(mean_left, 0, n_bytes) * memset(mean_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6458,7 +6480,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":677 + /* "sklearn/tree/_tree.pyx":685 * memset(mean_left, 0, n_bytes) * memset(mean_right, 0, n_bytes) * memset(mean_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6467,7 +6489,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":678 + /* "sklearn/tree/_tree.pyx":686 * memset(mean_right, 0, n_bytes) * memset(mean_total, 0, n_bytes) * memset(sq_sum_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6476,7 +6498,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":679 + /* "sklearn/tree/_tree.pyx":687 * memset(mean_total, 0, n_bytes) * memset(sq_sum_left, 0, n_bytes) * memset(sq_sum_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6485,7 +6507,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":680 + /* "sklearn/tree/_tree.pyx":688 * memset(sq_sum_left, 0, n_bytes) * memset(sq_sum_right, 0, n_bytes) * memset(sq_sum_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6494,7 +6516,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":681 + /* "sklearn/tree/_tree.pyx":689 * memset(sq_sum_right, 0, n_bytes) * memset(sq_sum_total, 0, n_bytes) * memset(var_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6503,7 +6525,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":682 + /* "sklearn/tree/_tree.pyx":690 * memset(sq_sum_total, 0, n_bytes) * memset(var_left, 0, n_bytes) * memset(var_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6512,7 +6534,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":683 + /* "sklearn/tree/_tree.pyx":691 * memset(var_left, 0, n_bytes) * memset(var_right, 0, n_bytes) * memset(sum_left, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6521,7 +6543,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":684 + /* "sklearn/tree/_tree.pyx":692 * memset(var_right, 0, n_bytes) * memset(sum_left, 0, n_bytes) * memset(sum_right, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6530,7 +6552,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":685 + /* "sklearn/tree/_tree.pyx":693 * memset(sum_left, 0, n_bytes) * memset(sum_right, 0, n_bytes) * memset(sum_total, 0, n_bytes) # <<<<<<<<<<<<<< @@ -6539,7 +6561,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":687 + /* "sklearn/tree/_tree.pyx":695 * memset(sum_total, 0, n_bytes) * * for p in range(start, end): # <<<<<<<<<<<<<< @@ -6550,7 +6572,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":688 + /* "sklearn/tree/_tree.pyx":696 * * for p in range(start, end): * i = samples[p] # <<<<<<<<<<<<<< @@ -6559,7 +6581,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":690 + /* "sklearn/tree/_tree.pyx":698 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -6569,7 +6591,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":691 + /* "sklearn/tree/_tree.pyx":699 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -6581,7 +6603,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_init(struct __py } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":693 + /* "sklearn/tree/_tree.pyx":701 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6592,7 +6614,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":694 + /* "sklearn/tree/_tree.pyx":702 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -6601,7 +6623,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":695 + /* "sklearn/tree/_tree.pyx":703 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -6610,7 +6632,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":696 + /* "sklearn/tree/_tree.pyx":704 * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik * sum_total[k] += w_y_ik # <<<<<<<<<<<<<< @@ -6620,7 +6642,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":697 + /* "sklearn/tree/_tree.pyx":705 * w_y_ik = w * y_ik * sum_total[k] += w_y_ik * sq_sum_total[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -6631,7 +6653,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":699 + /* "sklearn/tree/_tree.pyx":707 * sq_sum_total[k] += w_y_ik * y_ik * * weighted_n_node_samples += w # <<<<<<<<<<<<<< @@ -6641,7 +6663,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":701 + /* "sklearn/tree/_tree.pyx":709 * weighted_n_node_samples += w * * self.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6650,7 +6672,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":703 + /* "sklearn/tree/_tree.pyx":711 * self.weighted_n_node_samples = weighted_n_node_samples * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6661,7 +6683,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":704 + /* "sklearn/tree/_tree.pyx":712 * * for k in range(n_outputs): * mean_total[k] = sum_total[k] / weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6671,7 +6693,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":707 + /* "sklearn/tree/_tree.pyx":715 * * # Reset to pos=start * self.reset() # <<<<<<<<<<<<<< @@ -6680,18 +6702,18 @@ 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":639 + /* "sklearn/tree/_tree.pyx":645 * pass * * cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, # <<<<<<<<<<<<<< - * SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: - * """Initialize the criterion at node samples[start:end] and + * double weighted_n_samples, SIZE_t* samples, SIZE_t start, + * SIZE_t end) nogil: */ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":709 +/* "sklearn/tree/_tree.pyx":717 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -6719,7 +6741,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":711 + /* "sklearn/tree/_tree.pyx":719 * cdef void reset(self) nogil: * """Reset the criterion at pos=start.""" * self.pos = self.start # <<<<<<<<<<<<<< @@ -6729,7 +6751,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":713 + /* "sklearn/tree/_tree.pyx":721 * self.pos = self.start * * self.weighted_n_left = 0.0 # <<<<<<<<<<<<<< @@ -6738,7 +6760,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":714 + /* "sklearn/tree/_tree.pyx":722 * * self.weighted_n_left = 0.0 * self.weighted_n_right = self.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -6748,7 +6770,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":716 + /* "sklearn/tree/_tree.pyx":724 * self.weighted_n_right = self.weighted_n_node_samples * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -6758,7 +6780,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":717 + /* "sklearn/tree/_tree.pyx":725 * * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -6768,7 +6790,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":718 + /* "sklearn/tree/_tree.pyx":726 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -6778,7 +6800,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":719 + /* "sklearn/tree/_tree.pyx":727 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -6788,7 +6810,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":720 + /* "sklearn/tree/_tree.pyx":728 * cdef double* mean_right = self.mean_right * cdef double* mean_total = self.mean_total * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -6798,7 +6820,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":721 + /* "sklearn/tree/_tree.pyx":729 * 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 # <<<<<<<<<<<<<< @@ -6808,7 +6830,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":722 + /* "sklearn/tree/_tree.pyx":730 * 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 # <<<<<<<<<<<<<< @@ -6818,7 +6840,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":723 + /* "sklearn/tree/_tree.pyx":731 * 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 # <<<<<<<<<<<<<< @@ -6828,7 +6850,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":724 + /* "sklearn/tree/_tree.pyx":732 * cdef double* sq_sum_total = self.sq_sum_total * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -6838,7 +6860,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":725 + /* "sklearn/tree/_tree.pyx":733 * 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 # <<<<<<<<<<<<<< @@ -6848,7 +6870,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":726 + /* "sklearn/tree/_tree.pyx":734 * 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 # <<<<<<<<<<<<<< @@ -6858,7 +6880,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":727 + /* "sklearn/tree/_tree.pyx":735 * 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 # <<<<<<<<<<<<<< @@ -6868,7 +6890,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":728 + /* "sklearn/tree/_tree.pyx":736 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double* sum_total = self.sum_total # <<<<<<<<<<<<<< @@ -6878,7 +6900,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":730 + /* "sklearn/tree/_tree.pyx":738 * cdef double* sum_total = self.sum_total * * cdef SIZE_t k = 0 # <<<<<<<<<<<<<< @@ -6887,7 +6909,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p */ __pyx_v_k = 0; - /* "sklearn/tree/_tree.pyx":732 + /* "sklearn/tree/_tree.pyx":740 * cdef SIZE_t k = 0 * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -6898,7 +6920,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":733 + /* "sklearn/tree/_tree.pyx":741 * * for k in range(n_outputs): * mean_right[k] = mean_total[k] # <<<<<<<<<<<<<< @@ -6907,7 +6929,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":734 + /* "sklearn/tree/_tree.pyx":742 * for k in range(n_outputs): * mean_right[k] = mean_total[k] * mean_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -6916,7 +6938,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":735 + /* "sklearn/tree/_tree.pyx":743 * mean_right[k] = mean_total[k] * mean_left[k] = 0.0 * sq_sum_right[k] = sq_sum_total[k] # <<<<<<<<<<<<<< @@ -6925,7 +6947,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":736 + /* "sklearn/tree/_tree.pyx":744 * mean_left[k] = 0.0 * sq_sum_right[k] = sq_sum_total[k] * sq_sum_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -6934,7 +6956,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":737 + /* "sklearn/tree/_tree.pyx":745 * 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 - # <<<<<<<<<<<<<< @@ -6943,7 +6965,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":739 + /* "sklearn/tree/_tree.pyx":747 * var_right[k] = (sq_sum_right[k] / weighted_n_node_samples - * mean_right[k] * mean_right[k]) * var_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -6952,7 +6974,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":740 + /* "sklearn/tree/_tree.pyx":748 * mean_right[k] * mean_right[k]) * var_left[k] = 0.0 * sum_right[k] = sum_total[k] # <<<<<<<<<<<<<< @@ -6961,7 +6983,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":741 + /* "sklearn/tree/_tree.pyx":749 * var_left[k] = 0.0 * sum_right[k] = sum_total[k] * sum_left[k] = 0.0 # <<<<<<<<<<<<<< @@ -6971,7 +6993,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":709 + /* "sklearn/tree/_tree.pyx":717 * self.reset() * * cdef void reset(self) nogil: # <<<<<<<<<<<<<< @@ -6982,7 +7004,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":743 +/* "sklearn/tree/_tree.pyx":751 * sum_left[k] = 0.0 * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -7025,7 +7047,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":746 + /* "sklearn/tree/_tree.pyx":754 * """Update the collected statistics by moving samples[pos:new_pos] from * the right child to the left child.""" * cdef DOUBLE_t* y = self.y # <<<<<<<<<<<<<< @@ -7035,7 +7057,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":747 + /* "sklearn/tree/_tree.pyx":755 * the right child to the left child.""" * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride # <<<<<<<<<<<<<< @@ -7045,7 +7067,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":748 + /* "sklearn/tree/_tree.pyx":756 * cdef DOUBLE_t* y = self.y * cdef SIZE_t y_stride = self.y_stride * cdef DOUBLE_t* sample_weight = self.sample_weight # <<<<<<<<<<<<<< @@ -7055,7 +7077,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":750 + /* "sklearn/tree/_tree.pyx":758 * cdef DOUBLE_t* sample_weight = self.sample_weight * * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -7065,7 +7087,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":751 + /* "sklearn/tree/_tree.pyx":759 * * cdef SIZE_t* samples = self.samples * cdef SIZE_t pos = self.pos # <<<<<<<<<<<<<< @@ -7075,7 +7097,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":753 + /* "sklearn/tree/_tree.pyx":761 * cdef SIZE_t pos = self.pos * * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7085,7 +7107,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":754 + /* "sklearn/tree/_tree.pyx":762 * * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left # <<<<<<<<<<<<<< @@ -7095,7 +7117,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":755 + /* "sklearn/tree/_tree.pyx":763 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right # <<<<<<<<<<<<<< @@ -7105,7 +7127,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":756 + /* "sklearn/tree/_tree.pyx":764 * cdef double* mean_left = self.mean_left * cdef double* mean_right = self.mean_right * cdef double* sq_sum_left = self.sq_sum_left # <<<<<<<<<<<<<< @@ -7115,7 +7137,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":757 + /* "sklearn/tree/_tree.pyx":765 * 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 # <<<<<<<<<<<<<< @@ -7125,7 +7147,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":758 + /* "sklearn/tree/_tree.pyx":766 * 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 # <<<<<<<<<<<<<< @@ -7135,7 +7157,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":759 + /* "sklearn/tree/_tree.pyx":767 * cdef double* sq_sum_right = self.sq_sum_right * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7145,7 +7167,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":760 + /* "sklearn/tree/_tree.pyx":768 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -7155,7 +7177,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":761 + /* "sklearn/tree/_tree.pyx":769 * cdef double* var_right = self.var_right * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -7165,7 +7187,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":763 + /* "sklearn/tree/_tree.pyx":771 * cdef double* sum_right = self.sum_right * * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -7175,7 +7197,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":764 + /* "sklearn/tree/_tree.pyx":772 * * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right # <<<<<<<<<<<<<< @@ -7185,7 +7207,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":769 + /* "sklearn/tree/_tree.pyx":777 * cdef SIZE_t p * cdef SIZE_t k * cdef DOUBLE_t w = 1.0 # <<<<<<<<<<<<<< @@ -7194,7 +7216,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_w = 1.0; - /* "sklearn/tree/_tree.pyx":770 + /* "sklearn/tree/_tree.pyx":778 * cdef SIZE_t k * cdef DOUBLE_t w = 1.0 * cdef DOUBLE_t diff_w = 0.0 # <<<<<<<<<<<<<< @@ -7203,7 +7225,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ */ __pyx_v_diff_w = 0.0; - /* "sklearn/tree/_tree.pyx":774 + /* "sklearn/tree/_tree.pyx":782 * * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): # <<<<<<<<<<<<<< @@ -7214,7 +7236,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":775 + /* "sklearn/tree/_tree.pyx":783 * # Note: We assume start <= pos < new_pos <= end * for p in range(pos, new_pos): * i = samples[p] # <<<<<<<<<<<<<< @@ -7223,7 +7245,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":777 + /* "sklearn/tree/_tree.pyx":785 * i = samples[p] * * if sample_weight != NULL: # <<<<<<<<<<<<<< @@ -7233,7 +7255,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":778 + /* "sklearn/tree/_tree.pyx":786 * * if sample_weight != NULL: * w = sample_weight[i] # <<<<<<<<<<<<<< @@ -7245,7 +7267,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":780 + /* "sklearn/tree/_tree.pyx":788 * w = sample_weight[i] * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7256,7 +7278,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":781 + /* "sklearn/tree/_tree.pyx":789 * * for k in range(n_outputs): * y_ik = y[i * y_stride + k] # <<<<<<<<<<<<<< @@ -7265,7 +7287,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":782 + /* "sklearn/tree/_tree.pyx":790 * for k in range(n_outputs): * y_ik = y[i * y_stride + k] * w_y_ik = w * y_ik # <<<<<<<<<<<<<< @@ -7274,7 +7296,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":784 + /* "sklearn/tree/_tree.pyx":792 * w_y_ik = w * y_ik * * sum_left[k] += w_y_ik # <<<<<<<<<<<<<< @@ -7284,7 +7306,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":785 + /* "sklearn/tree/_tree.pyx":793 * * sum_left[k] += w_y_ik * sum_right[k] -= w_y_ik # <<<<<<<<<<<<<< @@ -7294,7 +7316,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":787 + /* "sklearn/tree/_tree.pyx":795 * sum_right[k] -= w_y_ik * * sq_sum_left[k] += w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -7304,7 +7326,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":788 + /* "sklearn/tree/_tree.pyx":796 * * sq_sum_left[k] += w_y_ik * y_ik * sq_sum_right[k] -= w_y_ik * y_ik # <<<<<<<<<<<<<< @@ -7315,7 +7337,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":790 + /* "sklearn/tree/_tree.pyx":798 * sq_sum_right[k] -= w_y_ik * y_ik * * diff_w += w # <<<<<<<<<<<<<< @@ -7325,7 +7347,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":792 + /* "sklearn/tree/_tree.pyx":800 * diff_w += w * * weighted_n_left += diff_w # <<<<<<<<<<<<<< @@ -7334,7 +7356,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":793 + /* "sklearn/tree/_tree.pyx":801 * * weighted_n_left += diff_w * weighted_n_right -= diff_w # <<<<<<<<<<<<<< @@ -7343,7 +7365,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":795 + /* "sklearn/tree/_tree.pyx":803 * weighted_n_right -= diff_w * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7354,7 +7376,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":796 + /* "sklearn/tree/_tree.pyx":804 * * for k in range(n_outputs): * mean_left[k] = sum_left[k] / weighted_n_left # <<<<<<<<<<<<<< @@ -7363,7 +7385,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":797 + /* "sklearn/tree/_tree.pyx":805 * for k in range(n_outputs): * mean_left[k] = sum_left[k] / weighted_n_left * mean_right[k] = sum_right[k] / weighted_n_right # <<<<<<<<<<<<<< @@ -7372,7 +7394,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":798 + /* "sklearn/tree/_tree.pyx":806 * 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 - # <<<<<<<<<<<<<< @@ -7381,7 +7403,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":800 + /* "sklearn/tree/_tree.pyx":808 * 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 - # <<<<<<<<<<<<<< @@ -7391,7 +7413,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":803 + /* "sklearn/tree/_tree.pyx":811 * mean_right[k] * mean_right[k]) * * self.weighted_n_left = weighted_n_left # <<<<<<<<<<<<<< @@ -7400,7 +7422,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":804 + /* "sklearn/tree/_tree.pyx":812 * * self.weighted_n_left = weighted_n_left * self.weighted_n_right = weighted_n_right # <<<<<<<<<<<<<< @@ -7409,7 +7431,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":806 + /* "sklearn/tree/_tree.pyx":814 * self.weighted_n_right = weighted_n_right * * self.pos = new_pos # <<<<<<<<<<<<<< @@ -7418,7 +7440,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":743 + /* "sklearn/tree/_tree.pyx":751 * sum_left[k] = 0.0 * * cdef void update(self, SIZE_t new_pos) nogil: # <<<<<<<<<<<<<< @@ -7429,7 +7451,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update(struct __ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":808 +/* "sklearn/tree/_tree.pyx":816 * self.pos = new_pos * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7445,7 +7467,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_impurity( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":811 +/* "sklearn/tree/_tree.pyx":819 * pass * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7458,7 +7480,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_children_impurit /* function exit code */ } -/* "sklearn/tree/_tree.pyx":815 +/* "sklearn/tree/_tree.pyx":823 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -7468,7 +7490,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":817 + /* "sklearn/tree/_tree.pyx":825 * 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)) # <<<<<<<<<<<<<< @@ -7477,7 +7499,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":815 + /* "sklearn/tree/_tree.pyx":823 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -7488,7 +7510,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_value(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":825 +/* "sklearn/tree/_tree.pyx":833 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7509,7 +7531,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":828 + /* "sklearn/tree/_tree.pyx":836 * """Evaluate the impurity of the current node, i.e. the impurity of * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7519,7 +7541,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":829 + /* "sklearn/tree/_tree.pyx":837 * samples[start:end].""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total # <<<<<<<<<<<<<< @@ -7529,7 +7551,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":830 + /* "sklearn/tree/_tree.pyx":838 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* sq_sum_total = self.sq_sum_total * cdef double* mean_total = self.mean_total # <<<<<<<<<<<<<< @@ -7539,7 +7561,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":831 + /* "sklearn/tree/_tree.pyx":839 * 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 # <<<<<<<<<<<<<< @@ -7549,7 +7571,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":832 + /* "sklearn/tree/_tree.pyx":840 * cdef double* mean_total = self.mean_total * cdef double weighted_n_node_samples = self.weighted_n_node_samples * cdef double total = 0.0 # <<<<<<<<<<<<<< @@ -7558,7 +7580,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ */ __pyx_v_total = 0.0; - /* "sklearn/tree/_tree.pyx":835 + /* "sklearn/tree/_tree.pyx":843 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7569,7 +7591,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":836 + /* "sklearn/tree/_tree.pyx":844 * * for k in range(n_outputs): * total += (sq_sum_total[k] / weighted_n_node_samples - # <<<<<<<<<<<<<< @@ -7579,7 +7601,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":839 + /* "sklearn/tree/_tree.pyx":847 * mean_total[k] * mean_total[k]) * * return total / n_outputs # <<<<<<<<<<<<<< @@ -7589,7 +7611,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":825 + /* "sklearn/tree/_tree.pyx":833 * MSE = var_left + var_right * """ * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -7602,7 +7624,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_3MSE_node_impurity(struct __pyx_obj_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":841 +/* "sklearn/tree/_tree.pyx":849 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7621,7 +7643,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":846 + /* "sklearn/tree/_tree.pyx":854 * left child (samples[start:pos]) and the impurity the right child * (samples[pos:end]).""" * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7631,7 +7653,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":847 + /* "sklearn/tree/_tree.pyx":855 * (samples[pos:end]).""" * cdef SIZE_t n_outputs = self.n_outputs * cdef double* var_left = self.var_left # <<<<<<<<<<<<<< @@ -7641,7 +7663,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":848 + /* "sklearn/tree/_tree.pyx":856 * cdef SIZE_t n_outputs = self.n_outputs * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right # <<<<<<<<<<<<<< @@ -7651,7 +7673,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":849 + /* "sklearn/tree/_tree.pyx":857 * cdef double* var_left = self.var_left * cdef double* var_right = self.var_right * cdef double total_left = 0.0 # <<<<<<<<<<<<<< @@ -7660,7 +7682,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":850 + /* "sklearn/tree/_tree.pyx":858 * cdef double* var_right = self.var_right * cdef double total_left = 0.0 * cdef double total_right = 0.0 # <<<<<<<<<<<<<< @@ -7669,7 +7691,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":853 + /* "sklearn/tree/_tree.pyx":861 * cdef SIZE_t k * * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -7680,7 +7702,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":854 + /* "sklearn/tree/_tree.pyx":862 * * for k in range(n_outputs): * total_left += var_left[k] # <<<<<<<<<<<<<< @@ -7689,7 +7711,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":855 + /* "sklearn/tree/_tree.pyx":863 * for k in range(n_outputs): * total_left += var_left[k] * total_right += var_right[k] # <<<<<<<<<<<<<< @@ -7699,7 +7721,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":857 + /* "sklearn/tree/_tree.pyx":865 * total_right += var_right[k] * * impurity_left[0] = total_left / n_outputs # <<<<<<<<<<<<<< @@ -7708,7 +7730,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":858 + /* "sklearn/tree/_tree.pyx":866 * * impurity_left[0] = total_left / n_outputs * impurity_right[0] = total_right / n_outputs # <<<<<<<<<<<<<< @@ -7717,7 +7739,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":841 + /* "sklearn/tree/_tree.pyx":849 * return total / n_outputs * * cdef void children_impurity(self, double* impurity_left, # <<<<<<<<<<<<<< @@ -7728,7 +7750,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_3MSE_children_impurity(struct __pyx_ob /* function exit code */ } -/* "sklearn/tree/_tree.pyx":870 +/* "sklearn/tree/_tree.pyx":878 * """ * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -7751,7 +7773,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":871 + /* "sklearn/tree/_tree.pyx":879 * * cdef double impurity_improvement(self, double impurity) nogil: * cdef SIZE_t n_outputs = self.n_outputs # <<<<<<<<<<<<<< @@ -7761,7 +7783,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":873 + /* "sklearn/tree/_tree.pyx":881 * cdef SIZE_t n_outputs = self.n_outputs * cdef SIZE_t k * cdef double* sum_left = self.sum_left # <<<<<<<<<<<<<< @@ -7771,7 +7793,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":874 + /* "sklearn/tree/_tree.pyx":882 * cdef SIZE_t k * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right # <<<<<<<<<<<<<< @@ -7781,7 +7803,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":875 + /* "sklearn/tree/_tree.pyx":883 * cdef double* sum_left = self.sum_left * cdef double* sum_right = self.sum_right * cdef double total_sum_left = 0.0 # <<<<<<<<<<<<<< @@ -7790,7 +7812,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_left = 0.0; - /* "sklearn/tree/_tree.pyx":876 + /* "sklearn/tree/_tree.pyx":884 * cdef double* sum_right = self.sum_right * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 # <<<<<<<<<<<<<< @@ -7799,7 +7821,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_total_sum_right = 0.0; - /* "sklearn/tree/_tree.pyx":877 + /* "sklearn/tree/_tree.pyx":885 * cdef double total_sum_left = 0.0 * cdef double total_sum_right = 0.0 * cdef double weighted_n_left = self.weighted_n_left # <<<<<<<<<<<<<< @@ -7809,7 +7831,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":878 + /* "sklearn/tree/_tree.pyx":886 * 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 # <<<<<<<<<<<<<< @@ -7819,7 +7841,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":879 + /* "sklearn/tree/_tree.pyx":887 * cdef double weighted_n_left = self.weighted_n_left * cdef double weighted_n_right = self.weighted_n_right * cdef double diff = 0.0 # <<<<<<<<<<<<<< @@ -7828,7 +7850,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s */ __pyx_v_diff = 0.0; - /* "sklearn/tree/_tree.pyx":881 + /* "sklearn/tree/_tree.pyx":889 * cdef double diff = 0.0 * * for k from 0 <= k < n_outputs: # <<<<<<<<<<<<<< @@ -7838,7 +7860,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":882 + /* "sklearn/tree/_tree.pyx":890 * * for k from 0 <= k < n_outputs: * total_sum_left += sum_left[k] # <<<<<<<<<<<<<< @@ -7847,7 +7869,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":883 + /* "sklearn/tree/_tree.pyx":891 * for k from 0 <= k < n_outputs: * total_sum_left += sum_left[k] * total_sum_right += sum_right[k] # <<<<<<<<<<<<<< @@ -7857,7 +7879,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":885 + /* "sklearn/tree/_tree.pyx":893 * total_sum_right += sum_right[k] * * total_sum_left = total_sum_left / n_outputs # <<<<<<<<<<<<<< @@ -7866,7 +7888,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":886 + /* "sklearn/tree/_tree.pyx":894 * * total_sum_left = total_sum_left / n_outputs * total_sum_right = total_sum_right / n_outputs # <<<<<<<<<<<<<< @@ -7875,7 +7897,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":887 + /* "sklearn/tree/_tree.pyx":895 * total_sum_left = total_sum_left / n_outputs * total_sum_right = total_sum_right / n_outputs * diff = ((total_sum_left / weighted_n_left) - # <<<<<<<<<<<<<< @@ -7884,7 +7906,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":890 + /* "sklearn/tree/_tree.pyx":898 * (total_sum_right / weighted_n_right)) * * return (weighted_n_left * weighted_n_right * diff * diff / # <<<<<<<<<<<<<< @@ -7894,7 +7916,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":870 + /* "sklearn/tree/_tree.pyx":878 * """ * * cdef double impurity_improvement(self, double impurity) nogil: # <<<<<<<<<<<<<< @@ -7907,7 +7929,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_11FriedmanMSE_impurity_improvement(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":899 +/* "sklearn/tree/_tree.pyx":907 * * cdef class Splitter: * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -7950,21 +7972,21 @@ 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, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __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, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __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 = 899; __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 = 907; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -7975,19 +7997,19 @@ static int __pyx_pw_7sklearn_4tree_5_tree_8Splitter_1__cinit__(PyObject *__pyx_v values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __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 = 899; __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 = 900; __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 = 907; __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 = 908; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __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 = 899; __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 = 907; __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_random_state); /* function exit code */ @@ -8004,7 +8026,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":901 + /* "sklearn/tree/_tree.pyx":909 * def __cinit__(self, Criterion criterion, SIZE_t max_features, * SIZE_t min_samples_leaf, object random_state): * self.criterion = criterion # <<<<<<<<<<<<<< @@ -8017,7 +8039,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":903 + /* "sklearn/tree/_tree.pyx":911 * self.criterion = criterion * * self.samples = NULL # <<<<<<<<<<<<<< @@ -8026,7 +8048,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->samples = NULL; - /* "sklearn/tree/_tree.pyx":904 + /* "sklearn/tree/_tree.pyx":912 * * self.samples = NULL * self.n_samples = 0 # <<<<<<<<<<<<<< @@ -8035,7 +8057,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":905 + /* "sklearn/tree/_tree.pyx":913 * self.samples = NULL * self.n_samples = 0 * self.features = NULL # <<<<<<<<<<<<<< @@ -8044,7 +8066,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->features = NULL; - /* "sklearn/tree/_tree.pyx":906 + /* "sklearn/tree/_tree.pyx":914 * self.n_samples = 0 * self.features = NULL * self.n_features = 0 # <<<<<<<<<<<<<< @@ -8053,7 +8075,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":907 + /* "sklearn/tree/_tree.pyx":915 * self.features = NULL * self.n_features = 0 * self.feature_values = NULL # <<<<<<<<<<<<<< @@ -8062,7 +8084,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":909 + /* "sklearn/tree/_tree.pyx":917 * self.feature_values = NULL * * self.X = NULL # <<<<<<<<<<<<<< @@ -8071,7 +8093,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->X = NULL; - /* "sklearn/tree/_tree.pyx":910 + /* "sklearn/tree/_tree.pyx":918 * * self.X = NULL * self.X_sample_stride = 0 # <<<<<<<<<<<<<< @@ -8080,7 +8102,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":911 + /* "sklearn/tree/_tree.pyx":919 * self.X = NULL * self.X_sample_stride = 0 * self.X_fx_stride = 0 # <<<<<<<<<<<<<< @@ -8089,7 +8111,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":912 + /* "sklearn/tree/_tree.pyx":920 * self.X_sample_stride = 0 * self.X_fx_stride = 0 * self.y = NULL # <<<<<<<<<<<<<< @@ -8098,7 +8120,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 */ __pyx_v_self->y = NULL; - /* "sklearn/tree/_tree.pyx":913 + /* "sklearn/tree/_tree.pyx":921 * self.X_fx_stride = 0 * self.y = NULL * self.y_stride = 0 # <<<<<<<<<<<<<< @@ -8107,7 +8129,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":914 + /* "sklearn/tree/_tree.pyx":922 * self.y = NULL * self.y_stride = 0 * self.sample_weight = NULL # <<<<<<<<<<<<<< @@ -8116,7 +8138,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":916 + /* "sklearn/tree/_tree.pyx":924 * self.sample_weight = NULL * * self.max_features = max_features # <<<<<<<<<<<<<< @@ -8125,7 +8147,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":917 + /* "sklearn/tree/_tree.pyx":925 * * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -8134,7 +8156,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":918 + /* "sklearn/tree/_tree.pyx":926 * self.max_features = max_features * self.min_samples_leaf = min_samples_leaf * self.random_state = random_state # <<<<<<<<<<<<<< @@ -8147,7 +8169,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":899 + /* "sklearn/tree/_tree.pyx":907 * * cdef class Splitter: * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -8161,7 +8183,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter___cinit__(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":920 +/* "sklearn/tree/_tree.pyx":928 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8184,7 +8206,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":922 + /* "sklearn/tree/_tree.pyx":930 * def __dealloc__(self): * """Destructor.""" * free(self.samples) # <<<<<<<<<<<<<< @@ -8193,7 +8215,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->samples); - /* "sklearn/tree/_tree.pyx":923 + /* "sklearn/tree/_tree.pyx":931 * """Destructor.""" * free(self.samples) * free(self.features) # <<<<<<<<<<<<<< @@ -8202,7 +8224,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o */ free(__pyx_v_self->features); - /* "sklearn/tree/_tree.pyx":924 + /* "sklearn/tree/_tree.pyx":932 * free(self.samples) * free(self.features) * free(self.constant_features) # <<<<<<<<<<<<<< @@ -8211,7 +8233,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":925 + /* "sklearn/tree/_tree.pyx":933 * free(self.features) * free(self.constant_features) * free(self.feature_values) # <<<<<<<<<<<<<< @@ -8220,7 +8242,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":920 + /* "sklearn/tree/_tree.pyx":928 * self.random_state = random_state * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8232,7 +8254,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_8Splitter_2__dealloc__(struct __pyx_o __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":927 +/* "sklearn/tree/_tree.pyx":935 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8262,7 +8284,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":928 + /* "sklearn/tree/_tree.pyx":936 * * def __getstate__(self): * return {} # <<<<<<<<<<<<<< @@ -8270,13 +8292,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 = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __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":927 + /* "sklearn/tree/_tree.pyx":935 * free(self.feature_values) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -8295,7 +8317,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_4__getstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":930 +/* "sklearn/tree/_tree.pyx":938 * return {} * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -8328,7 +8350,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_8Splitter_6__setstate__(CYTHON_U return __pyx_r; } -/* "sklearn/tree/_tree.pyx":933 +/* "sklearn/tree/_tree.pyx":941 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -8341,6 +8363,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_i; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_j; + double __pyx_v_weighted_n_samples; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_features; __pyx_t_7sklearn_4tree_5_tree_SIZE_t *__pyx_v_features; __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_v_fv; @@ -8372,27 +8395,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 = 933; __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 = 941; __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 = 933; __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 = 941; __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":939 + /* "sklearn/tree/_tree.pyx":947 * """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 = 939; __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 = 947; __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 = 939; __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 = 947; __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 = 939; __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 = 947; __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); @@ -8400,15 +8423,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 = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 947; __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 = 939; __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 = 947; __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":942 + /* "sklearn/tree/_tree.pyx":950 * * # Initialize samples and features structures * cdef SIZE_t n_samples = X.shape[0] # <<<<<<<<<<<<<< @@ -8417,7 +8440,7 @@ 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":943 + /* "sklearn/tree/_tree.pyx":951 * # Initialize samples and features structures * cdef SIZE_t n_samples = X.shape[0] * cdef SIZE_t* samples = realloc(self.samples, # <<<<<<<<<<<<<< @@ -8426,7 +8449,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_samples = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)realloc(__pyx_v_self->samples, (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t))))); - /* "sklearn/tree/_tree.pyx":945 + /* "sklearn/tree/_tree.pyx":953 * cdef SIZE_t* samples = realloc(self.samples, * n_samples * sizeof(SIZE_t)) * if samples == NULL: # <<<<<<<<<<<<<< @@ -8436,26 +8459,35 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_5 = ((__pyx_v_samples == NULL) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":946 + /* "sklearn/tree/_tree.pyx":954 * n_samples * sizeof(SIZE_t)) * if samples == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * cdef SIZE_t i, j */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":949 + /* "sklearn/tree/_tree.pyx":957 + * + * cdef SIZE_t i, j + * cdef double weighted_n_samples = 0.0 # <<<<<<<<<<<<<< + * j = 0 * + */ + __pyx_v_weighted_n_samples = 0.0; + + /* "sklearn/tree/_tree.pyx":958 * cdef SIZE_t i, j + * cdef double weighted_n_samples = 0.0 * j = 0 # <<<<<<<<<<<<<< * * for i in range(n_samples): */ __pyx_v_j = 0; - /* "sklearn/tree/_tree.pyx":951 + /* "sklearn/tree/_tree.pyx":960 * j = 0 * * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -8466,7 +8498,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":953 + /* "sklearn/tree/_tree.pyx":962 * for i in range(n_samples): * # Only work with positively weighted samples * if sample_weight == NULL or sample_weight[i] != 0.0: # <<<<<<<<<<<<<< @@ -8482,7 +8514,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea } if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":954 + /* "sklearn/tree/_tree.pyx":963 * # Only work with positively weighted samples * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i # <<<<<<<<<<<<<< @@ -8491,39 +8523,81 @@ 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":955 + /* "sklearn/tree/_tree.pyx":964 * if sample_weight == NULL or sample_weight[i] != 0.0: * samples[j] = i * j += 1 # <<<<<<<<<<<<<< * - * self.samples = samples + * if sample_weight != NULL: */ __pyx_v_j = (__pyx_v_j + 1); goto __pyx_L6; } __pyx_L6:; - } - /* "sklearn/tree/_tree.pyx":957 + /* "sklearn/tree/_tree.pyx":966 * j += 1 * + * if sample_weight != NULL: # <<<<<<<<<<<<<< + * weighted_n_samples += sample_weight[i] + * else: + */ + __pyx_t_9 = ((__pyx_v_sample_weight != NULL) != 0); + if (__pyx_t_9) { + + /* "sklearn/tree/_tree.pyx":967 + * + * if sample_weight != NULL: + * weighted_n_samples += sample_weight[i] # <<<<<<<<<<<<<< + * else: + * weighted_n_samples += 1.0 + */ + __pyx_v_weighted_n_samples = (__pyx_v_weighted_n_samples + (__pyx_v_sample_weight[__pyx_v_i])); + goto __pyx_L7; + } + /*else*/ { + + /* "sklearn/tree/_tree.pyx":969 + * weighted_n_samples += sample_weight[i] + * else: + * weighted_n_samples += 1.0 # <<<<<<<<<<<<<< + * + * self.samples = samples + */ + __pyx_v_weighted_n_samples = (__pyx_v_weighted_n_samples + 1.0); + } + __pyx_L7:; + } + + /* "sklearn/tree/_tree.pyx":971 + * weighted_n_samples += 1.0 + * * self.samples = samples # <<<<<<<<<<<<<< * self.n_samples = j - * + * self.weighted_n_samples = weighted_n_samples */ __pyx_v_self->samples = __pyx_v_samples; - /* "sklearn/tree/_tree.pyx":958 + /* "sklearn/tree/_tree.pyx":972 * * self.samples = samples * self.n_samples = j # <<<<<<<<<<<<<< + * self.weighted_n_samples = weighted_n_samples * - * cdef SIZE_t n_features = X.shape[1] */ __pyx_v_self->n_samples = __pyx_v_j; - /* "sklearn/tree/_tree.pyx":960 + /* "sklearn/tree/_tree.pyx":973 + * self.samples = samples * self.n_samples = j + * self.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< + * + * cdef SIZE_t n_features = X.shape[1] + */ + __pyx_v_self->weighted_n_samples = __pyx_v_weighted_n_samples; + + /* "sklearn/tree/_tree.pyx":975 + * self.weighted_n_samples = weighted_n_samples * * cdef SIZE_t n_features = X.shape[1] # <<<<<<<<<<<<<< * cdef SIZE_t* features = realloc(self.features, @@ -8531,7 +8605,7 @@ 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":961 + /* "sklearn/tree/_tree.pyx":976 * * cdef SIZE_t n_features = X.shape[1] * cdef SIZE_t* features = realloc(self.features, # <<<<<<<<<<<<<< @@ -8540,7 +8614,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_features = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)realloc(__pyx_v_self->features, (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t))))); - /* "sklearn/tree/_tree.pyx":963 + /* "sklearn/tree/_tree.pyx":978 * cdef SIZE_t* features = realloc(self.features, * n_features * sizeof(SIZE_t)) * if features == NULL: # <<<<<<<<<<<<<< @@ -8550,17 +8624,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_9 = ((__pyx_v_features == NULL) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":964 + /* "sklearn/tree/_tree.pyx":979 * n_features * sizeof(SIZE_t)) * if features == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * for i in range(n_features): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":966 + /* "sklearn/tree/_tree.pyx":981 * raise MemoryError() * * for i in range(n_features): # <<<<<<<<<<<<<< @@ -8571,7 +8645,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":967 + /* "sklearn/tree/_tree.pyx":982 * * for i in range(n_features): * features[i] = i # <<<<<<<<<<<<<< @@ -8581,7 +8655,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":969 + /* "sklearn/tree/_tree.pyx":984 * features[i] = i * * self.features = features # <<<<<<<<<<<<<< @@ -8590,7 +8664,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->features = __pyx_v_features; - /* "sklearn/tree/_tree.pyx":970 + /* "sklearn/tree/_tree.pyx":985 * * self.features = features * self.n_features = n_features # <<<<<<<<<<<<<< @@ -8599,7 +8673,7 @@ 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":971 + /* "sklearn/tree/_tree.pyx":986 * self.features = features * self.n_features = n_features * self.constant_features = realloc(self.constant_features, # <<<<<<<<<<<<<< @@ -8608,7 +8682,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->constant_features = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)realloc(__pyx_v_self->constant_features, (__pyx_v_n_features * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t))))); - /* "sklearn/tree/_tree.pyx":974 + /* "sklearn/tree/_tree.pyx":989 * n_features * sizeof(SIZE_t)) * * cdef DTYPE_t* fv = realloc(self.feature_values, # <<<<<<<<<<<<<< @@ -8617,7 +8691,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_fv = ((__pyx_t_7sklearn_4tree_5_tree_DTYPE_t *)realloc(__pyx_v_self->feature_values, (__pyx_v_n_samples * (sizeof(__pyx_t_7sklearn_4tree_5_tree_DTYPE_t))))); - /* "sklearn/tree/_tree.pyx":976 + /* "sklearn/tree/_tree.pyx":991 * cdef DTYPE_t* fv = realloc(self.feature_values, * n_samples * sizeof(DTYPE_t)) * if fv == NULL: # <<<<<<<<<<<<<< @@ -8627,17 +8701,17 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __pyx_t_9 = ((__pyx_v_fv == NULL) != 0); if (__pyx_t_9) { - /* "sklearn/tree/_tree.pyx":977 + /* "sklearn/tree/_tree.pyx":992 * n_samples * sizeof(DTYPE_t)) * if fv == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * self.feature_values = fv * */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":978 + /* "sklearn/tree/_tree.pyx":993 * if fv == NULL: * raise MemoryError() * self.feature_values = fv # <<<<<<<<<<<<<< @@ -8646,7 +8720,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea */ __pyx_v_self->feature_values = __pyx_v_fv; - /* "sklearn/tree/_tree.pyx":981 + /* "sklearn/tree/_tree.pyx":996 * * # Initialize X, y, sample_weight * self.X = X.data # <<<<<<<<<<<<<< @@ -8655,33 +8729,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":982 + /* "sklearn/tree/_tree.pyx":997 * # 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 = 982; __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 = 997; __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 = 982; __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 = 997; __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":983 + /* "sklearn/tree/_tree.pyx":998 * 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 = 983; __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 = 998; __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 = 983; __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 = 998; __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":984 + /* "sklearn/tree/_tree.pyx":999 * self.X_sample_stride = X.strides[0] / X.itemsize * self.X_fx_stride = X.strides[1] / X.itemsize * self.y = y.data # <<<<<<<<<<<<<< @@ -8690,20 +8764,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":985 + /* "sklearn/tree/_tree.pyx":1000 * 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 = 985; __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 = 1000; __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 = 985; __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 = 1000; __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":986 + /* "sklearn/tree/_tree.pyx":1001 * self.y = y.data * self.y_stride = y.strides[0] / y.itemsize * self.sample_weight = sample_weight # <<<<<<<<<<<<<< @@ -8712,7 +8786,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":933 + /* "sklearn/tree/_tree.pyx":941 * pass * * cdef void init(self, # <<<<<<<<<<<<<< @@ -8740,7 +8814,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_init(struct __pyx_obj_7sklea __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":988 +/* "sklearn/tree/_tree.pyx":1003 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< @@ -8751,7 +8825,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":991 + /* "sklearn/tree/_tree.pyx":1006 * double* weighted_n_node_samples) nogil: * """Reset splitter on node samples[start:end].""" * self.start = start # <<<<<<<<<<<<<< @@ -8760,7 +8834,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":992 + /* "sklearn/tree/_tree.pyx":1007 * """Reset splitter on node samples[start:end].""" * self.start = start * self.end = end # <<<<<<<<<<<<<< @@ -8769,16 +8843,16 @@ 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":994 + /* "sklearn/tree/_tree.pyx":1009 * self.end = end * * self.criterion.init(self.y, # <<<<<<<<<<<<<< * self.y_stride, * self.sample_weight, */ - ((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->samples, __pyx_v_start, __pyx_v_end); + ((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":1001 + /* "sklearn/tree/_tree.pyx":1017 * end) * * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples # <<<<<<<<<<<<<< @@ -8788,7 +8862,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":988 + /* "sklearn/tree/_tree.pyx":1003 * self.sample_weight = sample_weight * * cdef void node_reset(self, SIZE_t start, SIZE_t end, # <<<<<<<<<<<<<< @@ -8799,7 +8873,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_reset(struct __pyx_obj_ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1003 +/* "sklearn/tree/_tree.pyx":1019 * weighted_n_node_samples[0] = self.criterion.weighted_n_node_samples * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -8812,7 +8886,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_split(CYTHON_UNUSED str /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1011 +/* "sklearn/tree/_tree.pyx":1027 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -8822,7 +8896,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":1013 + /* "sklearn/tree/_tree.pyx":1029 * cdef void node_value(self, double* dest) nogil: * """Copy the value of node samples[start:end] into dest.""" * self.criterion.node_value(dest) # <<<<<<<<<<<<<< @@ -8831,7 +8905,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":1011 + /* "sklearn/tree/_tree.pyx":1027 * pass * * cdef void node_value(self, double* dest) nogil: # <<<<<<<<<<<<<< @@ -8842,7 +8916,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_value(struct __pyx_obj_ /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1015 +/* "sklearn/tree/_tree.pyx":1031 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -8853,7 +8927,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":1017 + /* "sklearn/tree/_tree.pyx":1033 * cdef double node_impurity(self) nogil: * """Copy the impurity of node samples[start:end.""" * return self.criterion.node_impurity() # <<<<<<<<<<<<<< @@ -8863,7 +8937,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":1015 + /* "sklearn/tree/_tree.pyx":1031 * self.criterion.node_value(dest) * * cdef double node_impurity(self) nogil: # <<<<<<<<<<<<<< @@ -8876,7 +8950,7 @@ static double __pyx_f_7sklearn_4tree_5_tree_8Splitter_node_impurity(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pxd":72 +/* "sklearn/tree/_tree.pxd":74 * * # Internal structures * cdef public Criterion criterion # Impurity criterion # <<<<<<<<<<<<<< @@ -8934,7 +9008,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 = 72; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -8984,7 +9058,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_9criterion_4__del__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pxd":73 +/* "sklearn/tree/_tree.pxd":75 * # Internal structures * cdef public Criterion criterion # Impurity criterion * cdef public SIZE_t max_features # Number of features to test # <<<<<<<<<<<<<< @@ -9014,7 +9088,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 = 73; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9052,7 +9126,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 = 73; __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 = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_features = __pyx_t_1; /* function exit code */ @@ -9066,7 +9140,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_12max_features_2__set__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pxd":74 +/* "sklearn/tree/_tree.pxd":76 * 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 # <<<<<<<<<<<<<< @@ -9096,7 +9170,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 = 74; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -9134,7 +9208,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 = 74; __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 = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->min_samples_leaf = __pyx_t_1; /* function exit code */ @@ -9148,7 +9222,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_8Splitter_16min_samples_leaf_2__set__( return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1022 +/* "sklearn/tree/_tree.pyx":1038 * cdef class BestSplitter(Splitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9180,7 +9254,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1023 + /* "sklearn/tree/_tree.pyx":1039 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -9189,34 +9263,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1024 + /* "sklearn/tree/_tree.pyx":1040 * def __reduce__(self): * return (BestSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.random_state), self.__getstate__()) */ - __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 = 1024; __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 = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1025 + /* "sklearn/tree/_tree.pyx":1041 * return (BestSplitter, (self.criterion, * self.max_features, * self.min_samples_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 = 1025; __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 = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1023 + /* "sklearn/tree/_tree.pyx":1039 * """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(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.criterion)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx_base.criterion)); @@ -9231,27 +9305,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1026 + /* "sklearn/tree/_tree.pyx":1042 * self.max_features, * self.min_samples_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, */ - __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 = 1026; __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 = 1042; __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 = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1042; __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":1023 + /* "sklearn/tree/_tree.pyx":1039 * """Splitter for finding the best split.""" * def __reduce__(self): * return (BestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __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 = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_BestSplitter))); @@ -9266,7 +9340,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1022 + /* "sklearn/tree/_tree.pyx":1038 * cdef class BestSplitter(Splitter): * """Splitter for finding the best split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -9287,7 +9361,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_12BestSplitter___reduce__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1028 +/* "sklearn/tree/_tree.pyx":1044 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -9340,7 +9414,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx int __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1035 + /* "sklearn/tree/_tree.pyx":1051 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -9350,7 +9424,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":1036 + /* "sklearn/tree/_tree.pyx":1052 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -9360,7 +9434,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":1037 + /* "sklearn/tree/_tree.pyx":1053 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -9370,7 +9444,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":1039 + /* "sklearn/tree/_tree.pyx":1055 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -9380,7 +9454,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":1040 + /* "sklearn/tree/_tree.pyx":1056 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -9390,7 +9464,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":1041 + /* "sklearn/tree/_tree.pyx":1057 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -9400,7 +9474,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":1043 + /* "sklearn/tree/_tree.pyx":1059 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -9410,7 +9484,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":1044 + /* "sklearn/tree/_tree.pyx":1060 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -9420,7 +9494,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":1045 + /* "sklearn/tree/_tree.pyx":1061 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -9430,7 +9504,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":1046 + /* "sklearn/tree/_tree.pyx":1062 * 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 # <<<<<<<<<<<<<< @@ -9440,7 +9514,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":1047 + /* "sklearn/tree/_tree.pyx":1063 * 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 # <<<<<<<<<<<<<< @@ -9450,7 +9524,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":1048 + /* "sklearn/tree/_tree.pyx":1064 * 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 # <<<<<<<<<<<<<< @@ -9460,7 +9534,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":1049 + /* "sklearn/tree/_tree.pyx":1065 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -9469,7 +9543,7 @@ 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":1051 + /* "sklearn/tree/_tree.pyx":1067 * cdef UINT32_t* random_state = &self.rand_r_state * * cdef double best_impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -9478,7 +9552,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_impurity_left = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1052 + /* "sklearn/tree/_tree.pyx":1068 * * cdef double best_impurity_left = INFINITY * cdef double best_impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -9487,7 +9561,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_impurity_right = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1053 + /* "sklearn/tree/_tree.pyx":1069 * cdef double best_impurity_left = INFINITY * cdef double best_impurity_right = INFINITY * cdef SIZE_t best_pos = end # <<<<<<<<<<<<<< @@ -9496,7 +9570,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1054 + /* "sklearn/tree/_tree.pyx":1070 * cdef double best_impurity_right = INFINITY * cdef SIZE_t best_pos = end * cdef SIZE_t best_feature = 0 # <<<<<<<<<<<<<< @@ -9505,7 +9579,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_feature = 0; - /* "sklearn/tree/_tree.pyx":1055 + /* "sklearn/tree/_tree.pyx":1071 * cdef SIZE_t best_pos = end * cdef SIZE_t best_feature = 0 * cdef double best_threshold = 0. # <<<<<<<<<<<<<< @@ -9514,7 +9588,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_threshold = 0.; - /* "sklearn/tree/_tree.pyx":1056 + /* "sklearn/tree/_tree.pyx":1072 * cdef SIZE_t best_feature = 0 * cdef double best_threshold = 0. * cdef double best_improvement = -INFINITY # <<<<<<<<<<<<<< @@ -9523,7 +9597,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); - /* "sklearn/tree/_tree.pyx":1066 + /* "sklearn/tree/_tree.pyx":1082 * cdef double current_threshold * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -9532,7 +9606,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_f_i = __pyx_v_n_features; - /* "sklearn/tree/_tree.pyx":1068 + /* "sklearn/tree/_tree.pyx":1084 * cdef SIZE_t f_i = n_features * cdef SIZE_t f_j, p, tmp * cdef SIZE_t n_visited_features = 0 # <<<<<<<<<<<<<< @@ -9541,7 +9615,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1070 + /* "sklearn/tree/_tree.pyx":1086 * 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 # <<<<<<<<<<<<<< @@ -9550,7 +9624,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1072 + /* "sklearn/tree/_tree.pyx":1088 * 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 # <<<<<<<<<<<<<< @@ -9559,7 +9633,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1073 + /* "sklearn/tree/_tree.pyx":1089 * # 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] # <<<<<<<<<<<<<< @@ -9568,7 +9642,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":1075 + /* "sklearn/tree/_tree.pyx":1091 * 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 # <<<<<<<<<<<<<< @@ -9577,7 +9651,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_total_constants = __pyx_v_n_known_constants; - /* "sklearn/tree/_tree.pyx":1088 + /* "sklearn/tree/_tree.pyx":1104 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -9588,7 +9662,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1090 + /* "sklearn/tree/_tree.pyx":1106 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -9598,7 +9672,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); if (!__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1092 + /* "sklearn/tree/_tree.pyx":1108 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -9616,7 +9690,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1094 + /* "sklearn/tree/_tree.pyx":1110 * n_visited_features <= n_found_constants + n_drawn_constants)): * * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -9625,7 +9699,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_visited_features = (__pyx_v_n_visited_features + 1); - /* "sklearn/tree/_tree.pyx":1109 + /* "sklearn/tree/_tree.pyx":1125 * # Draw a feature at random * f_j = rand_int(f_i - n_drawn_constants - n_found_constants, * random_state) + n_drawn_constants # <<<<<<<<<<<<<< @@ -9634,7 +9708,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":1127 * random_state) + n_drawn_constants * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -9644,7 +9718,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1113 + /* "sklearn/tree/_tree.pyx":1129 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -9653,7 +9727,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":1130 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -9662,7 +9736,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":1131 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -9671,7 +9745,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":1133 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -9683,7 +9757,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1121 + /* "sklearn/tree/_tree.pyx":1137 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -9692,7 +9766,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":1140 * # f_j in the interval [n_total_constants, f_i[ * * current_feature = features[f_j] # <<<<<<<<<<<<<< @@ -9701,7 +9775,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":1146 * # Xf[i] == X[samples[i], j], so the sort uses the cache more * # effectively. * for p in range(start, end): # <<<<<<<<<<<<<< @@ -9712,7 +9786,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx for (__pyx_t_8 = __pyx_v_start; __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1131 + /* "sklearn/tree/_tree.pyx":1147 * # effectively. * for p in range(start, end): * Xf[p] = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -9722,7 +9796,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":1150 * X_fx_stride * current_feature] * * sort(Xf + start, samples + start, end - start) # <<<<<<<<<<<<<< @@ -9731,7 +9805,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_f_7sklearn_4tree_5_tree_sort((__pyx_v_Xf + __pyx_v_start), (__pyx_v_samples + __pyx_v_start), (__pyx_v_end - __pyx_v_start)); - /* "sklearn/tree/_tree.pyx":1136 + /* "sklearn/tree/_tree.pyx":1152 * sort(Xf + start, samples + start, end - start) * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -9741,7 +9815,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = (((__pyx_v_Xf[(__pyx_v_end - 1)]) <= ((__pyx_v_Xf[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1137 + /* "sklearn/tree/_tree.pyx":1153 * * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -9750,7 +9824,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_features[__pyx_v_f_j]) = (__pyx_v_features[__pyx_v_n_total_constants]); - /* "sklearn/tree/_tree.pyx":1138 + /* "sklearn/tree/_tree.pyx":1154 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current_feature # <<<<<<<<<<<<<< @@ -9759,7 +9833,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_v_current_feature; - /* "sklearn/tree/_tree.pyx":1140 + /* "sklearn/tree/_tree.pyx":1156 * features[n_total_constants] = current_feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -9768,7 +9842,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_n_found_constants = (__pyx_v_n_found_constants + 1); - /* "sklearn/tree/_tree.pyx":1141 + /* "sklearn/tree/_tree.pyx":1157 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -9780,7 +9854,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1144 + /* "sklearn/tree/_tree.pyx":1160 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -9789,7 +9863,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_f_i = (__pyx_v_f_i - 1); - /* "sklearn/tree/_tree.pyx":1145 + /* "sklearn/tree/_tree.pyx":1161 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -9801,7 +9875,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx (__pyx_v_features[__pyx_v_f_i]) = __pyx_t_2; (__pyx_v_features[__pyx_v_f_j]) = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1148 + /* "sklearn/tree/_tree.pyx":1164 * * # Evaluate all splits * self.criterion.reset() # <<<<<<<<<<<<<< @@ -9810,7 +9884,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":1165 * # Evaluate all splits * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -9819,7 +9893,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":1167 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -9830,7 +9904,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1152 + /* "sklearn/tree/_tree.pyx":1168 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -9841,7 +9915,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_5 = (((__pyx_v_p + 1) < __pyx_v_end) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1153 + /* "sklearn/tree/_tree.pyx":1169 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -9855,7 +9929,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (!__pyx_t_7) break; - /* "sklearn/tree/_tree.pyx":1154 + /* "sklearn/tree/_tree.pyx":1170 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -9865,7 +9939,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":1174 * # (p + 1 >= end) or (X[samples[p + 1], current_feature] > * # X[samples[p], current_feature]) * p += 1 # <<<<<<<<<<<<<< @@ -9874,7 +9948,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":1178 * # X[samples[p - 1], current_feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -9884,7 +9958,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_7 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1163 + /* "sklearn/tree/_tree.pyx":1179 * * if p < end: * current_pos = p # <<<<<<<<<<<<<< @@ -9893,7 +9967,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":1182 * * # Reject if min_samples_leaf is not guaranteed * if (((current_pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -9903,7 +9977,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_7 = (((__pyx_v_current_pos - __pyx_v_start) < __pyx_v_min_samples_leaf) != 0); if (!__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1167 + /* "sklearn/tree/_tree.pyx":1183 * # Reject if min_samples_leaf is not guaranteed * if (((current_pos - start) < min_samples_leaf) or * ((end - current_pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -9917,7 +9991,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1168 + /* "sklearn/tree/_tree.pyx":1184 * if (((current_pos - start) < min_samples_leaf) or * ((end - current_pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -9927,7 +10001,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx goto __pyx_L9_continue; } - /* "sklearn/tree/_tree.pyx":1170 + /* "sklearn/tree/_tree.pyx":1186 * continue * * self.criterion.update(current_pos) # <<<<<<<<<<<<<< @@ -9936,7 +10010,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":1171 + /* "sklearn/tree/_tree.pyx":1187 * * self.criterion.update(current_pos) * current_improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -9945,7 +10019,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":1173 + /* "sklearn/tree/_tree.pyx":1189 * current_improvement = self.criterion.impurity_improvement(impurity) * * if current_improvement > best_improvement: # <<<<<<<<<<<<<< @@ -9955,7 +10029,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = ((__pyx_v_current_improvement > __pyx_v_best_improvement) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1174 + /* "sklearn/tree/_tree.pyx":1190 * * if current_improvement > best_improvement: * self.criterion.children_impurity(¤t_impurity_left, # <<<<<<<<<<<<<< @@ -9964,7 +10038,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)->children_impurity(__pyx_v_self->__pyx_base.criterion, (&__pyx_v_current_impurity_left), (&__pyx_v_current_impurity_right)); - /* "sklearn/tree/_tree.pyx":1176 + /* "sklearn/tree/_tree.pyx":1192 * self.criterion.children_impurity(¤t_impurity_left, * ¤t_impurity_right) * best_impurity_left = current_impurity_left # <<<<<<<<<<<<<< @@ -9973,7 +10047,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_impurity_left = __pyx_v_current_impurity_left; - /* "sklearn/tree/_tree.pyx":1177 + /* "sklearn/tree/_tree.pyx":1193 * ¤t_impurity_right) * best_impurity_left = current_impurity_left * best_impurity_right = current_impurity_right # <<<<<<<<<<<<<< @@ -9982,7 +10056,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_impurity_right = __pyx_v_current_impurity_right; - /* "sklearn/tree/_tree.pyx":1178 + /* "sklearn/tree/_tree.pyx":1194 * best_impurity_left = current_impurity_left * best_impurity_right = current_impurity_right * best_improvement = current_improvement # <<<<<<<<<<<<<< @@ -9991,7 +10065,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_improvement = __pyx_v_current_improvement; - /* "sklearn/tree/_tree.pyx":1179 + /* "sklearn/tree/_tree.pyx":1195 * best_impurity_right = current_impurity_right * best_improvement = current_improvement * best_pos = current_pos # <<<<<<<<<<<<<< @@ -10000,7 +10074,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_pos = __pyx_v_current_pos; - /* "sklearn/tree/_tree.pyx":1180 + /* "sklearn/tree/_tree.pyx":1196 * best_improvement = current_improvement * best_pos = current_pos * best_feature = current_feature # <<<<<<<<<<<<<< @@ -10009,7 +10083,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_best_feature = __pyx_v_current_feature; - /* "sklearn/tree/_tree.pyx":1182 + /* "sklearn/tree/_tree.pyx":1198 * best_feature = current_feature * * current_threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< @@ -10018,7 +10092,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_current_threshold = (((__pyx_v_Xf[(__pyx_v_p - 1)]) + (__pyx_v_Xf[__pyx_v_p])) / 2.0); - /* "sklearn/tree/_tree.pyx":1184 + /* "sklearn/tree/_tree.pyx":1200 * current_threshold = (Xf[p - 1] + Xf[p]) / 2.0 * * if current_threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -10028,7 +10102,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = ((__pyx_v_current_threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1185 + /* "sklearn/tree/_tree.pyx":1201 * * if current_threshold == Xf[p]: * current_threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -10040,7 +10114,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":1187 + /* "sklearn/tree/_tree.pyx":1203 * current_threshold = Xf[p - 1] * * best_threshold = current_threshold # <<<<<<<<<<<<<< @@ -10062,7 +10136,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_L5:; } - /* "sklearn/tree/_tree.pyx":1190 + /* "sklearn/tree/_tree.pyx":1206 * * # Reorganize into samples[start:best_pos] + samples[best_pos:end] * if best_pos < end: # <<<<<<<<<<<<<< @@ -10072,7 +10146,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = ((__pyx_v_best_pos < __pyx_v_end) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1191 + /* "sklearn/tree/_tree.pyx":1207 * # Reorganize into samples[start:best_pos] + samples[best_pos:end] * if best_pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -10081,7 +10155,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1192 + /* "sklearn/tree/_tree.pyx":1208 * if best_pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -10090,7 +10164,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":1210 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -10101,7 +10175,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_4) break; - /* "sklearn/tree/_tree.pyx":1196 + /* "sklearn/tree/_tree.pyx":1212 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best_feature] <= best_threshold: # <<<<<<<<<<<<<< @@ -10111,7 +10185,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx __pyx_t_4 = (((__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_4) { - /* "sklearn/tree/_tree.pyx":1197 + /* "sklearn/tree/_tree.pyx":1213 * if X[X_sample_stride * samples[p] + * X_fx_stride * best_feature] <= best_threshold: * p += 1 # <<<<<<<<<<<<<< @@ -10123,7 +10197,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } /*else*/ { - /* "sklearn/tree/_tree.pyx":1200 + /* "sklearn/tree/_tree.pyx":1216 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -10132,7 +10206,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":1218 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -10141,7 +10215,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":1219 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -10150,7 +10224,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_samples[__pyx_v_partition_end]) = (__pyx_v_samples[__pyx_v_p]); - /* "sklearn/tree/_tree.pyx":1204 + /* "sklearn/tree/_tree.pyx":1220 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -10165,7 +10239,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx } __pyx_L17:; - /* "sklearn/tree/_tree.pyx":1209 + /* "sklearn/tree/_tree.pyx":1225 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -10174,7 +10248,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":1228 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -10183,7 +10257,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":1233 * * # Return values * pos[0] = best_pos # <<<<<<<<<<<<<< @@ -10192,7 +10266,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_pos[0]) = __pyx_v_best_pos; - /* "sklearn/tree/_tree.pyx":1218 + /* "sklearn/tree/_tree.pyx":1234 * # Return values * pos[0] = best_pos * feature[0] = best_feature # <<<<<<<<<<<<<< @@ -10201,7 +10275,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_feature[0]) = __pyx_v_best_feature; - /* "sklearn/tree/_tree.pyx":1219 + /* "sklearn/tree/_tree.pyx":1235 * pos[0] = best_pos * feature[0] = best_feature * threshold[0] = best_threshold # <<<<<<<<<<<<<< @@ -10210,7 +10284,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_threshold[0]) = __pyx_v_best_threshold; - /* "sklearn/tree/_tree.pyx":1220 + /* "sklearn/tree/_tree.pyx":1236 * feature[0] = best_feature * threshold[0] = best_threshold * impurity_left[0] = best_impurity_left # <<<<<<<<<<<<<< @@ -10219,7 +10293,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_impurity_left[0]) = __pyx_v_best_impurity_left; - /* "sklearn/tree/_tree.pyx":1221 + /* "sklearn/tree/_tree.pyx":1237 * threshold[0] = best_threshold * impurity_left[0] = best_impurity_left * impurity_right[0] = best_impurity_right # <<<<<<<<<<<<<< @@ -10228,7 +10302,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_impurity_right[0]) = __pyx_v_best_impurity_right; - /* "sklearn/tree/_tree.pyx":1222 + /* "sklearn/tree/_tree.pyx":1238 * impurity_left[0] = best_impurity_left * impurity_right[0] = best_impurity_right * impurity_improvement[0] = best_improvement # <<<<<<<<<<<<<< @@ -10237,7 +10311,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx */ (__pyx_v_impurity_improvement[0]) = __pyx_v_best_improvement; - /* "sklearn/tree/_tree.pyx":1223 + /* "sklearn/tree/_tree.pyx":1239 * impurity_right[0] = best_impurity_right * impurity_improvement[0] = best_improvement * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -10246,7 +10320,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":1028 + /* "sklearn/tree/_tree.pyx":1044 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -10257,7 +10331,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_12BestSplitter_node_split(struct __pyx /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1228 +/* "sklearn/tree/_tree.pyx":1244 * # 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: # <<<<<<<<<<<<<< @@ -10268,7 +10342,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":1229 + /* "sklearn/tree/_tree.pyx":1245 * # 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) # <<<<<<<<<<<<<< @@ -10277,7 +10351,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":1230 + /* "sklearn/tree/_tree.pyx":1246 * 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) # <<<<<<<<<<<<<< @@ -10286,7 +10360,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":1228 + /* "sklearn/tree/_tree.pyx":1244 * # 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: # <<<<<<<<<<<<<< @@ -10297,7 +10371,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sort(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1233 +/* "sklearn/tree/_tree.pyx":1249 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10311,7 +10385,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":1235 + /* "sklearn/tree/_tree.pyx":1251 * 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] # <<<<<<<<<<<<<< @@ -10323,7 +10397,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":1236 + /* "sklearn/tree/_tree.pyx":1252 * # Helper for sort * Xf[i], Xf[j] = Xf[j], Xf[i] * samples[i], samples[j] = samples[j], samples[i] # <<<<<<<<<<<<<< @@ -10335,7 +10409,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":1233 + /* "sklearn/tree/_tree.pyx":1249 * * * cdef inline void swap(DTYPE_t* Xf, SIZE_t* samples, SIZE_t i, SIZE_t j) nogil: # <<<<<<<<<<<<<< @@ -10346,7 +10420,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_swap(__pyx_t_7sklearn_4t /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1239 +/* "sklearn/tree/_tree.pyx":1255 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10361,7 +10435,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":1242 + /* "sklearn/tree/_tree.pyx":1258 * # 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] # <<<<<<<<<<<<<< @@ -10372,7 +10446,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":1243 + /* "sklearn/tree/_tree.pyx":1259 * # 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: # <<<<<<<<<<<<<< @@ -10382,7 +10456,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":1244 + /* "sklearn/tree/_tree.pyx":1260 * cdef DTYPE_t a = Xf[0], b = Xf[n / 2], c = Xf[n - 1] * if a < b: * if b < c: # <<<<<<<<<<<<<< @@ -10392,7 +10466,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":1245 + /* "sklearn/tree/_tree.pyx":1261 * if a < b: * if b < c: * return b # <<<<<<<<<<<<<< @@ -10403,7 +10477,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1246 + /* "sklearn/tree/_tree.pyx":1262 * if b < c: * return b * elif a < c: # <<<<<<<<<<<<<< @@ -10413,7 +10487,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":1263 * return b * elif a < c: * return c # <<<<<<<<<<<<<< @@ -10425,7 +10499,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":1265 * return c * else: * return a # <<<<<<<<<<<<<< @@ -10437,7 +10511,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } } - /* "sklearn/tree/_tree.pyx":1250 + /* "sklearn/tree/_tree.pyx":1266 * else: * return a * elif b < c: # <<<<<<<<<<<<<< @@ -10447,7 +10521,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":1251 + /* "sklearn/tree/_tree.pyx":1267 * return a * elif b < c: * if a < c: # <<<<<<<<<<<<<< @@ -10457,7 +10531,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":1252 + /* "sklearn/tree/_tree.pyx":1268 * elif b < c: * if a < c: * return a # <<<<<<<<<<<<<< @@ -10469,7 +10543,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1254 + /* "sklearn/tree/_tree.pyx":1270 * return a * else: * return c # <<<<<<<<<<<<<< @@ -10482,7 +10556,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1256 + /* "sklearn/tree/_tree.pyx":1272 * return c * else: * return b # <<<<<<<<<<<<<< @@ -10493,7 +10567,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1239 + /* "sklearn/tree/_tree.pyx":1255 * * * cdef inline DTYPE_t median3(DTYPE_t* Xf, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10506,7 +10580,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_DTYPE_t __pyx_f_7sklearn_4tre return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1261 +/* "sklearn/tree/_tree.pyx":1277 * # 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: # <<<<<<<<<<<<<< @@ -10521,7 +10595,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":1265 + /* "sklearn/tree/_tree.pyx":1281 * cdef SIZE_t i, l, r * * while n > 1: # <<<<<<<<<<<<<< @@ -10532,7 +10606,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":1266 + /* "sklearn/tree/_tree.pyx":1282 * * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") # <<<<<<<<<<<<<< @@ -10542,7 +10616,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":1267 + /* "sklearn/tree/_tree.pyx":1283 * while n > 1: * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) # <<<<<<<<<<<<<< @@ -10551,7 +10625,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":1268 + /* "sklearn/tree/_tree.pyx":1284 * if maxd <= 0: # max depth limit exceeded ("gone quadratic") * heapsort(Xf, samples, n) * return # <<<<<<<<<<<<<< @@ -10561,7 +10635,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":1269 + /* "sklearn/tree/_tree.pyx":1285 * heapsort(Xf, samples, n) * return * maxd -= 1 # <<<<<<<<<<<<<< @@ -10570,7 +10644,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":1271 + /* "sklearn/tree/_tree.pyx":1287 * maxd -= 1 * * pivot = median3(Xf, n) # <<<<<<<<<<<<<< @@ -10579,7 +10653,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":1274 + /* "sklearn/tree/_tree.pyx":1290 * * # Three-way partition. * i = l = 0 # <<<<<<<<<<<<<< @@ -10589,7 +10663,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":1275 + /* "sklearn/tree/_tree.pyx":1291 * # Three-way partition. * i = l = 0 * r = n # <<<<<<<<<<<<<< @@ -10598,7 +10672,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":1276 + /* "sklearn/tree/_tree.pyx":1292 * i = l = 0 * r = n * while i < r: # <<<<<<<<<<<<<< @@ -10609,7 +10683,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":1277 + /* "sklearn/tree/_tree.pyx":1293 * r = n * while i < r: * if Xf[i] < pivot: # <<<<<<<<<<<<<< @@ -10619,7 +10693,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":1278 + /* "sklearn/tree/_tree.pyx":1294 * while i < r: * if Xf[i] < pivot: * swap(Xf, samples, i, l) # <<<<<<<<<<<<<< @@ -10628,7 +10702,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":1279 + /* "sklearn/tree/_tree.pyx":1295 * if Xf[i] < pivot: * swap(Xf, samples, i, l) * i += 1 # <<<<<<<<<<<<<< @@ -10637,7 +10711,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":1280 + /* "sklearn/tree/_tree.pyx":1296 * swap(Xf, samples, i, l) * i += 1 * l += 1 # <<<<<<<<<<<<<< @@ -10648,7 +10722,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre goto __pyx_L8; } - /* "sklearn/tree/_tree.pyx":1281 + /* "sklearn/tree/_tree.pyx":1297 * i += 1 * l += 1 * elif Xf[i] > pivot: # <<<<<<<<<<<<<< @@ -10658,7 +10732,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":1282 + /* "sklearn/tree/_tree.pyx":1298 * l += 1 * elif Xf[i] > pivot: * r -= 1 # <<<<<<<<<<<<<< @@ -10667,7 +10741,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":1283 + /* "sklearn/tree/_tree.pyx":1299 * elif Xf[i] > pivot: * r -= 1 * swap(Xf, samples, i, r) # <<<<<<<<<<<<<< @@ -10679,7 +10753,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre } /*else*/ { - /* "sklearn/tree/_tree.pyx":1285 + /* "sklearn/tree/_tree.pyx":1301 * swap(Xf, samples, i, r) * else: * i += 1 # <<<<<<<<<<<<<< @@ -10691,7 +10765,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1287 + /* "sklearn/tree/_tree.pyx":1303 * i += 1 * * introsort(Xf, samples, l, maxd) # <<<<<<<<<<<<<< @@ -10700,7 +10774,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":1288 + /* "sklearn/tree/_tree.pyx":1304 * * introsort(Xf, samples, l, maxd) * Xf += r # <<<<<<<<<<<<<< @@ -10709,7 +10783,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":1289 + /* "sklearn/tree/_tree.pyx":1305 * introsort(Xf, samples, l, maxd) * Xf += r * samples += r # <<<<<<<<<<<<<< @@ -10718,7 +10792,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":1290 + /* "sklearn/tree/_tree.pyx":1306 * Xf += r * samples += r * n -= r # <<<<<<<<<<<<<< @@ -10728,7 +10802,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":1261 + /* "sklearn/tree/_tree.pyx":1277 * # 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: # <<<<<<<<<<<<<< @@ -10740,7 +10814,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_introsort(__pyx_t_7sklearn_4tree_5_tre __pyx_L0:; } -/* "sklearn/tree/_tree.pyx":1293 +/* "sklearn/tree/_tree.pyx":1309 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -10756,7 +10830,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":1298 + /* "sklearn/tree/_tree.pyx":1314 * cdef SIZE_t child, maxind, root * * root = start # <<<<<<<<<<<<<< @@ -10765,7 +10839,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":1299 + /* "sklearn/tree/_tree.pyx":1315 * * root = start * while True: # <<<<<<<<<<<<<< @@ -10774,7 +10848,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea */ while (1) { - /* "sklearn/tree/_tree.pyx":1300 + /* "sklearn/tree/_tree.pyx":1316 * root = start * while True: * child = root * 2 + 1 # <<<<<<<<<<<<<< @@ -10783,7 +10857,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":1303 + /* "sklearn/tree/_tree.pyx":1319 * * # find max of root, left child, right child * maxind = root # <<<<<<<<<<<<<< @@ -10792,7 +10866,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":1304 + /* "sklearn/tree/_tree.pyx":1320 * # find max of root, left child, right child * maxind = root * if child < end and Xf[maxind] < Xf[child]: # <<<<<<<<<<<<<< @@ -10808,7 +10882,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":1305 + /* "sklearn/tree/_tree.pyx":1321 * maxind = root * if child < end and Xf[maxind] < Xf[child]: * maxind = child # <<<<<<<<<<<<<< @@ -10820,7 +10894,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1306 + /* "sklearn/tree/_tree.pyx":1322 * if child < end and Xf[maxind] < Xf[child]: * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: # <<<<<<<<<<<<<< @@ -10836,7 +10910,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } if (__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":1307 + /* "sklearn/tree/_tree.pyx":1323 * maxind = child * if child + 1 < end and Xf[maxind] < Xf[child + 1]: * maxind = child + 1 # <<<<<<<<<<<<<< @@ -10848,7 +10922,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":1309 + /* "sklearn/tree/_tree.pyx":1325 * maxind = child + 1 * * if maxind == root: # <<<<<<<<<<<<<< @@ -10858,7 +10932,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":1310 + /* "sklearn/tree/_tree.pyx":1326 * * if maxind == root: * break # <<<<<<<<<<<<<< @@ -10869,7 +10943,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":1312 + /* "sklearn/tree/_tree.pyx":1328 * break * else: * swap(Xf, samples, root, maxind) # <<<<<<<<<<<<<< @@ -10878,7 +10952,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":1313 + /* "sklearn/tree/_tree.pyx":1329 * else: * swap(Xf, samples, root, maxind) * root = maxind # <<<<<<<<<<<<<< @@ -10890,7 +10964,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1293 + /* "sklearn/tree/_tree.pyx":1309 * * * cdef inline void sift_down(DTYPE_t* Xf, SIZE_t* samples, # <<<<<<<<<<<<<< @@ -10901,7 +10975,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_5_tree_sift_down(__pyx_t_7sklea /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1316 +/* "sklearn/tree/_tree.pyx":1332 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -10914,7 +10988,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":1320 + /* "sklearn/tree/_tree.pyx":1336 * * # heapify * start = (n - 2) / 2 # <<<<<<<<<<<<<< @@ -10923,7 +10997,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":1321 + /* "sklearn/tree/_tree.pyx":1337 * # heapify * start = (n - 2) / 2 * end = n # <<<<<<<<<<<<<< @@ -10932,7 +11006,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":1322 + /* "sklearn/tree/_tree.pyx":1338 * start = (n - 2) / 2 * end = n * while True: # <<<<<<<<<<<<<< @@ -10941,7 +11015,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree */ while (1) { - /* "sklearn/tree/_tree.pyx":1323 + /* "sklearn/tree/_tree.pyx":1339 * end = n * while True: * sift_down(Xf, samples, start, end) # <<<<<<<<<<<<<< @@ -10950,7 +11024,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":1324 + /* "sklearn/tree/_tree.pyx":1340 * while True: * sift_down(Xf, samples, start, end) * if start == 0: # <<<<<<<<<<<<<< @@ -10960,7 +11034,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":1325 + /* "sklearn/tree/_tree.pyx":1341 * sift_down(Xf, samples, start, end) * if start == 0: * break # <<<<<<<<<<<<<< @@ -10970,7 +11044,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree goto __pyx_L4_break; } - /* "sklearn/tree/_tree.pyx":1326 + /* "sklearn/tree/_tree.pyx":1342 * if start == 0: * break * start -= 1 # <<<<<<<<<<<<<< @@ -10981,7 +11055,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree } __pyx_L4_break:; - /* "sklearn/tree/_tree.pyx":1329 + /* "sklearn/tree/_tree.pyx":1345 * * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 # <<<<<<<<<<<<<< @@ -10990,7 +11064,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":1330 + /* "sklearn/tree/_tree.pyx":1346 * # sort by shrinking the heap, putting the max element immediately after it * end = n - 1 * while end > 0: # <<<<<<<<<<<<<< @@ -11001,7 +11075,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":1331 + /* "sklearn/tree/_tree.pyx":1347 * end = n - 1 * while end > 0: * swap(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11010,7 +11084,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":1332 + /* "sklearn/tree/_tree.pyx":1348 * while end > 0: * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) # <<<<<<<<<<<<<< @@ -11019,7 +11093,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":1333 + /* "sklearn/tree/_tree.pyx":1349 * swap(Xf, samples, 0, end) * sift_down(Xf, samples, 0, end) * end = end - 1 # <<<<<<<<<<<<<< @@ -11029,7 +11103,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":1316 + /* "sklearn/tree/_tree.pyx":1332 * * * cdef void heapsort(DTYPE_t* Xf, SIZE_t* samples, SIZE_t n) nogil: # <<<<<<<<<<<<<< @@ -11040,7 +11114,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_heapsort(__pyx_t_7sklearn_4tree_5_tree /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1338 +/* "sklearn/tree/_tree.pyx":1354 * cdef class RandomSplitter(Splitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11072,7 +11146,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1339 + /* "sklearn/tree/_tree.pyx":1355 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -11081,34 +11155,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1340 + /* "sklearn/tree/_tree.pyx":1356 * def __reduce__(self): * return (RandomSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.random_state), self.__getstate__()) */ - __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 = 1340; __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 = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1341 + /* "sklearn/tree/_tree.pyx":1357 * return (RandomSplitter, (self.criterion, * self.max_features, * self.min_samples_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 = 1341; __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 = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1339 + /* "sklearn/tree/_tree.pyx":1355 * """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(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.criterion)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx_base.criterion)); @@ -11123,27 +11197,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1342 + /* "sklearn/tree/_tree.pyx":1358 * self.max_features, * self.min_samples_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, */ - __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 = 1342; __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 = 1358; __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 = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1358; __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":1339 + /* "sklearn/tree/_tree.pyx":1355 * """Splitter for finding the best random split.""" * def __reduce__(self): * return (RandomSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __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 = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_RandomSplitter))); @@ -11158,7 +11232,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1338 + /* "sklearn/tree/_tree.pyx":1354 * cdef class RandomSplitter(Splitter): * """Splitter for finding the best random split.""" * def __reduce__(self): # <<<<<<<<<<<<<< @@ -11179,7 +11253,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_14RandomSplitter___reduce__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1344 +/* "sklearn/tree/_tree.pyx":1360 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -11235,7 +11309,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p int __pyx_t_7; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1351 + /* "sklearn/tree/_tree.pyx":1367 * """Find the best random split on node samples[start:end].""" * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -11245,7 +11319,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":1352 + /* "sklearn/tree/_tree.pyx":1368 * # Draw random splits and pick the best * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -11255,7 +11329,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":1353 + /* "sklearn/tree/_tree.pyx":1369 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -11265,7 +11339,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":1355 + /* "sklearn/tree/_tree.pyx":1371 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -11275,7 +11349,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":1356 + /* "sklearn/tree/_tree.pyx":1372 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -11285,7 +11359,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":1357 + /* "sklearn/tree/_tree.pyx":1373 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -11295,7 +11369,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":1359 + /* "sklearn/tree/_tree.pyx":1375 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -11305,7 +11379,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":1360 + /* "sklearn/tree/_tree.pyx":1376 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -11315,7 +11389,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":1361 + /* "sklearn/tree/_tree.pyx":1377 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -11325,7 +11399,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":1362 + /* "sklearn/tree/_tree.pyx":1378 * 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 # <<<<<<<<<<<<<< @@ -11335,7 +11409,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":1363 + /* "sklearn/tree/_tree.pyx":1379 * 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 # <<<<<<<<<<<<<< @@ -11345,7 +11419,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":1364 + /* "sklearn/tree/_tree.pyx":1380 * 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 # <<<<<<<<<<<<<< @@ -11355,7 +11429,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":1365 + /* "sklearn/tree/_tree.pyx":1381 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -11364,7 +11438,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":1367 + /* "sklearn/tree/_tree.pyx":1383 * cdef UINT32_t* random_state = &self.rand_r_state * * cdef double best_impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -11373,7 +11447,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_impurity_left = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1368 + /* "sklearn/tree/_tree.pyx":1384 * * cdef double best_impurity_left = INFINITY * cdef double best_impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -11382,7 +11456,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_impurity_right = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1369 + /* "sklearn/tree/_tree.pyx":1385 * cdef double best_impurity_left = INFINITY * cdef double best_impurity_right = INFINITY * cdef SIZE_t best_pos = end # <<<<<<<<<<<<<< @@ -11391,7 +11465,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1370 + /* "sklearn/tree/_tree.pyx":1386 * cdef double best_impurity_right = INFINITY * cdef SIZE_t best_pos = end * cdef SIZE_t best_feature = 0 # <<<<<<<<<<<<<< @@ -11400,7 +11474,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_feature = 0; - /* "sklearn/tree/_tree.pyx":1371 + /* "sklearn/tree/_tree.pyx":1387 * cdef SIZE_t best_pos = end * cdef SIZE_t best_feature = 0 * cdef double best_threshold = 0. # <<<<<<<<<<<<<< @@ -11409,7 +11483,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_threshold = 0.; - /* "sklearn/tree/_tree.pyx":1372 + /* "sklearn/tree/_tree.pyx":1388 * cdef SIZE_t best_feature = 0 * cdef double best_threshold = 0. * cdef double best_improvement = -INFINITY # <<<<<<<<<<<<<< @@ -11418,7 +11492,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); - /* "sklearn/tree/_tree.pyx":1382 + /* "sklearn/tree/_tree.pyx":1398 * cdef double current_threshold * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -11427,7 +11501,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":1385 + /* "sklearn/tree/_tree.pyx":1401 * 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 # <<<<<<<<<<<<<< @@ -11436,7 +11510,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1387 + /* "sklearn/tree/_tree.pyx":1403 * 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 # <<<<<<<<<<<<<< @@ -11445,7 +11519,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1388 + /* "sklearn/tree/_tree.pyx":1404 * # 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] # <<<<<<<<<<<<<< @@ -11454,7 +11528,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":1390 + /* "sklearn/tree/_tree.pyx":1406 * 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 # <<<<<<<<<<<<<< @@ -11463,7 +11537,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":1391 + /* "sklearn/tree/_tree.pyx":1407 * # 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 # <<<<<<<<<<<<<< @@ -11472,7 +11546,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1406 + /* "sklearn/tree/_tree.pyx":1422 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -11483,7 +11557,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_4 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1408 + /* "sklearn/tree/_tree.pyx":1424 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -11493,7 +11567,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); if (!__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1410 + /* "sklearn/tree/_tree.pyx":1426 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -11511,7 +11585,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1411 + /* "sklearn/tree/_tree.pyx":1427 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -11520,7 +11594,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":1426 + /* "sklearn/tree/_tree.pyx":1442 * # Draw a feature at random * f_j = rand_int(f_i - n_drawn_constants - n_found_constants, * random_state) + n_drawn_constants # <<<<<<<<<<<<<< @@ -11529,7 +11603,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":1428 + /* "sklearn/tree/_tree.pyx":1444 * random_state) + n_drawn_constants * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -11539,7 +11613,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1430 + /* "sklearn/tree/_tree.pyx":1446 * if f_j < n_known_constants: * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -11548,7 +11622,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":1431 + /* "sklearn/tree/_tree.pyx":1447 * # f_j in the interval [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -11557,7 +11631,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":1432 + /* "sklearn/tree/_tree.pyx":1448 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -11566,7 +11640,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":1434 + /* "sklearn/tree/_tree.pyx":1450 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -11578,7 +11652,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1438 + /* "sklearn/tree/_tree.pyx":1454 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -11587,7 +11661,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":1441 + /* "sklearn/tree/_tree.pyx":1457 * # f_j in the interval [n_total_constants, f_i[ * * current_feature = features[f_j] # <<<<<<<<<<<<<< @@ -11596,7 +11670,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":1444 + /* "sklearn/tree/_tree.pyx":1460 * * # Find min, max * min_feature_value = X[X_sample_stride * samples[start] + # <<<<<<<<<<<<<< @@ -11605,7 +11679,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":1446 + /* "sklearn/tree/_tree.pyx":1462 * min_feature_value = X[X_sample_stride * samples[start] + * X_fx_stride * current_feature] * max_feature_value = min_feature_value # <<<<<<<<<<<<<< @@ -11614,7 +11688,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":1447 + /* "sklearn/tree/_tree.pyx":1463 * X_fx_stride * current_feature] * max_feature_value = min_feature_value * Xf[start] = min_feature_value # <<<<<<<<<<<<<< @@ -11623,7 +11697,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":1449 + /* "sklearn/tree/_tree.pyx":1465 * Xf[start] = min_feature_value * * for p in range(start + 1, end): # <<<<<<<<<<<<<< @@ -11634,7 +11708,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p for (__pyx_t_8 = (__pyx_v_start + 1); __pyx_t_8 < __pyx_t_2; __pyx_t_8+=1) { __pyx_v_p = __pyx_t_8; - /* "sklearn/tree/_tree.pyx":1450 + /* "sklearn/tree/_tree.pyx":1466 * * for p in range(start + 1, end): * current_feature_value = X[X_sample_stride * samples[p] + # <<<<<<<<<<<<<< @@ -11643,7 +11717,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":1452 + /* "sklearn/tree/_tree.pyx":1468 * current_feature_value = X[X_sample_stride * samples[p] + * X_fx_stride * current_feature] * Xf[p] = current_feature_value # <<<<<<<<<<<<<< @@ -11652,7 +11726,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":1454 + /* "sklearn/tree/_tree.pyx":1470 * Xf[p] = current_feature_value * * if current_feature_value < min_feature_value: # <<<<<<<<<<<<<< @@ -11662,7 +11736,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_feature_value < __pyx_v_min_feature_value) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1455 + /* "sklearn/tree/_tree.pyx":1471 * * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -11673,7 +11747,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L8; } - /* "sklearn/tree/_tree.pyx":1456 + /* "sklearn/tree/_tree.pyx":1472 * if current_feature_value < min_feature_value: * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: # <<<<<<<<<<<<<< @@ -11683,7 +11757,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_feature_value > __pyx_v_max_feature_value) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1457 + /* "sklearn/tree/_tree.pyx":1473 * min_feature_value = current_feature_value * elif current_feature_value > max_feature_value: * max_feature_value = current_feature_value # <<<<<<<<<<<<<< @@ -11696,7 +11770,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L8:; } - /* "sklearn/tree/_tree.pyx":1459 + /* "sklearn/tree/_tree.pyx":1475 * max_feature_value = current_feature_value * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -11706,7 +11780,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_max_feature_value <= (__pyx_v_min_feature_value + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1460 + /* "sklearn/tree/_tree.pyx":1476 * * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -11715,7 +11789,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":1461 + /* "sklearn/tree/_tree.pyx":1477 * if max_feature_value <= min_feature_value + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current_feature # <<<<<<<<<<<<<< @@ -11724,7 +11798,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_v_current_feature; - /* "sklearn/tree/_tree.pyx":1463 + /* "sklearn/tree/_tree.pyx":1479 * features[n_total_constants] = current_feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -11733,7 +11807,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":1464 + /* "sklearn/tree/_tree.pyx":1480 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -11745,7 +11819,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1467 + /* "sklearn/tree/_tree.pyx":1483 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -11754,7 +11828,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":1468 + /* "sklearn/tree/_tree.pyx":1484 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -11766,7 +11840,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_8; - /* "sklearn/tree/_tree.pyx":1471 + /* "sklearn/tree/_tree.pyx":1487 * * # Draw a random threshold * current_threshold = (min_feature_value + # <<<<<<<<<<<<<< @@ -11775,7 +11849,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":1476 + /* "sklearn/tree/_tree.pyx":1492 * min_feature_value)) * * if current_threshold == max_feature_value: # <<<<<<<<<<<<<< @@ -11785,7 +11859,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_threshold == __pyx_v_max_feature_value) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1477 + /* "sklearn/tree/_tree.pyx":1493 * * if current_threshold == max_feature_value: * current_threshold = min_feature_value # <<<<<<<<<<<<<< @@ -11797,7 +11871,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L10:; - /* "sklearn/tree/_tree.pyx":1480 + /* "sklearn/tree/_tree.pyx":1496 * * # Partition * partition_end = end # <<<<<<<<<<<<<< @@ -11806,7 +11880,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":1481 + /* "sklearn/tree/_tree.pyx":1497 * # Partition * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -11815,7 +11889,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1482 + /* "sklearn/tree/_tree.pyx":1498 * partition_end = end * p = start * while p < partition_end: # <<<<<<<<<<<<<< @@ -11826,7 +11900,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_5) break; - /* "sklearn/tree/_tree.pyx":1483 + /* "sklearn/tree/_tree.pyx":1499 * p = start * while p < partition_end: * current_feature_value = Xf[p] # <<<<<<<<<<<<<< @@ -11835,7 +11909,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":1484 + /* "sklearn/tree/_tree.pyx":1500 * while p < partition_end: * current_feature_value = Xf[p] * if current_feature_value <= current_threshold: # <<<<<<<<<<<<<< @@ -11845,7 +11919,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = ((__pyx_v_current_feature_value <= __pyx_v_current_threshold) != 0); if (__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1485 + /* "sklearn/tree/_tree.pyx":1501 * current_feature_value = Xf[p] * if current_feature_value <= current_threshold: * p += 1 # <<<<<<<<<<<<<< @@ -11857,7 +11931,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1487 + /* "sklearn/tree/_tree.pyx":1503 * p += 1 * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -11866,7 +11940,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":1489 + /* "sklearn/tree/_tree.pyx":1505 * partition_end -= 1 * * Xf[p] = Xf[partition_end] # <<<<<<<<<<<<<< @@ -11875,7 +11949,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":1490 + /* "sklearn/tree/_tree.pyx":1506 * * Xf[p] = Xf[partition_end] * Xf[partition_end] = current_feature_value # <<<<<<<<<<<<<< @@ -11884,7 +11958,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":1492 + /* "sklearn/tree/_tree.pyx":1508 * Xf[partition_end] = current_feature_value * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -11893,7 +11967,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":1493 + /* "sklearn/tree/_tree.pyx":1509 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -11902,7 +11976,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":1494 + /* "sklearn/tree/_tree.pyx":1510 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -11914,7 +11988,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L13:; } - /* "sklearn/tree/_tree.pyx":1496 + /* "sklearn/tree/_tree.pyx":1512 * samples[p] = tmp * * current_pos = partition_end # <<<<<<<<<<<<<< @@ -11923,7 +11997,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":1499 + /* "sklearn/tree/_tree.pyx":1515 * * # Reject if min_samples_leaf is not guaranteed * if (((current_pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -11933,7 +12007,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_5 = (((__pyx_v_current_pos - __pyx_v_start) < __pyx_v_min_samples_leaf) != 0); if (!__pyx_t_5) { - /* "sklearn/tree/_tree.pyx":1500 + /* "sklearn/tree/_tree.pyx":1516 * # Reject if min_samples_leaf is not guaranteed * if (((current_pos - start) < min_samples_leaf) or * ((end - current_pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -11947,7 +12021,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1501 + /* "sklearn/tree/_tree.pyx":1517 * if (((current_pos - start) < min_samples_leaf) or * ((end - current_pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -11957,7 +12031,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p goto __pyx_L3_continue; } - /* "sklearn/tree/_tree.pyx":1504 + /* "sklearn/tree/_tree.pyx":1520 * * # Evaluate split * self.criterion.reset() # <<<<<<<<<<<<<< @@ -11966,7 +12040,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":1505 + /* "sklearn/tree/_tree.pyx":1521 * # Evaluate split * self.criterion.reset() * self.criterion.update(current_pos) # <<<<<<<<<<<<<< @@ -11975,7 +12049,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":1506 + /* "sklearn/tree/_tree.pyx":1522 * self.criterion.reset() * self.criterion.update(current_pos) * current_improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -11984,7 +12058,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":1508 + /* "sklearn/tree/_tree.pyx":1524 * current_improvement = self.criterion.impurity_improvement(impurity) * * if current_improvement > best_improvement: # <<<<<<<<<<<<<< @@ -11994,7 +12068,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_7 = ((__pyx_v_current_improvement > __pyx_v_best_improvement) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1509 + /* "sklearn/tree/_tree.pyx":1525 * * if current_improvement > best_improvement: * self.criterion.children_impurity(¤t_impurity_left, # <<<<<<<<<<<<<< @@ -12003,7 +12077,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":1511 + /* "sklearn/tree/_tree.pyx":1527 * self.criterion.children_impurity(¤t_impurity_left, * ¤t_impurity_right) * best_impurity_left = current_impurity_left # <<<<<<<<<<<<<< @@ -12012,7 +12086,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_impurity_left = __pyx_v_current_impurity_left; - /* "sklearn/tree/_tree.pyx":1512 + /* "sklearn/tree/_tree.pyx":1528 * ¤t_impurity_right) * best_impurity_left = current_impurity_left * best_impurity_right = current_impurity_right # <<<<<<<<<<<<<< @@ -12021,7 +12095,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_impurity_right = __pyx_v_current_impurity_right; - /* "sklearn/tree/_tree.pyx":1513 + /* "sklearn/tree/_tree.pyx":1529 * best_impurity_left = current_impurity_left * best_impurity_right = current_impurity_right * best_improvement = current_improvement # <<<<<<<<<<<<<< @@ -12030,7 +12104,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_improvement = __pyx_v_current_improvement; - /* "sklearn/tree/_tree.pyx":1514 + /* "sklearn/tree/_tree.pyx":1530 * best_impurity_right = current_impurity_right * best_improvement = current_improvement * best_pos = current_pos # <<<<<<<<<<<<<< @@ -12039,7 +12113,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_pos = __pyx_v_current_pos; - /* "sklearn/tree/_tree.pyx":1515 + /* "sklearn/tree/_tree.pyx":1531 * best_improvement = current_improvement * best_pos = current_pos * best_feature = current_feature # <<<<<<<<<<<<<< @@ -12048,7 +12122,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_best_feature = __pyx_v_current_feature; - /* "sklearn/tree/_tree.pyx":1516 + /* "sklearn/tree/_tree.pyx":1532 * best_pos = current_pos * best_feature = current_feature * best_threshold = current_threshold # <<<<<<<<<<<<<< @@ -12066,7 +12140,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_L3_continue:; } - /* "sklearn/tree/_tree.pyx":1519 + /* "sklearn/tree/_tree.pyx":1535 * * # Reorganize into samples[start:best_pos] + samples[best_pos:end] * if best_pos < end and current_feature != best_feature: # <<<<<<<<<<<<<< @@ -12082,7 +12156,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1520 + /* "sklearn/tree/_tree.pyx":1536 * # Reorganize into samples[start:best_pos] + samples[best_pos:end] * if best_pos < end and current_feature != best_feature: * partition_end = end # <<<<<<<<<<<<<< @@ -12091,7 +12165,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":1521 + /* "sklearn/tree/_tree.pyx":1537 * if best_pos < end and current_feature != best_feature: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -12100,7 +12174,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1523 + /* "sklearn/tree/_tree.pyx":1539 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -12111,7 +12185,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_4 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_4) break; - /* "sklearn/tree/_tree.pyx":1525 + /* "sklearn/tree/_tree.pyx":1541 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best_feature] <= best_threshold: # <<<<<<<<<<<<<< @@ -12121,7 +12195,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p __pyx_t_4 = (((__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_4) { - /* "sklearn/tree/_tree.pyx":1526 + /* "sklearn/tree/_tree.pyx":1542 * if X[X_sample_stride * samples[p] + * X_fx_stride * best_feature] <= best_threshold: * p += 1 # <<<<<<<<<<<<<< @@ -12133,7 +12207,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } /*else*/ { - /* "sklearn/tree/_tree.pyx":1529 + /* "sklearn/tree/_tree.pyx":1545 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -12142,7 +12216,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":1531 + /* "sklearn/tree/_tree.pyx":1547 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -12151,7 +12225,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":1532 + /* "sklearn/tree/_tree.pyx":1548 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -12160,7 +12234,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":1533 + /* "sklearn/tree/_tree.pyx":1549 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -12175,7 +12249,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":1538 + /* "sklearn/tree/_tree.pyx":1554 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -12184,7 +12258,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":1541 + /* "sklearn/tree/_tree.pyx":1557 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -12193,7 +12267,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":1546 + /* "sklearn/tree/_tree.pyx":1562 * * # Return values * pos[0] = best_pos # <<<<<<<<<<<<<< @@ -12202,7 +12276,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_pos[0]) = __pyx_v_best_pos; - /* "sklearn/tree/_tree.pyx":1547 + /* "sklearn/tree/_tree.pyx":1563 * # Return values * pos[0] = best_pos * feature[0] = best_feature # <<<<<<<<<<<<<< @@ -12211,7 +12285,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_feature[0]) = __pyx_v_best_feature; - /* "sklearn/tree/_tree.pyx":1548 + /* "sklearn/tree/_tree.pyx":1564 * pos[0] = best_pos * feature[0] = best_feature * threshold[0] = best_threshold # <<<<<<<<<<<<<< @@ -12220,7 +12294,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_threshold[0]) = __pyx_v_best_threshold; - /* "sklearn/tree/_tree.pyx":1549 + /* "sklearn/tree/_tree.pyx":1565 * feature[0] = best_feature * threshold[0] = best_threshold * impurity_left[0] = best_impurity_left # <<<<<<<<<<<<<< @@ -12229,7 +12303,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_impurity_left[0]) = __pyx_v_best_impurity_left; - /* "sklearn/tree/_tree.pyx":1550 + /* "sklearn/tree/_tree.pyx":1566 * threshold[0] = best_threshold * impurity_left[0] = best_impurity_left * impurity_right[0] = best_impurity_right # <<<<<<<<<<<<<< @@ -12238,7 +12312,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_impurity_right[0]) = __pyx_v_best_impurity_right; - /* "sklearn/tree/_tree.pyx":1551 + /* "sklearn/tree/_tree.pyx":1567 * impurity_left[0] = best_impurity_left * impurity_right[0] = best_impurity_right * impurity_improvement[0] = best_improvement # <<<<<<<<<<<<<< @@ -12247,7 +12321,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p */ (__pyx_v_impurity_improvement[0]) = __pyx_v_best_improvement; - /* "sklearn/tree/_tree.pyx":1552 + /* "sklearn/tree/_tree.pyx":1568 * impurity_right[0] = best_impurity_right * impurity_improvement[0] = best_improvement * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -12256,7 +12330,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":1344 + /* "sklearn/tree/_tree.pyx":1360 * self.random_state), self.__getstate__()) * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -12267,7 +12341,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_14RandomSplitter_node_split(struct __p /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1565 +/* "sklearn/tree/_tree.pyx":1581 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12310,21 +12384,21 @@ 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, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __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, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_random_state)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __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 = 1565; __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 = 1581; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -12335,19 +12409,19 @@ static int __pyx_pw_7sklearn_4tree_5_tree_19PresortBestSplitter_1__cinit__(PyObj values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __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 = 1565; __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 = 1566; __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 = 1581; __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 = 1582; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_random_state = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __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 = 1565; __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 = 1581; __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_random_state); /* function exit code */ @@ -12364,7 +12438,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1568 + /* "sklearn/tree/_tree.pyx":1584 * SIZE_t min_samples_leaf, object random_state): * # Initialize pointers * self.X_old = NULL # <<<<<<<<<<<<<< @@ -12373,7 +12447,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_old = NULL; - /* "sklearn/tree/_tree.pyx":1569 + /* "sklearn/tree/_tree.pyx":1585 * # Initialize pointers * self.X_old = NULL * self.X_argsorted_ptr = NULL # <<<<<<<<<<<<<< @@ -12382,7 +12456,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1570 + /* "sklearn/tree/_tree.pyx":1586 * self.X_old = NULL * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 # <<<<<<<<<<<<<< @@ -12391,7 +12465,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->X_argsorted_stride = 0; - /* "sklearn/tree/_tree.pyx":1571 + /* "sklearn/tree/_tree.pyx":1587 * self.X_argsorted_ptr = NULL * self.X_argsorted_stride = 0 * self.sample_mask = NULL # <<<<<<<<<<<<<< @@ -12400,7 +12474,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct */ __pyx_v_self->sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1565 + /* "sklearn/tree/_tree.pyx":1581 * cdef unsigned char* sample_mask * * def __cinit__(self, Criterion criterion, SIZE_t max_features, # <<<<<<<<<<<<<< @@ -12414,7 +12488,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter___cinit__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1573 +/* "sklearn/tree/_tree.pyx":1589 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12437,7 +12511,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_tree.pyx":1575 + /* "sklearn/tree/_tree.pyx":1591 * def __dealloc__(self): * """Destructor.""" * free(self.sample_mask) # <<<<<<<<<<<<<< @@ -12446,7 +12520,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st */ free(__pyx_v_self->sample_mask); - /* "sklearn/tree/_tree.pyx":1573 + /* "sklearn/tree/_tree.pyx":1589 * self.sample_mask = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -12458,7 +12532,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_2__dealloc__(st __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1577 +/* "sklearn/tree/_tree.pyx":1593 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -12490,7 +12564,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); - /* "sklearn/tree/_tree.pyx":1578 + /* "sklearn/tree/_tree.pyx":1594 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< @@ -12499,34 +12573,34 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ */ __Pyx_XDECREF(__pyx_r); - /* "sklearn/tree/_tree.pyx":1579 + /* "sklearn/tree/_tree.pyx":1595 * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, * self.max_features, # <<<<<<<<<<<<<< * self.min_samples_leaf, * self.random_state), self.__getstate__()) */ - __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 = 1579; __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 = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":1580 + /* "sklearn/tree/_tree.pyx":1596 * return (PresortBestSplitter, (self.criterion, * self.max_features, * self.min_samples_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 = 1580; __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 = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":1578 + /* "sklearn/tree/_tree.pyx":1594 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_3 = PyTuple_New(4); 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(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.criterion)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->__pyx_base.criterion)); @@ -12541,27 +12615,27 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":1581 + /* "sklearn/tree/_tree.pyx":1597 * self.max_features, * self.min_samples_leaf, * self.random_state), self.__getstate__()) # <<<<<<<<<<<<<< * * cdef void init(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 = 1581; __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 = 1597; __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 = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1597; __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":1578 + /* "sklearn/tree/_tree.pyx":1594 * * def __reduce__(self): * return (PresortBestSplitter, (self.criterion, # <<<<<<<<<<<<<< * self.max_features, * self.min_samples_leaf, */ - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1578; __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 = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)__pyx_ptype_7sklearn_4tree_5_tree_PresortBestSplitter))); @@ -12576,7 +12650,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ __pyx_t_2 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":1577 + /* "sklearn/tree/_tree.pyx":1593 * free(self.sample_mask) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -12597,7 +12671,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_19PresortBestSplitter_4__reduce_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1583 +/* "sklearn/tree/_tree.pyx":1599 * self.random_state), self.__getstate__()) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -12634,16 +12708,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 = 1583; __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 = 1599; __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 = 1583; __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 = 1599; __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":1587 + /* "sklearn/tree/_tree.pyx":1603 * np.ndarray[DOUBLE_t, ndim=2, mode="c"] y, * DOUBLE_t* sample_weight): * cdef void* sample_mask = NULL # <<<<<<<<<<<<<< @@ -12652,7 +12726,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_sample_mask = NULL; - /* "sklearn/tree/_tree.pyx":1590 + /* "sklearn/tree/_tree.pyx":1606 * * # Call parent initializer * Splitter.init(self, X, y, sample_weight) # <<<<<<<<<<<<<< @@ -12661,7 +12735,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":1593 + /* "sklearn/tree/_tree.pyx":1609 * * # Pre-sort X * if self.X_old != self.X: # <<<<<<<<<<<<<< @@ -12671,7 +12745,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":1594 + /* "sklearn/tree/_tree.pyx":1610 * # Pre-sort X * if self.X_old != self.X: * self.X_old = self.X # <<<<<<<<<<<<<< @@ -12681,79 +12755,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":1595 + /* "sklearn/tree/_tree.pyx":1611 * 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 = 1595; __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 = 1611; __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 = 1595; __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 = 1611; __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 = 1595; __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 = 1611; __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 = 1595; __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 = 1611; __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 = 1595; __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 = 1611; __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 = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __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 = 1595; __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 = 1595; __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 = 1611; __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 = 1611; __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 = 1595; __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 = 1611; __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 = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "sklearn/tree/_tree.pyx":1596 + /* "sklearn/tree/_tree.pyx":1612 * 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 = 1596; __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 = 1612; __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 = 1596; __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 = 1612; __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 = 1595; __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 = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1595 + /* "sklearn/tree/_tree.pyx":1611 * 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 = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __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 = 1595; __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 = 1611; __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":1597 + /* "sklearn/tree/_tree.pyx":1613 * self.X_argsorted = np.asfortranarray(np.argsort(X, axis=0), * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data # <<<<<<<<<<<<<< @@ -12762,19 +12836,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":1599 + /* "sklearn/tree/_tree.pyx":1615 * 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 = 1599; __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 = 1615; __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 = 1599; __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 = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1598 + /* "sklearn/tree/_tree.pyx":1614 * dtype=np.int32) * self.X_argsorted_ptr = self.X_argsorted.data * self.X_argsorted_stride = ( self.X_argsorted.strides[1] / # <<<<<<<<<<<<<< @@ -12783,7 +12857,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":1601 + /* "sklearn/tree/_tree.pyx":1617 * self.X_argsorted.itemsize) * * self.n_total_samples = X.shape[0] # <<<<<<<<<<<<<< @@ -12792,7 +12866,7 @@ 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":1602 + /* "sklearn/tree/_tree.pyx":1618 * * self.n_total_samples = X.shape[0] * sample_mask = realloc(self.sample_mask, self.n_total_samples) # <<<<<<<<<<<<<< @@ -12801,7 +12875,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ __pyx_v_sample_mask = realloc(__pyx_v_self->sample_mask, __pyx_v_self->n_total_samples); - /* "sklearn/tree/_tree.pyx":1603 + /* "sklearn/tree/_tree.pyx":1619 * self.n_total_samples = X.shape[0] * sample_mask = realloc(self.sample_mask, self.n_total_samples) * if sample_mask == NULL: # <<<<<<<<<<<<<< @@ -12811,40 +12885,40 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __pyx_t_1 = ((__pyx_v_sample_mask == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":1605 + /* "sklearn/tree/_tree.pyx":1621 * if sample_mask == NULL: * raise MemoryError("failed to allocate %d bytes" * % self.n_total_samples) # <<<<<<<<<<<<<< * memset(sample_mask, 0, self.n_total_samples) * self.sample_mask = sample_mask */ - __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_total_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->n_total_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_d_bytes, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_d_bytes, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/tree/_tree.pyx":1604 + /* "sklearn/tree/_tree.pyx":1620 * sample_mask = realloc(self.sample_mask, self.n_total_samples) * if sample_mask == NULL: * raise MemoryError("failed to allocate %d bytes" # <<<<<<<<<<<<<< * % self.n_total_samples) * memset(sample_mask, 0, self.n_total_samples) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __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 = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1606 + /* "sklearn/tree/_tree.pyx":1622 * raise MemoryError("failed to allocate %d bytes" * % self.n_total_samples) * memset(sample_mask, 0, self.n_total_samples) # <<<<<<<<<<<<<< @@ -12853,7 +12927,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py */ memset(__pyx_v_sample_mask, 0, __pyx_v_self->n_total_samples); - /* "sklearn/tree/_tree.pyx":1607 + /* "sklearn/tree/_tree.pyx":1623 * % self.n_total_samples) * memset(sample_mask, 0, self.n_total_samples) * self.sample_mask = sample_mask # <<<<<<<<<<<<<< @@ -12865,7 +12939,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":1583 + /* "sklearn/tree/_tree.pyx":1599 * self.random_state), self.__getstate__()) * * cdef void init(self, # <<<<<<<<<<<<<< @@ -12895,7 +12969,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_init(struct __py __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":1609 +/* "sklearn/tree/_tree.pyx":1625 * self.sample_mask = sample_mask * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -12956,7 +13030,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc int __pyx_t_9; int __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1616 + /* "sklearn/tree/_tree.pyx":1632 * """Find the best split on node samples[start:end].""" * # Find the best split * cdef SIZE_t* samples = self.samples # <<<<<<<<<<<<<< @@ -12966,7 +13040,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":1617 + /* "sklearn/tree/_tree.pyx":1633 * # Find the best split * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start # <<<<<<<<<<<<<< @@ -12976,7 +13050,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":1618 + /* "sklearn/tree/_tree.pyx":1634 * cdef SIZE_t* samples = self.samples * cdef SIZE_t start = self.start * cdef SIZE_t end = self.end # <<<<<<<<<<<<<< @@ -12986,7 +13060,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":1620 + /* "sklearn/tree/_tree.pyx":1636 * cdef SIZE_t end = self.end * * cdef SIZE_t* features = self.features # <<<<<<<<<<<<<< @@ -12996,7 +13070,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":1621 + /* "sklearn/tree/_tree.pyx":1637 * * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features # <<<<<<<<<<<<<< @@ -13006,7 +13080,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":1622 + /* "sklearn/tree/_tree.pyx":1638 * cdef SIZE_t* features = self.features * cdef SIZE_t* constant_features = self.constant_features * cdef SIZE_t n_features = self.n_features # <<<<<<<<<<<<<< @@ -13016,7 +13090,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":1624 + /* "sklearn/tree/_tree.pyx":1640 * cdef SIZE_t n_features = self.n_features * * cdef DTYPE_t* X = self.X # <<<<<<<<<<<<<< @@ -13026,7 +13100,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":1625 + /* "sklearn/tree/_tree.pyx":1641 * * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values # <<<<<<<<<<<<<< @@ -13036,7 +13110,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":1626 + /* "sklearn/tree/_tree.pyx":1642 * cdef DTYPE_t* X = self.X * cdef DTYPE_t* Xf = self.feature_values * cdef SIZE_t X_sample_stride = self.X_sample_stride # <<<<<<<<<<<<<< @@ -13046,7 +13120,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":1627 + /* "sklearn/tree/_tree.pyx":1643 * 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 # <<<<<<<<<<<<<< @@ -13056,7 +13130,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":1628 + /* "sklearn/tree/_tree.pyx":1644 * 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 # <<<<<<<<<<<<<< @@ -13066,7 +13140,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":1629 + /* "sklearn/tree/_tree.pyx":1645 * 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 # <<<<<<<<<<<<<< @@ -13076,7 +13150,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":1630 + /* "sklearn/tree/_tree.pyx":1646 * 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 # <<<<<<<<<<<<<< @@ -13086,7 +13160,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":1631 + /* "sklearn/tree/_tree.pyx":1647 * 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 # <<<<<<<<<<<<<< @@ -13096,7 +13170,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":1633 + /* "sklearn/tree/_tree.pyx":1649 * cdef unsigned char* sample_mask = self.sample_mask * * cdef SIZE_t max_features = self.max_features # <<<<<<<<<<<<<< @@ -13106,7 +13180,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":1634 + /* "sklearn/tree/_tree.pyx":1650 * * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -13116,7 +13190,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":1635 + /* "sklearn/tree/_tree.pyx":1651 * cdef SIZE_t max_features = self.max_features * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef UINT32_t* random_state = &self.rand_r_state # <<<<<<<<<<<<<< @@ -13125,7 +13199,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":1637 + /* "sklearn/tree/_tree.pyx":1653 * cdef UINT32_t* random_state = &self.rand_r_state * * cdef double best_impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -13134,7 +13208,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_impurity_left = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1638 + /* "sklearn/tree/_tree.pyx":1654 * * cdef double best_impurity_left = INFINITY * cdef double best_impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -13143,7 +13217,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_impurity_right = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1639 + /* "sklearn/tree/_tree.pyx":1655 * cdef double best_impurity_left = INFINITY * cdef double best_impurity_right = INFINITY * cdef SIZE_t best_pos = end # <<<<<<<<<<<<<< @@ -13152,7 +13226,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1640 + /* "sklearn/tree/_tree.pyx":1656 * cdef double best_impurity_right = INFINITY * cdef SIZE_t best_pos = end * cdef SIZE_t best_feature = 0 # <<<<<<<<<<<<<< @@ -13161,7 +13235,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_feature = 0; - /* "sklearn/tree/_tree.pyx":1641 + /* "sklearn/tree/_tree.pyx":1657 * cdef SIZE_t best_pos = end * cdef SIZE_t best_feature = 0 * cdef double best_threshold = 0. # <<<<<<<<<<<<<< @@ -13170,7 +13244,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_threshold = 0.; - /* "sklearn/tree/_tree.pyx":1642 + /* "sklearn/tree/_tree.pyx":1658 * cdef SIZE_t best_feature = 0 * cdef double best_threshold = 0. * cdef double best_improvement = -INFINITY # <<<<<<<<<<<<<< @@ -13179,7 +13253,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_improvement = (-__pyx_v_7sklearn_4tree_5_tree_INFINITY); - /* "sklearn/tree/_tree.pyx":1652 + /* "sklearn/tree/_tree.pyx":1668 * cdef double current_threshold * * cdef SIZE_t f_i = n_features # <<<<<<<<<<<<<< @@ -13188,7 +13262,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":1655 + /* "sklearn/tree/_tree.pyx":1671 * cdef SIZE_t f_j, p * # Number of features discovered to be constant during the split search * cdef SIZE_t n_found_constants = 0 # <<<<<<<<<<<<<< @@ -13197,7 +13271,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_found_constants = 0; - /* "sklearn/tree/_tree.pyx":1657 + /* "sklearn/tree/_tree.pyx":1673 * 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 # <<<<<<<<<<<<<< @@ -13206,7 +13280,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_drawn_constants = 0; - /* "sklearn/tree/_tree.pyx":1658 + /* "sklearn/tree/_tree.pyx":1674 * # 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] # <<<<<<<<<<<<<< @@ -13215,7 +13289,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":1660 + /* "sklearn/tree/_tree.pyx":1676 * 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 # <<<<<<<<<<<<<< @@ -13224,7 +13298,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":1661 + /* "sklearn/tree/_tree.pyx":1677 * # 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 # <<<<<<<<<<<<<< @@ -13233,7 +13307,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_n_visited_features = 0; - /* "sklearn/tree/_tree.pyx":1666 + /* "sklearn/tree/_tree.pyx":1682 * * # Set sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -13244,7 +13318,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc for (__pyx_t_6 = __pyx_v_start; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_p = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1667 + /* "sklearn/tree/_tree.pyx":1683 * # Set sample mask * for p in range(start, end): * sample_mask[samples[p]] = 1 # <<<<<<<<<<<<<< @@ -13254,7 +13328,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":1678 + /* "sklearn/tree/_tree.pyx":1694 * # newly discovered constant features to spare computation on descendant * # nodes. * while (f_i > n_total_constants and # Stop early if remaining features # <<<<<<<<<<<<<< @@ -13265,7 +13339,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_7 = ((__pyx_v_f_i > __pyx_v_n_total_constants) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1680 + /* "sklearn/tree/_tree.pyx":1696 * while (f_i > n_total_constants and # Stop early if remaining features * # are constant * (n_visited_features < max_features or # <<<<<<<<<<<<<< @@ -13275,7 +13349,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_n_visited_features < __pyx_v_max_features) != 0); if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1682 + /* "sklearn/tree/_tree.pyx":1698 * (n_visited_features < max_features or * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): # <<<<<<<<<<<<<< @@ -13293,7 +13367,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1683 + /* "sklearn/tree/_tree.pyx":1699 * # At least one drawn features must be non constant * n_visited_features <= n_found_constants + n_drawn_constants)): * n_visited_features += 1 # <<<<<<<<<<<<<< @@ -13302,7 +13376,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":1698 + /* "sklearn/tree/_tree.pyx":1714 * # Draw a feature at random * f_j = rand_int(f_i - n_drawn_constants - n_found_constants, * random_state) + n_drawn_constants # <<<<<<<<<<<<<< @@ -13311,7 +13385,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":1700 + /* "sklearn/tree/_tree.pyx":1716 * random_state) + n_drawn_constants * * if f_j < n_known_constants: # <<<<<<<<<<<<<< @@ -13321,7 +13395,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_f_j < __pyx_v_n_known_constants) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1702 + /* "sklearn/tree/_tree.pyx":1718 * if f_j < n_known_constants: * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] # <<<<<<<<<<<<<< @@ -13330,7 +13404,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":1703 + /* "sklearn/tree/_tree.pyx":1719 * # f_j is in [n_drawn_constants, n_known_constants[ * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] # <<<<<<<<<<<<<< @@ -13339,7 +13413,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":1704 + /* "sklearn/tree/_tree.pyx":1720 * tmp = features[f_j] * features[f_j] = features[n_drawn_constants] * features[n_drawn_constants] = tmp # <<<<<<<<<<<<<< @@ -13348,7 +13422,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":1706 + /* "sklearn/tree/_tree.pyx":1722 * features[n_drawn_constants] = tmp * * n_drawn_constants += 1 # <<<<<<<<<<<<<< @@ -13360,7 +13434,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1710 + /* "sklearn/tree/_tree.pyx":1726 * else: * # f_j in the interval [n_known_constants, f_i - n_found_constants[ * f_j += n_found_constants # <<<<<<<<<<<<<< @@ -13369,7 +13443,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":1713 + /* "sklearn/tree/_tree.pyx":1729 * # f_j in the interval [n_total_constants, f_i[ * * current_feature = features[f_j] # <<<<<<<<<<<<<< @@ -13378,7 +13452,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":1716 + /* "sklearn/tree/_tree.pyx":1732 * * # Extract ordering from X_argsorted * p = start # <<<<<<<<<<<<<< @@ -13387,7 +13461,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1718 + /* "sklearn/tree/_tree.pyx":1734 * p = start * * for i in range(n_total_samples): # <<<<<<<<<<<<<< @@ -13398,7 +13472,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_2; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1719 + /* "sklearn/tree/_tree.pyx":1735 * * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current_feature + i] # <<<<<<<<<<<<<< @@ -13407,7 +13481,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":1720 + /* "sklearn/tree/_tree.pyx":1736 * for i in range(n_total_samples): * j = X_argsorted[X_argsorted_stride * current_feature + i] * if sample_mask[j] == 1: # <<<<<<<<<<<<<< @@ -13417,7 +13491,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = (((__pyx_v_sample_mask[__pyx_v_j]) == 1) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1721 + /* "sklearn/tree/_tree.pyx":1737 * j = X_argsorted[X_argsorted_stride * current_feature + i] * if sample_mask[j] == 1: * samples[p] = j # <<<<<<<<<<<<<< @@ -13426,7 +13500,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":1722 + /* "sklearn/tree/_tree.pyx":1738 * if sample_mask[j] == 1: * samples[p] = j * Xf[p] = X[X_sample_stride * j + # <<<<<<<<<<<<<< @@ -13435,7 +13509,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":1724 + /* "sklearn/tree/_tree.pyx":1740 * Xf[p] = X[X_sample_stride * j + * X_fx_stride * current_feature] * p += 1 # <<<<<<<<<<<<<< @@ -13448,7 +13522,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":1727 + /* "sklearn/tree/_tree.pyx":1743 * * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: # <<<<<<<<<<<<<< @@ -13458,7 +13532,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = (((__pyx_v_Xf[(__pyx_v_end - 1)]) <= ((__pyx_v_Xf[__pyx_v_start]) + __pyx_v_7sklearn_4tree_5_tree_FEATURE_THRESHOLD)) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1728 + /* "sklearn/tree/_tree.pyx":1744 * # Evaluate all splits * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] # <<<<<<<<<<<<<< @@ -13467,7 +13541,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":1729 + /* "sklearn/tree/_tree.pyx":1745 * if Xf[end - 1] <= Xf[start] + FEATURE_THRESHOLD: * features[f_j] = features[n_total_constants] * features[n_total_constants] = current_feature # <<<<<<<<<<<<<< @@ -13476,7 +13550,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_features[__pyx_v_n_total_constants]) = __pyx_v_current_feature; - /* "sklearn/tree/_tree.pyx":1731 + /* "sklearn/tree/_tree.pyx":1747 * features[n_total_constants] = current_feature * * n_found_constants += 1 # <<<<<<<<<<<<<< @@ -13485,7 +13559,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":1732 + /* "sklearn/tree/_tree.pyx":1748 * * n_found_constants += 1 * n_total_constants += 1 # <<<<<<<<<<<<<< @@ -13497,7 +13571,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1735 + /* "sklearn/tree/_tree.pyx":1751 * * else: * f_i -= 1 # <<<<<<<<<<<<<< @@ -13506,7 +13580,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":1736 + /* "sklearn/tree/_tree.pyx":1752 * else: * f_i -= 1 * features[f_i], features[f_j] = features[f_j], features[f_i] # <<<<<<<<<<<<<< @@ -13518,7 +13592,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_6; - /* "sklearn/tree/_tree.pyx":1738 + /* "sklearn/tree/_tree.pyx":1754 * features[f_i], features[f_j] = features[f_j], features[f_i] * * self.criterion.reset() # <<<<<<<<<<<<<< @@ -13527,7 +13601,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":1739 + /* "sklearn/tree/_tree.pyx":1755 * * self.criterion.reset() * p = start # <<<<<<<<<<<<<< @@ -13536,7 +13610,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1741 + /* "sklearn/tree/_tree.pyx":1757 * p = start * * while p < end: # <<<<<<<<<<<<<< @@ -13547,7 +13621,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = ((__pyx_v_p < __pyx_v_end) != 0); if (!__pyx_t_8) break; - /* "sklearn/tree/_tree.pyx":1742 + /* "sklearn/tree/_tree.pyx":1758 * * while p < end: * while (p + 1 < end and # <<<<<<<<<<<<<< @@ -13558,7 +13632,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_8 = (((__pyx_v_p + 1) < __pyx_v_end) != 0); if (__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":1743 + /* "sklearn/tree/_tree.pyx":1759 * while p < end: * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): # <<<<<<<<<<<<<< @@ -13572,7 +13646,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (!__pyx_t_10) break; - /* "sklearn/tree/_tree.pyx":1744 + /* "sklearn/tree/_tree.pyx":1760 * while (p + 1 < end and * Xf[p + 1] <= Xf[p] + FEATURE_THRESHOLD): * p += 1 # <<<<<<<<<<<<<< @@ -13582,7 +13656,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_v_p = (__pyx_v_p + 1); } - /* "sklearn/tree/_tree.pyx":1748 + /* "sklearn/tree/_tree.pyx":1764 * # (p + 1 >= end) or (X[samples[p + 1], current_feature] > * # X[samples[p], current_feature]) * p += 1 # <<<<<<<<<<<<<< @@ -13591,7 +13665,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = (__pyx_v_p + 1); - /* "sklearn/tree/_tree.pyx":1752 + /* "sklearn/tree/_tree.pyx":1768 * # X[samples[p - 1], current_feature]) * * if p < end: # <<<<<<<<<<<<<< @@ -13601,7 +13675,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_10 = ((__pyx_v_p < __pyx_v_end) != 0); if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":1753 + /* "sklearn/tree/_tree.pyx":1769 * * if p < end: * current_pos = p # <<<<<<<<<<<<<< @@ -13610,7 +13684,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_current_pos = __pyx_v_p; - /* "sklearn/tree/_tree.pyx":1756 + /* "sklearn/tree/_tree.pyx":1772 * * # Reject if min_samples_leaf is not guaranteed * if (((current_pos - start) < min_samples_leaf) or # <<<<<<<<<<<<<< @@ -13620,7 +13694,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_10 = (((__pyx_v_current_pos - __pyx_v_start) < __pyx_v_min_samples_leaf) != 0); if (!__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":1757 + /* "sklearn/tree/_tree.pyx":1773 * # Reject if min_samples_leaf is not guaranteed * if (((current_pos - start) < min_samples_leaf) or * ((end - current_pos) < min_samples_leaf)): # <<<<<<<<<<<<<< @@ -13634,7 +13708,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1758 + /* "sklearn/tree/_tree.pyx":1774 * if (((current_pos - start) < min_samples_leaf) or * ((end - current_pos) < min_samples_leaf)): * continue # <<<<<<<<<<<<<< @@ -13644,7 +13718,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc goto __pyx_L12_continue; } - /* "sklearn/tree/_tree.pyx":1760 + /* "sklearn/tree/_tree.pyx":1776 * continue * * self.criterion.update(current_pos) # <<<<<<<<<<<<<< @@ -13653,7 +13727,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":1761 + /* "sklearn/tree/_tree.pyx":1777 * * self.criterion.update(current_pos) * current_improvement = self.criterion.impurity_improvement(impurity) # <<<<<<<<<<<<<< @@ -13662,7 +13736,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":1763 + /* "sklearn/tree/_tree.pyx":1779 * current_improvement = self.criterion.impurity_improvement(impurity) * * if current_improvement > best_improvement: # <<<<<<<<<<<<<< @@ -13672,7 +13746,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_7 = ((__pyx_v_current_improvement > __pyx_v_best_improvement) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1764 + /* "sklearn/tree/_tree.pyx":1780 * * if current_improvement > best_improvement: * self.criterion.children_impurity(¤t_impurity_left, # <<<<<<<<<<<<<< @@ -13681,7 +13755,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":1766 + /* "sklearn/tree/_tree.pyx":1782 * self.criterion.children_impurity(¤t_impurity_left, * ¤t_impurity_right) * best_impurity_left = current_impurity_left # <<<<<<<<<<<<<< @@ -13690,7 +13764,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_impurity_left = __pyx_v_current_impurity_left; - /* "sklearn/tree/_tree.pyx":1767 + /* "sklearn/tree/_tree.pyx":1783 * ¤t_impurity_right) * best_impurity_left = current_impurity_left * best_impurity_right = current_impurity_right # <<<<<<<<<<<<<< @@ -13699,7 +13773,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_impurity_right = __pyx_v_current_impurity_right; - /* "sklearn/tree/_tree.pyx":1768 + /* "sklearn/tree/_tree.pyx":1784 * best_impurity_left = current_impurity_left * best_impurity_right = current_impurity_right * best_improvement = current_improvement # <<<<<<<<<<<<<< @@ -13708,7 +13782,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_improvement = __pyx_v_current_improvement; - /* "sklearn/tree/_tree.pyx":1769 + /* "sklearn/tree/_tree.pyx":1785 * best_impurity_right = current_impurity_right * best_improvement = current_improvement * best_pos = current_pos # <<<<<<<<<<<<<< @@ -13717,7 +13791,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_pos = __pyx_v_current_pos; - /* "sklearn/tree/_tree.pyx":1770 + /* "sklearn/tree/_tree.pyx":1786 * best_improvement = current_improvement * best_pos = current_pos * best_feature = current_feature # <<<<<<<<<<<<<< @@ -13726,7 +13800,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_best_feature = __pyx_v_current_feature; - /* "sklearn/tree/_tree.pyx":1772 + /* "sklearn/tree/_tree.pyx":1788 * best_feature = current_feature * * current_threshold = (Xf[p - 1] + Xf[p]) / 2.0 # <<<<<<<<<<<<<< @@ -13735,7 +13809,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":1774 + /* "sklearn/tree/_tree.pyx":1790 * current_threshold = (Xf[p - 1] + Xf[p]) / 2.0 * * if current_threshold == Xf[p]: # <<<<<<<<<<<<<< @@ -13745,7 +13819,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_7 = ((__pyx_v_current_threshold == (__pyx_v_Xf[__pyx_v_p])) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1775 + /* "sklearn/tree/_tree.pyx":1791 * * if current_threshold == Xf[p]: * current_threshold = Xf[p - 1] # <<<<<<<<<<<<<< @@ -13757,7 +13831,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } __pyx_L19:; - /* "sklearn/tree/_tree.pyx":1777 + /* "sklearn/tree/_tree.pyx":1793 * current_threshold = Xf[p - 1] * * best_threshold = current_threshold # <<<<<<<<<<<<<< @@ -13779,7 +13853,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_L7:; } - /* "sklearn/tree/_tree.pyx":1780 + /* "sklearn/tree/_tree.pyx":1796 * * # Reorganize into samples[start:best_pos] + samples[best_pos:end] * if best_pos < end: # <<<<<<<<<<<<<< @@ -13789,7 +13863,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_7 = ((__pyx_v_best_pos < __pyx_v_end) != 0); if (__pyx_t_7) { - /* "sklearn/tree/_tree.pyx":1781 + /* "sklearn/tree/_tree.pyx":1797 * # Reorganize into samples[start:best_pos] + samples[best_pos:end] * if best_pos < end: * partition_end = end # <<<<<<<<<<<<<< @@ -13798,7 +13872,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_partition_end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":1782 + /* "sklearn/tree/_tree.pyx":1798 * if best_pos < end: * partition_end = end * p = start # <<<<<<<<<<<<<< @@ -13807,7 +13881,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ __pyx_v_p = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":1784 + /* "sklearn/tree/_tree.pyx":1800 * p = start * * while p < partition_end: # <<<<<<<<<<<<<< @@ -13818,7 +13892,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_7 = ((__pyx_v_p < __pyx_v_partition_end) != 0); if (!__pyx_t_7) break; - /* "sklearn/tree/_tree.pyx":1786 + /* "sklearn/tree/_tree.pyx":1802 * while p < partition_end: * if X[X_sample_stride * samples[p] + * X_fx_stride * best_feature] <= best_threshold: # <<<<<<<<<<<<<< @@ -13828,7 +13902,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc __pyx_t_7 = (((__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_7) { - /* "sklearn/tree/_tree.pyx":1787 + /* "sklearn/tree/_tree.pyx":1803 * if X[X_sample_stride * samples[p] + * X_fx_stride * best_feature] <= best_threshold: * p += 1 # <<<<<<<<<<<<<< @@ -13840,7 +13914,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } /*else*/ { - /* "sklearn/tree/_tree.pyx":1790 + /* "sklearn/tree/_tree.pyx":1806 * * else: * partition_end -= 1 # <<<<<<<<<<<<<< @@ -13849,7 +13923,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":1792 + /* "sklearn/tree/_tree.pyx":1808 * partition_end -= 1 * * tmp = samples[partition_end] # <<<<<<<<<<<<<< @@ -13858,7 +13932,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":1793 + /* "sklearn/tree/_tree.pyx":1809 * * tmp = samples[partition_end] * samples[partition_end] = samples[p] # <<<<<<<<<<<<<< @@ -13867,7 +13941,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":1794 + /* "sklearn/tree/_tree.pyx":1810 * tmp = samples[partition_end] * samples[partition_end] = samples[p] * samples[p] = tmp # <<<<<<<<<<<<<< @@ -13882,7 +13956,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc } __pyx_L20:; - /* "sklearn/tree/_tree.pyx":1797 + /* "sklearn/tree/_tree.pyx":1813 * * # Reset sample mask * for p in range(start, end): # <<<<<<<<<<<<<< @@ -13893,7 +13967,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_6; __pyx_t_2+=1) { __pyx_v_p = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":1798 + /* "sklearn/tree/_tree.pyx":1814 * # Reset sample mask * for p in range(start, end): * sample_mask[samples[p]] = 0 # <<<<<<<<<<<<<< @@ -13903,7 +13977,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":1803 + /* "sklearn/tree/_tree.pyx":1819 * # element in features[:n_known_constants] must be preserved for sibling * # and child nodes * memcpy(features, constant_features, sizeof(SIZE_t) * n_known_constants) # <<<<<<<<<<<<<< @@ -13912,7 +13986,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":1806 + /* "sklearn/tree/_tree.pyx":1822 * * # Copy newly found constant features * memcpy(constant_features + n_known_constants, # <<<<<<<<<<<<<< @@ -13921,7 +13995,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":1811 + /* "sklearn/tree/_tree.pyx":1827 * * # Return values * pos[0] = best_pos # <<<<<<<<<<<<<< @@ -13930,7 +14004,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_pos[0]) = __pyx_v_best_pos; - /* "sklearn/tree/_tree.pyx":1812 + /* "sklearn/tree/_tree.pyx":1828 * # Return values * pos[0] = best_pos * feature[0] = best_feature # <<<<<<<<<<<<<< @@ -13939,7 +14013,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_feature[0]) = __pyx_v_best_feature; - /* "sklearn/tree/_tree.pyx":1813 + /* "sklearn/tree/_tree.pyx":1829 * pos[0] = best_pos * feature[0] = best_feature * threshold[0] = best_threshold # <<<<<<<<<<<<<< @@ -13948,7 +14022,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_threshold[0]) = __pyx_v_best_threshold; - /* "sklearn/tree/_tree.pyx":1814 + /* "sklearn/tree/_tree.pyx":1830 * feature[0] = best_feature * threshold[0] = best_threshold * impurity_left[0] = best_impurity_left # <<<<<<<<<<<<<< @@ -13957,7 +14031,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_impurity_left[0]) = __pyx_v_best_impurity_left; - /* "sklearn/tree/_tree.pyx":1815 + /* "sklearn/tree/_tree.pyx":1831 * threshold[0] = best_threshold * impurity_left[0] = best_impurity_left * impurity_right[0] = best_impurity_right # <<<<<<<<<<<<<< @@ -13966,7 +14040,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_impurity_right[0]) = __pyx_v_best_impurity_right; - /* "sklearn/tree/_tree.pyx":1816 + /* "sklearn/tree/_tree.pyx":1832 * impurity_left[0] = best_impurity_left * impurity_right[0] = best_impurity_right * impurity_improvement[0] = best_improvement # <<<<<<<<<<<<<< @@ -13975,7 +14049,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc */ (__pyx_v_impurity_improvement[0]) = __pyx_v_best_improvement; - /* "sklearn/tree/_tree.pyx":1817 + /* "sklearn/tree/_tree.pyx":1833 * impurity_right[0] = best_impurity_right * impurity_improvement[0] = best_improvement * n_constant_features[0] = n_total_constants # <<<<<<<<<<<<<< @@ -13984,7 +14058,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":1609 + /* "sklearn/tree/_tree.pyx":1625 * self.sample_mask = sample_mask * * cdef void node_split(self, double impurity, SIZE_t* pos, SIZE_t* feature, # <<<<<<<<<<<<<< @@ -13995,7 +14069,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_19PresortBestSplitter_node_split(struc /* function exit code */ } -/* "sklearn/tree/_tree.pyx":1826 +/* "sklearn/tree/_tree.pyx":1842 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14006,7 +14080,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":1827 + /* "sklearn/tree/_tree.pyx":1843 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -14029,7 +14103,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED } } - /* "sklearn/tree/_tree.pyx":1826 + /* "sklearn/tree/_tree.pyx":1842 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14040,11 +14114,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 = 1826; __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 = 1842; __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 = 1826; __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 = 1842; __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)); @@ -14058,7 +14132,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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1842; __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; @@ -14069,7 +14143,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":1828 + /* "sklearn/tree/_tree.pyx":1844 * 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).""" # <<<<<<<<<<<<<< @@ -14092,7 +14166,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_11TreeBuilder_build(CYTHON_UNUSED return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1826 +/* "sklearn/tree/_tree.pyx":1842 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14118,7 +14192,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":1827 + /* "sklearn/tree/_tree.pyx":1843 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -14145,12 +14219,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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -14159,7 +14233,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 = 1826; __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 = 1842; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -14178,19 +14252,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 = 1826; __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 = 1842; __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 = 1826; __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 = 1826; __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 = 1826; __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 = 1827; __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 = 1842; __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 = 1842; __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 = 1842; __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 = 1843; __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":1826 + /* "sklearn/tree/_tree.pyx":1842 * """Interface for different tree building strategies. """ * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14219,7 +14293,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 = 1826; __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 = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14236,7 +14310,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_11TreeBuilder_build(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1837 +/* "sklearn/tree/_tree.pyx":1853 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -14279,21 +14353,21 @@ 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, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __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, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __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 = 1837; __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; @@ -14304,19 +14378,19 @@ static int __pyx_pw_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_1__cinit__(PyO values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __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 = 1837; __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 = 1838; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[3]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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 = 1853; __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 = 1854; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[3]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __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 = 1837; __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 = 1853; __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_max_depth); /* function exit code */ @@ -14333,7 +14407,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":1839 + /* "sklearn/tree/_tree.pyx":1855 * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, * SIZE_t min_samples_leaf, SIZE_t max_depth): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -14346,7 +14420,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":1840 + /* "sklearn/tree/_tree.pyx":1856 * SIZE_t min_samples_leaf, SIZE_t max_depth): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -14355,7 +14429,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":1841 + /* "sklearn/tree/_tree.pyx":1857 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -14364,7 +14438,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":1842 + /* "sklearn/tree/_tree.pyx":1858 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -14373,7 +14447,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":1837 + /* "sklearn/tree/_tree.pyx":1853 * """Build a decision tree in depth-first fashion.""" * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -14387,7 +14461,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder___cinit__(stru return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1844 +/* "sklearn/tree/_tree.pyx":1860 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14398,7 +14472,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":1845 + /* "sklearn/tree/_tree.pyx":1861 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -14462,7 +14536,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":1844 + /* "sklearn/tree/_tree.pyx":1860 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -14473,11 +14547,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 = 1844; __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 = 1860; __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 = 1844; __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 = 1860; __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)); @@ -14491,7 +14565,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 = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1860; __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; @@ -14502,82 +14576,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":1848 + /* "sklearn/tree/_tree.pyx":1864 * """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 = 1848; __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 = 1864; __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 = 1848; __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 = 1864; __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 = 1848; __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 = 1864; __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 = 1848; __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 = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1850 + /* "sklearn/tree/_tree.pyx":1866 * 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 = 1850; __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 = 1866; __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 = 1850; __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 = 1866; __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 = 1850; __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 = 1866; __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 = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __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 = 1850; __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 = 1866; __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 = 1850; __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 = 1866; __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 = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1866; __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 = 1850; __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 = 1866; __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":1852 + /* "sklearn/tree/_tree.pyx":1868 * 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 = 1852; __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 = 1868; __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 = 1852; __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 = 1868; __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 = 1852; __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 = 1868; __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 = 1852; __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 = 1868; __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 = 1852; __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 = 1868; __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 = 1852; __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 = 1868; __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 = 1852; __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 = 1868; __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; @@ -14586,42 +14660,42 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1853 + /* "sklearn/tree/_tree.pyx":1869 * * 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 = 1853; __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 = 1869; __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 = 1853; __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 = 1869; __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 = 1853; __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 = 1869; __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __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 = 1853; __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 = 1869; __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 = 1853; __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 = 1869; __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1869; __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 = 1853; __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 = 1869; __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":1855 + /* "sklearn/tree/_tree.pyx":1871 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -14630,7 +14704,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":1856 + /* "sklearn/tree/_tree.pyx":1872 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -14641,37 +14715,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":1857 + /* "sklearn/tree/_tree.pyx":1873 * 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 = 1857; __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 = 1873; __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 = 1857; __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 = 1873; __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 = 1857; __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 = 1873; __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 = 1857; __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 = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":1858 + /* "sklearn/tree/_tree.pyx":1874 * 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 = 1858; __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 = 1874; __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 = 1858; __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 = 1874; __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 = 1858; __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 = 1874; __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; @@ -14680,59 +14754,59 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":1859 + /* "sklearn/tree/_tree.pyx":1875 * 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 = 1859; __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 = 1875; __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 = 1859; __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 = 1875; __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 = 1859; __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 = 1875; __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 = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":1860 + /* "sklearn/tree/_tree.pyx":1876 * (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 = 1860; __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 = 1876; __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 = 1859; __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 = 1875; __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 = 1859; __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 = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":1859 + /* "sklearn/tree/_tree.pyx":1875 * 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 = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1875; __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 = 1859; __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 = 1875; __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":1861 + /* "sklearn/tree/_tree.pyx":1877 * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -14744,7 +14818,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":1866 + /* "sklearn/tree/_tree.pyx":1882 * cdef int init_capacity * * if tree.max_depth <= 10: # <<<<<<<<<<<<<< @@ -14754,7 +14828,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":1867 + /* "sklearn/tree/_tree.pyx":1883 * * if tree.max_depth <= 10: * init_capacity = (2 ** (tree.max_depth + 1)) - 1 # <<<<<<<<<<<<<< @@ -14766,7 +14840,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":1869 + /* "sklearn/tree/_tree.pyx":1885 * init_capacity = (2 ** (tree.max_depth + 1)) - 1 * else: * init_capacity = 2047 # <<<<<<<<<<<<<< @@ -14777,7 +14851,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":1871 + /* "sklearn/tree/_tree.pyx":1887 * init_capacity = 2047 * * tree._resize(init_capacity) # <<<<<<<<<<<<<< @@ -14786,7 +14860,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":1874 + /* "sklearn/tree/_tree.pyx":1890 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -14798,7 +14872,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":1875 + /* "sklearn/tree/_tree.pyx":1891 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth # <<<<<<<<<<<<<< @@ -14808,7 +14882,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":1876 + /* "sklearn/tree/_tree.pyx":1892 * cdef Splitter splitter = self.splitter * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf # <<<<<<<<<<<<<< @@ -14818,7 +14892,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":1877 + /* "sklearn/tree/_tree.pyx":1893 * cdef SIZE_t max_depth = self.max_depth * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef SIZE_t min_samples_split = self.min_samples_split # <<<<<<<<<<<<<< @@ -14828,7 +14902,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":1880 + /* "sklearn/tree/_tree.pyx":1896 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< @@ -14837,7 +14911,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":1887 + /* "sklearn/tree/_tree.pyx":1903 * cdef SIZE_t parent * cdef bint is_left * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -14847,7 +14921,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":1894 + /* "sklearn/tree/_tree.pyx":1910 * * cdef double threshold * cdef double impurity = INFINITY # <<<<<<<<<<<<<< @@ -14856,7 +14930,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":1895 + /* "sklearn/tree/_tree.pyx":1911 * cdef double threshold * cdef double impurity = INFINITY * cdef double split_impurity_left = INFINITY # <<<<<<<<<<<<<< @@ -14865,7 +14939,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_split_impurity_left = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1896 + /* "sklearn/tree/_tree.pyx":1912 * cdef double impurity = INFINITY * cdef double split_impurity_left = INFINITY * cdef double split_impurity_right = INFINITY # <<<<<<<<<<<<<< @@ -14874,7 +14948,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_split_impurity_right = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1897 + /* "sklearn/tree/_tree.pyx":1913 * cdef double split_impurity_left = INFINITY * cdef double split_impurity_right = INFINITY * cdef double split_improvement = INFINITY # <<<<<<<<<<<<<< @@ -14883,7 +14957,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_split_improvement = __pyx_v_7sklearn_4tree_5_tree_INFINITY; - /* "sklearn/tree/_tree.pyx":1900 + /* "sklearn/tree/_tree.pyx":1916 * cdef SIZE_t n_constant_features * cdef bint is_leaf * cdef bint first = 1 # <<<<<<<<<<<<<< @@ -14892,7 +14966,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_first = 1; - /* "sklearn/tree/_tree.pyx":1901 + /* "sklearn/tree/_tree.pyx":1917 * cdef bint is_leaf * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -14901,7 +14975,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":1902 + /* "sklearn/tree/_tree.pyx":1918 * cdef bint first = 1 * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -14910,27 +14984,27 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":1904 + /* "sklearn/tree/_tree.pyx":1920 * 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 = 1904; __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 = 1920; __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 = 1904; __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 = 1920; __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 = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 1920; __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":1908 + /* "sklearn/tree/_tree.pyx":1924 * * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) # <<<<<<<<<<<<<< @@ -14939,7 +15013,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":1909 + /* "sklearn/tree/_tree.pyx":1925 * # push root node onto stack * rc = stack.push(0, n_node_samples, 0, _TREE_UNDEFINED, 0, INFINITY, 0) * if rc == -1: # <<<<<<<<<<<<<< @@ -14949,17 +15023,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":1911 + /* "sklearn/tree/_tree.pyx":1927 * if rc == -1: * # got return code -1 - out-of-memory * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1913 + /* "sklearn/tree/_tree.pyx":1929 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -14973,7 +15047,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":1914 + /* "sklearn/tree/_tree.pyx":1930 * * with nogil: * while not stack.is_empty(): # <<<<<<<<<<<<<< @@ -14984,7 +15058,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":1915 + /* "sklearn/tree/_tree.pyx":1931 * with nogil: * while not stack.is_empty(): * stack.pop(&stack_record) # <<<<<<<<<<<<<< @@ -14993,7 +15067,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":1917 + /* "sklearn/tree/_tree.pyx":1933 * stack.pop(&stack_record) * * start = stack_record.start # <<<<<<<<<<<<<< @@ -15003,7 +15077,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.start; __pyx_v_start = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1918 + /* "sklearn/tree/_tree.pyx":1934 * * start = stack_record.start * end = stack_record.end # <<<<<<<<<<<<<< @@ -15013,7 +15087,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.end; __pyx_v_end = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1919 + /* "sklearn/tree/_tree.pyx":1935 * start = stack_record.start * end = stack_record.end * depth = stack_record.depth # <<<<<<<<<<<<<< @@ -15023,7 +15097,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.depth; __pyx_v_depth = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1920 + /* "sklearn/tree/_tree.pyx":1936 * end = stack_record.end * depth = stack_record.depth * parent = stack_record.parent # <<<<<<<<<<<<<< @@ -15033,7 +15107,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.parent; __pyx_v_parent = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1921 + /* "sklearn/tree/_tree.pyx":1937 * depth = stack_record.depth * parent = stack_record.parent * is_left = stack_record.is_left # <<<<<<<<<<<<<< @@ -15043,7 +15117,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":1922 + /* "sklearn/tree/_tree.pyx":1938 * parent = stack_record.parent * is_left = stack_record.is_left * impurity = stack_record.impurity # <<<<<<<<<<<<<< @@ -15053,7 +15127,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_10 = __pyx_v_stack_record.impurity; __pyx_v_impurity = __pyx_t_10; - /* "sklearn/tree/_tree.pyx":1923 + /* "sklearn/tree/_tree.pyx":1939 * is_left = stack_record.is_left * impurity = stack_record.impurity * n_constant_features = stack_record.n_constant_features # <<<<<<<<<<<<<< @@ -15063,7 +15137,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_t_9 = __pyx_v_stack_record.n_constant_features; __pyx_v_n_constant_features = __pyx_t_9; - /* "sklearn/tree/_tree.pyx":1925 + /* "sklearn/tree/_tree.pyx":1941 * n_constant_features = stack_record.n_constant_features * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -15072,7 +15146,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":1926 + /* "sklearn/tree/_tree.pyx":1942 * * n_node_samples = end - start * is_leaf = ((depth >= max_depth) or # <<<<<<<<<<<<<< @@ -15082,7 +15156,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":1927 + /* "sklearn/tree/_tree.pyx":1943 * n_node_samples = end - start * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or # <<<<<<<<<<<<<< @@ -15092,7 +15166,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":1928 + /* "sklearn/tree/_tree.pyx":1944 * is_leaf = ((depth >= max_depth) or * (n_node_samples < min_samples_split) or * (n_node_samples < 2 * min_samples_leaf)) # <<<<<<<<<<<<<< @@ -15110,7 +15184,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_v_is_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":1930 + /* "sklearn/tree/_tree.pyx":1946 * (n_node_samples < 2 * min_samples_leaf)) * * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -15119,7 +15193,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":1932 + /* "sklearn/tree/_tree.pyx":1948 * splitter.node_reset(start, end, &weighted_n_node_samples) * * if first: # <<<<<<<<<<<<<< @@ -15129,7 +15203,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":1933 + /* "sklearn/tree/_tree.pyx":1949 * * if first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -15138,7 +15212,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":1934 + /* "sklearn/tree/_tree.pyx":1950 * if first: * impurity = splitter.node_impurity() * first = 0 # <<<<<<<<<<<<<< @@ -15150,7 +15224,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L14:; - /* "sklearn/tree/_tree.pyx":1936 + /* "sklearn/tree/_tree.pyx":1952 * first = 0 * * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) # <<<<<<<<<<<<<< @@ -15165,7 +15239,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_v_is_leaf = __pyx_t_6; - /* "sklearn/tree/_tree.pyx":1938 + /* "sklearn/tree/_tree.pyx":1954 * is_leaf = is_leaf or (impurity <= MIN_IMPURITY_SPLIT) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -15175,7 +15249,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":1939 + /* "sklearn/tree/_tree.pyx":1955 * * if not is_leaf: * splitter.node_split(impurity, &pos, &feature, &threshold, # <<<<<<<<<<<<<< @@ -15184,7 +15258,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_pos), (&__pyx_v_feature), (&__pyx_v_threshold), (&__pyx_v_split_impurity_left), (&__pyx_v_split_impurity_right), (&__pyx_v_split_improvement), (&__pyx_v_n_constant_features)); - /* "sklearn/tree/_tree.pyx":1944 + /* "sklearn/tree/_tree.pyx":1960 * &split_improvement, * &n_constant_features) * is_leaf = is_leaf or (pos >= end) # <<<<<<<<<<<<<< @@ -15202,7 +15276,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L15:; - /* "sklearn/tree/_tree.pyx":1946 + /* "sklearn/tree/_tree.pyx":1962 * is_leaf = is_leaf or (pos >= end) * * node_id = tree._add_node(parent, is_left, is_leaf, feature, # <<<<<<<<<<<<<< @@ -15211,7 +15285,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_feature, __pyx_v_threshold, __pyx_v_impurity, __pyx_v_n_node_samples, __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":1950 + /* "sklearn/tree/_tree.pyx":1966 * weighted_n_node_samples) * * if is_leaf: # <<<<<<<<<<<<<< @@ -15221,7 +15295,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":1952 + /* "sklearn/tree/_tree.pyx":1968 * if is_leaf: * # Don't store value for internal nodes * splitter.node_value(tree.value + # <<<<<<<<<<<<<< @@ -15233,7 +15307,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } /*else*/ { - /* "sklearn/tree/_tree.pyx":1957 + /* "sklearn/tree/_tree.pyx":1973 * else: * # Push right child on stack * rc = stack.push(pos, end, depth + 1, node_id, 0, # <<<<<<<<<<<<<< @@ -15242,7 +15316,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_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":1959 + /* "sklearn/tree/_tree.pyx":1975 * rc = stack.push(pos, end, depth + 1, node_id, 0, * split_impurity_right, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -15252,7 +15326,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":1960 + /* "sklearn/tree/_tree.pyx":1976 * split_impurity_right, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -15262,7 +15336,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str goto __pyx_L13_break; } - /* "sklearn/tree/_tree.pyx":1963 + /* "sklearn/tree/_tree.pyx":1979 * * # Push left child on stack * rc = stack.push(start, pos, depth + 1, node_id, 1, # <<<<<<<<<<<<<< @@ -15271,7 +15345,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_pos, (__pyx_v_depth + 1), __pyx_v_node_id, 1, __pyx_v_split_impurity_left, __pyx_v_n_constant_features); - /* "sklearn/tree/_tree.pyx":1965 + /* "sklearn/tree/_tree.pyx":1981 * rc = stack.push(start, pos, depth + 1, node_id, 1, * split_impurity_left, n_constant_features) * if rc == -1: # <<<<<<<<<<<<<< @@ -15281,7 +15355,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":1966 + /* "sklearn/tree/_tree.pyx":1982 * split_impurity_left, n_constant_features) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -15293,7 +15367,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L16:; - /* "sklearn/tree/_tree.pyx":1968 + /* "sklearn/tree/_tree.pyx":1984 * break * * if depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -15303,7 +15377,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":1969 + /* "sklearn/tree/_tree.pyx":1985 * * if depth > max_depth_seen: * max_depth_seen = depth # <<<<<<<<<<<<<< @@ -15317,7 +15391,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L13_break:; - /* "sklearn/tree/_tree.pyx":1971 + /* "sklearn/tree/_tree.pyx":1987 * max_depth_seen = depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -15327,7 +15401,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":1972 + /* "sklearn/tree/_tree.pyx":1988 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -15342,7 +15416,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } __pyx_L20:; - /* "sklearn/tree/_tree.pyx":1974 + /* "sklearn/tree/_tree.pyx":1990 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -15352,7 +15426,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":1975 + /* "sklearn/tree/_tree.pyx":1991 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -15365,7 +15439,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str __pyx_L21:; } - /* "sklearn/tree/_tree.pyx":1913 + /* "sklearn/tree/_tree.pyx":1929 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -15383,7 +15457,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_build(str } } - /* "sklearn/tree/_tree.pyx":1977 + /* "sklearn/tree/_tree.pyx":1993 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -15393,17 +15467,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":1978 + /* "sklearn/tree/_tree.pyx":1994 * * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":1844 + /* "sklearn/tree/_tree.pyx":1860 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15450,7 +15524,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":1845 + /* "sklearn/tree/_tree.pyx":1861 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -15477,12 +15551,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 = 1844; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __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 = 1844; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -15491,7 +15565,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 = 1844; __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 = 1860; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -15510,19 +15584,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 = 1844; __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 = 1860; __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 = 1844; __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 = 1844; __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 = 1844; __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 = 1845; __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 = 1860; __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 = 1860; __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 = 1860; __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 = 1861; __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":1844 + /* "sklearn/tree/_tree.pyx":1860 * self.max_depth = max_depth * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15551,7 +15625,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 = 1844; __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 = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -15568,7 +15642,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_21DepthFirstTreeBuilder_2build(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":1983 +/* "sklearn/tree/_tree.pyx":1999 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -15579,17 +15653,17 @@ 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":1987 + /* "sklearn/tree/_tree.pyx":2003 * """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, # <<<<<<<<<<<<<< - * rec.is_leaf, rec.improvement, rec.impurity) - * + * rec.is_leaf, rec.improvement, rec.impurity, + * rec.impurity_left, rec.impurity_right) */ - __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_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":1983 + /* "sklearn/tree/_tree.pyx":1999 * # Best first builder ---------------------------------------------------------- * * cdef inline int _add_to_frontier(PriorityHeapRecord* rec, # <<<<<<<<<<<<<< @@ -15602,7 +15676,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree__add_to_frontier(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2001 +/* "sklearn/tree/_tree.pyx":2018 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -15647,26 +15721,26 @@ 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, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __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 = 2001; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_depth)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_max_leaf_nodes)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __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 = 2001; __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 = 2018; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; @@ -15678,20 +15752,20 @@ static int __pyx_pw_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_1__cinit__(PyOb 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 = 2001; __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 = 2002; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[3]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_max_leaf_nodes = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_leaf_nodes == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __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 = 2018; __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 = 2019; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_depth = __Pyx_PyInt_As_Py_intptr_t(values[3]); if (unlikely((__pyx_v_max_depth == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_max_leaf_nodes = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_max_leaf_nodes == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; __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 = 2001; __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 = 2018; __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 = 2001; __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 = 2018; __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_max_depth, __pyx_v_max_leaf_nodes); /* function exit code */ @@ -15708,7 +15782,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_tree.pyx":2004 + /* "sklearn/tree/_tree.pyx":2021 * SIZE_t min_samples_leaf, SIZE_t max_depth, * SIZE_t max_leaf_nodes): * self.splitter = splitter # <<<<<<<<<<<<<< @@ -15721,7 +15795,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":2005 + /* "sklearn/tree/_tree.pyx":2022 * SIZE_t max_leaf_nodes): * self.splitter = splitter * self.min_samples_split = min_samples_split # <<<<<<<<<<<<<< @@ -15730,7 +15804,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":2006 + /* "sklearn/tree/_tree.pyx":2023 * self.splitter = splitter * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf # <<<<<<<<<<<<<< @@ -15739,7 +15813,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":2007 + /* "sklearn/tree/_tree.pyx":2024 * self.min_samples_split = min_samples_split * self.min_samples_leaf = min_samples_leaf * self.max_depth = max_depth # <<<<<<<<<<<<<< @@ -15748,7 +15822,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":2008 + /* "sklearn/tree/_tree.pyx":2025 * self.min_samples_leaf = min_samples_leaf * self.max_depth = max_depth * self.max_leaf_nodes = max_leaf_nodes # <<<<<<<<<<<<<< @@ -15757,7 +15831,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":2001 + /* "sklearn/tree/_tree.pyx":2018 * cdef SIZE_t max_leaf_nodes * * def __cinit__(self, Splitter splitter, SIZE_t min_samples_split, # <<<<<<<<<<<<<< @@ -15771,7 +15845,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder___cinit__(struc return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2010 +/* "sklearn/tree/_tree.pyx":2027 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15782,7 +15856,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":2011 + /* "sklearn/tree/_tree.pyx":2028 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -15832,7 +15906,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":2010 + /* "sklearn/tree/_tree.pyx":2027 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -15843,11 +15917,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 = 2010; __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 = 2027; __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 = 2010; __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 = 2027; __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)); @@ -15861,7 +15935,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 = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2027; __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; @@ -15872,82 +15946,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":2014 + /* "sklearn/tree/_tree.pyx":2031 * """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 = 2014; __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 = 2031; __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 = 2014; __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 = 2031; __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 = 2014; __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 = 2031; __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 = 2014; __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 = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2016 + /* "sklearn/tree/_tree.pyx":2033 * 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 = 2016; __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 = 2033; __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 = 2016; __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 = 2033; __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 = 2016; __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 = 2033; __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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2033; __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 = 2016; __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 = 2033; __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 = 2016; __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 = 2033; __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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2033; __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 = 2016; __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 = 2033; __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":2018 + /* "sklearn/tree/_tree.pyx":2035 * 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 = 2018; __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 = 2035; __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 = 2018; __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 = 2035; __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 = 2018; __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 = 2035; __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 = 2018; __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 = 2035; __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 = 2018; __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 = 2035; __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 = 2018; __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 = 2035; __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 = 2018; __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 = 2035; __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; @@ -15956,42 +16030,42 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2019 + /* "sklearn/tree/_tree.pyx":2036 * * 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 = 2019; __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 = 2036; __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 = 2019; __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 = 2036; __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 = 2019; __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 = 2036; __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 = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2036; __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 = 2019; __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 = 2036; __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 = 2019; __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 = 2036; __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 = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2036; __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 = 2019; __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 = 2036; __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":2021 + /* "sklearn/tree/_tree.pyx":2038 * y = np.ascontiguousarray(y, dtype=DOUBLE) * * cdef DOUBLE_t* sample_weight_ptr = NULL # <<<<<<<<<<<<<< @@ -16000,7 +16074,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_sample_weight_ptr = NULL; - /* "sklearn/tree/_tree.pyx":2022 + /* "sklearn/tree/_tree.pyx":2039 * * cdef DOUBLE_t* sample_weight_ptr = NULL * if sample_weight is not None: # <<<<<<<<<<<<<< @@ -16011,37 +16085,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":2023 + /* "sklearn/tree/_tree.pyx":2040 * 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 = 2023; __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 = 2040; __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 = 2023; __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 = 2040; __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 = 2023; __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 = 2040; __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 = 2023; __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 = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2024 + /* "sklearn/tree/_tree.pyx":2041 * 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 = 2024; __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 = 2041; __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 = 2024; __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 = 2041; __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 = 2024; __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 = 2041; __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; @@ -16050,59 +16124,59 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } if (__pyx_t_6) { - /* "sklearn/tree/_tree.pyx":2025 + /* "sklearn/tree/_tree.pyx":2042 * 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 = 2025; __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 = 2042; __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 = 2025; __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 = 2042; __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 = 2025; __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 = 2042; __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 = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2026 + /* "sklearn/tree/_tree.pyx":2043 * (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 = 2026; __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 = 2043; __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 = 2025; __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 = 2042; __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 = 2025; __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 = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/tree/_tree.pyx":2025 + /* "sklearn/tree/_tree.pyx":2042 * 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 = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2042; __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 = 2025; __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 = 2042; __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":2027 + /* "sklearn/tree/_tree.pyx":2044 * sample_weight = np.asarray(sample_weight, * dtype=DOUBLE, order="C") * sample_weight_ptr = sample_weight.data # <<<<<<<<<<<<<< @@ -16114,7 +16188,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2030 + /* "sklearn/tree/_tree.pyx":2047 * * # Parameters * cdef Splitter splitter = self.splitter # <<<<<<<<<<<<<< @@ -16126,7 +16200,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":2031 + /* "sklearn/tree/_tree.pyx":2048 * # Parameters * cdef Splitter splitter = self.splitter * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes # <<<<<<<<<<<<<< @@ -16136,7 +16210,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":2032 + /* "sklearn/tree/_tree.pyx":2049 * 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 # <<<<<<<<<<<<<< @@ -16146,7 +16220,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":2033 + /* "sklearn/tree/_tree.pyx":2050 * cdef SIZE_t max_leaf_nodes = self.max_leaf_nodes * cdef SIZE_t min_samples_leaf = self.min_samples_leaf * cdef SIZE_t min_samples_split = self.min_samples_split # <<<<<<<<<<<<<< @@ -16156,7 +16230,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":2036 + /* "sklearn/tree/_tree.pyx":2053 * * # Recursive partition (without actual recursion) * splitter.init(X, y, sample_weight_ptr) # <<<<<<<<<<<<<< @@ -16165,27 +16239,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":2038 + /* "sklearn/tree/_tree.pyx":2055 * 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 = 2038; __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 = 2055; __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 = 2038; __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 = 2055; __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 = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2055; __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":2043 + /* "sklearn/tree/_tree.pyx":2060 * cdef PriorityHeapRecord split_node_right * * cdef SIZE_t n_node_samples = splitter.n_samples # <<<<<<<<<<<<<< @@ -16195,7 +16269,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":2044 + /* "sklearn/tree/_tree.pyx":2061 * * cdef SIZE_t n_node_samples = splitter.n_samples * cdef int max_split_nodes = max_leaf_nodes - 1 # <<<<<<<<<<<<<< @@ -16204,7 +16278,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":2046 + /* "sklearn/tree/_tree.pyx":2063 * cdef int max_split_nodes = max_leaf_nodes - 1 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 # <<<<<<<<<<<<<< @@ -16213,7 +16287,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_max_depth_seen = -1; - /* "sklearn/tree/_tree.pyx":2047 + /* "sklearn/tree/_tree.pyx":2064 * cdef bint is_leaf * cdef SIZE_t max_depth_seen = -1 * cdef int rc = 0 # <<<<<<<<<<<<<< @@ -16222,7 +16296,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru */ __pyx_v_rc = 0; - /* "sklearn/tree/_tree.pyx":2051 + /* "sklearn/tree/_tree.pyx":2068 * * # Initial capacity * cdef int init_capacity = max_split_nodes + max_leaf_nodes # <<<<<<<<<<<<<< @@ -16231,7 +16305,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":2052 + /* "sklearn/tree/_tree.pyx":2069 * # Initial capacity * cdef int init_capacity = max_split_nodes + max_leaf_nodes * tree._resize(init_capacity) # <<<<<<<<<<<<<< @@ -16240,7 +16314,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":2054 + /* "sklearn/tree/_tree.pyx":2071 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -16254,7 +16328,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2056 + /* "sklearn/tree/_tree.pyx":2073 * with nogil: * # add root to frontier * rc = self._add_split_node(splitter, tree, 0, n_node_samples, # <<<<<<<<<<<<<< @@ -16263,7 +16337,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":2059 + /* "sklearn/tree/_tree.pyx":2076 * INFINITY, IS_FIRST, IS_LEFT, NULL, 0, * &split_node_left) * if rc >= 0: # <<<<<<<<<<<<<< @@ -16273,7 +16347,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":2060 + /* "sklearn/tree/_tree.pyx":2077 * &split_node_left) * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -16286,7 +16360,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":2054 + /* "sklearn/tree/_tree.pyx":2071 * tree._resize(init_capacity) * * with nogil: # <<<<<<<<<<<<<< @@ -16304,7 +16378,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":2061 + /* "sklearn/tree/_tree.pyx":2078 * if rc >= 0: * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -16314,17 +16388,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":2062 + /* "sklearn/tree/_tree.pyx":2079 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * raise MemoryError() # <<<<<<<<<<<<<< * * with nogil: */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2064 + /* "sklearn/tree/_tree.pyx":2081 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -16338,7 +16412,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2065 + /* "sklearn/tree/_tree.pyx":2082 * * with nogil: * while not frontier.is_empty(): # <<<<<<<<<<<<<< @@ -16349,7 +16423,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":2066 + /* "sklearn/tree/_tree.pyx":2083 * with nogil: * while not frontier.is_empty(): * frontier.pop(&record) # <<<<<<<<<<<<<< @@ -16358,7 +16432,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":2068 + /* "sklearn/tree/_tree.pyx":2085 * frontier.pop(&record) * * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -16367,7 +16441,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":2069 + /* "sklearn/tree/_tree.pyx":2086 * * node = &tree.nodes[record.node_id] * is_leaf = (record.is_leaf or max_split_nodes <= 0) # <<<<<<<<<<<<<< @@ -16382,7 +16456,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_v_is_leaf = __pyx_t_4; - /* "sklearn/tree/_tree.pyx":2071 + /* "sklearn/tree/_tree.pyx":2088 * is_leaf = (record.is_leaf or max_split_nodes <= 0) * * if is_leaf: # <<<<<<<<<<<<<< @@ -16392,7 +16466,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":2073 + /* "sklearn/tree/_tree.pyx":2090 * if is_leaf: * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -16401,7 +16475,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":2074 + /* "sklearn/tree/_tree.pyx":2091 * # Node is not expandable; set node as leaf * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -16410,7 +16484,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":2075 + /* "sklearn/tree/_tree.pyx":2092 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -16419,7 +16493,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":2076 + /* "sklearn/tree/_tree.pyx":2093 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -16431,7 +16505,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } /*else*/ { - /* "sklearn/tree/_tree.pyx":2082 + /* "sklearn/tree/_tree.pyx":2099 * * # Decrement number of split nodes available * max_split_nodes -= 1 # <<<<<<<<<<<<<< @@ -16440,17 +16514,17 @@ 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":2085 + /* "sklearn/tree/_tree.pyx":2102 * * # Compute left split node * rc = self._add_split_node(splitter, tree, # <<<<<<<<<<<<<< * record.start, record.pos, - * record.impurity, IS_NOT_FIRST, + * record.impurity_left, */ - __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, __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)); + __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":2090 - * IS_LEFT, node, record.depth + 1, + /* "sklearn/tree/_tree.pyx":2108 + * record.depth + 1, * &split_node_left) * if rc == -1: # <<<<<<<<<<<<<< * break @@ -16459,7 +16533,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":2091 + /* "sklearn/tree/_tree.pyx":2109 * &split_node_left) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16469,7 +16543,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L16_break; } - /* "sklearn/tree/_tree.pyx":2094 + /* "sklearn/tree/_tree.pyx":2112 * * # tree.nodes may have changed * node = &tree.nodes[record.node_id] # <<<<<<<<<<<<<< @@ -16478,16 +16552,16 @@ 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":2097 + /* "sklearn/tree/_tree.pyx":2115 * * # Compute right split node * rc = self._add_split_node(splitter, tree, record.pos, # <<<<<<<<<<<<<< - * record.end, record.impurity, - * IS_NOT_FIRST, IS_NOT_LEFT, node, + * record.end, + * record.impurity_right, */ - __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, __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)); + __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":2102 + /* "sklearn/tree/_tree.pyx":2121 * record.depth + 1, * &split_node_right) * if rc == -1: # <<<<<<<<<<<<<< @@ -16497,7 +16571,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":2103 + /* "sklearn/tree/_tree.pyx":2122 * &split_node_right) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16507,7 +16581,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L16_break; } - /* "sklearn/tree/_tree.pyx":2106 + /* "sklearn/tree/_tree.pyx":2125 * * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) # <<<<<<<<<<<<<< @@ -16516,7 +16590,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":2107 + /* "sklearn/tree/_tree.pyx":2126 * # Add nodes to queue * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -16526,7 +16600,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":2108 + /* "sklearn/tree/_tree.pyx":2127 * rc = _add_to_frontier(&split_node_left, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16536,7 +16610,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru goto __pyx_L16_break; } - /* "sklearn/tree/_tree.pyx":2110 + /* "sklearn/tree/_tree.pyx":2129 * break * * rc = _add_to_frontier(&split_node_right, frontier) # <<<<<<<<<<<<<< @@ -16545,7 +16619,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":2111 + /* "sklearn/tree/_tree.pyx":2130 * * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: # <<<<<<<<<<<<<< @@ -16555,7 +16629,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":2112 + /* "sklearn/tree/_tree.pyx":2131 * rc = _add_to_frontier(&split_node_right, frontier) * if rc == -1: * break # <<<<<<<<<<<<<< @@ -16567,7 +16641,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L17:; - /* "sklearn/tree/_tree.pyx":2114 + /* "sklearn/tree/_tree.pyx":2133 * break * * if record.depth > max_depth_seen: # <<<<<<<<<<<<<< @@ -16577,7 +16651,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":2115 + /* "sklearn/tree/_tree.pyx":2134 * * if record.depth > max_depth_seen: * max_depth_seen = record.depth # <<<<<<<<<<<<<< @@ -16592,7 +16666,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L16_break:; - /* "sklearn/tree/_tree.pyx":2117 + /* "sklearn/tree/_tree.pyx":2136 * max_depth_seen = record.depth * * if rc >= 0: # <<<<<<<<<<<<<< @@ -16602,7 +16676,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":2118 + /* "sklearn/tree/_tree.pyx":2137 * * if rc >= 0: * rc = tree._resize_c(tree.node_count) # <<<<<<<<<<<<<< @@ -16617,7 +16691,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } __pyx_L23:; - /* "sklearn/tree/_tree.pyx":2120 + /* "sklearn/tree/_tree.pyx":2139 * rc = tree._resize_c(tree.node_count) * * if rc >= 0: # <<<<<<<<<<<<<< @@ -16627,7 +16701,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":2121 + /* "sklearn/tree/_tree.pyx":2140 * * if rc >= 0: * tree.max_depth = max_depth_seen # <<<<<<<<<<<<<< @@ -16640,7 +16714,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru __pyx_L24:; } - /* "sklearn/tree/_tree.pyx":2064 + /* "sklearn/tree/_tree.pyx":2081 * raise MemoryError() * * with nogil: # <<<<<<<<<<<<<< @@ -16658,7 +16732,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_build(stru } } - /* "sklearn/tree/_tree.pyx":2123 + /* "sklearn/tree/_tree.pyx":2142 * tree.max_depth = max_depth_seen * * if rc == -1: # <<<<<<<<<<<<<< @@ -16668,17 +16742,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":2124 + /* "sklearn/tree/_tree.pyx":2143 * * 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 = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2010 + /* "sklearn/tree/_tree.pyx":2027 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -16725,7 +16799,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":2011 + /* "sklearn/tree/_tree.pyx":2028 * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, * np.ndarray sample_weight=None): # <<<<<<<<<<<<<< @@ -16752,12 +16826,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 = 2010; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __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 = 2010; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("build", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { @@ -16766,7 +16840,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 = 2010; __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 = 2027; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -16785,19 +16859,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 = 2010; __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 = 2027; __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 = 2010; __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 = 2010; __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 = 2010; __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 = 2011; __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 = 2027; __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 = 2027; __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 = 2027; __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 = 2028; __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":2010 + /* "sklearn/tree/_tree.pyx":2027 * self.max_leaf_nodes = max_leaf_nodes * * cpdef build(self, Tree tree, np.ndarray X, np.ndarray y, # <<<<<<<<<<<<<< @@ -16826,7 +16900,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 = 2010; __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 = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16843,7 +16917,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_20BestFirstTreeBuilder_2build(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2126 +/* "sklearn/tree/_tree.pyx":2145 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -16871,7 +16945,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a int __pyx_t_5; ptrdiff_t __pyx_t_6; - /* "sklearn/tree/_tree.pyx":2140 + /* "sklearn/tree/_tree.pyx":2159 * cdef double split_improvement * cdef SIZE_t n_node_samples * cdef SIZE_t n_constant_features = 0 # <<<<<<<<<<<<<< @@ -16880,7 +16954,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_n_constant_features = 0; - /* "sklearn/tree/_tree.pyx":2146 + /* "sklearn/tree/_tree.pyx":2165 * cdef double imp_diff * * splitter.node_reset(start, end, &weighted_n_node_samples) # <<<<<<<<<<<<<< @@ -16889,7 +16963,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":2148 + /* "sklearn/tree/_tree.pyx":2167 * splitter.node_reset(start, end, &weighted_n_node_samples) * * if is_first: # <<<<<<<<<<<<<< @@ -16899,7 +16973,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = (__pyx_v_is_first != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2149 + /* "sklearn/tree/_tree.pyx":2168 * * if is_first: * impurity = splitter.node_impurity() # <<<<<<<<<<<<<< @@ -16911,7 +16985,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2151 + /* "sklearn/tree/_tree.pyx":2170 * impurity = splitter.node_impurity() * * n_node_samples = end - start # <<<<<<<<<<<<<< @@ -16920,7 +16994,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":2152 + /* "sklearn/tree/_tree.pyx":2171 * * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or # <<<<<<<<<<<<<< @@ -16930,7 +17004,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = (__pyx_v_depth > __pyx_v_self->__pyx_base.max_depth); if (!__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2153 + /* "sklearn/tree/_tree.pyx":2172 * n_node_samples = end - start * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or # <<<<<<<<<<<<<< @@ -16940,7 +17014,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_2 = (__pyx_v_n_node_samples < __pyx_v_self->__pyx_base.min_samples_split); if (!__pyx_t_2) { - /* "sklearn/tree/_tree.pyx":2154 + /* "sklearn/tree/_tree.pyx":2173 * is_leaf = ((depth > self.max_depth) or * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or # <<<<<<<<<<<<<< @@ -16950,7 +17024,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_3 = (__pyx_v_n_node_samples < (2 * __pyx_v_self->__pyx_base.min_samples_leaf)); if (!__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2155 + /* "sklearn/tree/_tree.pyx":2174 * (n_node_samples < self.min_samples_split) or * (n_node_samples < 2 * self.min_samples_leaf) or * (impurity <= MIN_IMPURITY_SPLIT)) # <<<<<<<<<<<<<< @@ -16972,7 +17046,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_v_is_leaf = __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2157 + /* "sklearn/tree/_tree.pyx":2176 * (impurity <= MIN_IMPURITY_SPLIT)) * * if not is_leaf: # <<<<<<<<<<<<<< @@ -16982,7 +17056,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":2158 + /* "sklearn/tree/_tree.pyx":2177 * * if not is_leaf: * splitter.node_split(impurity, &pos, &feature, &threshold, # <<<<<<<<<<<<<< @@ -16991,7 +17065,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_pos), (&__pyx_v_feature), (&__pyx_v_threshold), (&__pyx_v_split_impurity_left), (&__pyx_v_split_impurity_right), (&__pyx_v_split_improvement), (&__pyx_v_n_constant_features)); - /* "sklearn/tree/_tree.pyx":2161 + /* "sklearn/tree/_tree.pyx":2180 * &split_impurity_left, &split_impurity_right, * &split_improvement, &n_constant_features) * is_leaf = is_leaf or (pos >= end) # <<<<<<<<<<<<<< @@ -17009,7 +17083,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":2164 + /* "sklearn/tree/_tree.pyx":2183 * * node_id = tree._add_node(parent - tree.nodes * if parent != NULL # <<<<<<<<<<<<<< @@ -17018,7 +17092,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ if (((__pyx_v_parent != NULL) != 0)) { - /* "sklearn/tree/_tree.pyx":2163 + /* "sklearn/tree/_tree.pyx":2182 * is_leaf = is_leaf or (pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -17028,7 +17102,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_6 = (__pyx_v_parent - __pyx_v_tree->nodes); } else { - /* "sklearn/tree/_tree.pyx":2165 + /* "sklearn/tree/_tree.pyx":2184 * node_id = tree._add_node(parent - tree.nodes * if parent != NULL * else _TREE_UNDEFINED, # <<<<<<<<<<<<<< @@ -17038,7 +17112,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_6 = __pyx_v_7sklearn_4tree_5_tree__TREE_UNDEFINED; } - /* "sklearn/tree/_tree.pyx":2163 + /* "sklearn/tree/_tree.pyx":2182 * is_leaf = is_leaf or (pos >= end) * * node_id = tree._add_node(parent - tree.nodes # <<<<<<<<<<<<<< @@ -17047,7 +17121,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_6, __pyx_v_is_left, __pyx_v_is_leaf, __pyx_v_feature, __pyx_v_threshold, __pyx_v_impurity, __pyx_v_n_node_samples, __pyx_v_weighted_n_node_samples); - /* "sklearn/tree/_tree.pyx":2169 + /* "sklearn/tree/_tree.pyx":2188 * feature, threshold, impurity, n_node_samples, * weighted_n_node_samples) * if node_id == (-1): # <<<<<<<<<<<<<< @@ -17057,7 +17131,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = ((__pyx_v_node_id == ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t)-1)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2170 + /* "sklearn/tree/_tree.pyx":2189 * weighted_n_node_samples) * if node_id == (-1): * return -1 # <<<<<<<<<<<<<< @@ -17068,7 +17142,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2173 + /* "sklearn/tree/_tree.pyx":2192 * * # compute values also for split nodes (might become leafs later). * splitter.node_value(tree.value + node_id * tree.value_stride) # <<<<<<<<<<<<<< @@ -17077,7 +17151,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":2175 + /* "sklearn/tree/_tree.pyx":2194 * splitter.node_value(tree.value + node_id * tree.value_stride) * * res.node_id = node_id # <<<<<<<<<<<<<< @@ -17086,7 +17160,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":2176 + /* "sklearn/tree/_tree.pyx":2195 * * res.node_id = node_id * res.start = start # <<<<<<<<<<<<<< @@ -17095,7 +17169,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->start = __pyx_v_start; - /* "sklearn/tree/_tree.pyx":2177 + /* "sklearn/tree/_tree.pyx":2196 * res.node_id = node_id * res.start = start * res.end = end # <<<<<<<<<<<<<< @@ -17104,7 +17178,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->end = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2178 + /* "sklearn/tree/_tree.pyx":2197 * res.start = start * res.end = end * res.depth = depth # <<<<<<<<<<<<<< @@ -17113,7 +17187,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->depth = __pyx_v_depth; - /* "sklearn/tree/_tree.pyx":2179 + /* "sklearn/tree/_tree.pyx":2198 * res.end = end * res.depth = depth * res.impurity = impurity # <<<<<<<<<<<<<< @@ -17122,7 +17196,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":2181 + /* "sklearn/tree/_tree.pyx":2200 * res.impurity = impurity * * if not is_leaf: # <<<<<<<<<<<<<< @@ -17132,7 +17206,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_t_1 = ((!(__pyx_v_is_leaf != 0)) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2183 + /* "sklearn/tree/_tree.pyx":2202 * if not is_leaf: * # is split node * res.pos = pos # <<<<<<<<<<<<<< @@ -17141,28 +17215,46 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->pos = __pyx_v_pos; - /* "sklearn/tree/_tree.pyx":2184 + /* "sklearn/tree/_tree.pyx":2203 * # is split node * res.pos = pos * res.is_leaf = 0 # <<<<<<<<<<<<<< * res.improvement = split_improvement - * else: + * res.impurity_left = split_impurity_left */ __pyx_v_res->is_leaf = 0; - /* "sklearn/tree/_tree.pyx":2185 + /* "sklearn/tree/_tree.pyx":2204 * res.pos = pos * res.is_leaf = 0 * res.improvement = split_improvement # <<<<<<<<<<<<<< - * else: - * # is leaf => 0 improvement + * res.impurity_left = split_impurity_left + * res.impurity_right = split_impurity_right */ __pyx_v_res->improvement = __pyx_v_split_improvement; + + /* "sklearn/tree/_tree.pyx":2205 + * res.is_leaf = 0 + * res.improvement = split_improvement + * res.impurity_left = split_impurity_left # <<<<<<<<<<<<<< + * res.impurity_right = split_impurity_right + * + */ + __pyx_v_res->impurity_left = __pyx_v_split_impurity_left; + + /* "sklearn/tree/_tree.pyx":2206 + * res.improvement = split_improvement + * res.impurity_left = split_impurity_left + * res.impurity_right = split_impurity_right # <<<<<<<<<<<<<< + * + * else: + */ + __pyx_v_res->impurity_right = __pyx_v_split_impurity_right; goto __pyx_L6; } /*else*/ { - /* "sklearn/tree/_tree.pyx":2188 + /* "sklearn/tree/_tree.pyx":2210 * else: * # is leaf => 0 improvement * res.pos = end # <<<<<<<<<<<<<< @@ -17171,28 +17263,46 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a */ __pyx_v_res->pos = __pyx_v_end; - /* "sklearn/tree/_tree.pyx":2189 + /* "sklearn/tree/_tree.pyx":2211 * # is leaf => 0 improvement * res.pos = end * res.is_leaf = 1 # <<<<<<<<<<<<<< * res.improvement = 0.0 - * + * res.impurity_left = impurity */ __pyx_v_res->is_leaf = 1; - /* "sklearn/tree/_tree.pyx":2190 + /* "sklearn/tree/_tree.pyx":2212 * res.pos = end * res.is_leaf = 1 * res.improvement = 0.0 # <<<<<<<<<<<<<< + * res.impurity_left = impurity + * res.impurity_right = impurity + */ + __pyx_v_res->improvement = 0.0; + + /* "sklearn/tree/_tree.pyx":2213 + * res.is_leaf = 1 + * res.improvement = 0.0 + * res.impurity_left = impurity # <<<<<<<<<<<<<< + * res.impurity_right = impurity + * + */ + __pyx_v_res->impurity_left = __pyx_v_impurity; + + /* "sklearn/tree/_tree.pyx":2214 + * res.improvement = 0.0 + * res.impurity_left = impurity + * res.impurity_right = impurity # <<<<<<<<<<<<<< * * return 0 */ - __pyx_v_res->improvement = 0.0; + __pyx_v_res->impurity_right = __pyx_v_impurity; } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":2192 - * res.improvement = 0.0 + /* "sklearn/tree/_tree.pyx":2216 + * res.impurity_right = impurity * * return 0 # <<<<<<<<<<<<<< * @@ -17201,7 +17311,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2126 + /* "sklearn/tree/_tree.pyx":2145 * raise MemoryError() * * cdef inline int _add_split_node(self, Splitter splitter, Tree tree, # <<<<<<<<<<<<<< @@ -17214,7 +17324,7 @@ static CYTHON_INLINE int __pyx_f_7sklearn_4tree_5_tree_20BestFirstTreeBuilder__a return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2258 +/* "sklearn/tree/_tree.pyx":2282 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -17245,7 +17355,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":2260 + /* "sklearn/tree/_tree.pyx":2284 * def __get__(self): * # it's small; copy for memory safety * return sizet_ptr_to_ndarray(self.n_classes, self.n_outputs).copy() # <<<<<<<<<<<<<< @@ -17253,19 +17363,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 = 2260; __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 = 2284; __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 = 2260; __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 = 2284; __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 = 2260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2284; __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":2258 + /* "sklearn/tree/_tree.pyx":2282 * # (i.e. through `_resize` or `__setstate__`) * property n_classes: * def __get__(self): # <<<<<<<<<<<<<< @@ -17285,7 +17395,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_classes___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2263 +/* "sklearn/tree/_tree.pyx":2287 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -17316,7 +17426,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":2264 + /* "sklearn/tree/_tree.pyx":2288 * property children_left: * def __get__(self): * return self._get_node_ndarray()['left_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -17324,19 +17434,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 = 2264; __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 = 2288; __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 = 2264; __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 = 2288; __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 = 2264; __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 = 2288; __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":2263 + /* "sklearn/tree/_tree.pyx":2287 * * property children_left: * def __get__(self): # <<<<<<<<<<<<<< @@ -17356,7 +17466,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_13children_left___get__(st return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2267 +/* "sklearn/tree/_tree.pyx":2291 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -17387,7 +17497,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":2268 + /* "sklearn/tree/_tree.pyx":2292 * property children_right: * def __get__(self): * return self._get_node_ndarray()['right_child'][:self.node_count] # <<<<<<<<<<<<<< @@ -17395,19 +17505,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 = 2268; __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 = 2292; __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 = 2268; __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 = 2292; __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 = 2268; __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 = 2292; __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":2267 + /* "sklearn/tree/_tree.pyx":2291 * * property children_right: * def __get__(self): # <<<<<<<<<<<<<< @@ -17427,7 +17537,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14children_right___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2271 +/* "sklearn/tree/_tree.pyx":2295 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -17458,7 +17568,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":2272 + /* "sklearn/tree/_tree.pyx":2296 * property feature: * def __get__(self): * return self._get_node_ndarray()['feature'][:self.node_count] # <<<<<<<<<<<<<< @@ -17466,19 +17576,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 = 2272; __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 = 2296; __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 = 2272; __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 = 2296; __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 = 2272; __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 = 2296; __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":2271 + /* "sklearn/tree/_tree.pyx":2295 * * property feature: * def __get__(self): # <<<<<<<<<<<<<< @@ -17498,7 +17608,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_7feature___get__(struct __ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2275 +/* "sklearn/tree/_tree.pyx":2299 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -17529,7 +17639,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":2276 + /* "sklearn/tree/_tree.pyx":2300 * property threshold: * def __get__(self): * return self._get_node_ndarray()['threshold'][:self.node_count] # <<<<<<<<<<<<<< @@ -17537,19 +17647,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 = 2276; __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 = 2300; __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 = 2276; __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 = 2300; __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 = 2276; __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 = 2300; __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":2275 + /* "sklearn/tree/_tree.pyx":2299 * * property threshold: * def __get__(self): # <<<<<<<<<<<<<< @@ -17569,7 +17679,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_9threshold___get__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2279 +/* "sklearn/tree/_tree.pyx":2303 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -17600,7 +17710,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":2280 + /* "sklearn/tree/_tree.pyx":2304 * property impurity: * def __get__(self): * return self._get_node_ndarray()['impurity'][:self.node_count] # <<<<<<<<<<<<<< @@ -17608,19 +17718,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 = 2280; __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 = 2304; __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 = 2280; __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 = 2304; __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 = 2280; __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 = 2304; __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":2279 + /* "sklearn/tree/_tree.pyx":2303 * * property impurity: * def __get__(self): # <<<<<<<<<<<<<< @@ -17640,11 +17750,11 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8impurity___get__(struct _ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2283 +/* "sklearn/tree/_tree.pyx":2307 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< - * return self._get_node_ndarray()['n_samples'][:self.node_count] + * return self._get_node_ndarray()['n_node_samples'][:self.node_count] * */ @@ -17671,31 +17781,31 @@ 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":2284 + /* "sklearn/tree/_tree.pyx":2308 * property n_node_samples: * def __get__(self): - * return self._get_node_ndarray()['n_samples'][:self.node_count] # <<<<<<<<<<<<<< + * return self._get_node_ndarray()['n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< * * 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 = 2284; __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 = 2308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_n_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __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 = 2308; __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 = 2284; __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 = 2308; __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":2283 + /* "sklearn/tree/_tree.pyx":2307 * * property n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< - * return self._get_node_ndarray()['n_samples'][:self.node_count] + * return self._get_node_ndarray()['n_node_samples'][:self.node_count] * */ @@ -17711,11 +17821,11 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14n_node_samples___get__(s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2287 +/* "sklearn/tree/_tree.pyx":2311 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< - * return self._get_node_ndarray()['weighted_n_samples'][:self.node_count] + * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] * */ @@ -17742,31 +17852,31 @@ 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":2288 + /* "sklearn/tree/_tree.pyx":2312 * property weighted_n_node_samples: * def __get__(self): - * return self._get_node_ndarray()['weighted_n_samples'][:self.node_count] # <<<<<<<<<<<<<< + * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] # <<<<<<<<<<<<<< * * 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 = 2288; __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 = 2312; __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_samples); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2288; __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 = 2312; __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 = 2288; __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 = 2312; __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":2287 + /* "sklearn/tree/_tree.pyx":2311 * * property weighted_n_node_samples: * def __get__(self): # <<<<<<<<<<<<<< - * return self._get_node_ndarray()['weighted_n_samples'][:self.node_count] + * return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] * */ @@ -17782,7 +17892,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_23weighted_n_node_samples_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2291 +/* "sklearn/tree/_tree.pyx":2315 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -17813,7 +17923,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":2292 + /* "sklearn/tree/_tree.pyx":2316 * property value: * def __get__(self): * return self._get_value_ndarray()[:self.node_count] # <<<<<<<<<<<<<< @@ -17821,16 +17931,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 = 2292; __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 = 2316; __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 = 2292; __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 = 2316; __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":2291 + /* "sklearn/tree/_tree.pyx":2315 * * property value: * def __get__(self): # <<<<<<<<<<<<<< @@ -17850,7 +17960,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_5value___get__(struct __py return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2294 +/* "sklearn/tree/_tree.pyx":2318 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -17891,16 +18001,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 = 2294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __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 = 2294; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __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 = 2294; __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 = 2318; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; @@ -17909,19 +18019,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 = 2294; __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 = 2318; __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 = 2295; __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 = 2319; __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 = 2294; __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 = 2318; __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 = 2294; __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 = 2318; __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 */ @@ -17956,11 +18066,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 = 2294; __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 = 2318; __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":2298 + /* "sklearn/tree/_tree.pyx":2322 * """Constructor.""" * # Input/Output layout * self.n_features = n_features # <<<<<<<<<<<<<< @@ -17969,7 +18079,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":2299 + /* "sklearn/tree/_tree.pyx":2323 * # Input/Output layout * self.n_features = n_features * self.n_outputs = n_outputs # <<<<<<<<<<<<<< @@ -17978,7 +18088,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":2300 + /* "sklearn/tree/_tree.pyx":2324 * self.n_features = n_features * self.n_outputs = n_outputs * self.n_classes = malloc(n_outputs * sizeof(SIZE_t)) # <<<<<<<<<<<<<< @@ -17987,7 +18097,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->n_classes = ((__pyx_t_7sklearn_4tree_5_tree_SIZE_t *)malloc((__pyx_v_n_outputs * (sizeof(__pyx_t_7sklearn_4tree_5_tree_SIZE_t))))); - /* "sklearn/tree/_tree.pyx":2302 + /* "sklearn/tree/_tree.pyx":2326 * self.n_classes = malloc(n_outputs * sizeof(SIZE_t)) * * if self.n_classes == NULL: # <<<<<<<<<<<<<< @@ -17997,42 +18107,42 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle __pyx_t_1 = ((__pyx_v_self->n_classes == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_tree.pyx":2303 + /* "sklearn/tree/_tree.pyx":2327 * * if self.n_classes == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * self.max_n_classes = np.max(n_classes) */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2305 + /* "sklearn/tree/_tree.pyx":2329 * raise MemoryError() * * 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 = 2305; __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 = 2329; __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 = 2305; __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 = 2329; __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 = 2305; __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 = 2329; __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 = 2305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2329; __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 = 2305; __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 = 2329; __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":2306 + /* "sklearn/tree/_tree.pyx":2330 * * self.max_n_classes = np.max(n_classes) * self.value_stride = n_outputs * self.max_n_classes # <<<<<<<<<<<<<< @@ -18041,7 +18151,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":2309 + /* "sklearn/tree/_tree.pyx":2333 * * cdef SIZE_t k * for k in range(n_outputs): # <<<<<<<<<<<<<< @@ -18052,7 +18162,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":2310 + /* "sklearn/tree/_tree.pyx":2334 * cdef SIZE_t k * for k in range(n_outputs): * self.n_classes[k] = n_classes[k] # <<<<<<<<<<<<<< @@ -18063,7 +18173,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":2313 + /* "sklearn/tree/_tree.pyx":2337 * * # Inner structures * self.max_depth = 0 # <<<<<<<<<<<<<< @@ -18072,7 +18182,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":2314 + /* "sklearn/tree/_tree.pyx":2338 * # Inner structures * self.max_depth = 0 * self.node_count = 0 # <<<<<<<<<<<<<< @@ -18081,7 +18191,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":2315 + /* "sklearn/tree/_tree.pyx":2339 * self.max_depth = 0 * self.node_count = 0 * self.capacity = 0 # <<<<<<<<<<<<<< @@ -18090,7 +18200,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->capacity = 0; - /* "sklearn/tree/_tree.pyx":2316 + /* "sklearn/tree/_tree.pyx":2340 * self.node_count = 0 * self.capacity = 0 * self.value = NULL # <<<<<<<<<<<<<< @@ -18099,7 +18209,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->value = NULL; - /* "sklearn/tree/_tree.pyx":2317 + /* "sklearn/tree/_tree.pyx":2341 * self.capacity = 0 * self.value = NULL * self.nodes = NULL # <<<<<<<<<<<<<< @@ -18108,7 +18218,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle */ __pyx_v_self->nodes = NULL; - /* "sklearn/tree/_tree.pyx":2294 + /* "sklearn/tree/_tree.pyx":2318 * return self._get_value_ndarray()[:self.node_count] * * def __cinit__(self, int n_features, np.ndarray[SIZE_t, ndim=1] n_classes, # <<<<<<<<<<<<<< @@ -18137,7 +18247,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree___cinit__(struct __pyx_obj_7skle return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2319 +/* "sklearn/tree/_tree.pyx":2343 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -18160,7 +18270,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":2322 + /* "sklearn/tree/_tree.pyx":2346 * """Destructor.""" * # Free all inner structures * free(self.n_classes) # <<<<<<<<<<<<<< @@ -18169,7 +18279,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":2323 + /* "sklearn/tree/_tree.pyx":2347 * # Free all inner structures * free(self.n_classes) * free(self.value) # <<<<<<<<<<<<<< @@ -18178,7 +18288,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":2324 + /* "sklearn/tree/_tree.pyx":2348 * free(self.n_classes) * free(self.value) * free(self.nodes) # <<<<<<<<<<<<<< @@ -18187,7 +18297,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":2319 + /* "sklearn/tree/_tree.pyx":2343 * self.nodes = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -18199,7 +18309,7 @@ static void __pyx_pf_7sklearn_4tree_5_tree_4Tree_2__dealloc__(struct __pyx_obj_7 __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2326 +/* "sklearn/tree/_tree.pyx":2350 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -18233,7 +18343,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":2328 + /* "sklearn/tree/_tree.pyx":2352 * def __reduce__(self): * """Reduce re-implementation, for pickling.""" * return (Tree, (self.n_features, # <<<<<<<<<<<<<< @@ -18241,37 +18351,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 = 2328; __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 = 2352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2329 + /* "sklearn/tree/_tree.pyx":2353 * """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 = 2329; __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 = 2353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "sklearn/tree/_tree.pyx":2330 + /* "sklearn/tree/_tree.pyx":2354 * 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 = 2330; __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 = 2354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - /* "sklearn/tree/_tree.pyx":2328 + /* "sklearn/tree/_tree.pyx":2352 * 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 = 2328; __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 = 2352; __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); @@ -18283,27 +18393,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":2330 + /* "sklearn/tree/_tree.pyx":2354 * 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 = 2330; __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 = 2354; __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 = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2354; __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":2328 + /* "sklearn/tree/_tree.pyx":2352 * 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 = 2328; __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 = 2352; __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))); @@ -18318,7 +18428,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":2326 + /* "sklearn/tree/_tree.pyx":2350 * free(self.nodes) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -18340,7 +18450,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_4__reduce__(struct __pyx_o return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2332 +/* "sklearn/tree/_tree.pyx":2356 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -18372,55 +18482,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":2334 + /* "sklearn/tree/_tree.pyx":2358 * 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 = 2334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2358; __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":2335 + /* "sklearn/tree/_tree.pyx":2359 * """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 = 2335; __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 = 2359; __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 = 2335; __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 = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2336 + /* "sklearn/tree/_tree.pyx":2360 * 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 = 2336; __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); - if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_n_s_nodes, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __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 = 2360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2337 + /* "sklearn/tree/_tree.pyx":2361 * 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 = 2337; __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 = 2361; __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 = 2337; __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 = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2338 + /* "sklearn/tree/_tree.pyx":2362 * d["nodes"] = self._get_node_ndarray() * d["values"] = self._get_value_ndarray() * return d # <<<<<<<<<<<<<< @@ -18432,7 +18542,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":2332 + /* "sklearn/tree/_tree.pyx":2356 * self.n_outputs), self.__getstate__()) * * def __getstate__(self): # <<<<<<<<<<<<<< @@ -18452,7 +18562,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_6__getstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2340 +/* "sklearn/tree/_tree.pyx":2364 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -18501,101 +18611,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":2342 + /* "sklearn/tree/_tree.pyx":2366 * 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 = 2342; __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 = 2366; __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 = 2342; __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 = 2366; __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":2344 + /* "sklearn/tree/_tree.pyx":2368 * 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 = 2344; __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 = 2368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2345 + /* "sklearn/tree/_tree.pyx":2369 * * 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 = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; __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 = 2345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2348 + /* "sklearn/tree/_tree.pyx":2372 * '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 = 2348; __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 = 2372; __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":2349 + /* "sklearn/tree/_tree.pyx":2373 * * 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 = 2349; __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 = 2373; __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":2351 + /* "sklearn/tree/_tree.pyx":2375 * 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 = 2351; __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 = 2375; __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 = 2351; __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 = 2375; __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 = 2351; __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 = 2375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2352 + /* "sklearn/tree/_tree.pyx":2376 * * 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 = 2352; __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 = 2376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "sklearn/tree/_tree.pyx":2351 + /* "sklearn/tree/_tree.pyx":2375 * 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 = 2351; __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 = 2375; __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); @@ -18609,106 +18719,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":2353 + /* "sklearn/tree/_tree.pyx":2377 * 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 = 2353; __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 = 2377; __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 = 2353; __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 = 2377; __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 = 2353; __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 = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_4) { - /* "sklearn/tree/_tree.pyx":2354 + /* "sklearn/tree/_tree.pyx":2378 * 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 = 2354; __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 = 2378; __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 = 2354; __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 = 2378; __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 = 2354; __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 = 2378; __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 = 2354; __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 = 2378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2355 + /* "sklearn/tree/_tree.pyx":2379 * 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 = 2355; __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 = 2379; __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 = 2355; __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 = 2379; __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 = 2355; __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 = 2379; __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":2356 + /* "sklearn/tree/_tree.pyx":2380 * 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 = 2356; __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 = 2380; __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 = 2356; __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 = 2380; __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 = 2356; __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 = 2380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_8) { - /* "sklearn/tree/_tree.pyx":2357 + /* "sklearn/tree/_tree.pyx":2381 * 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 = 2357; __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 = 2381; __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 = 2357; __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 = 2381; __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 = 2357; __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 = 2381; __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":2358 + /* "sklearn/tree/_tree.pyx":2382 * 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 = 2358; __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 = 2382; __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 = 2358; __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 = 2382; __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 = 2358; __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 = 2382; __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 = 2358; __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 = 2382; __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 = 2358; __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 = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_12 = __pyx_t_10; } else { @@ -18732,37 +18842,37 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx } if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2359 + /* "sklearn/tree/_tree.pyx":2383 * 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 = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2383; __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 = 2359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2361 + /* "sklearn/tree/_tree.pyx":2385 * 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 = 2361; __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 = 2385; __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 = 2361; __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 = 2385; __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 = 2361; __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 = 2385; __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":2362 + /* "sklearn/tree/_tree.pyx":2386 * * self.capacity = node_ndarray.shape[0] * if self._resize_c(self.capacity) != 0: # <<<<<<<<<<<<<< @@ -18775,32 +18885,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":2363 + /* "sklearn/tree/_tree.pyx":2387 * 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 = 2363; __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 = 2387; __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 = 2363; __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 = 2387; __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 = 2363; __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 = 2387; __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 = 2363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __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 = 2363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2364 + /* "sklearn/tree/_tree.pyx":2388 * if self._resize_c(self.capacity) != 0: * raise MemoryError("resizing tree to %d" % self.capacity) * nodes = memcpy(self.nodes, ( node_ndarray).data, # <<<<<<<<<<<<<< @@ -18809,7 +18919,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":2366 + /* "sklearn/tree/_tree.pyx":2390 * nodes = memcpy(self.nodes, ( node_ndarray).data, * self.capacity * sizeof(Node)) * value = memcpy(self.value, ( value_ndarray).data, # <<<<<<<<<<<<<< @@ -18818,7 +18928,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":2340 + /* "sklearn/tree/_tree.pyx":2364 * return d * * def __setstate__(self, d): # <<<<<<<<<<<<<< @@ -18845,7 +18955,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_8__setstate__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2369 +/* "sklearn/tree/_tree.pyx":2393 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity): # <<<<<<<<<<<<<< @@ -18863,7 +18973,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":2372 + /* "sklearn/tree/_tree.pyx":2396 * """Resize all inner arrays to `capacity`, if `capacity` == -1, then * double the size of the inner arrays.""" * if self._resize_c(capacity)!= 0: # <<<<<<<<<<<<<< @@ -18876,17 +18986,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":2373 + /* "sklearn/tree/_tree.pyx":2397 * 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 = 2373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_tree.pyx":2369 + /* "sklearn/tree/_tree.pyx":2393 * self.capacity * self.value_stride * sizeof(double)) * * cdef void _resize(self, SIZE_t capacity): # <<<<<<<<<<<<<< @@ -18902,7 +19012,7 @@ static void __pyx_f_7sklearn_4tree_5_tree_4Tree__resize(struct __pyx_obj_7sklear __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_tree.pyx":2377 +/* "sklearn/tree/_tree.pyx":2401 * # 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: # <<<<<<<<<<<<<< @@ -18923,7 +19033,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } } - /* "sklearn/tree/_tree.pyx":2379 + /* "sklearn/tree/_tree.pyx":2403 * 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: # <<<<<<<<<<<<<< @@ -18939,7 +19049,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } if (__pyx_t_3) { - /* "sklearn/tree/_tree.pyx":2380 + /* "sklearn/tree/_tree.pyx":2404 * """Guts of _resize. Returns 0 for success, -1 for error.""" * if capacity == self.capacity and self.nodes != NULL: * return 0 # <<<<<<<<<<<<<< @@ -18950,7 +19060,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2382 + /* "sklearn/tree/_tree.pyx":2406 * return 0 * * if capacity == (-1): # <<<<<<<<<<<<<< @@ -18960,7 +19070,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":2383 + /* "sklearn/tree/_tree.pyx":2407 * * if capacity == (-1): * if self.capacity == 0: # <<<<<<<<<<<<<< @@ -18970,7 +19080,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":2384 + /* "sklearn/tree/_tree.pyx":2408 * if capacity == (-1): * if self.capacity == 0: * capacity = 3 # default initial value # <<<<<<<<<<<<<< @@ -18982,7 +19092,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } /*else*/ { - /* "sklearn/tree/_tree.pyx":2386 + /* "sklearn/tree/_tree.pyx":2410 * capacity = 3 # default initial value * else: * capacity = 2 * self.capacity # <<<<<<<<<<<<<< @@ -18996,7 +19106,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L4:; - /* "sklearn/tree/_tree.pyx":2388 + /* "sklearn/tree/_tree.pyx":2412 * capacity = 2 * self.capacity * * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) # <<<<<<<<<<<<<< @@ -19005,7 +19115,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":2389 + /* "sklearn/tree/_tree.pyx":2413 * * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -19015,7 +19125,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":2390 + /* "sklearn/tree/_tree.pyx":2414 * cdef void* ptr = realloc(self.nodes, capacity * sizeof(Node)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -19026,7 +19136,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2391 + /* "sklearn/tree/_tree.pyx":2415 * if ptr == NULL: * return -1 * self.nodes = ptr # <<<<<<<<<<<<<< @@ -19035,7 +19145,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":2392 + /* "sklearn/tree/_tree.pyx":2416 * return -1 * self.nodes = ptr * ptr = realloc(self.value, # <<<<<<<<<<<<<< @@ -19044,7 +19154,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":2394 + /* "sklearn/tree/_tree.pyx":2418 * ptr = realloc(self.value, * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: # <<<<<<<<<<<<<< @@ -19054,7 +19164,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":2395 + /* "sklearn/tree/_tree.pyx":2419 * capacity * self.value_stride * sizeof(double)) * if ptr == NULL: * return -1 # <<<<<<<<<<<<<< @@ -19065,7 +19175,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea goto __pyx_L0; } - /* "sklearn/tree/_tree.pyx":2396 + /* "sklearn/tree/_tree.pyx":2420 * if ptr == NULL: * return -1 * self.value = ptr # <<<<<<<<<<<<<< @@ -19074,7 +19184,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":2399 + /* "sklearn/tree/_tree.pyx":2423 * * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: # <<<<<<<<<<<<<< @@ -19084,7 +19194,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":2400 + /* "sklearn/tree/_tree.pyx":2424 * # value memory is initialised to 0 to enable classifier argmax * if capacity > self.capacity: * memset((self.value + self.capacity * self.value_stride), 0, # <<<<<<<<<<<<<< @@ -19096,7 +19206,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L8:; - /* "sklearn/tree/_tree.pyx":2405 + /* "sklearn/tree/_tree.pyx":2429 * * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: # <<<<<<<<<<<<<< @@ -19106,7 +19216,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":2406 + /* "sklearn/tree/_tree.pyx":2430 * # if capacity smaller than node_count, adjust the counter * if capacity < self.node_count: * self.node_count = capacity # <<<<<<<<<<<<<< @@ -19118,7 +19228,7 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea } __pyx_L9:; - /* "sklearn/tree/_tree.pyx":2408 + /* "sklearn/tree/_tree.pyx":2432 * self.node_count = capacity * * self.capacity = capacity # <<<<<<<<<<<<<< @@ -19127,7 +19237,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":2409 + /* "sklearn/tree/_tree.pyx":2433 * * self.capacity = capacity * return 0 # <<<<<<<<<<<<<< @@ -19137,7 +19247,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":2377 + /* "sklearn/tree/_tree.pyx":2401 * # 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: # <<<<<<<<<<<<<< @@ -19150,22 +19260,22 @@ static int __pyx_f_7sklearn_4tree_5_tree_4Tree__resize_c(struct __pyx_obj_7sklea return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2411 +/* "sklearn/tree/_tree.pyx":2435 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< * SIZE_t feature, double threshold, double impurity, - * SIZE_t n_samples, double weighted_n_samples) nogil: + * SIZE_t n_node_samples, double weighted_n_node_samples) nogil: */ -static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree__add_node(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_parent, int __pyx_v_is_left, int __pyx_v_is_leaf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_feature, double __pyx_v_threshold, double __pyx_v_impurity, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_samples, double __pyx_v_weighted_n_samples) { +static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree__add_node(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *__pyx_v_self, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_parent, int __pyx_v_is_left, int __pyx_v_is_leaf, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_feature, double __pyx_v_threshold, double __pyx_v_impurity, __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_n_node_samples, double __pyx_v_weighted_n_node_samples) { __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_v_node_id; struct __pyx_t_7sklearn_4tree_5_tree_Node *__pyx_v_node; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_r; __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_t_1; int __pyx_t_2; - /* "sklearn/tree/_tree.pyx":2420 + /* "sklearn/tree/_tree.pyx":2444 * Returns (size_t)(-1) on error. * """ * cdef SIZE_t node_id = self.node_count # <<<<<<<<<<<<<< @@ -19175,7 +19285,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":2422 + /* "sklearn/tree/_tree.pyx":2446 * cdef SIZE_t node_id = self.node_count * * if node_id >= self.capacity: # <<<<<<<<<<<<<< @@ -19185,7 +19295,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":2423 + /* "sklearn/tree/_tree.pyx":2447 * * if node_id >= self.capacity: * if self._resize_c() != 0: # <<<<<<<<<<<<<< @@ -19195,7 +19305,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":2424 + /* "sklearn/tree/_tree.pyx":2448 * if node_id >= self.capacity: * if self._resize_c() != 0: * return (-1) # <<<<<<<<<<<<<< @@ -19209,44 +19319,44 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2426 + /* "sklearn/tree/_tree.pyx":2450 * return (-1) * * cdef Node* node = &self.nodes[node_id] # <<<<<<<<<<<<<< * node.impurity = impurity - * node.n_samples = n_samples + * node.n_node_samples = n_node_samples */ __pyx_v_node = (&(__pyx_v_self->nodes[__pyx_v_node_id])); - /* "sklearn/tree/_tree.pyx":2427 + /* "sklearn/tree/_tree.pyx":2451 * * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity # <<<<<<<<<<<<<< - * node.n_samples = n_samples - * node.weighted_n_samples = weighted_n_samples + * node.n_node_samples = n_node_samples + * node.weighted_n_node_samples = weighted_n_node_samples */ __pyx_v_node->impurity = __pyx_v_impurity; - /* "sklearn/tree/_tree.pyx":2428 + /* "sklearn/tree/_tree.pyx":2452 * cdef Node* node = &self.nodes[node_id] * node.impurity = impurity - * node.n_samples = n_samples # <<<<<<<<<<<<<< - * node.weighted_n_samples = weighted_n_samples + * node.n_node_samples = n_node_samples # <<<<<<<<<<<<<< + * node.weighted_n_node_samples = weighted_n_node_samples * */ - __pyx_v_node->n_samples = __pyx_v_n_samples; + __pyx_v_node->n_node_samples = __pyx_v_n_node_samples; - /* "sklearn/tree/_tree.pyx":2429 + /* "sklearn/tree/_tree.pyx":2453 * node.impurity = impurity - * node.n_samples = n_samples - * node.weighted_n_samples = weighted_n_samples # <<<<<<<<<<<<<< + * node.n_node_samples = n_node_samples + * node.weighted_n_node_samples = weighted_n_node_samples # <<<<<<<<<<<<<< * * if parent != _TREE_UNDEFINED: */ - __pyx_v_node->weighted_n_samples = __pyx_v_weighted_n_samples; + __pyx_v_node->weighted_n_node_samples = __pyx_v_weighted_n_node_samples; - /* "sklearn/tree/_tree.pyx":2431 - * node.weighted_n_samples = weighted_n_samples + /* "sklearn/tree/_tree.pyx":2455 + * node.weighted_n_node_samples = weighted_n_node_samples * * if parent != _TREE_UNDEFINED: # <<<<<<<<<<<<<< * if is_left: @@ -19255,7 +19365,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":2432 + /* "sklearn/tree/_tree.pyx":2456 * * if parent != _TREE_UNDEFINED: * if is_left: # <<<<<<<<<<<<<< @@ -19265,7 +19375,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":2433 + /* "sklearn/tree/_tree.pyx":2457 * if parent != _TREE_UNDEFINED: * if is_left: * self.nodes[parent].left_child = node_id # <<<<<<<<<<<<<< @@ -19277,7 +19387,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":2435 + /* "sklearn/tree/_tree.pyx":2459 * self.nodes[parent].left_child = node_id * else: * self.nodes[parent].right_child = node_id # <<<<<<<<<<<<<< @@ -19291,7 +19401,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2437 + /* "sklearn/tree/_tree.pyx":2461 * self.nodes[parent].right_child = node_id * * if is_leaf: # <<<<<<<<<<<<<< @@ -19301,7 +19411,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":2438 + /* "sklearn/tree/_tree.pyx":2462 * * if is_leaf: * node.left_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -19310,7 +19420,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":2439 + /* "sklearn/tree/_tree.pyx":2463 * if is_leaf: * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF # <<<<<<<<<<<<<< @@ -19319,7 +19429,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":2440 + /* "sklearn/tree/_tree.pyx":2464 * node.left_child = _TREE_LEAF * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -19328,7 +19438,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":2441 + /* "sklearn/tree/_tree.pyx":2465 * node.right_child = _TREE_LEAF * node.feature = _TREE_UNDEFINED * node.threshold = _TREE_UNDEFINED # <<<<<<<<<<<<<< @@ -19340,7 +19450,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } /*else*/ { - /* "sklearn/tree/_tree.pyx":2445 + /* "sklearn/tree/_tree.pyx":2469 * else: * # left_child and right_child will be set later * node.feature = feature # <<<<<<<<<<<<<< @@ -19349,7 +19459,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":2446 + /* "sklearn/tree/_tree.pyx":2470 * # left_child and right_child will be set later * node.feature = feature * node.threshold = threshold # <<<<<<<<<<<<<< @@ -19360,7 +19470,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ } __pyx_L7:; - /* "sklearn/tree/_tree.pyx":2448 + /* "sklearn/tree/_tree.pyx":2472 * node.threshold = threshold * * self.node_count += 1 # <<<<<<<<<<<<<< @@ -19369,7 +19479,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":2450 + /* "sklearn/tree/_tree.pyx":2474 * self.node_count += 1 * * return node_id # <<<<<<<<<<<<<< @@ -19379,12 +19489,12 @@ 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":2411 + /* "sklearn/tree/_tree.pyx":2435 * return 0 * * cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, # <<<<<<<<<<<<<< * SIZE_t feature, double threshold, double impurity, - * SIZE_t n_samples, double weighted_n_samples) nogil: + * SIZE_t n_node_samples, double weighted_n_node_samples) nogil: */ /* function exit code */ @@ -19392,7 +19502,7 @@ static __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree_5_tree_4Tree_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2452 +/* "sklearn/tree/_tree.pyx":2476 * return node_id * * cpdef np.ndarray predict(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19422,26 +19532,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 = 2452; __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 = 2476; __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 = 2452; __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 = 2476; __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 = 2452; __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 = 2476; __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 = 2452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2476; __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 = 2452; __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 = 2476; __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; @@ -19450,30 +19560,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":2454 + /* "sklearn/tree/_tree.pyx":2478 * 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 = 2454; __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 = 2478; __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 = 2454; __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 = 2478; __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 = 2454; __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 = 2478; __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 = 2454; __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 = 2478; __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 = 2454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2478; __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 = 2454; __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 = 2454; __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 = 2454; __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 = 2478; __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 = 2478; __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 = 2478; __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; @@ -19481,7 +19591,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":2456 + /* "sklearn/tree/_tree.pyx":2480 * out = self._get_value_ndarray().take(self.apply(X), axis=0, * mode='clip') * if self.n_outputs == 1: # <<<<<<<<<<<<<< @@ -19491,20 +19601,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":2457 + /* "sklearn/tree/_tree.pyx":2481 * 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 = 2457; __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 = 2481; __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 = 2457; __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 = 2481; __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 = 2457; __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 = 2481; __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 = 2457; __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 = 2481; __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); @@ -19512,7 +19622,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 = 2457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2481; __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; @@ -19522,7 +19632,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_predict(struct __pyx_o } __pyx_L3:; - /* "sklearn/tree/_tree.pyx":2458 + /* "sklearn/tree/_tree.pyx":2482 * if self.n_outputs == 1: * out = out.reshape(X.shape[0], self.max_n_classes) * return out # <<<<<<<<<<<<<< @@ -19530,12 +19640,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 = 2458; __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 = 2482; __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":2452 + /* "sklearn/tree/_tree.pyx":2476 * return node_id * * cpdef np.ndarray predict(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19575,7 +19685,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 = 2452; __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 = 2476; __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 */ @@ -19603,11 +19713,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 = 2452; __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 = 2476; __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 = 2452; __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 = 2476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -19631,7 +19741,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_10predict(struct __pyx_obj return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2460 +/* "sklearn/tree/_tree.pyx":2484 * return out * * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19678,26 +19788,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 = 2460; __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 = 2484; __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 = 2460; __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 = 2484; __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 = 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 = 2484; __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 = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2484; __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 = 2460; __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 = 2484; __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; @@ -19706,7 +19816,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":2462 + /* "sklearn/tree/_tree.pyx":2486 * 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] # <<<<<<<<<<<<<< @@ -19715,7 +19825,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":2463 + /* "sklearn/tree/_tree.pyx":2487 * """Finds the terminal region (=leaf node) for each sample in X.""" * cdef SIZE_t n_samples = X.shape[0] * cdef Node* node = NULL # <<<<<<<<<<<<<< @@ -19724,7 +19834,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj */ __pyx_v_node = NULL; - /* "sklearn/tree/_tree.pyx":2464 + /* "sklearn/tree/_tree.pyx":2488 * cdef SIZE_t n_samples = X.shape[0] * cdef Node* node = NULL * cdef SIZE_t i = 0 # <<<<<<<<<<<<<< @@ -19733,51 +19843,51 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj */ __pyx_v_i = 0; - /* "sklearn/tree/_tree.pyx":2466 + /* "sklearn/tree/_tree.pyx":2490 * 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 = 2466; __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2490; __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 = 2466; __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 = 2490; __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 = 2466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2490; __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]; } } @@ -19785,7 +19895,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":2467 + /* "sklearn/tree/_tree.pyx":2491 * * cdef np.ndarray[SIZE_t] out = np.zeros((n_samples,), dtype=np.intp) * cdef SIZE_t* out_data = out.data # <<<<<<<<<<<<<< @@ -19794,7 +19904,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":2469 + /* "sklearn/tree/_tree.pyx":2493 * cdef SIZE_t* out_data = out.data * * with nogil: # <<<<<<<<<<<<<< @@ -19808,7 +19918,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj #endif /*try:*/ { - /* "sklearn/tree/_tree.pyx":2470 + /* "sklearn/tree/_tree.pyx":2494 * * with nogil: * for i in range(n_samples): # <<<<<<<<<<<<<< @@ -19819,7 +19929,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":2471 + /* "sklearn/tree/_tree.pyx":2495 * with nogil: * for i in range(n_samples): * node = self.nodes # <<<<<<<<<<<<<< @@ -19829,7 +19939,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":2474 + /* "sklearn/tree/_tree.pyx":2498 * * # While node not a leaf * while node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -19840,7 +19950,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":2476 + /* "sklearn/tree/_tree.pyx":2500 * while node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * if X[i, node.feature] <= node.threshold: # <<<<<<<<<<<<<< @@ -19852,7 +19962,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":2477 + /* "sklearn/tree/_tree.pyx":2501 * # ... and node.right_child != _TREE_LEAF: * if X[i, node.feature] <= node.threshold: * node = &self.nodes[node.left_child] # <<<<<<<<<<<<<< @@ -19864,7 +19974,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } /*else*/ { - /* "sklearn/tree/_tree.pyx":2479 + /* "sklearn/tree/_tree.pyx":2503 * node = &self.nodes[node.left_child] * else: * node = &self.nodes[node.right_child] # <<<<<<<<<<<<<< @@ -19876,7 +19986,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj __pyx_L10:; } - /* "sklearn/tree/_tree.pyx":2481 + /* "sklearn/tree/_tree.pyx":2505 * node = &self.nodes[node.right_child] * * out_data[i] = (node - self.nodes) # node offset # <<<<<<<<<<<<<< @@ -19887,7 +19997,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } - /* "sklearn/tree/_tree.pyx":2469 + /* "sklearn/tree/_tree.pyx":2493 * cdef SIZE_t* out_data = out.data * * with nogil: # <<<<<<<<<<<<<< @@ -19905,7 +20015,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_apply(struct __pyx_obj } } - /* "sklearn/tree/_tree.pyx":2483 + /* "sklearn/tree/_tree.pyx":2507 * out_data[i] = (node - self.nodes) # node offset * * return out # <<<<<<<<<<<<<< @@ -19917,7 +20027,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":2460 + /* "sklearn/tree/_tree.pyx":2484 * return out * * cpdef np.ndarray apply(self, np.ndarray[DTYPE_t, ndim=2] X): # <<<<<<<<<<<<<< @@ -19960,7 +20070,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 = 2460; __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 = 2484; __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 */ @@ -19988,11 +20098,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 = 2460; __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 = 2484; __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 = 2460; __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 = 2484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20016,7 +20126,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_12apply(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2485 +/* "sklearn/tree/_tree.pyx":2509 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -20067,16 +20177,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 = 2485; __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 = 2509; __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 = 2485; __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 = 2509; __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 = 2485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2509; __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; @@ -20087,7 +20197,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":2489 + /* "sklearn/tree/_tree.pyx":2513 * cdef Node* left * cdef Node* right * cdef Node* nodes = self.nodes # <<<<<<<<<<<<<< @@ -20097,7 +20207,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":2490 + /* "sklearn/tree/_tree.pyx":2514 * cdef Node* right * cdef Node* nodes = self.nodes * cdef Node* node = nodes # <<<<<<<<<<<<<< @@ -20106,7 +20216,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances */ __pyx_v_node = __pyx_v_nodes; - /* "sklearn/tree/_tree.pyx":2491 + /* "sklearn/tree/_tree.pyx":2515 * cdef Node* nodes = self.nodes * cdef Node* node = nodes * cdef Node* end_node = node + self.node_count # <<<<<<<<<<<<<< @@ -20115,35 +20225,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":2494 + /* "sklearn/tree/_tree.pyx":2518 * * 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 = 2494; __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 = 2518; __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 = 2494; __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 = 2518; __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 = 2494; __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 = 2518; __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 = 2494; __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 = 2518; __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 = 2494; __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 = 2518; __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 = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2518; __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 = 2494; __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 = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20159,13 +20269,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 = 2494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __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":2496 + /* "sklearn/tree/_tree.pyx":2520 * importances = np.zeros((self.n_features,)) * * while node != end_node: # <<<<<<<<<<<<<< @@ -20176,7 +20286,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":2497 + /* "sklearn/tree/_tree.pyx":2521 * * while node != end_node: * if node.left_child != _TREE_LEAF: # <<<<<<<<<<<<<< @@ -20186,7 +20296,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":2499 + /* "sklearn/tree/_tree.pyx":2523 * if node.left_child != _TREE_LEAF: * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] # <<<<<<<<<<<<<< @@ -20195,7 +20305,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":2500 + /* "sklearn/tree/_tree.pyx":2524 * # ... and node.right_child != _TREE_LEAF: * left = &nodes[node.left_child] * right = &nodes[node.right_child] # <<<<<<<<<<<<<< @@ -20204,42 +20314,42 @@ 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":2502 + /* "sklearn/tree/_tree.pyx":2526 * right = &nodes[node.right_child] * * importances[node.feature] += ( # <<<<<<<<<<<<<< - * node.weighted_n_samples * node.impurity - - * left.weighted_n_samples * left.impurity - + * node.weighted_n_node_samples * node.impurity - + * left.weighted_n_node_samples * left.impurity - */ __pyx_t_11 = __pyx_v_node->feature; - *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_importances.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_importances.diminfo[0].strides) += (((__pyx_v_node->weighted_n_samples * __pyx_v_node->impurity) - (__pyx_v_left->weighted_n_samples * __pyx_v_left->impurity)) - (__pyx_v_right->weighted_n_samples * __pyx_v_right->impurity)); + *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_importances.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_importances.diminfo[0].strides) += (((__pyx_v_node->weighted_n_node_samples * __pyx_v_node->impurity) - (__pyx_v_left->weighted_n_node_samples * __pyx_v_left->impurity)) - (__pyx_v_right->weighted_n_node_samples * __pyx_v_right->impurity)); goto __pyx_L5; } __pyx_L5:; - /* "sklearn/tree/_tree.pyx":2506 - * left.weighted_n_samples * left.impurity - - * right.weighted_n_samples * right.impurity) + /* "sklearn/tree/_tree.pyx":2530 + * left.weighted_n_node_samples * left.impurity - + * right.weighted_n_node_samples * right.impurity) * node += 1 # <<<<<<<<<<<<<< * - * importances = importances / nodes[0].weighted_n_samples + * importances = importances / nodes[0].weighted_n_node_samples */ __pyx_v_node = (__pyx_v_node + 1); } - /* "sklearn/tree/_tree.pyx":2508 + /* "sklearn/tree/_tree.pyx":2532 * node += 1 * - * importances = importances / nodes[0].weighted_n_samples # <<<<<<<<<<<<<< + * importances = importances / nodes[0].weighted_n_node_samples # <<<<<<<<<<<<<< * cdef double normalizer * */ - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_nodes[0]).weighted_n_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; __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 = 2532; __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 = 2508; __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 = 2532; __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 = 2508; __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 = 2532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20255,48 +20365,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 = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __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":2511 + /* "sklearn/tree/_tree.pyx":2535 * 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 = 2511; __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 = 2535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_10) { - /* "sklearn/tree/_tree.pyx":2512 + /* "sklearn/tree/_tree.pyx":2536 * * 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 = 2512; __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 = 2536; __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 = 2512; __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 = 2536; __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 = 2512; __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 = 2536; __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 = 2512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __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 = 2536; __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 = 2512; __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 = 2536; __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":2514 + /* "sklearn/tree/_tree.pyx":2538 * normalizer = np.sum(importances) * * if normalizer > 0.0: # <<<<<<<<<<<<<< @@ -20306,19 +20416,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":2516 + /* "sklearn/tree/_tree.pyx":2540 * 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 = 2516; __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 = 2540; __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 = 2516; __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 = 2540; __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 = 2516; __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 = 2540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -20334,7 +20444,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 = 2516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_importances, ((PyArrayObject *)__pyx_t_1)); @@ -20346,7 +20456,7 @@ static PyObject *__pyx_f_7sklearn_4tree_5_tree_4Tree_compute_feature_importances } __pyx_L6:; - /* "sklearn/tree/_tree.pyx":2518 + /* "sklearn/tree/_tree.pyx":2542 * importances /= normalizer * * return importances # <<<<<<<<<<<<<< @@ -20358,7 +20468,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":2485 + /* "sklearn/tree/_tree.pyx":2509 * return out * * cpdef compute_feature_importances(self, normalize=True): # <<<<<<<<<<<<<< @@ -20419,7 +20529,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 = 2485; __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 = 2509; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -20432,7 +20542,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 = 2485; __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 = 2509; __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(); @@ -20457,7 +20567,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 = 2485; __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 = 2509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20474,7 +20584,7 @@ static PyObject *__pyx_pf_7sklearn_4tree_5_tree_4Tree_14compute_feature_importan return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2520 +/* "sklearn/tree/_tree.pyx":2544 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -20493,7 +20603,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":2527 + /* "sklearn/tree/_tree.pyx":2551 * """ * cdef np.npy_intp shape[3] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -20502,7 +20612,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":2528 + /* "sklearn/tree/_tree.pyx":2552 * cdef np.npy_intp shape[3] * shape[0] = self.node_count * shape[1] = self.n_outputs # <<<<<<<<<<<<<< @@ -20511,7 +20621,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":2529 + /* "sklearn/tree/_tree.pyx":2553 * shape[0] = self.node_count * shape[1] = self.n_outputs * shape[2] = self.max_n_classes # <<<<<<<<<<<<<< @@ -20520,20 +20630,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":2531 + /* "sklearn/tree/_tree.pyx":2555 * 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 = 2531; __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 = 2555; __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 = 2531; __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 = 2555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_arr = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/tree/_tree.pyx":2532 + /* "sklearn/tree/_tree.pyx":2556 * cdef np.ndarray arr * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -20542,7 +20652,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":2533 + /* "sklearn/tree/_tree.pyx":2557 * arr = np.PyArray_SimpleNewFromData(3, shape, np.NPY_DOUBLE, self.value) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -20551,7 +20661,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":2534 + /* "sklearn/tree/_tree.pyx":2558 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -20563,7 +20673,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":2520 + /* "sklearn/tree/_tree.pyx":2544 * return importances * * cdef np.ndarray _get_value_ndarray(self): # <<<<<<<<<<<<<< @@ -20583,7 +20693,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_value_ndarray(str return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2536 +/* "sklearn/tree/_tree.pyx":2560 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -20604,7 +20714,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":2544 + /* "sklearn/tree/_tree.pyx":2568 * """ * cdef np.npy_intp shape[1] * shape[0] = self.node_count # <<<<<<<<<<<<<< @@ -20613,7 +20723,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":2546 + /* "sklearn/tree/_tree.pyx":2570 * shape[0] = self.node_count * cdef np.npy_intp strides[1] * strides[0] = sizeof(Node) # <<<<<<<<<<<<<< @@ -20622,51 +20732,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":2548 + /* "sklearn/tree/_tree.pyx":2572 * 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 = 2548; __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 = 2572; __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":2549 + /* "sklearn/tree/_tree.pyx":2573 * 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 = 2549; __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 = 2573; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "sklearn/tree/_tree.pyx":2551 + /* "sklearn/tree/_tree.pyx":2575 * 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 = 2549; __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 = 2573; __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":2549 + /* "sklearn/tree/_tree.pyx":2573 * 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 = 2549; __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_v_arr = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2552 + /* "sklearn/tree/_tree.pyx":2576 * strides, self.nodes, * np.NPY_DEFAULT, None) * Py_INCREF(self) # <<<<<<<<<<<<<< @@ -20675,7 +20785,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru */ Py_INCREF(((PyObject *)__pyx_v_self)); - /* "sklearn/tree/_tree.pyx":2553 + /* "sklearn/tree/_tree.pyx":2577 * np.NPY_DEFAULT, None) * Py_INCREF(self) * arr.base = self # <<<<<<<<<<<<<< @@ -20684,7 +20794,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":2554 + /* "sklearn/tree/_tree.pyx":2578 * Py_INCREF(self) * arr.base = self * return arr # <<<<<<<<<<<<<< @@ -20696,7 +20806,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":2536 + /* "sklearn/tree/_tree.pyx":2560 * return arr * * cdef np.ndarray _get_node_ndarray(self): # <<<<<<<<<<<<<< @@ -20717,7 +20827,7 @@ static PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_4Tree__get_node_ndarray(stru return __pyx_r; } -/* "sklearn/tree/_tree.pxd":153 +/* "sklearn/tree/_tree.pxd":156 * * # Input/Output layout * cdef public SIZE_t n_features # Number of features in X # <<<<<<<<<<<<<< @@ -20747,7 +20857,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 = 153; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20785,7 +20895,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 = 153; __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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_features = __pyx_t_1; /* function exit code */ @@ -20799,7 +20909,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10n_features_2__set__(struct __p return __pyx_r; } -/* "sklearn/tree/_tree.pxd":155 +/* "sklearn/tree/_tree.pxd":158 * 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 # <<<<<<<<<<<<<< @@ -20829,7 +20939,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 = 155; __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 = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20867,7 +20977,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 = 155; __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 = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->n_outputs = __pyx_t_1; /* function exit code */ @@ -20881,7 +20991,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9n_outputs_2__set__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pxd":156 +/* "sklearn/tree/_tree.pxd":159 * 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) # <<<<<<<<<<<<<< @@ -20911,7 +21021,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 = 156; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -20949,7 +21059,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 = 156; __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 = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_n_classes = __pyx_t_1; /* function exit code */ @@ -20963,7 +21073,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_13max_n_classes_2__set__(struct return __pyx_r; } -/* "sklearn/tree/_tree.pxd":160 +/* "sklearn/tree/_tree.pxd":163 * # 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 # <<<<<<<<<<<<<< @@ -20993,7 +21103,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 = 160; __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 = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21031,7 +21141,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 = 160; __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 = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->max_depth = __pyx_t_1; /* function exit code */ @@ -21045,7 +21155,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_9max_depth_2__set__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_tree.pxd":161 +/* "sklearn/tree/_tree.pxd":164 * # 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 # <<<<<<<<<<<<<< @@ -21075,7 +21185,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 = 161; __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21113,7 +21223,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 = 161; __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 = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->node_count = __pyx_t_1; /* function exit code */ @@ -21127,7 +21237,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_10node_count_2__set__(struct __p return __pyx_r; } -/* "sklearn/tree/_tree.pxd":162 +/* "sklearn/tree/_tree.pxd":165 * 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 # <<<<<<<<<<<<<< @@ -21157,7 +21267,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 = 162; __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 = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -21195,7 +21305,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 = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_PyInt_As_Py_intptr_t(__pyx_v_value); if (unlikely((__pyx_t_1 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->capacity = __pyx_t_1; /* function exit code */ @@ -21209,7 +21319,7 @@ static int __pyx_pf_7sklearn_4tree_5_tree_4Tree_8capacity_2__set__(struct __pyx_ return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2563 +/* "sklearn/tree/_tree.pyx":2587 * # 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: # <<<<<<<<<<<<<< @@ -21221,7 +21331,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":2564 + /* "sklearn/tree/_tree.pyx":2588 * # 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) # <<<<<<<<<<<<<< @@ -21231,7 +21341,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":2565 + /* "sklearn/tree/_tree.pyx":2589 * cdef inline UINT32_t our_rand_r(UINT32_t* seed) nogil: * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) # <<<<<<<<<<<<<< @@ -21241,7 +21351,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":2566 + /* "sklearn/tree/_tree.pyx":2590 * seed[0] ^= (seed[0] << 13) * seed[0] ^= (seed[0] >> 17) * seed[0] ^= (seed[0] << 5) # <<<<<<<<<<<<<< @@ -21251,7 +21361,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":2568 + /* "sklearn/tree/_tree.pyx":2592 * seed[0] ^= (seed[0] << 5) * * return seed[0] % (RAND_R_MAX + 1) # <<<<<<<<<<<<<< @@ -21261,7 +21371,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":2563 + /* "sklearn/tree/_tree.pyx":2587 * # 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: # <<<<<<<<<<<<<< @@ -21274,7 +21384,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_UINT32_t __pyx_f_7sklearn_4tr return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2570 +/* "sklearn/tree/_tree.pyx":2594 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -21292,7 +21402,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":2573 + /* "sklearn/tree/_tree.pyx":2597 * """Encapsulate data into a 1D numpy array of intp's.""" * cdef np.npy_intp shape[1] * shape[0] = size # <<<<<<<<<<<<<< @@ -21301,7 +21411,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":2574 + /* "sklearn/tree/_tree.pyx":2598 * cdef np.npy_intp shape[1] * shape[0] = size * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) # <<<<<<<<<<<<<< @@ -21309,14 +21419,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 = 2574; __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 = 2598; __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 = 2574; __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 = 2598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "sklearn/tree/_tree.pyx":2570 + /* "sklearn/tree/_tree.pyx":2594 * return seed[0] % (RAND_R_MAX + 1) * * cdef inline np.ndarray sizet_ptr_to_ndarray(SIZE_t* data, SIZE_t size): # <<<<<<<<<<<<<< @@ -21335,7 +21445,7 @@ static CYTHON_INLINE PyArrayObject *__pyx_f_7sklearn_4tree_5_tree_sizet_ptr_to_n return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2576 +/* "sklearn/tree/_tree.pyx":2600 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t end, UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21346,7 +21456,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":2578 + /* "sklearn/tree/_tree.pyx":2602 * 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 # <<<<<<<<<<<<<< @@ -21356,7 +21466,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":2576 + /* "sklearn/tree/_tree.pyx":2600 * return np.PyArray_SimpleNewFromData(1, shape, np.NPY_INTP, data) * * cdef inline SIZE_t rand_int(SIZE_t end, UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21369,7 +21479,7 @@ static CYTHON_INLINE __pyx_t_7sklearn_4tree_5_tree_SIZE_t __pyx_f_7sklearn_4tree return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2580 +/* "sklearn/tree/_tree.pyx":2604 * return our_rand_r(random_state) % end * * cdef inline double rand_double(UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21380,7 +21490,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":2582 + /* "sklearn/tree/_tree.pyx":2606 * 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 # <<<<<<<<<<<<<< @@ -21390,7 +21500,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":2580 + /* "sklearn/tree/_tree.pyx":2604 * return our_rand_r(random_state) % end * * cdef inline double rand_double(UINT32_t* random_state) nogil: # <<<<<<<<<<<<<< @@ -21403,7 +21513,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_rand_double(__pyx_t_7s return __pyx_r; } -/* "sklearn/tree/_tree.pyx":2584 +/* "sklearn/tree/_tree.pyx":2608 * return our_rand_r(random_state) / RAND_R_MAX * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -21413,7 +21523,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":2585 + /* "sklearn/tree/_tree.pyx":2609 * * cdef inline double log(double x) nogil: * return ln(x) / ln(2.0) # <<<<<<<<<<<<<< @@ -21421,7 +21531,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":2584 + /* "sklearn/tree/_tree.pyx":2608 * return our_rand_r(random_state) / RAND_R_MAX * * cdef inline double log(double x) nogil: # <<<<<<<<<<<<<< @@ -21433,7 +21543,7 @@ static CYTHON_INLINE double __pyx_f_7sklearn_4tree_5_tree_log(double __pyx_v_x) return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -21485,7 +21595,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -21498,7 +21608,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -21507,7 +21617,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -21516,7 +21626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -21525,7 +21635,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -21535,7 +21645,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -21547,7 +21657,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -21558,7 +21668,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -21568,7 +21678,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -21582,7 +21692,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_3) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -21596,7 +21706,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -21606,7 +21716,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -21620,7 +21730,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_2) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -21634,7 +21744,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -21643,7 +21753,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -21652,7 +21762,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -21662,7 +21772,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -21671,7 +21781,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))); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -21680,7 +21790,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -21691,7 +21801,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -21700,7 +21810,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]); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "/usr/local/lib/python2.7/dist-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] # <<<<<<<<<<<<<< @@ -21713,7 +21823,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -21722,7 +21832,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)); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -21733,7 +21843,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L7:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -21742,7 +21852,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -21751,7 +21861,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -21760,7 +21870,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -21769,7 +21879,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -21781,7 +21891,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -21790,7 +21900,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -21806,7 +21916,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -21822,7 +21932,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -21837,7 +21947,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L10:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -21847,7 +21957,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -21857,7 +21967,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -21872,7 +21982,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (!__pyx_t_2) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -21892,7 +22002,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -21906,7 +22016,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21915,7 +22025,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21926,7 +22036,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21937,7 +22047,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21948,7 +22058,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21959,7 +22069,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21970,7 +22080,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21981,7 +22091,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -21992,7 +22102,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22003,7 +22113,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22014,7 +22124,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22025,7 +22135,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22036,7 +22146,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22047,7 +22157,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22058,7 +22168,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22069,7 +22179,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22080,7 +22190,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22091,7 +22201,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22103,7 +22213,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -22129,7 +22239,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -22138,7 +22248,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -22150,7 +22260,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -22159,7 +22269,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -22168,7 +22278,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -22177,7 +22287,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "/usr/local/lib/python2.7/dist-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, # <<<<<<<<<<<<<< @@ -22187,7 +22297,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -22197,7 +22307,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -22229,7 +22339,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -22253,7 +22363,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -22263,7 +22373,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -22275,7 +22385,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -22285,7 +22395,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -22297,7 +22407,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -22309,7 +22419,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22326,7 +22436,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -22340,7 +22450,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -22359,7 +22469,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22376,7 +22486,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -22390,7 +22500,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -22409,7 +22519,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22426,7 +22536,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -22440,7 +22550,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -22459,7 +22569,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22476,7 +22586,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -22490,7 +22600,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -22509,7 +22619,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -22526,7 +22636,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -22540,7 +22650,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -22559,7 +22669,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -22593,7 +22703,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -22602,7 +22712,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -22611,7 +22721,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -22633,7 +22743,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -22646,7 +22756,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -22685,7 +22795,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -22702,7 +22812,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); if (__pyx_t_6) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -22716,7 +22826,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -22731,7 +22841,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -22751,7 +22861,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -22765,7 +22875,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -22781,7 +22891,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -22790,7 +22900,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -22799,7 +22909,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -22810,7 +22920,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); } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -22820,7 +22930,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); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -22830,7 +22940,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -22842,7 +22952,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -22852,7 +22962,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); if (__pyx_t_6) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -22866,7 +22976,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[2]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22884,7 +22994,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22902,7 +23012,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22920,7 +23030,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22938,7 +23048,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22956,7 +23066,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22974,7 +23084,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -22992,7 +23102,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23010,7 +23120,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23028,7 +23138,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23046,7 +23156,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23064,7 +23174,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23082,7 +23192,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23100,7 +23210,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -23120,7 +23230,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -23140,7 +23250,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -23160,7 +23270,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -23179,7 +23289,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -23202,7 +23312,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L11:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -23214,7 +23324,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -23228,7 +23338,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -23238,7 +23348,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -23263,7 +23373,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -23278,7 +23388,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); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -23289,7 +23399,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -23301,7 +23411,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -23310,7 +23420,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -23321,7 +23431,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -23330,7 +23440,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -23339,7 +23449,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -23351,7 +23461,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -23365,7 +23475,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -23375,7 +23485,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) { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -23389,7 +23499,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -23400,7 +23510,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -23885,7 +23995,7 @@ static PyTypeObject __pyx_type_7sklearn_4tree_5_tree_Tree = { 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("Array-based representation of a binary decision tree.\n\n The binary tree is represented as a number of parallel arrays. The i-th\n element of each array holds information about the node `i`. Node 0 is the\n tree's root. You can find a detailed description of all arrays in\n `_tree.pxd`. NOTE: Some of the arrays only apply to either leaves or split\n nodes, resp. In this case the values of nodes of the other type are\n arbitrary!\n\n Attributes\n ----------\n node_count : int\n The number of nodes (internal nodes + leaves) in the tree.\n\n capacity : int\n The current capacity (i.e., size) of the arrays, which is at least as\n great as `node_count`.\n\n max_depth : int\n The maximal depth of the tree.\n\n children_left : array of int, shape [node_count]\n children_left[i] holds the node id of the left child of node i.\n For leaves, children_left[i] == TREE_LEAF. Otherwise,\n children_left[i] > i. This child handles the case where\n X[:, feature[i]] <= threshold[i].\n\n children_right : array of int, shape [node_count]\n children_right[i] holds the node id of the right child of node i.\n For leaves, children_right[i] == TREE_LEAF. Otherwise,\n children_right[i] > i. This child handles the case where\n X[:, feature[i]] > threshold[i].\n\n feature : array of int, shape [node_count]\n feature[i] holds the feature to split on, for the internal node i.\n\n threshold : array of double, shape [node_count]\n threshold[i] holds the threshold for the internal node i.\n\n value : array of double, shape [node_count, n_outputs, ]\n Contains the constant prediction value of each node.\n\n impurity : array of double, shape [node_count]\n impurity[i] holds the impurity (i.e., the value of the splitting\n criterion) at node i.\n\n n_node_samples : array of int, shape [node_count]\n n_node_samples[i] holds the number of training samples reaching node i.\n\n weighted_n_node_samples : array of int, shape [node_count]\n weighted_n_samples[i] holds the weighted number of training samples\n reaching node i.\n "), /*tp_doc*/ + __Pyx_DOCSTR("Array-based representation of a binary decision tree.\n\n The binary tree is represented as a number of parallel arrays. The i-th\n element of each array holds information about the node `i`. Node 0 is the\n tree's root. You can find a detailed description of all arrays in\n `_tree.pxd`. NOTE: Some of the arrays only apply to either leaves or split\n nodes, resp. In this case the values of nodes of the other type are\n arbitrary!\n\n Attributes\n ----------\n node_count : int\n The number of nodes (internal nodes + leaves) in the tree.\n\n capacity : int\n The current capacity (i.e., size) of the arrays, which is at least as\n great as `node_count`.\n\n max_depth : int\n The maximal depth of the tree.\n\n children_left : array of int, shape [node_count]\n children_left[i] holds the node id of the left child of node i.\n For leaves, children_left[i] == TREE_LEAF. Otherwise,\n children_left[i] > i. This child handles the case where\n X[:, feature[i]] <= threshold[i].\n\n children_right : array of int, shape [node_count]\n children_right[i] holds the node id of the right child of node i.\n For leaves, children_right[i] == TREE_LEAF. Otherwise,\n children_right[i] > i. This child handles the case where\n X[:, feature[i]] > threshold[i].\n\n feature : array of int, shape [node_count]\n feature[i] holds the feature to split on, for the internal node i.\n\n threshold : array of double, shape [node_count]\n threshold[i] holds the threshold for the internal node i.\n\n value : array of double, shape [node_count, n_outputs, ]\n Contains the constant prediction value of each node.\n\n impurity : array of double, shape [node_count]\n impurity[i] holds the impurity (i.e., the value of the splitting\n criterion) at node i.\n\n n_node_samples : array of int, shape [node_count]\n n_node_samples[i] holds the number of training samples reaching node i.\n\n weighted_n_node_samples : array of int, shape [node_count]\n weighted_n_node_samples[i] holds the weighted number of training samples\n reaching node i.\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -24994,8 +25104,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_n_classes, __pyx_k_n_classes, sizeof(__pyx_k_n_classes), 0, 0, 1, 1}, {&__pyx_n_s_n_features, __pyx_k_n_features, sizeof(__pyx_k_n_features), 0, 0, 1, 1}, + {&__pyx_n_s_n_node_samples, __pyx_k_n_node_samples, sizeof(__pyx_k_n_node_samples), 0, 0, 1, 1}, {&__pyx_n_s_n_outputs, __pyx_k_n_outputs, sizeof(__pyx_k_n_outputs), 0, 0, 1, 1}, - {&__pyx_n_s_n_samples, __pyx_k_n_samples, sizeof(__pyx_k_n_samples), 0, 0, 1, 1}, {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1}, {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, @@ -25027,15 +25137,15 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 0, 0, 1, 1}, {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_weighted_n_samples, __pyx_k_weighted_n_samples, sizeof(__pyx_k_weighted_n_samples), 0, 0, 1, 1}, + {&__pyx_n_s_weighted_n_node_samples, __pyx_k_weighted_n_node_samples, sizeof(__pyx_k_weighted_n_node_samples), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __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 = 174; __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 = 2345; __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 = 174; __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 = 179; __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 = 2369; __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:; @@ -25046,29 +25156,29 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "sklearn/tree/_tree.pyx":2345 + /* "sklearn/tree/_tree.pyx":2369 * * 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 = 2345; __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 = 2369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "sklearn/tree/_tree.pyx":2359 + /* "sklearn/tree/_tree.pyx":2383 * 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 = 2359; __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 = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -25079,7 +25189,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -25090,7 +25200,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -25101,7 +25211,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -25112,7 +25222,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -25123,7 +25233,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -25242,7 +25352,7 @@ PyMODINIT_FUNC PyInit__tree(void) /*--- 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 *, __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.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; @@ -25260,10 +25370,10 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_vtable_7sklearn_4tree_5_tree_Splitter.node_split = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Splitter *, double, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, double *, double *, double *, double *, __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 = 898; __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 = 906; __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 = 898; __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 = 898; __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 = 906; __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 = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Splitter = &__pyx_type_7sklearn_4tree_5_tree_Splitter; __pyx_vtabptr_7sklearn_4tree_5_tree_Tree = &__pyx_vtable_7sklearn_4tree_5_tree_Tree; __pyx_vtable_7sklearn_4tree_5_tree_Tree._add_node = (__pyx_t_7sklearn_4tree_5_tree_SIZE_t (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, int, int, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double, double, __pyx_t_7sklearn_4tree_5_tree_SIZE_t, double))__pyx_f_7sklearn_4tree_5_tree_4Tree__add_node; @@ -25274,131 +25384,131 @@ 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 = 2199; __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 = 2223; __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 = 2199; __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 = 2199; __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 = 2223; __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 = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Tree = &__pyx_type_7sklearn_4tree_5_tree_Tree; __pyx_vtabptr_7sklearn_4tree_5_tree_TreeBuilder = &__pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtable_7sklearn_4tree_5_tree_TreeBuilder.build = (PyObject *(*)(struct __pyx_obj_7sklearn_4tree_5_tree_TreeBuilder *, struct __pyx_obj_7sklearn_4tree_5_tree_Tree *, 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 = 1823; __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 = 1839; __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 = 1823; __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 = 1823; __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 = 1839; __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 = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_TreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_TreeBuilder; __pyx_vtabptr_7sklearn_4tree_5_tree_ClassificationCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; - __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 *, __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; + __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; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base.reset = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_reset; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base.update = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update; __pyx_vtable_7sklearn_4tree_5_tree_ClassificationCriterion.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_node_impurity; __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 = 136; __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 = 141; __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 = 136; __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 = 136; __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 = 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;} __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 = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __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 = 354; __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 = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_Entropy.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_Entropy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __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 = 360; __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 = 445; __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 = 451; __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 = 445; __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 = 445; __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 = 451; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_Gini = &__pyx_type_7sklearn_4tree_5_tree_Gini; __pyx_vtabptr_7sklearn_4tree_5_tree_RegressionCriterion = &__pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base = *__pyx_vtabptr_7sklearn_4tree_5_tree_Criterion; - __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 *, __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; + __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; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base.reset = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_reset; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base.update = (void (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t))__pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_update; __pyx_vtable_7sklearn_4tree_5_tree_RegressionCriterion.__pyx_base.node_impurity = (double (*)(struct __pyx_obj_7sklearn_4tree_5_tree_Criterion *))__pyx_f_7sklearn_4tree_5_tree_19RegressionCriterion_node_impurity; __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 = 539; __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 = 545; __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 = 539; __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 = 539; __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 = 545; __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 = 545; __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 = 820; __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 = 828; __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 = 820; __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 = 820; __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 = 828; __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 = 828; __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 = 861; __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 = 869; __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 = 861; __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 = 861; __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 = 869; __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 = 869; __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, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, double *, double *, double *, double *, __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 = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __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 = 1020; __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 = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_BestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_BestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __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 = 1036; __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, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, double *, double *, double *, double *, __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 = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __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 = 1336; __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 = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_RandomSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_RandomSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __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 = 1352; __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, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, __pyx_t_7sklearn_4tree_5_tree_SIZE_t *, double *, double *, double *, double *, __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 = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __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 = 1555; __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 = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_PresortBestSplitter.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_PresortBestSplitter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __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 = 1571; __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 = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __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 = 1834; __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 = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_5_tree_DepthFirstTreeBuilder.tp_dict, __pyx_vtabptr_7sklearn_4tree_5_tree_DepthFirstTreeBuilder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __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 = 1850; __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 = 1991; __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 = 2008; __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 = 1991; __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 = 1991; __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 = 2008; __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 = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_5_tree_BestFirstTreeBuilder = &__pyx_type_7sklearn_4tree_5_tree_BestFirstTreeBuilder; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -25417,8 +25527,8 @@ PyMODINIT_FUNC PyInit__tree(void) __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_Stack = __Pyx_ImportType("sklearn.tree._utils", "Stack", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_Stack), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_vtabptr_7sklearn_4tree_6_utils_Stack = (struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_6_utils_Stack->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_6_utils_Stack)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = __Pyx_ImportType("sklearn.tree._utils", "PriorityHeap", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap = (struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = __Pyx_ImportType("sklearn.tree._utils", "PriorityHeap", sizeof(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap), 1); if (unlikely(!__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap = (struct __pyx_vtabstruct_7sklearn_4tree_6_utils_PriorityHeap*)__Pyx_GetVtable(__pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap->tp_dict); if (unlikely(!__pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ /*--- Execution code ---*/ @@ -25614,7 +25724,7 @@ PyMODINIT_FUNC PyInit__tree(void) * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', - * 'n_samples', 'weighted_n_samples'], + * '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_GOTREF(__pyx_t_2); @@ -25623,7 +25733,7 @@ PyMODINIT_FUNC PyInit__tree(void) * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', # <<<<<<<<<<<<<< - * 'n_samples', 'weighted_n_samples'], + * '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;} @@ -25643,18 +25753,18 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_INCREF(__pyx_n_s_impurity); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_impurity); __Pyx_GIVEREF(__pyx_n_s_impurity); - __Pyx_INCREF(__pyx_n_s_n_samples); - PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_n_samples); - __Pyx_GIVEREF(__pyx_n_s_n_samples); - __Pyx_INCREF(__pyx_n_s_weighted_n_samples); - PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_weighted_n_samples); - __Pyx_GIVEREF(__pyx_n_s_weighted_n_samples); + __Pyx_INCREF(__pyx_n_s_n_node_samples); + PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_n_node_samples); + __Pyx_GIVEREF(__pyx_n_s_n_node_samples); + __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;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/tree/_tree.pyx":70 * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', - * 'n_samples', 'weighted_n_samples'], + * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, # <<<<<<<<<<<<<< * np.float64], * 'offsets': [ @@ -25691,7 +25801,7 @@ PyMODINIT_FUNC PyInit__tree(void) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/tree/_tree.pyx":71 - * 'n_samples', 'weighted_n_samples'], + * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, * np.float64], # <<<<<<<<<<<<<< * 'offsets': [ @@ -25705,7 +25815,7 @@ PyMODINIT_FUNC PyInit__tree(void) /* "sklearn/tree/_tree.pyx":70 * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', - * 'n_samples', 'weighted_n_samples'], + * 'n_node_samples', 'weighted_n_node_samples'], * 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, # <<<<<<<<<<<<<< * np.float64], * 'offsets': [ @@ -25771,7 +25881,7 @@ PyMODINIT_FUNC PyInit__tree(void) * &( NULL).feature, * &( NULL).threshold, # <<<<<<<<<<<<<< * &( NULL).impurity, - * &( NULL).n_samples, + * &( 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_GOTREF(__pyx_t_9); @@ -25780,8 +25890,8 @@ PyMODINIT_FUNC PyInit__tree(void) * &( NULL).feature, * &( NULL).threshold, * &( NULL).impurity, # <<<<<<<<<<<<<< - * &( NULL).n_samples, - * &( NULL).weighted_n_samples + * &( 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_GOTREF(__pyx_t_8); @@ -25789,21 +25899,21 @@ PyMODINIT_FUNC PyInit__tree(void) /* "sklearn/tree/_tree.pyx":78 * &( NULL).threshold, * &( NULL).impurity, - * &( NULL).n_samples, # <<<<<<<<<<<<<< - * &( NULL).weighted_n_samples + * &( 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_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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); /* "sklearn/tree/_tree.pyx":79 * &( NULL).impurity, - * &( NULL).n_samples, - * &( NULL).weighted_n_samples # <<<<<<<<<<<<<< + * &( 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_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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); /* "sklearn/tree/_tree.pyx":72 @@ -25844,7 +25954,7 @@ PyMODINIT_FUNC PyInit__tree(void) * # Repeat struct definition for numpy * NODE_DTYPE = np.dtype({ # <<<<<<<<<<<<<< * 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', - * 'n_samples', 'weighted_n_samples'], + * '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_GOTREF(__pyx_t_5); @@ -25857,7 +25967,7 @@ PyMODINIT_FUNC PyInit__tree(void) 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;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "sklearn/tree/_tree.pyx":2377 + /* "sklearn/tree/_tree.pyx":2401 * # 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: # <<<<<<<<<<<<<< @@ -25876,7 +25986,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; - /* "/Users/ajoly/.virtualenvs/sklearn/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< diff --git a/sklearn/tree/_tree.pxd b/sklearn/tree/_tree.pxd index 0faad4f59d566..6da1a68eceba7 100644 --- a/sklearn/tree/_tree.pxd +++ b/sklearn/tree/_tree.pxd @@ -39,7 +39,8 @@ cdef class Criterion: cdef SIZE_t n_outputs # Number of outputs cdef SIZE_t n_node_samples # Number of samples in the node (end-start) - cdef double weighted_n_node_samples # Weighted number of samples + cdef double weighted_n_samples # Weighted number of samples (in total) + cdef double weighted_n_node_samples # Weighted number of samples in the node cdef double weighted_n_left # Weighted number of samples in the left node cdef double weighted_n_right # Weighted number of samples in the right node @@ -48,7 +49,8 @@ cdef class Criterion: # Methods cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, - SIZE_t* samples, SIZE_t start, SIZE_t end) nogil + double weighted_n_samples, SIZE_t* samples, SIZE_t start, + SIZE_t end) nogil cdef void reset(self) nogil cdef void update(self, SIZE_t new_pos) nogil cdef double node_impurity(self) nogil @@ -78,6 +80,7 @@ cdef class Splitter: cdef SIZE_t* samples # Sample indices in X, y cdef SIZE_t n_samples # X.shape[0] + cdef double weighted_n_samples # Weighted number of samples cdef SIZE_t* features # Feature indices in X cdef SIZE_t* constant_features # Constant features indices cdef SIZE_t n_features # X.shape[1] @@ -136,13 +139,13 @@ cdef class Splitter: cdef struct Node: # Base storage structure for the nodes in a Tree object - SIZE_t left_child # id of the left child of the node - SIZE_t right_child # id of the right child of the node - SIZE_t feature # Feature used for splitting the node - DOUBLE_t threshold # Threshold value at the node - DOUBLE_t impurity # Impurity of the node (i.e., the value of the criterion) - SIZE_t n_samples # Number of samples at the node - DOUBLE_t weighted_n_samples # Weighted number of samples at the node + SIZE_t left_child # id of the left child of the node + SIZE_t right_child # id of the right child of the node + SIZE_t feature # Feature used for splitting the node + DOUBLE_t threshold # Threshold value at the node + DOUBLE_t impurity # Impurity of the node (i.e., the value of the criterion) + SIZE_t n_node_samples # Number of samples at the node + DOUBLE_t weighted_n_node_samples # Weighted number of samples at the node cdef class Tree: # The Tree object is a binary tree structure constructed by the diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index b734bac9f5a38..b6a45dce20cc7 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -66,7 +66,7 @@ cdef enum: # Repeat struct definition for numpy NODE_DTYPE = np.dtype({ 'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', - 'n_samples', 'weighted_n_samples'], + 'n_node_samples', 'weighted_n_node_samples'], 'formats': [np.intp, np.intp, np.intp, np.float64, np.float64, np.intp, np.float64], 'offsets': [ @@ -75,8 +75,8 @@ NODE_DTYPE = np.dtype({ &( NULL).feature, &( NULL).threshold, &( NULL).impurity, - &( NULL).n_samples, - &( NULL).weighted_n_samples + &( NULL).n_node_samples, + &( NULL).weighted_n_node_samples ] }) @@ -89,7 +89,8 @@ cdef class Criterion: """Interface for impurity criteria.""" cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, - SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: + double weighted_n_samples, SIZE_t* samples, SIZE_t start, + SIZE_t end) nogil: """Initialize the criterion at node samples[start:end] and children samples[start:start] and samples[start:end].""" pass @@ -119,18 +120,22 @@ cdef class Criterion: pass cdef double impurity_improvement(self, double impurity) nogil: - """Impurity improvement, i.e. - impurity - (left impurity + right impurity).""" + """Weighted impurity improvement, i.e. + + N_t / N * (impurity - N_t_L / N_t * left impurity + - N_t_L / N_t * right impurity), + + where N is the total number of samples, N_t is the number of samples + in the current node, N_t_L is the number of samples in the left + child and N_t_R is the number of samples in the right child.""" cdef double impurity_left cdef double impurity_right self.children_impurity(&impurity_left, &impurity_right) - return (impurity - - (self.weighted_n_right / self.weighted_n_node_samples * - impurity_right) - - (self.weighted_n_left / self.weighted_n_node_samples * - impurity_left)) + return ((self.weighted_n_node_samples / self.weighted_n_samples) * + (impurity - self.weighted_n_right / self.weighted_n_node_samples * impurity_right + - self.weighted_n_left / self.weighted_n_node_samples * impurity_left)) cdef class ClassificationCriterion(Criterion): @@ -211,8 +216,8 @@ cdef class ClassificationCriterion(Criterion): pass cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, - DOUBLE_t* sample_weight, SIZE_t* samples, - SIZE_t start, SIZE_t end) nogil: + DOUBLE_t* sample_weight, double weighted_n_samples, + SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: """Initialize the criterion at node samples[start:end] and children samples[start:start] and samples[start:end].""" # Initialize fields @@ -223,6 +228,7 @@ cdef class ClassificationCriterion(Criterion): self.start = start self.end = end self.n_node_samples = end - start + self.weighted_n_samples = weighted_n_samples cdef double weighted_n_node_samples = 0.0 # Initialize label_count_total and weighted_n_node_samples @@ -477,7 +483,7 @@ cdef class Gini(ClassificationCriterion): gini = 0.0 for c in range(n_classes[k]): - tmp = label_count_total[c] # TODO: use weighted count instead + tmp = label_count_total[c] gini += tmp * tmp gini = 1.0 - gini / (weighted_n_node_samples * @@ -517,7 +523,7 @@ cdef class Gini(ClassificationCriterion): gini_right = 0.0 for c in range(n_classes[k]): - tmp = label_count_left[c] # TODO: use weighted count instead + tmp = label_count_left[c] gini_left += tmp * tmp tmp = label_count_right[c] gini_right += tmp * tmp @@ -637,7 +643,8 @@ cdef class RegressionCriterion(Criterion): pass cdef void init(self, DOUBLE_t* y, SIZE_t y_stride, DOUBLE_t* sample_weight, - SIZE_t* samples, SIZE_t start, SIZE_t end) nogil: + double weighted_n_samples, SIZE_t* samples, SIZE_t start, + SIZE_t end) nogil: """Initialize the criterion at node samples[start:end] and children samples[start:start] and samples[start:end].""" # Initialize fields @@ -648,6 +655,7 @@ cdef class RegressionCriterion(Criterion): self.start = start self.end = end self.n_node_samples = end - start + self.weighted_n_samples = weighted_n_samples cdef double weighted_n_node_samples = 0. # Initialize accumulators @@ -946,6 +954,7 @@ cdef class Splitter: raise MemoryError() cdef SIZE_t i, j + cdef double weighted_n_samples = 0.0 j = 0 for i in range(n_samples): @@ -954,8 +963,14 @@ cdef class Splitter: samples[j] = i j += 1 + if sample_weight != NULL: + weighted_n_samples += sample_weight[i] + else: + weighted_n_samples += 1.0 + self.samples = samples self.n_samples = j + self.weighted_n_samples = weighted_n_samples cdef SIZE_t n_features = X.shape[1] cdef SIZE_t* features = realloc(self.features, @@ -994,6 +1009,7 @@ cdef class Splitter: self.criterion.init(self.y, self.y_stride, self.sample_weight, + self.weighted_n_samples, self.samples, start, end) @@ -1985,7 +2001,8 @@ cdef inline int _add_to_frontier(PriorityHeapRecord* rec, """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, - rec.is_leaf, rec.improvement, rec.impurity) + rec.is_leaf, rec.improvement, rec.impurity, + rec.impurity_left, rec.impurity_right) cdef class BestFirstTreeBuilder(TreeBuilder): @@ -2084,8 +2101,9 @@ cdef class BestFirstTreeBuilder(TreeBuilder): # Compute left split node rc = self._add_split_node(splitter, tree, record.start, record.pos, - record.impurity, IS_NOT_FIRST, - IS_LEFT, node, record.depth + 1, + record.impurity_left, + IS_NOT_FIRST, IS_LEFT, node, + record.depth + 1, &split_node_left) if rc == -1: break @@ -2095,7 +2113,8 @@ cdef class BestFirstTreeBuilder(TreeBuilder): # Compute right split node rc = self._add_split_node(splitter, tree, record.pos, - record.end, record.impurity, + record.end, + record.impurity_right, IS_NOT_FIRST, IS_NOT_LEFT, node, record.depth + 1, &split_node_right) @@ -2183,11 +2202,16 @@ cdef class BestFirstTreeBuilder(TreeBuilder): res.pos = pos res.is_leaf = 0 res.improvement = split_improvement + res.impurity_left = split_impurity_left + res.impurity_right = split_impurity_right + else: # is leaf => 0 improvement res.pos = end res.is_leaf = 1 res.improvement = 0.0 + res.impurity_left = impurity + res.impurity_right = impurity return 0 @@ -2247,7 +2271,7 @@ cdef class Tree: n_node_samples[i] holds the number of training samples reaching node i. weighted_n_node_samples : array of int, shape [node_count] - weighted_n_samples[i] holds the weighted number of training samples + weighted_n_node_samples[i] holds the weighted number of training samples reaching node i. """ # Wrap for outside world. @@ -2281,11 +2305,11 @@ cdef class Tree: property n_node_samples: def __get__(self): - return self._get_node_ndarray()['n_samples'][:self.node_count] + return self._get_node_ndarray()['n_node_samples'][:self.node_count] property weighted_n_node_samples: def __get__(self): - return self._get_node_ndarray()['weighted_n_samples'][:self.node_count] + return self._get_node_ndarray()['weighted_n_node_samples'][:self.node_count] property value: def __get__(self): @@ -2410,7 +2434,7 @@ cdef class Tree: cdef SIZE_t _add_node(self, SIZE_t parent, bint is_left, bint is_leaf, SIZE_t feature, double threshold, double impurity, - SIZE_t n_samples, double weighted_n_samples) nogil: + SIZE_t n_node_samples, double weighted_n_node_samples) nogil: """Add a node to the tree. The new node registers itself as the child of its parent. @@ -2425,8 +2449,8 @@ cdef class Tree: cdef Node* node = &self.nodes[node_id] node.impurity = impurity - node.n_samples = n_samples - node.weighted_n_samples = weighted_n_samples + node.n_node_samples = n_node_samples + node.weighted_n_node_samples = weighted_n_node_samples if parent != _TREE_UNDEFINED: if is_left: @@ -2500,12 +2524,12 @@ cdef class Tree: right = &nodes[node.right_child] importances[node.feature] += ( - node.weighted_n_samples * node.impurity - - left.weighted_n_samples * left.impurity - - right.weighted_n_samples * right.impurity) + node.weighted_n_node_samples * node.impurity - + left.weighted_n_node_samples * left.impurity - + right.weighted_n_node_samples * right.impurity) node += 1 - importances = importances / nodes[0].weighted_n_samples + importances = importances / nodes[0].weighted_n_node_samples cdef double normalizer if normalize: diff --git a/sklearn/tree/_utils.c b/sklearn/tree/_utils.c index a19b490c02b9e..cbd6255c29f02 100644 --- a/sklearn/tree/_utils.c +++ b/sklearn/tree/_utils.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.20 on Thu Mar 20 14:03:08 2014 */ +/* Generated by Cython 0.20.1 on Thu Apr 10 20:15:12 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" +#define CYTHON_ABI "0_20_1" #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -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, 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) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" @@ -161,10 +161,16 @@ #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 @@ -231,7 +237,7 @@ #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif -#if PY_VERSION_HEX < 0x03020000 +#if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong @@ -550,7 +556,7 @@ static const char *__pyx_f[] = { "type.pxd", }; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -559,7 +565,7 @@ static const char *__pyx_f[] = { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -568,7 +574,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -577,7 +583,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -586,7 +592,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -595,7 +601,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -604,7 +610,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -613,7 +619,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -622,7 +628,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -631,7 +637,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -640,7 +646,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -649,7 +655,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748 +/* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -658,7 +664,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -667,7 +673,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -676,7 +682,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -685,7 +691,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -694,7 +700,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -703,7 +709,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -712,7 +718,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -721,7 +727,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -730,7 +736,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -772,7 +778,7 @@ typedef npy_intp __pyx_t_7sklearn_4tree_6_utils_SIZE_t; struct __pyx_obj_7sklearn_4tree_6_utils_Stack; struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -781,7 +787,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -790,7 +796,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -799,7 +805,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -842,6 +848,8 @@ struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord { __pyx_t_7sklearn_4tree_6_utils_SIZE_t depth; int is_leaf; double impurity; + double impurity_left; + double impurity_right; double improvement; }; @@ -861,7 +869,7 @@ struct __pyx_obj_7sklearn_4tree_6_utils_Stack { }; -/* "sklearn/tree/_utils.pxd":56 +/* "sklearn/tree/_utils.pxd":58 * double improvement * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -894,7 +902,7 @@ struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack { static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7sklearn_4tree_6_utils_Stack; -/* "sklearn/tree/_utils.pyx":167 +/* "sklearn/tree/_utils.pyx":169 * * * cdef class PriorityHeap: # <<<<<<<<<<<<<< @@ -904,7 +912,7 @@ static struct __pyx_vtabstruct_7sklearn_4tree_6_utils_Stack *__pyx_vtabptr_7skle 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); + 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; @@ -996,6 +1004,12 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*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 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*/ @@ -1934,7 +1948,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_6_utils_copy_heap(struct __pyx_ * a.depth = b.depth * a.is_leaf = b.is_leaf # <<<<<<<<<<<<<< * a.impurity = b.impurity - * a.improvement = b.improvement + * a.impurity_left = b.impurity_left */ __pyx_t_2 = __pyx_v_b->is_leaf; __pyx_v_a->is_leaf = __pyx_t_2; @@ -1943,8 +1957,8 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_6_utils_copy_heap(struct __pyx_ * a.depth = b.depth * a.is_leaf = b.is_leaf * a.impurity = b.impurity # <<<<<<<<<<<<<< - * a.improvement = b.improvement - * + * a.impurity_left = b.impurity_left + * a.impurity_right = b.impurity_right */ __pyx_t_3 = __pyx_v_b->impurity; __pyx_v_a->impurity = __pyx_t_3; @@ -1952,6 +1966,26 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_6_utils_copy_heap(struct __pyx_ /* "sklearn/tree/_utils.pyx":122 * a.is_leaf = b.is_leaf * a.impurity = b.impurity + * a.impurity_left = b.impurity_left # <<<<<<<<<<<<<< + * a.impurity_right = b.impurity_right + * a.improvement = b.improvement + */ + __pyx_t_3 = __pyx_v_b->impurity_left; + __pyx_v_a->impurity_left = __pyx_t_3; + + /* "sklearn/tree/_utils.pyx":123 + * a.impurity = b.impurity + * a.impurity_left = b.impurity_left + * a.impurity_right = b.impurity_right # <<<<<<<<<<<<<< + * a.improvement = b.improvement + * + */ + __pyx_t_3 = __pyx_v_b->impurity_right; + __pyx_v_a->impurity_right = __pyx_t_3; + + /* "sklearn/tree/_utils.pyx":124 + * a.impurity_left = b.impurity_left + * a.impurity_right = b.impurity_right * a.improvement = b.improvement # <<<<<<<<<<<<<< * * @@ -1970,7 +2004,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_6_utils_copy_heap(struct __pyx_ /* function exit code */ } -/* "sklearn/tree/_utils.pyx":125 +/* "sklearn/tree/_utils.pyx":127 * * * cdef void swap_heap(PriorityHeapRecord* heap, SIZE_t a, SIZE_t b) nogil: # <<<<<<<<<<<<<< @@ -1981,7 +2015,7 @@ static CYTHON_INLINE void __pyx_f_7sklearn_4tree_6_utils_copy_heap(struct __pyx_ static void __pyx_f_7sklearn_4tree_6_utils_swap_heap(struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *__pyx_v_heap, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_a, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_b) { struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord __pyx_v_tmp; - /* "sklearn/tree/_utils.pyx":128 + /* "sklearn/tree/_utils.pyx":130 * """Swap record ``a`` and ``b`` in ``heap``. """ * cdef PriorityHeapRecord tmp * copy_heap(&tmp, heap + a) # <<<<<<<<<<<<<< @@ -1990,7 +2024,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_swap_heap(struct __pyx_t_7sklearn_4tr */ __pyx_f_7sklearn_4tree_6_utils_copy_heap((&__pyx_v_tmp), (__pyx_v_heap + __pyx_v_a)); - /* "sklearn/tree/_utils.pyx":129 + /* "sklearn/tree/_utils.pyx":131 * cdef PriorityHeapRecord tmp * copy_heap(&tmp, heap + a) * copy_heap(heap + a, heap + b) # <<<<<<<<<<<<<< @@ -1999,7 +2033,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_swap_heap(struct __pyx_t_7sklearn_4tr */ __pyx_f_7sklearn_4tree_6_utils_copy_heap((__pyx_v_heap + __pyx_v_a), (__pyx_v_heap + __pyx_v_b)); - /* "sklearn/tree/_utils.pyx":130 + /* "sklearn/tree/_utils.pyx":132 * copy_heap(&tmp, heap + a) * copy_heap(heap + a, heap + b) * copy_heap(heap + b, &tmp) # <<<<<<<<<<<<<< @@ -2008,7 +2042,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_swap_heap(struct __pyx_t_7sklearn_4tr */ __pyx_f_7sklearn_4tree_6_utils_copy_heap((__pyx_v_heap + __pyx_v_b), (&__pyx_v_tmp)); - /* "sklearn/tree/_utils.pyx":125 + /* "sklearn/tree/_utils.pyx":127 * * * cdef void swap_heap(PriorityHeapRecord* heap, SIZE_t a, SIZE_t b) nogil: # <<<<<<<<<<<<<< @@ -2019,7 +2053,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_swap_heap(struct __pyx_t_7sklearn_4tr /* function exit code */ } -/* "sklearn/tree/_utils.pyx":133 +/* "sklearn/tree/_utils.pyx":135 * * * cdef void heapify_up(PriorityHeapRecord* heap, SIZE_t pos) nogil: # <<<<<<<<<<<<<< @@ -2031,7 +2065,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_parent_pos; int __pyx_t_1; - /* "sklearn/tree/_utils.pyx":136 + /* "sklearn/tree/_utils.pyx":138 * """Restore heap invariant parent.improvement > child.improvement from * ``pos`` upwards. """ * if pos == 0: # <<<<<<<<<<<<<< @@ -2041,7 +2075,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t __pyx_t_1 = ((__pyx_v_pos == 0) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_utils.pyx":137 + /* "sklearn/tree/_utils.pyx":139 * ``pos`` upwards. """ * if pos == 0: * return # <<<<<<<<<<<<<< @@ -2051,7 +2085,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t goto __pyx_L0; } - /* "sklearn/tree/_utils.pyx":139 + /* "sklearn/tree/_utils.pyx":141 * return * * cdef SIZE_t parent_pos = (pos - 1) / 2 # <<<<<<<<<<<<<< @@ -2060,7 +2094,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t */ __pyx_v_parent_pos = ((__pyx_v_pos - 1) / 2); - /* "sklearn/tree/_utils.pyx":141 + /* "sklearn/tree/_utils.pyx":143 * cdef SIZE_t parent_pos = (pos - 1) / 2 * * if heap[parent_pos].improvement < heap[pos].improvement: # <<<<<<<<<<<<<< @@ -2070,7 +2104,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t __pyx_t_1 = (((__pyx_v_heap[__pyx_v_parent_pos]).improvement < (__pyx_v_heap[__pyx_v_pos]).improvement) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_utils.pyx":142 + /* "sklearn/tree/_utils.pyx":144 * * if heap[parent_pos].improvement < heap[pos].improvement: * swap_heap(heap, parent_pos, pos) # <<<<<<<<<<<<<< @@ -2079,7 +2113,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t */ __pyx_f_7sklearn_4tree_6_utils_swap_heap(__pyx_v_heap, __pyx_v_parent_pos, __pyx_v_pos); - /* "sklearn/tree/_utils.pyx":143 + /* "sklearn/tree/_utils.pyx":145 * if heap[parent_pos].improvement < heap[pos].improvement: * swap_heap(heap, parent_pos, pos) * heapify_up(heap, parent_pos) # <<<<<<<<<<<<<< @@ -2091,7 +2125,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t } __pyx_L4:; - /* "sklearn/tree/_utils.pyx":133 + /* "sklearn/tree/_utils.pyx":135 * * * cdef void heapify_up(PriorityHeapRecord* heap, SIZE_t pos) nogil: # <<<<<<<<<<<<<< @@ -2103,7 +2137,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_up(struct __pyx_t_7sklearn_4t __pyx_L0:; } -/* "sklearn/tree/_utils.pyx":146 +/* "sklearn/tree/_utils.pyx":148 * * * cdef void heapify_down(PriorityHeapRecord* heap, SIZE_t pos, # <<<<<<<<<<<<<< @@ -2119,7 +2153,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ int __pyx_t_2; int __pyx_t_3; - /* "sklearn/tree/_utils.pyx":150 + /* "sklearn/tree/_utils.pyx":152 * """Restore heap invariant parent.improvement > children.improvement from * ``pos`` downwards. """ * cdef SIZE_t left_pos = 2 * (pos + 1) - 1 # <<<<<<<<<<<<<< @@ -2128,7 +2162,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ */ __pyx_v_left_pos = ((2 * (__pyx_v_pos + 1)) - 1); - /* "sklearn/tree/_utils.pyx":151 + /* "sklearn/tree/_utils.pyx":153 * ``pos`` downwards. """ * cdef SIZE_t left_pos = 2 * (pos + 1) - 1 * cdef SIZE_t right_pos = 2 * (pos + 1) # <<<<<<<<<<<<<< @@ -2137,7 +2171,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ */ __pyx_v_right_pos = (2 * (__pyx_v_pos + 1)); - /* "sklearn/tree/_utils.pyx":152 + /* "sklearn/tree/_utils.pyx":154 * cdef SIZE_t left_pos = 2 * (pos + 1) - 1 * cdef SIZE_t right_pos = 2 * (pos + 1) * cdef SIZE_t largest = pos # <<<<<<<<<<<<<< @@ -2146,7 +2180,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ */ __pyx_v_largest = __pyx_v_pos; - /* "sklearn/tree/_utils.pyx":154 + /* "sklearn/tree/_utils.pyx":156 * cdef SIZE_t largest = pos * * if (left_pos < heap_length and # <<<<<<<<<<<<<< @@ -2156,7 +2190,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ __pyx_t_1 = ((__pyx_v_left_pos < __pyx_v_heap_length) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_utils.pyx":155 + /* "sklearn/tree/_utils.pyx":157 * * if (left_pos < heap_length and * heap[left_pos].improvement > heap[largest].improvement): # <<<<<<<<<<<<<< @@ -2170,7 +2204,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ } if (__pyx_t_3) { - /* "sklearn/tree/_utils.pyx":156 + /* "sklearn/tree/_utils.pyx":158 * if (left_pos < heap_length and * heap[left_pos].improvement > heap[largest].improvement): * largest = left_pos # <<<<<<<<<<<<<< @@ -2182,7 +2216,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ } __pyx_L3:; - /* "sklearn/tree/_utils.pyx":158 + /* "sklearn/tree/_utils.pyx":160 * largest = left_pos * * if (right_pos < heap_length and # <<<<<<<<<<<<<< @@ -2192,7 +2226,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ __pyx_t_3 = ((__pyx_v_right_pos < __pyx_v_heap_length) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_utils.pyx":159 + /* "sklearn/tree/_utils.pyx":161 * * if (right_pos < heap_length and * heap[right_pos].improvement > heap[largest].improvement): # <<<<<<<<<<<<<< @@ -2206,7 +2240,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ } if (__pyx_t_2) { - /* "sklearn/tree/_utils.pyx":160 + /* "sklearn/tree/_utils.pyx":162 * if (right_pos < heap_length and * heap[right_pos].improvement > heap[largest].improvement): * largest = right_pos # <<<<<<<<<<<<<< @@ -2218,7 +2252,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ } __pyx_L4:; - /* "sklearn/tree/_utils.pyx":162 + /* "sklearn/tree/_utils.pyx":164 * largest = right_pos * * if largest != pos: # <<<<<<<<<<<<<< @@ -2228,7 +2262,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ __pyx_t_2 = ((__pyx_v_largest != __pyx_v_pos) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_utils.pyx":163 + /* "sklearn/tree/_utils.pyx":165 * * if largest != pos: * swap_heap(heap, pos, largest) # <<<<<<<<<<<<<< @@ -2237,7 +2271,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ */ __pyx_f_7sklearn_4tree_6_utils_swap_heap(__pyx_v_heap, __pyx_v_pos, __pyx_v_largest); - /* "sklearn/tree/_utils.pyx":164 + /* "sklearn/tree/_utils.pyx":166 * if largest != pos: * swap_heap(heap, pos, largest) * heapify_down(heap, largest, heap_length) # <<<<<<<<<<<<<< @@ -2249,7 +2283,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ } __pyx_L5:; - /* "sklearn/tree/_utils.pyx":146 + /* "sklearn/tree/_utils.pyx":148 * * * cdef void heapify_down(PriorityHeapRecord* heap, SIZE_t pos, # <<<<<<<<<<<<<< @@ -2260,7 +2294,7 @@ static void __pyx_f_7sklearn_4tree_6_utils_heapify_down(struct __pyx_t_7sklearn_ /* function exit code */ } -/* "sklearn/tree/_utils.pyx":187 +/* "sklearn/tree/_utils.pyx":189 * """ * * def __cinit__(self, SIZE_t capacity): # <<<<<<<<<<<<<< @@ -2296,18 +2330,18 @@ static int __pyx_pw_7sklearn_4tree_6_utils_12PriorityHeap_1__cinit__(PyObject *_ 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 = 187; __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 = 189; __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_capacity = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_capacity == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_capacity = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_capacity == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __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 = 187; __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 = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.tree._utils.PriorityHeap.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2329,7 +2363,7 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "sklearn/tree/_utils.pyx":188 + /* "sklearn/tree/_utils.pyx":190 * * def __cinit__(self, SIZE_t capacity): * self.capacity = capacity # <<<<<<<<<<<<<< @@ -2338,7 +2372,7 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx */ __pyx_v_self->capacity = __pyx_v_capacity; - /* "sklearn/tree/_utils.pyx":189 + /* "sklearn/tree/_utils.pyx":191 * def __cinit__(self, SIZE_t capacity): * self.capacity = capacity * self.heap_ptr = 0 # <<<<<<<<<<<<<< @@ -2347,7 +2381,7 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx */ __pyx_v_self->heap_ptr = 0; - /* "sklearn/tree/_utils.pyx":190 + /* "sklearn/tree/_utils.pyx":192 * self.capacity = capacity * self.heap_ptr = 0 * self.heap_ = malloc(capacity * sizeof(PriorityHeapRecord)) # <<<<<<<<<<<<<< @@ -2356,7 +2390,7 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx */ __pyx_v_self->heap_ = ((struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *)malloc((__pyx_v_capacity * (sizeof(struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord))))); - /* "sklearn/tree/_utils.pyx":191 + /* "sklearn/tree/_utils.pyx":193 * self.heap_ptr = 0 * self.heap_ = malloc(capacity * sizeof(PriorityHeapRecord)) * if self.heap_ == NULL: # <<<<<<<<<<<<<< @@ -2366,17 +2400,17 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx __pyx_t_1 = ((__pyx_v_self->heap_ == NULL) != 0); if (__pyx_t_1) { - /* "sklearn/tree/_utils.pyx":192 + /* "sklearn/tree/_utils.pyx":194 * self.heap_ = malloc(capacity * sizeof(PriorityHeapRecord)) * if self.heap_ == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/tree/_utils.pyx":187 + /* "sklearn/tree/_utils.pyx":189 * """ * * def __cinit__(self, SIZE_t capacity): # <<<<<<<<<<<<<< @@ -2395,7 +2429,7 @@ static int __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap___cinit__(struct __pyx return __pyx_r; } -/* "sklearn/tree/_utils.pyx":194 +/* "sklearn/tree/_utils.pyx":196 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2418,7 +2452,7 @@ static void __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap_2__dealloc__(struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "sklearn/tree/_utils.pyx":195 + /* "sklearn/tree/_utils.pyx":197 * * def __dealloc__(self): * free(self.heap_) # <<<<<<<<<<<<<< @@ -2427,7 +2461,7 @@ static void __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap_2__dealloc__(struct _ */ free(__pyx_v_self->heap_); - /* "sklearn/tree/_utils.pyx":194 + /* "sklearn/tree/_utils.pyx":196 * raise MemoryError() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2439,7 +2473,7 @@ static void __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap_2__dealloc__(struct _ __Pyx_RefNannyFinishContext(); } -/* "sklearn/tree/_utils.pyx":197 +/* "sklearn/tree/_utils.pyx":199 * free(self.heap_) * * cdef bint is_empty(self) nogil: # <<<<<<<<<<<<<< @@ -2450,7 +2484,7 @@ static void __pyx_pf_7sklearn_4tree_6_utils_12PriorityHeap_2__dealloc__(struct _ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_is_empty(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self) { int __pyx_r; - /* "sklearn/tree/_utils.pyx":198 + /* "sklearn/tree/_utils.pyx":200 * * cdef bint is_empty(self) nogil: * return self.heap_ptr <= 0 # <<<<<<<<<<<<<< @@ -2460,7 +2494,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_is_empty(struct __pyx_o __pyx_r = (__pyx_v_self->heap_ptr <= 0); goto __pyx_L0; - /* "sklearn/tree/_utils.pyx":197 + /* "sklearn/tree/_utils.pyx":199 * free(self.heap_) * * cdef bint is_empty(self) nogil: # <<<<<<<<<<<<<< @@ -2473,15 +2507,15 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_is_empty(struct __pyx_o return __pyx_r; } -/* "sklearn/tree/_utils.pyx":200 +/* "sklearn/tree/_utils.pyx":202 * return self.heap_ptr <= 0 * * cdef int push(self, SIZE_t node_id, SIZE_t start, SIZE_t end, SIZE_t pos, # <<<<<<<<<<<<<< * SIZE_t depth, bint is_leaf, double improvement, - * double impurity) nogil: + * double impurity, double impurity_left, */ -static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_node_id, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_end, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_pos, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_depth, int __pyx_v_is_leaf, double __pyx_v_improvement, double __pyx_v_impurity) { +static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *__pyx_v_self, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_node_id, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_start, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_end, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_pos, __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_depth, int __pyx_v_is_leaf, double __pyx_v_improvement, double __pyx_v_impurity, double __pyx_v_impurity_left, double __pyx_v_impurity_right) { __pyx_t_7sklearn_4tree_6_utils_SIZE_t __pyx_v_heap_ptr; struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *__pyx_v_heap; int __pyx_r; @@ -2489,7 +2523,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 int __pyx_t_2; struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *__pyx_t_3; - /* "sklearn/tree/_utils.pyx":207 + /* "sklearn/tree/_utils.pyx":210 * Returns 0 if successful; -1 on out of memory error. * """ * cdef SIZE_t heap_ptr = self.heap_ptr # <<<<<<<<<<<<<< @@ -2499,7 +2533,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 __pyx_t_1 = __pyx_v_self->heap_ptr; __pyx_v_heap_ptr = __pyx_t_1; - /* "sklearn/tree/_utils.pyx":208 + /* "sklearn/tree/_utils.pyx":211 * """ * cdef SIZE_t heap_ptr = self.heap_ptr * cdef PriorityHeapRecord* heap = NULL # <<<<<<<<<<<<<< @@ -2508,7 +2542,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ __pyx_v_heap = NULL; - /* "sklearn/tree/_utils.pyx":211 + /* "sklearn/tree/_utils.pyx":214 * * # Resize if capacity not sufficient * if heap_ptr >= self.capacity: # <<<<<<<<<<<<<< @@ -2518,7 +2552,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 __pyx_t_2 = ((__pyx_v_heap_ptr >= __pyx_v_self->capacity) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_utils.pyx":212 + /* "sklearn/tree/_utils.pyx":215 * # Resize if capacity not sufficient * if heap_ptr >= self.capacity: * self.capacity *= 2 # <<<<<<<<<<<<<< @@ -2527,7 +2561,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ __pyx_v_self->capacity = (__pyx_v_self->capacity * 2); - /* "sklearn/tree/_utils.pyx":213 + /* "sklearn/tree/_utils.pyx":216 * if heap_ptr >= self.capacity: * self.capacity *= 2 * heap = realloc(self.heap_, # <<<<<<<<<<<<<< @@ -2536,7 +2570,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ __pyx_v_heap = ((struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *)realloc(__pyx_v_self->heap_, (__pyx_v_self->capacity * (sizeof(struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord))))); - /* "sklearn/tree/_utils.pyx":216 + /* "sklearn/tree/_utils.pyx":219 * self.capacity * * sizeof(PriorityHeapRecord)) * if heap == NULL: # <<<<<<<<<<<<<< @@ -2546,7 +2580,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 __pyx_t_2 = ((__pyx_v_heap == NULL) != 0); if (__pyx_t_2) { - /* "sklearn/tree/_utils.pyx":218 + /* "sklearn/tree/_utils.pyx":221 * if heap == NULL: * # no free; __dealloc__ handles that * return -1 # <<<<<<<<<<<<<< @@ -2557,7 +2591,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 goto __pyx_L0; } - /* "sklearn/tree/_utils.pyx":219 + /* "sklearn/tree/_utils.pyx":222 * # no free; __dealloc__ handles that * return -1 * self.heap_ = heap # <<<<<<<<<<<<<< @@ -2569,7 +2603,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 } __pyx_L3:; - /* "sklearn/tree/_utils.pyx":222 + /* "sklearn/tree/_utils.pyx":225 * * # Put element as last element of heap * heap = self.heap_ # <<<<<<<<<<<<<< @@ -2579,7 +2613,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 __pyx_t_3 = __pyx_v_self->heap_; __pyx_v_heap = __pyx_t_3; - /* "sklearn/tree/_utils.pyx":223 + /* "sklearn/tree/_utils.pyx":226 * # Put element as last element of heap * heap = self.heap_ * heap[heap_ptr].node_id = node_id # <<<<<<<<<<<<<< @@ -2588,7 +2622,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ (__pyx_v_heap[__pyx_v_heap_ptr]).node_id = __pyx_v_node_id; - /* "sklearn/tree/_utils.pyx":224 + /* "sklearn/tree/_utils.pyx":227 * heap = self.heap_ * heap[heap_ptr].node_id = node_id * heap[heap_ptr].start = start # <<<<<<<<<<<<<< @@ -2597,7 +2631,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ (__pyx_v_heap[__pyx_v_heap_ptr]).start = __pyx_v_start; - /* "sklearn/tree/_utils.pyx":225 + /* "sklearn/tree/_utils.pyx":228 * heap[heap_ptr].node_id = node_id * heap[heap_ptr].start = start * heap[heap_ptr].end = end # <<<<<<<<<<<<<< @@ -2606,7 +2640,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ (__pyx_v_heap[__pyx_v_heap_ptr]).end = __pyx_v_end; - /* "sklearn/tree/_utils.pyx":226 + /* "sklearn/tree/_utils.pyx":229 * heap[heap_ptr].start = start * heap[heap_ptr].end = end * heap[heap_ptr].pos = pos # <<<<<<<<<<<<<< @@ -2615,7 +2649,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ (__pyx_v_heap[__pyx_v_heap_ptr]).pos = __pyx_v_pos; - /* "sklearn/tree/_utils.pyx":227 + /* "sklearn/tree/_utils.pyx":230 * heap[heap_ptr].end = end * heap[heap_ptr].pos = pos * heap[heap_ptr].depth = depth # <<<<<<<<<<<<<< @@ -2624,34 +2658,52 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ (__pyx_v_heap[__pyx_v_heap_ptr]).depth = __pyx_v_depth; - /* "sklearn/tree/_utils.pyx":228 + /* "sklearn/tree/_utils.pyx":231 * heap[heap_ptr].pos = pos * heap[heap_ptr].depth = depth * heap[heap_ptr].is_leaf = is_leaf # <<<<<<<<<<<<<< * heap[heap_ptr].impurity = impurity - * heap[heap_ptr].improvement = improvement + * heap[heap_ptr].impurity_left = impurity_left */ (__pyx_v_heap[__pyx_v_heap_ptr]).is_leaf = __pyx_v_is_leaf; - /* "sklearn/tree/_utils.pyx":229 + /* "sklearn/tree/_utils.pyx":232 * heap[heap_ptr].depth = depth * heap[heap_ptr].is_leaf = is_leaf * heap[heap_ptr].impurity = impurity # <<<<<<<<<<<<<< - * heap[heap_ptr].improvement = improvement - * + * heap[heap_ptr].impurity_left = impurity_left + * heap[heap_ptr].impurity_right = impurity_right */ (__pyx_v_heap[__pyx_v_heap_ptr]).impurity = __pyx_v_impurity; - /* "sklearn/tree/_utils.pyx":230 + /* "sklearn/tree/_utils.pyx":233 * heap[heap_ptr].is_leaf = is_leaf * heap[heap_ptr].impurity = impurity + * heap[heap_ptr].impurity_left = impurity_left # <<<<<<<<<<<<<< + * heap[heap_ptr].impurity_right = impurity_right + * heap[heap_ptr].improvement = improvement + */ + (__pyx_v_heap[__pyx_v_heap_ptr]).impurity_left = __pyx_v_impurity_left; + + /* "sklearn/tree/_utils.pyx":234 + * heap[heap_ptr].impurity = impurity + * heap[heap_ptr].impurity_left = impurity_left + * heap[heap_ptr].impurity_right = impurity_right # <<<<<<<<<<<<<< + * heap[heap_ptr].improvement = improvement + * + */ + (__pyx_v_heap[__pyx_v_heap_ptr]).impurity_right = __pyx_v_impurity_right; + + /* "sklearn/tree/_utils.pyx":235 + * heap[heap_ptr].impurity_left = impurity_left + * heap[heap_ptr].impurity_right = impurity_right * heap[heap_ptr].improvement = improvement # <<<<<<<<<<<<<< * * # Heapify up */ (__pyx_v_heap[__pyx_v_heap_ptr]).improvement = __pyx_v_improvement; - /* "sklearn/tree/_utils.pyx":233 + /* "sklearn/tree/_utils.pyx":238 * * # Heapify up * heapify_up(heap, heap_ptr) # <<<<<<<<<<<<<< @@ -2660,7 +2712,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ __pyx_f_7sklearn_4tree_6_utils_heapify_up(__pyx_v_heap, __pyx_v_heap_ptr); - /* "sklearn/tree/_utils.pyx":236 + /* "sklearn/tree/_utils.pyx":241 * * # Increase element count * self.heap_ptr = heap_ptr + 1 # <<<<<<<<<<<<<< @@ -2669,7 +2721,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 */ __pyx_v_self->heap_ptr = (__pyx_v_heap_ptr + 1); - /* "sklearn/tree/_utils.pyx":237 + /* "sklearn/tree/_utils.pyx":242 * # Increase element count * self.heap_ptr = heap_ptr + 1 * return 0 # <<<<<<<<<<<<<< @@ -2679,12 +2731,12 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_utils.pyx":200 + /* "sklearn/tree/_utils.pyx":202 * return self.heap_ptr <= 0 * * cdef int push(self, SIZE_t node_id, SIZE_t start, SIZE_t end, SIZE_t pos, # <<<<<<<<<<<<<< * SIZE_t depth, bint is_leaf, double improvement, - * double impurity) nogil: + * double impurity, double impurity_left, */ /* function exit code */ @@ -2692,7 +2744,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push(struct __pyx_obj_7 return __pyx_r; } -/* "sklearn/tree/_utils.pyx":239 +/* "sklearn/tree/_utils.pyx":244 * return 0 * * cdef int pop(self, PriorityHeapRecord* res) nogil: # <<<<<<<<<<<<<< @@ -2708,7 +2760,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *__pyx_t_2; int __pyx_t_3; - /* "sklearn/tree/_utils.pyx":241 + /* "sklearn/tree/_utils.pyx":246 * cdef int pop(self, PriorityHeapRecord* res) nogil: * """Remove max element from the heap. """ * cdef SIZE_t heap_ptr = self.heap_ptr # <<<<<<<<<<<<<< @@ -2718,7 +2770,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s __pyx_t_1 = __pyx_v_self->heap_ptr; __pyx_v_heap_ptr = __pyx_t_1; - /* "sklearn/tree/_utils.pyx":242 + /* "sklearn/tree/_utils.pyx":247 * """Remove max element from the heap. """ * cdef SIZE_t heap_ptr = self.heap_ptr * cdef PriorityHeapRecord* heap = self.heap_ # <<<<<<<<<<<<<< @@ -2728,7 +2780,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s __pyx_t_2 = __pyx_v_self->heap_; __pyx_v_heap = __pyx_t_2; - /* "sklearn/tree/_utils.pyx":244 + /* "sklearn/tree/_utils.pyx":249 * cdef PriorityHeapRecord* heap = self.heap_ * * if heap_ptr <= 0: # <<<<<<<<<<<<<< @@ -2738,7 +2790,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s __pyx_t_3 = ((__pyx_v_heap_ptr <= 0) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_utils.pyx":245 + /* "sklearn/tree/_utils.pyx":250 * * if heap_ptr <= 0: * return -1 # <<<<<<<<<<<<<< @@ -2749,7 +2801,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s goto __pyx_L0; } - /* "sklearn/tree/_utils.pyx":248 + /* "sklearn/tree/_utils.pyx":253 * * # Take first element * copy_heap(res, heap) # <<<<<<<<<<<<<< @@ -2758,7 +2810,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s */ __pyx_f_7sklearn_4tree_6_utils_copy_heap(__pyx_v_res, __pyx_v_heap); - /* "sklearn/tree/_utils.pyx":251 + /* "sklearn/tree/_utils.pyx":256 * * # Put last element to the front * swap_heap(heap, 0, heap_ptr - 1) # <<<<<<<<<<<<<< @@ -2767,7 +2819,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s */ __pyx_f_7sklearn_4tree_6_utils_swap_heap(__pyx_v_heap, 0, (__pyx_v_heap_ptr - 1)); - /* "sklearn/tree/_utils.pyx":254 + /* "sklearn/tree/_utils.pyx":259 * * # Restore heap invariant * if heap_ptr > 1: # <<<<<<<<<<<<<< @@ -2777,7 +2829,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s __pyx_t_3 = ((__pyx_v_heap_ptr > 1) != 0); if (__pyx_t_3) { - /* "sklearn/tree/_utils.pyx":255 + /* "sklearn/tree/_utils.pyx":260 * # Restore heap invariant * if heap_ptr > 1: * heapify_down(heap, 0, heap_ptr - 1) # <<<<<<<<<<<<<< @@ -2789,7 +2841,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s } __pyx_L4:; - /* "sklearn/tree/_utils.pyx":257 + /* "sklearn/tree/_utils.pyx":262 * heapify_down(heap, 0, heap_ptr - 1) * * self.heap_ptr = heap_ptr - 1 # <<<<<<<<<<<<<< @@ -2798,7 +2850,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s */ __pyx_v_self->heap_ptr = (__pyx_v_heap_ptr - 1); - /* "sklearn/tree/_utils.pyx":259 + /* "sklearn/tree/_utils.pyx":264 * self.heap_ptr = heap_ptr - 1 * * return 0 # <<<<<<<<<<<<<< @@ -2806,7 +2858,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s __pyx_r = 0; goto __pyx_L0; - /* "sklearn/tree/_utils.pyx":239 + /* "sklearn/tree/_utils.pyx":244 * return 0 * * cdef int pop(self, PriorityHeapRecord* res) nogil: # <<<<<<<<<<<<<< @@ -2819,7 +2871,7 @@ static int __pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop(struct __pyx_obj_7s return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -2871,7 +2923,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -2884,7 +2936,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -2893,7 +2945,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -2902,7 +2954,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -2911,7 +2963,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -2921,7 +2973,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -2933,7 +2985,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -2944,7 +2996,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -2954,7 +3006,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -2968,21 +3020,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_3) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -2992,7 +3044,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -3006,21 +3058,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_2) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -3029,7 +3081,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -3038,7 +3090,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -3048,7 +3100,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -3057,7 +3109,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))); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -3066,7 +3118,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -3077,7 +3129,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229 * info.shape = info.strides + ndim * for i in range(ndim): * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< @@ -3086,7 +3138,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]); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "/usr/local/lib/python2.7/dist-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] # <<<<<<<<<<<<<< @@ -3099,7 +3151,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -3108,7 +3160,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)); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -3119,7 +3171,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L7:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -3128,7 +3180,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -3137,7 +3189,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -3146,7 +3198,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -3155,7 +3207,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -3167,7 +3219,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -3176,7 +3228,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -3192,7 +3244,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -3208,7 +3260,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -3223,7 +3275,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L10:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -3233,7 +3285,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -3243,7 +3295,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -3258,7 +3310,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (!__pyx_t_2) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "/usr/local/lib/python2.7/dist-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)): # <<<<<<<<<<<<<< @@ -3278,21 +3330,21 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } if (__pyx_t_1) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3301,7 +3353,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3312,7 +3364,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3323,7 +3375,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3334,7 +3386,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3345,7 +3397,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3356,7 +3408,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3367,7 +3419,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3378,7 +3430,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3389,7 +3441,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3400,7 +3452,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3411,7 +3463,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3422,7 +3474,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3433,7 +3485,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3444,7 +3496,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3455,7 +3507,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3466,7 +3518,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3477,7 +3529,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -3489,7 +3541,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -3506,7 +3558,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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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); @@ -3515,7 +3567,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -3524,7 +3576,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -3536,7 +3588,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -3545,7 +3597,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -3554,7 +3606,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -3563,7 +3615,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "/usr/local/lib/python2.7/dist-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, # <<<<<<<<<<<<<< @@ -3573,7 +3625,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[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_9; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -3583,7 +3635,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -3615,7 +3667,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3639,7 +3691,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -3649,7 +3701,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -3661,7 +3713,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -3671,7 +3723,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -3683,7 +3735,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -3695,7 +3747,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3712,7 +3764,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -3726,7 +3778,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -3745,7 +3797,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3762,7 +3814,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -3776,7 +3828,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -3795,7 +3847,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3812,7 +3864,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -3826,7 +3878,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -3845,7 +3897,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3862,7 +3914,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":778 * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< @@ -3876,7 +3928,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -3895,7 +3947,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -3912,7 +3964,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -3926,7 +3978,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "/usr/local/lib/python2.7/dist-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): # <<<<<<<<<<<<<< @@ -3945,7 +3997,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -3979,7 +4031,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -3988,7 +4040,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -3997,7 +4049,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -4019,7 +4071,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -4032,7 +4084,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -4071,7 +4123,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -4088,21 +4140,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4117,7 +4169,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (!__pyx_t_7) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -4137,21 +4189,21 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } if (__pyx_t_6) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -4167,7 +4219,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -4176,7 +4228,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -4185,7 +4237,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -4196,7 +4248,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); } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -4206,7 +4258,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); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -4216,7 +4268,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -4228,7 +4280,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; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -4238,21 +4290,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-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 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4270,7 +4322,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4288,7 +4340,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4306,7 +4358,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4324,7 +4376,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4342,7 +4394,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4360,7 +4412,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4378,7 +4430,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4396,7 +4448,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4414,7 +4466,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4432,7 +4484,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4450,7 +4502,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4468,7 +4520,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4486,7 +4538,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4506,7 +4558,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4526,7 +4578,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "/usr/local/lib/python2.7/dist-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 # <<<<<<<<<<<<<< @@ -4546,7 +4598,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L11; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "/usr/local/lib/python2.7/dist-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" # <<<<<<<<<<<<<< @@ -4565,7 +4617,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -4579,7 +4631,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 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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); @@ -4588,7 +4640,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L11:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -4600,7 +4652,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "/usr/local/lib/python2.7/dist-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) # <<<<<<<<<<<<<< @@ -4614,7 +4666,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -4624,7 +4676,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "/usr/local/lib/python2.7/dist-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: # <<<<<<<<<<<<<< @@ -4649,7 +4701,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4664,7 +4716,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); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968 * cdef inline void set_array_base(ndarray arr, object base): * cdef PyObject* baseptr * if base is None: # <<<<<<<<<<<<<< @@ -4675,7 +4727,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -4687,7 +4739,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -4696,7 +4748,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -4707,7 +4759,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -4716,7 +4768,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -4725,7 +4777,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4737,7 +4789,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4751,7 +4803,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -4761,7 +4813,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) { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -4775,7 +4827,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -4786,7 +4838,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5051,7 +5103,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -5062,7 +5114,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -5073,7 +5125,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -5084,7 +5136,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -5095,7 +5147,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "/usr/local/lib/python2.7/dist-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") # <<<<<<<<<<<<<< @@ -5106,7 +5158,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -5221,12 +5273,12 @@ PyMODINIT_FUNC PyInit__utils(void) __pyx_ptype_7sklearn_4tree_6_utils_Stack = &__pyx_type_7sklearn_4tree_6_utils_Stack; __pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap = &__pyx_vtable_7sklearn_4tree_6_utils_PriorityHeap; __pyx_vtable_7sklearn_4tree_6_utils_PriorityHeap.is_empty = (int (*)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *))__pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_is_empty; - __pyx_vtable_7sklearn_4tree_6_utils_PriorityHeap.push = (int (*)(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))__pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push; + __pyx_vtable_7sklearn_4tree_6_utils_PriorityHeap.push = (int (*)(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))__pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_push; __pyx_vtable_7sklearn_4tree_6_utils_PriorityHeap.pop = (int (*)(struct __pyx_obj_7sklearn_4tree_6_utils_PriorityHeap *, struct __pyx_t_7sklearn_4tree_6_utils_PriorityHeapRecord *))__pyx_f_7sklearn_4tree_6_utils_12PriorityHeap_pop; - if (PyType_Ready(&__pyx_type_7sklearn_4tree_6_utils_PriorityHeap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_7sklearn_4tree_6_utils_PriorityHeap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_type_7sklearn_4tree_6_utils_PriorityHeap.tp_print = 0; - if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_6_utils_PriorityHeap.tp_dict, __pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "PriorityHeap", (PyObject *)&__pyx_type_7sklearn_4tree_6_utils_PriorityHeap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetVtable(__pyx_type_7sklearn_4tree_6_utils_PriorityHeap.tp_dict, __pyx_vtabptr_7sklearn_4tree_6_utils_PriorityHeap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetAttrString(__pyx_m, "PriorityHeap", (PyObject *)&__pyx_type_7sklearn_4tree_6_utils_PriorityHeap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7sklearn_4tree_6_utils_PriorityHeap = &__pyx_type_7sklearn_4tree_6_utils_PriorityHeap; /*--- Type import code ---*/ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", @@ -5255,7 +5307,7 @@ PyMODINIT_FUNC PyInit__utils(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/Users/ajoly/.virtualenvs/research/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "/usr/local/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -5449,6 +5501,29 @@ static void __Pyx_RaiseArgtupleInvalid( (num_expected == 1) ? "" : "s", num_found); } +#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 CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_COMPILING_IN_CPYTHON PyObject *tmp_type, *tmp_value, *tmp_tb; @@ -6724,11 +6799,13 @@ 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/_utils.pxd b/sklearn/tree/_utils.pxd index 421e4ccaff5fc..eef93aa99643b 100644 --- a/sklearn/tree/_utils.pxd +++ b/sklearn/tree/_utils.pxd @@ -51,6 +51,8 @@ cdef struct PriorityHeapRecord: SIZE_t depth bint is_leaf double impurity + double impurity_left + double impurity_right double improvement cdef class PriorityHeap: @@ -61,5 +63,6 @@ cdef class PriorityHeap: cdef bint is_empty(self) nogil cdef int push(self, SIZE_t node_id, SIZE_t start, SIZE_t end, SIZE_t pos, SIZE_t depth, bint is_leaf, double improvement, - double impurity) nogil + double impurity, double impurity_left, + double impurity_right) nogil cdef int pop(self, PriorityHeapRecord* res) nogil diff --git a/sklearn/tree/_utils.pyx b/sklearn/tree/_utils.pyx index 6f4bf5b2b6798..80b249222278f 100644 --- a/sklearn/tree/_utils.pyx +++ b/sklearn/tree/_utils.pyx @@ -119,6 +119,8 @@ cdef inline void copy_heap(PriorityHeapRecord* a, PriorityHeapRecord* b) nogil: a.depth = b.depth a.is_leaf = b.is_leaf a.impurity = b.impurity + a.impurity_left = b.impurity_left + a.impurity_right = b.impurity_right a.improvement = b.improvement @@ -199,7 +201,8 @@ cdef class PriorityHeap: cdef int push(self, SIZE_t node_id, SIZE_t start, SIZE_t end, SIZE_t pos, SIZE_t depth, bint is_leaf, double improvement, - double impurity) nogil: + double impurity, double impurity_left, + double impurity_right) nogil: """Push record on the priority heap. Returns 0 if successful; -1 on out of memory error. @@ -227,6 +230,8 @@ cdef class PriorityHeap: heap[heap_ptr].depth = depth heap[heap_ptr].is_leaf = is_leaf heap[heap_ptr].impurity = impurity + heap[heap_ptr].impurity_left = impurity_left + heap[heap_ptr].impurity_right = impurity_right heap[heap_ptr].improvement = improvement # Heapify up diff --git a/sklearn/tree/tests/test_tree.py b/sklearn/tree/tests/test_tree.py index d14ee3dfa0c85..50c3de77c6405 100644 --- a/sklearn/tree/tests/test_tree.py +++ b/sklearn/tree/tests/test_tree.py @@ -276,6 +276,16 @@ def test_importances(): assert_less(0, X_new.shape[1], "Failed with {0}".format(name)) assert_less(X_new.shape[1], X.shape[1], "Failed with {0}".format(name)) + # Check on iris that importances are the same for all builders + clf = DecisionTreeClassifier(random_state=0) + clf.fit(iris.data, iris.target) + clf2 = DecisionTreeClassifier(random_state=0, + max_leaf_nodes=len(iris.data)) + clf2.fit(iris.data, iris.target) + + assert_array_equal(clf.feature_importances_, + clf2.feature_importances_) + @raises(ValueError) def test_importances_raises(): @@ -295,8 +305,13 @@ def test_importances_gini_equal_mse(): shuffle=False, random_state=0) - clf = DecisionTreeClassifier(criterion="gini", random_state=0).fit(X, y) - reg = DecisionTreeRegressor(criterion="mse", random_state=0).fit(X, y) + # The gini index and the mean square error (variance) might differ due + # to numerical instability. Since those instabilities mainly occurs at + # high tree depth, we restrict this maximal depth. + clf = DecisionTreeClassifier(criterion="gini", max_depth=8, + random_state=0).fit(X, y) + reg = DecisionTreeRegressor(criterion="mse", max_depth=8, + random_state=0).fit(X, y) assert_almost_equal(clf.feature_importances_, reg.feature_importances_) assert_array_equal(clf.tree_.feature, reg.tree_.feature) @@ -609,7 +624,7 @@ def test_sample_weight(): clf.fit(X, y, sample_weight=sample_weight) assert_equal(clf.tree_.threshold[0], 149.5) - sample_weight[y == 2] = .50 # Samples of class '2' are no longer weightier + sample_weight[y == 2] = .5 # Samples of class '2' are no longer weightier clf = DecisionTreeClassifier(max_depth=1, random_state=0) clf.fit(X, y, sample_weight=sample_weight) assert_equal(clf.tree_.threshold[0], 49.5) # Threshold should have moved diff --git a/sklearn/utils/extmath.py b/sklearn/utils/extmath.py index 5694a8669d310..711ea81ab28ab 100644 --- a/sklearn/utils/extmath.py +++ b/sklearn/utils/extmath.py @@ -8,7 +8,9 @@ # Lars Buitinck # License: BSD 3 clause +from functools import partial import warnings + import numpy as np from scipy import linalg from scipy.sparse import issparse @@ -25,13 +27,30 @@ def norm(x): """Compute the Euclidean or Frobenius norm of x. Returns the Euclidean norm when x is a vector, the Frobenius norm when x - is a matrix (2-d array). + is a matrix (2-d array). More precise than sqrt(squared_norm(x)). """ x = np.asarray(x) nrm2, = linalg.get_blas_funcs(['nrm2'], [x]) return nrm2(x) +# Newer NumPy has a ravel that needs less copying. +if np_version < (1, 7, 1): + _ravel = np.ravel +else: + _ravel = partial(np.ravel, order='K') + + +def squared_norm(x): + """Squared Euclidean or Frobenius norm of x. + + Returns the Euclidean norm when x is a vector, the Frobenius norm when x + is a matrix (2-d array). Faster than norm(x) ** 2. + """ + x = _ravel(x) + return np.dot(x, x) + + def row_norms(X, squared=False): """Row-wise (squared) Euclidean norm of X. diff --git a/sklearn/utils/testing.py b/sklearn/utils/testing.py index 604ded4fd94e8..7fbb46cd6f783 100644 --- a/sklearn/utils/testing.py +++ b/sklearn/utils/testing.py @@ -442,7 +442,8 @@ def uninstall_mldata_mock(): "OutputCodeClassifier", "OneVsRestClassifier", "RFE", "RFECV", "BaseEnsemble"] # estimators that there is no way to default-construct sensibly -other = ["Pipeline", "FeatureUnion", "GridSearchCV", "RandomizedSearchCV"] +other = ["Pipeline", "FeatureUnion", + "GridSearchCV", "RandomizedSearchCV", "SelectFromModel"] def all_estimators(include_meta_estimators=False, include_other=False, diff --git a/sklearn/utils/tests/test_extmath.py b/sklearn/utils/tests/test_extmath.py index 124c4fb24e394..8368ce3f3090d 100644 --- a/sklearn/utils/tests/test_extmath.py +++ b/sklearn/utils/tests/test_extmath.py @@ -20,6 +20,7 @@ from sklearn.utils.extmath import density from sklearn.utils.extmath import logsumexp +from sklearn.utils.extmath import norm, squared_norm from sklearn.utils.extmath import randomized_svd from sklearn.utils.extmath import row_norms from sklearn.utils.extmath import weighted_mode @@ -125,6 +126,16 @@ def test_randomized_svd_low_rank(): assert_almost_equal(s[:rank], sa[:rank]) +def test_norm_squared_norm(): + X = np.random.RandomState(42).randn(50, 63) + X *= 100 # check stability + X += 200 + + assert_almost_equal(np.linalg.norm(X.ravel()), norm(X)) + assert_almost_equal(norm(X) ** 2, squared_norm(X), decimal=6) + assert_almost_equal(np.linalg.norm(X), np.sqrt(squared_norm(X)), decimal=6) + + def test_row_norms(): X = np.random.RandomState(42).randn(100, 100) sq_norm = (X ** 2).sum(axis=1) diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py index 2ef0a534a3e17..a43dfe7751f2d 100644 --- a/sklearn/utils/tests/test_validation.py +++ b/sklearn/utils/tests/test_validation.py @@ -36,6 +36,11 @@ def test_safe_asarray(): Y = safe_asarray(X, dtype=np.int) assert_equal(Y.dtype, np.int) + # Non-regression: LIL and DOK used to fail for lack of a .data attribute + X = np.ones([2, 3]) + safe_asarray(sp.dok_matrix(X)) + safe_asarray(sp.lil_matrix(X), dtype=X.dtype) + def test_as_float_array(): """Test function for as_float_array""" @@ -70,6 +75,25 @@ def test_as_float_array(): assert_false(np.isnan(M).any()) +def test_atleast2d_or_sparse(): + for typ in [sp.csr_matrix, sp.dok_matrix, sp.lil_matrix, sp.coo_matrix]: + X = typ(np.arange(9, dtype=float).reshape(3, 3)) + + Y = atleast2d_or_csr(X, copy=True) + assert_true(isinstance(Y, sp.csr_matrix)) + Y.data[:] = 1 + assert_array_equal(X.toarray().ravel(), np.arange(9)) + + Y = atleast2d_or_csc(X, copy=False) + Y.data[:] = 4 + assert_true(np.all(X.data == 4) + if isinstance(X, sp.csc_matrix) + else np.all(X.toarray().ravel() == np.arange(9))) + + Y = atleast2d_or_csr(X, dtype=np.float32) + assert_true(Y.dtype == np.float32) + + def test_check_arrays_exceptions(): """Check that invalid arguments raise appropriate exceptions""" assert_raises(ValueError, check_arrays, [0], [0, 1]) diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py index 48c0ddd7543d6..a0c8a3287b93c 100644 --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -11,7 +11,7 @@ import numbers import numpy as np -from scipy import sparse +import scipy.sparse as sp from ..externals import six from .fixes import safe_copy @@ -50,15 +50,23 @@ def assert_all_finite(X): # First try an O(n) time, O(1) space solution for the common case that # there everything is finite; fall back to O(n) space np.isfinite to # prevent false positives from overflow in sum method. - _assert_all_finite(X.data if sparse.issparse(X) else X) + _assert_all_finite(X.data if sp.issparse(X) else X) def safe_asarray(X, dtype=None, order=None, copy=False, force_all_finite=True): """Convert X to an array or CSC/CSR/COO sparse matrix. - Prevents copying X when possible; sparse matrices are passed through.""" - if sparse.issparse(X): - if copy: + Prevents copying X when possible. Sparse matrices in CSR, CSC and COO + formats are passed through. Other sparse formats are converted to CSR + (somewhat arbitrarily). + + If a specific compressed sparse format is required, use atleast2d_or_cs{c,r} + instead. + """ + if sp.issparse(X): + if not isinstance(X, (sp.coo_matrix, sp.csc_matrix, sp.csr_matrix)): + X = X.tocsr() + elif copy: X = X.copy() if force_all_finite: _assert_all_finite(X.data) @@ -92,10 +100,10 @@ def as_float_array(X, copy=True, force_all_finite=True): An array of type np.float """ if isinstance(X, np.matrix) or (not isinstance(X, np.ndarray) - and not sparse.issparse(X)): + and not sp.issparse(X)): return safe_asarray(X, dtype=np.float64, copy=copy, force_all_finite=force_all_finite) - elif sparse.issparse(X) and X.dtype in [np.float32, np.float64]: + elif sp.issparse(X) and X.dtype in [np.float32, np.float64]: return X.copy() if copy else X elif X.dtype in [np.float32, np.float64]: # is numpy array return X.copy('F' if X.flags['F_CONTIGUOUS'] else 'C') if copy else X @@ -105,7 +113,7 @@ def as_float_array(X, copy=True, force_all_finite=True): def array2d(X, dtype=None, order=None, copy=False, force_all_finite=True): """Returns at least 2-d array with data from X""" - if sparse.issparse(X): + if sp.issparse(X): raise TypeError('A sparse matrix was passed, but dense data ' 'is required. Use X.toarray() to convert to dense.') X_2d = np.asarray(np.atleast_2d(X), dtype=dtype, order=order) @@ -117,9 +125,11 @@ def array2d(X, dtype=None, order=None, copy=False, force_all_finite=True): def _atleast2d_or_sparse(X, dtype, order, copy, sparse_class, convmethod, - force_all_finite): - if sparse.issparse(X): - if dtype is None or X.dtype == dtype: + check_same_type, force_all_finite): + if sp.issparse(X): + if check_same_type(X) and X.dtype == dtype: + X = getattr(X, convmethod)(copy=copy) + elif dtype is None or X.dtype == dtype: X = getattr(X, convmethod)() else: X = sparse_class(X, dtype=dtype) @@ -138,8 +148,9 @@ def atleast2d_or_csc(X, dtype=None, order=None, copy=False, Also, converts np.matrix to np.ndarray. """ - return _atleast2d_or_sparse(X, dtype, order, copy, sparse.csc_matrix, - "tocsc", force_all_finite) + return _atleast2d_or_sparse(X, dtype, order, copy, sp.csc_matrix, + "tocsc", sp.isspmatrix_csc, + force_all_finite) def atleast2d_or_csr(X, dtype=None, order=None, copy=False, @@ -148,8 +159,9 @@ def atleast2d_or_csr(X, dtype=None, order=None, copy=False, Also, converts np.matrix to np.ndarray. """ - return _atleast2d_or_sparse(X, dtype, order, copy, sparse.csr_matrix, - "tocsr", force_all_finite) + return _atleast2d_or_sparse(X, dtype, order, copy, sp.csr_matrix, + "tocsr", sp.isspmatrix_csr, + force_all_finite) def _num_samples(x): @@ -199,6 +211,9 @@ def check_arrays(*arrays, **options): allow_lists : bool Allow lists of arbitrary objects as input, just check their length. Disables + + allow_nans : boolean, False by default + Allows nans in the arrays """ sparse_format = options.pop('sparse_format', None) if sparse_format not in (None, 'csr', 'csc', 'dense'): @@ -207,6 +222,8 @@ def check_arrays(*arrays, **options): check_ccontiguous = options.pop('check_ccontiguous', False) dtype = options.pop('dtype', None) allow_lists = options.pop('allow_lists', False) + allow_nans = options.pop('allow_nans', False) + if options: raise TypeError("Unexpected keyword arguments: %r" % options.keys()) @@ -229,7 +246,7 @@ def check_arrays(*arrays, **options): % (size, n_samples)) if not allow_lists or hasattr(array, "shape"): - if sparse.issparse(array): + if sp.issparse(array): if sparse_format == 'csr': array = array.tocsr() elif sparse_format == 'csc': @@ -242,13 +259,15 @@ def check_arrays(*arrays, **options): array.data = np.ascontiguousarray(array.data, dtype=dtype) else: array.data = np.asarray(array.data, dtype=dtype) - _assert_all_finite(array.data) + if not allow_nans: + _assert_all_finite(array.data) else: if check_ccontiguous: array = np.ascontiguousarray(array, dtype=dtype) else: array = np.asarray(array, dtype=dtype) - _assert_all_finite(array) + if not allow_nans: + _assert_all_finite(array) if array.ndim >= 3: raise ValueError("Found array with dim %d. Expected <= 2" %