From e3afc0e8c9de522324a2f0cf0f7a17fee5147195 Mon Sep 17 00:00:00 2001 From: Raghav R V Date: Sat, 6 Jun 2015 00:15:45 +0530 Subject: [PATCH 1/5] MAINT move custom error/warning classes into sklearn.exceptions ENH NonBLASDotWarning -> EfficiencyWarning; Improve error message DOC Add exceptions module to modules/classes.rst MAINT Move ConvergenceWarning, UndefinedMetricWarning et al into exceptions MAINT Remove ChangedBehaviorWarning from base DOC/FIX Improve DataConversionWarning's docstring --- doc/developers/performance.rst | 2 +- doc/developers/utilities.rst | 4 +- doc/modules/classes.rst | 25 + examples/linear_model/plot_sparse_recovery.py | 2 +- sklearn/__init__.py | 2 +- sklearn/base.py | 7 +- sklearn/cluster/birch.py | 3 +- sklearn/cluster/tests/test_k_means.py | 2 +- sklearn/covariance/graph_lasso_.py | 2 +- .../tests/test_robust_covariance.py | 4 +- sklearn/cross_validation.py | 5 +- sklearn/decomposition/factor_analysis.py | 2 +- sklearn/decomposition/kernel_pca.py | 3 +- sklearn/decomposition/nmf.py | 2 +- sklearn/decomposition/online_lda.py | 3 +- .../tests/test_factor_analysis.py | 2 +- .../decomposition/tests/test_online_lda.py | 2 +- sklearn/ensemble/forest.py | 2 +- sklearn/ensemble/gradient_boosting.py | 2 +- .../ensemble/tests/test_gradient_boosting.py | 5 +- sklearn/exceptions.py | 117 +++ sklearn/feature_selection/from_model.py | 6 +- sklearn/grid_search.py | 3 +- sklearn/linear_model/base.py | 3 +- sklearn/linear_model/coordinate_descent.py | 2 +- sklearn/linear_model/least_angle.py | 2 +- sklearn/linear_model/logistic.py | 7 +- sklearn/linear_model/randomized_l1.py | 3 +- sklearn/linear_model/sag.py | 2 +- .../linear_model/tests/test_least_angle.py | 2 +- sklearn/linear_model/tests/test_logistic.py | 2 +- sklearn/linear_model/tests/test_theil_sen.py | 2 +- sklearn/linear_model/theil_sen.py | 3 +- sklearn/metrics/base.py | 4 - sklearn/metrics/classification.py | 3 +- sklearn/metrics/ranking.py | 2 +- sklearn/metrics/tests/test_classification.py | 2 +- sklearn/metrics/tests/test_ranking.py | 2 +- sklearn/neighbors/base.py | 17 +- sklearn/preprocessing/tests/test_data.py | 2 +- sklearn/random_projection.py | 5 +- sklearn/svm/base.py | 10 +- sklearn/svm/libsvm_sparse.c | 830 +++++++++--------- sklearn/svm/libsvm_sparse.pyx | 2 +- sklearn/svm/tests/test_sparse.py | 2 +- sklearn/svm/tests/test_svm.py | 6 +- sklearn/tests/test_grid_search.py | 9 +- sklearn/tests/test_random_projection.py | 2 +- sklearn/tree/tests/test_tree.py | 7 +- sklearn/tree/tree.py | 3 +- sklearn/utils/__init__.py | 23 +- sklearn/utils/estimator_checks.py | 4 +- sklearn/utils/extmath.py | 13 +- sklearn/utils/validation.py | 39 +- 54 files changed, 686 insertions(+), 536 deletions(-) create mode 100644 sklearn/exceptions.py diff --git a/doc/developers/performance.rst b/doc/developers/performance.rst index 75cfa914e616f..64149a0268538 100644 --- a/doc/developers/performance.rst +++ b/doc/developers/performance.rst @@ -105,7 +105,7 @@ silently dispatched to ``numpy.dot``. If you want to be sure when the original activate the related warning:: >>> import warnings - >>> from sklearn.utils.validation import NonBLASDotWarning + >>> from sklearn.exceptions import NonBLASDotWarning >>> warnings.simplefilter('always', NonBLASDotWarning) # doctest: +SKIP .. _profiling-python-code: diff --git a/doc/developers/utilities.rst b/doc/developers/utilities.rst index bc61f0856b456..88096a1b77519 100644 --- a/doc/developers/utilities.rst +++ b/doc/developers/utilities.rst @@ -293,5 +293,5 @@ Warnings and Exceptions - :class:`deprecated`: Decorator to mark a function or class as deprecated. -- :class:`ConvergenceWarning`: Custom warning to catch convergence problems. - Used in ``sklearn.covariance.graph_lasso``. +- :class:`sklearn.exceptions.ConvergenceWarning`: Custom warning to catch + convergence problems. Used in ``sklearn.covariance.graph_lasso``. diff --git a/doc/modules/classes.rst b/doc/modules/classes.rst index 78a727f0e255b..17842e70a3d68 100644 --- a/doc/modules/classes.rst +++ b/doc/modules/classes.rst @@ -378,6 +378,31 @@ partial dependence ensemble.partial_dependence.plot_partial_dependence +.. _exceptions_ref: + +:mod:`sklearn.exceptions`: Exceptions and warnings +================================================== + +.. automodule:: sklearn.exceptions + :no-members: + :no-inherited-members: + +.. currentmodule:: sklearn + +.. autosummary:: + :toctree: generated/ + :template: class_without_init.rst + + exceptions.NotFittedError + exceptions.ChangedBehaviorWarning + exceptions.ConvergenceWarning + exceptions.DataConversionWarning + exceptions.DataDimensionalityWarning + exceptions.EfficiencyWarning + exceptions.FitFailedWarning + exceptions.NonBLASDotWarning + exceptions.UndefinedMetricWarning + .. _feature_extraction_ref: :mod:`sklearn.feature_extraction`: Feature Extraction diff --git a/examples/linear_model/plot_sparse_recovery.py b/examples/linear_model/plot_sparse_recovery.py index 00bb5cd7ef8ff..4d2aa6a504f93 100644 --- a/examples/linear_model/plot_sparse_recovery.py +++ b/examples/linear_model/plot_sparse_recovery.py @@ -56,7 +56,7 @@ from sklearn.metrics import auc, precision_recall_curve from sklearn.ensemble import ExtraTreesRegressor from sklearn.utils.extmath import pinvh -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning def mutual_incoherence(X_relevant, X_irelevant): diff --git a/sklearn/__init__.py b/sklearn/__init__.py index 8828b12fadd79..421d503cf7f41 100644 --- a/sklearn/__init__.py +++ b/sklearn/__init__.py @@ -59,7 +59,7 @@ __all__ = ['calibration', 'cluster', 'covariance', 'cross_decomposition', 'cross_validation', 'datasets', 'decomposition', 'dummy', - 'ensemble', 'externals', 'feature_extraction', + 'ensemble', 'exceptions', 'externals', 'feature_extraction', 'feature_selection', 'gaussian_process', 'grid_search', 'isotonic', 'kernel_approximation', 'kernel_ridge', 'lda', 'learning_curve', diff --git a/sklearn/base.py b/sklearn/base.py index 8de001f06b9ba..e9320fd1180e2 100644 --- a/sklearn/base.py +++ b/sklearn/base.py @@ -9,10 +9,13 @@ from scipy import sparse from .externals import six from .utils.fixes import signature +from .exceptions import ChangedBehaviorWarning -class ChangedBehaviorWarning(UserWarning): - pass +ChangedBehaviorWarning = deprecated("ChangedBehaviorWarning has been moved " + "into the sklearn.exceptions module. " + "It will not be available here from " + "version 0.19")(ChangedBehaviorWarning) ############################################################################## diff --git a/sklearn/cluster/birch.py b/sklearn/cluster/birch.py index 6a4d2b14245eb..98e2d7a69eb39 100644 --- a/sklearn/cluster/birch.py +++ b/sklearn/cluster/birch.py @@ -14,7 +14,8 @@ from ..externals.six.moves import xrange from ..utils import check_array from ..utils.extmath import row_norms, safe_sparse_dot -from ..utils.validation import NotFittedError, check_is_fitted +from ..utils.validation import check_is_fitted +from ..exceptions import NotFittedError from .hierarchical import AgglomerativeClustering diff --git a/sklearn/cluster/tests/test_k_means.py b/sklearn/cluster/tests/test_k_means.py index 8b20ac7af5dfd..077cf6e28c23b 100644 --- a/sklearn/cluster/tests/test_k_means.py +++ b/sklearn/cluster/tests/test_k_means.py @@ -20,7 +20,6 @@ from sklearn.utils.testing import assert_raise_message -from sklearn.utils.validation import DataConversionWarning from sklearn.utils.extmath import row_norms from sklearn.metrics.cluster import v_measure_score from sklearn.cluster import KMeans, k_means @@ -29,6 +28,7 @@ from sklearn.cluster.k_means_ import _mini_batch_step from sklearn.datasets.samples_generator import make_blobs from sklearn.externals.six.moves import cStringIO as StringIO +from sklearn.exceptions import DataConversionWarning # non centered, sparse centers to check the diff --git a/sklearn/covariance/graph_lasso_.py b/sklearn/covariance/graph_lasso_.py index 1bde81b036814..dd08ed4206120 100644 --- a/sklearn/covariance/graph_lasso_.py +++ b/sklearn/covariance/graph_lasso_.py @@ -16,7 +16,7 @@ from .empirical_covariance_ import (empirical_covariance, EmpiricalCovariance, log_likelihood) -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning from ..utils.extmath import pinvh from ..utils.validation import check_random_state, check_array from ..linear_model import lars_path diff --git a/sklearn/covariance/tests/test_robust_covariance.py b/sklearn/covariance/tests/test_robust_covariance.py index c0b94102e8885..be5b65cd768b5 100644 --- a/sklearn/covariance/tests/test_robust_covariance.py +++ b/sklearn/covariance/tests/test_robust_covariance.py @@ -8,9 +8,9 @@ from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal -from sklearn.utils.testing import assert_raises, assert_warns +from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raise_message -from sklearn.utils.validation import NotFittedError +from sklearn.exceptions import NotFittedError from sklearn import datasets from sklearn.covariance import empirical_covariance, MinCovDet, \ diff --git a/sklearn/cross_validation.py b/sklearn/cross_validation.py index cbd05950a63b1..fa69f95459307 100644 --- a/sklearn/cross_validation.py +++ b/sklearn/cross_validation.py @@ -32,6 +32,7 @@ from .metrics.scorer import check_scoring from .utils.fixes import bincount from .gaussian_process.kernels import Kernel as GPKernel +from .exceptions import FitFailedWarning __all__ = ['KFold', 'LabelKFold', @@ -1428,10 +1429,6 @@ def cross_val_score(estimator, X, y=None, scoring=None, cv=None, n_jobs=1, return np.array(scores)[:, 0] -class FitFailedWarning(RuntimeWarning): - pass - - def _fit_and_score(estimator, X, y, scorer, train, test, verbose, parameters, fit_params, return_train_score=False, return_parameters=False, error_score='raise'): diff --git a/sklearn/decomposition/factor_analysis.py b/sklearn/decomposition/factor_analysis.py index 582996e10fa7c..c247538951a50 100644 --- a/sklearn/decomposition/factor_analysis.py +++ b/sklearn/decomposition/factor_analysis.py @@ -30,7 +30,7 @@ from ..utils import check_array, check_random_state from ..utils.extmath import fast_logdet, fast_dot, randomized_svd, squared_norm from ..utils.validation import check_is_fitted -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning class FactorAnalysis(BaseEstimator, TransformerMixin): diff --git a/sklearn/decomposition/kernel_pca.py b/sklearn/decomposition/kernel_pca.py index eddc3ab0c5625..4131bf2fc642e 100644 --- a/sklearn/decomposition/kernel_pca.py +++ b/sklearn/decomposition/kernel_pca.py @@ -7,7 +7,8 @@ from scipy import linalg from ..utils.arpack import eigsh -from ..utils.validation import check_is_fitted, NotFittedError +from ..utils.validation import check_is_fitted +from ..exceptions import NotFittedError from ..base import BaseEstimator, TransformerMixin from ..preprocessing import KernelCenterer from ..metrics.pairwise import pairwise_kernels diff --git a/sklearn/decomposition/nmf.py b/sklearn/decomposition/nmf.py index 0c27b1f7c4e4e..55bdd96fb221c 100644 --- a/sklearn/decomposition/nmf.py +++ b/sklearn/decomposition/nmf.py @@ -26,7 +26,7 @@ from ..utils.extmath import fast_dot from ..utils.validation import check_is_fitted, check_non_negative from ..utils import deprecated -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning from .cdnmf_fast import _update_cdnmf_fast diff --git a/sklearn/decomposition/online_lda.py b/sklearn/decomposition/online_lda.py index d3b8bbf6d8848..1967bb448999f 100644 --- a/sklearn/decomposition/online_lda.py +++ b/sklearn/decomposition/online_lda.py @@ -18,10 +18,11 @@ from ..base import BaseEstimator, TransformerMixin from ..utils import (check_random_state, check_array, gen_batches, gen_even_slices, _get_n_jobs) -from ..utils.validation import NotFittedError, check_non_negative +from ..utils.validation import check_non_negative from ..utils.extmath import logsumexp from ..externals.joblib import Parallel, delayed from ..externals.six.moves import xrange +from ..exceptions import NotFittedError from ._online_lda import (mean_change, _dirichlet_expectation_1d, _dirichlet_expectation_2d) diff --git a/sklearn/decomposition/tests/test_factor_analysis.py b/sklearn/decomposition/tests/test_factor_analysis.py index 129e3c2609ef9..e4767685c0363 100644 --- a/sklearn/decomposition/tests/test_factor_analysis.py +++ b/sklearn/decomposition/tests/test_factor_analysis.py @@ -11,7 +11,7 @@ from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_array_almost_equal -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning from sklearn.decomposition import FactorAnalysis diff --git a/sklearn/decomposition/tests/test_online_lda.py b/sklearn/decomposition/tests/test_online_lda.py index 28e1b8c36db68..5ec2fc8d6a0ce 100644 --- a/sklearn/decomposition/tests/test_online_lda.py +++ b/sklearn/decomposition/tests/test_online_lda.py @@ -15,7 +15,7 @@ from sklearn.utils.testing import assert_raises_regexp from sklearn.utils.testing import if_safe_multiprocessing_with_blas -from sklearn.utils.validation import NotFittedError +from sklearn.exceptions import NotFittedError from sklearn.externals.six.moves import xrange diff --git a/sklearn/ensemble/forest.py b/sklearn/ensemble/forest.py index e1d469bfecf5b..eb21fa933e1b3 100644 --- a/sklearn/ensemble/forest.py +++ b/sklearn/ensemble/forest.py @@ -59,7 +59,7 @@ class calls the ``fit`` method of each sub-estimator on random samples ExtraTreeClassifier, ExtraTreeRegressor) from ..tree._tree import DTYPE, DOUBLE from ..utils import check_random_state, check_array, compute_sample_weight -from ..utils.validation import DataConversionWarning, NotFittedError +from ..exceptions import DataConversionWarning, NotFittedError from .base import BaseEnsemble, _partition_estimators from ..utils.fixes import bincount from ..utils.multiclass import check_classification_targets diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py index 8f9a3f1c98b61..4a826944c0edb 100644 --- a/sklearn/ensemble/gradient_boosting.py +++ b/sklearn/ensemble/gradient_boosting.py @@ -61,8 +61,8 @@ from ..utils.fixes import bincount from ..utils.stats import _weighted_percentile from ..utils.validation import check_is_fitted -from ..utils.validation import NotFittedError from ..utils.multiclass import check_classification_targets +from ..exceptions import NotFittedError class QuantileEstimator(BaseEstimator): diff --git a/sklearn/ensemble/tests/test_gradient_boosting.py b/sklearn/ensemble/tests/test_gradient_boosting.py index 4f2329be50358..46265dda1e4aa 100644 --- a/sklearn/ensemble/tests/test_gradient_boosting.py +++ b/sklearn/ensemble/tests/test_gradient_boosting.py @@ -26,9 +26,8 @@ from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_warns -from sklearn.utils.testing import ignore_warnings -from sklearn.utils.validation import DataConversionWarning -from sklearn.utils.validation import NotFittedError +from sklearn.exceptions import DataConversionWarning +from sklearn.exceptions import NotFittedError # toy sample X = [[-2, -1], [-1, -1], [-1, -2], [1, 1], [1, 2], [2, 1]] diff --git a/sklearn/exceptions.py b/sklearn/exceptions.py new file mode 100644 index 0000000000000..0bd15aba1a0b0 --- /dev/null +++ b/sklearn/exceptions.py @@ -0,0 +1,117 @@ +""" +The :mod:`sklearn.exceptions` module includes all custom warnings and error +classes used across scikit-learn. +""" + +__all__ = ['NotFittedError', + 'ChangedBehaviorWarning', + 'ConvergenceWarning', + 'DataConversionWarning', + 'DataDimensionalityWarning', + 'EfficiencyWarning', + 'FitFailedWarning', + 'NonBLASDotWarning', + 'UndefinedMetricWarning'] + + +class NotFittedError(ValueError, AttributeError): + """Exception class to raise if estimator is used before fitting. + + This class inherits from both ValueError and AttributeError to help with + exception handling and backward compatibility. + + Examples + -------- + >>> from sklearn.svm import LinearSVC + >>> from sklearn.exceptions import NotFittedError + >>> try: + ... LinearSVC().predict([[1, 2], [2, 3], [3, 4]]) + ... except NotFittedError as e: + ... print(repr(e)) + ... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS + NotFittedError('This LinearSVC instance is not fitted yet',) + """ + + +class ChangedBehaviorWarning(UserWarning): + """Warning class used to notify the user of any change in the behavior.""" + + +class ConvergenceWarning(UserWarning): + """Custom warning to capture convergence problems""" + + +class DataConversionWarning(UserWarning): + """Warning used to notify implicit data conversions happening in the code. + + This warning occurs when some input data needs to be converted or + interpreted in a way that may not match the user's expectations. + + For example, this warning may occur when the the user + - passes an integer array to a function which expects float input and + will convert the input + - requests a non-copying operation, but a copy is required to meet the + implementation's data-type expectations; + - passes an input whose shape can be interpreted ambiguously. + """ + + +class DataDimensionalityWarning(UserWarning): + """Custom warning to notify potential issues with data dimensionality. + + For example, in random projection, this warning is raised when the + number of components, which quantifes the dimensionality of the target + projection space, is higher than the number of features, which quantifies + the dimensionality of the original source space, to imply that the + dimensionality of the problem will not be reduced. + """ + + +class EfficiencyWarning(UserWarning): + """Warning used to notify the user of inefficient computation. + + This warning notifies the user that the efficiency may not be optimal due + to some reason which may be included as a part of the warning message. + This may be subclassed into a more specific Warning class. + """ + + +class FitFailedWarning(RuntimeWarning): + """Warning class used if there is an error while fitting the estimator. + + This Warning is used in meta estimators GridSearchCV and RandomizedSearchCV + and the cross-validation helper function cross_val_score to warn when there + is an error while fitting the estimator. + + Examples + -------- + >>> from sklearn.grid_search import GridSearchCV + >>> from sklearn.svm import LinearSVC + >>> from sklearn.exceptions import FitFailedWarning + >>> import warnings + >>> warnings.simplefilter('always', FitFailedWarning) + >>> gs = GridSearchCV(LinearSVC(), {'C': [-1, -2]}, error_score=0) + >>> X, y = [[1, 2], [3, 4], [5, 6], [7, 8], [8, 9]], [0, 0, 0, 1, 1] + >>> with warnings.catch_warnings(record=True) as w: + ... try: + ... gs.fit(X, y) # This will raise a ValueError since C is < 0 + ... except ValueError: + ... pass + ... print(repr(w[-1].message)) + ... # doctest: +NORMALIZE_WHITESPACE + FitFailedWarning("Classifier fit failed. The score on this train-test + partition for these parameters will be set to 0.000000. Details: + \\nValueError('Penalty term must be positive; got (C=-2)',)",) + """ + + +class NonBLASDotWarning(EfficiencyWarning): + """Warning used when the dot operation does not use BLAS. + + This warning is used to notify the user that BLAS was not used for dot + operation and hence the efficiency may be affected. + """ + + +class UndefinedMetricWarning(UserWarning): + pass diff --git a/sklearn/feature_selection/from_model.py b/sklearn/feature_selection/from_model.py index 81e35a8000adf..a0eea0079d563 100644 --- a/sklearn/feature_selection/from_model.py +++ b/sklearn/feature_selection/from_model.py @@ -4,12 +4,12 @@ import numpy as np from .base import SelectorMixin -from ..base import (TransformerMixin, BaseEstimator, clone, - MetaEstimatorMixin) +from ..base import TransformerMixin, BaseEstimator, clone from ..externals import six from ..utils import safe_mask, check_array, deprecated -from ..utils.validation import NotFittedError, check_is_fitted +from ..utils.validation import check_is_fitted +from ..exceptions import NotFittedError def _get_feature_importances(estimator): diff --git a/sklearn/grid_search.py b/sklearn/grid_search.py index 1f63e5f65a677..d6fe1e0f5dcaf 100644 --- a/sklearn/grid_search.py +++ b/sklearn/grid_search.py @@ -20,7 +20,7 @@ import numpy as np from .base import BaseEstimator, is_classifier, clone -from .base import MetaEstimatorMixin, ChangedBehaviorWarning +from .base import MetaEstimatorMixin from .cross_validation import check_cv from .cross_validation import _fit_and_score from .externals.joblib import Parallel, delayed @@ -30,6 +30,7 @@ from .utils.validation import _num_samples, indexable from .utils.metaestimators import if_delegate_has_method from .metrics.scorer import check_scoring +from .exceptions import ChangedBehaviorWarning __all__ = ['GridSearchCV', 'ParameterGrid', 'fit_grid_point', diff --git a/sklearn/linear_model/base.py b/sklearn/linear_model/base.py index af107433ac408..6c7d0bb96eac9 100644 --- a/sklearn/linear_model/base.py +++ b/sklearn/linear_model/base.py @@ -30,8 +30,9 @@ from ..utils.extmath import safe_sparse_dot from ..utils.sparsefuncs import mean_variance_axis, inplace_column_scale from ..utils.fixes import sparse_lsqr -from ..utils.validation import NotFittedError, check_is_fitted from ..utils.seq_dataset import ArrayDataset, CSRDataset +from ..utils.validation import check_is_fitted +from ..exceptions import NotFittedError # diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py index 0640e454bfb58..2ebbd38c88286 100644 --- a/sklearn/linear_model/coordinate_descent.py +++ b/sklearn/linear_model/coordinate_descent.py @@ -24,7 +24,7 @@ from ..utils.extmath import safe_sparse_dot from ..utils.validation import check_is_fitted from ..utils.validation import column_or_1d -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning from . import cd_fast diff --git a/sklearn/linear_model/least_angle.py b/sklearn/linear_model/least_angle.py index b27d60fefef45..8fa0a021bcc32 100644 --- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -23,7 +23,7 @@ from ..base import RegressorMixin from ..utils import arrayfuncs, as_float_array, check_X_y from ..cross_validation import check_cv -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning from ..externals.joblib import Parallel, delayed from ..externals.six.moves import xrange from ..externals.six import string_types diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py index 0e44d91ac9027..2d52cca8107ab 100644 --- a/sklearn/linear_model/logistic.py +++ b/sklearn/linear_model/logistic.py @@ -26,8 +26,9 @@ from ..utils.extmath import (logsumexp, log_logistic, safe_sparse_dot, softmax, squared_norm) from ..utils.optimize import newton_cg -from ..utils.validation import (DataConversionWarning, - check_X_y, NotFittedError) +from ..utils.validation import check_X_y +from ..exceptions import DataConversionWarning +from ..exceptions import NotFittedError from ..utils.fixes import expit from ..utils.multiclass import check_classification_targets from ..externals.joblib import Parallel, delayed @@ -1125,7 +1126,7 @@ def fit(self, X, y, sample_weight=None): raise ValueError("Tolerance for stopping criteria must be " "positive; got (tol=%r)" % self.tol) - X, y = check_X_y(X, y, accept_sparse='csr', dtype=np.float64, + X, y = check_X_y(X, y, accept_sparse='csr', dtype=np.float64, order="C") check_classification_targets(y) self.classes_ = np.unique(y) diff --git a/sklearn/linear_model/randomized_l1.py b/sklearn/linear_model/randomized_l1.py index 1ba6ec822c8f9..bef06f59911bc 100644 --- a/sklearn/linear_model/randomized_l1.py +++ b/sklearn/linear_model/randomized_l1.py @@ -20,10 +20,11 @@ from ..externals import six from ..externals.joblib import Memory, Parallel, delayed from ..utils import (as_float_array, check_random_state, check_X_y, - check_array, safe_mask, ConvergenceWarning) + check_array, safe_mask) from ..utils.validation import check_is_fitted from .least_angle import lars_path, LassoLarsIC from .logistic import LogisticRegression +from ..exceptions import ConvergenceWarning ############################################################################### diff --git a/sklearn/linear_model/sag.py b/sklearn/linear_model/sag.py index 48104e9a610b7..9d8d5a6cc47cd 100644 --- a/sklearn/linear_model/sag.py +++ b/sklearn/linear_model/sag.py @@ -7,7 +7,7 @@ import numpy as np import warnings -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning from ..utils import check_array from .base import make_dataset from .sgd_fast import Log, SquaredLoss diff --git a/sklearn/linear_model/tests/test_least_angle.py b/sklearn/linear_model/tests/test_least_angle.py index eaa99d11e7844..9692edaaa2b2d 100644 --- a/sklearn/linear_model/tests/test_least_angle.py +++ b/sklearn/linear_model/tests/test_least_angle.py @@ -12,7 +12,7 @@ from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert_no_warnings, assert_warns from sklearn.utils.testing import TempMemmap -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning from sklearn import linear_model, datasets from sklearn.linear_model.least_angle import _lars_path_residues diff --git a/sklearn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py index f70849dd57d19..ddaab4981dc17 100644 --- a/sklearn/linear_model/tests/test_logistic.py +++ b/sklearn/linear_model/tests/test_logistic.py @@ -14,7 +14,7 @@ from sklearn.utils.testing import raises from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert_raise_message -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model.logistic import ( LogisticRegression, diff --git a/sklearn/linear_model/tests/test_theil_sen.py b/sklearn/linear_model/tests/test_theil_sen.py index 521fe272f2d05..5f0076cc87f21 100644 --- a/sklearn/linear_model/tests/test_theil_sen.py +++ b/sklearn/linear_model/tests/test_theil_sen.py @@ -16,7 +16,7 @@ from scipy.linalg import norm from scipy.optimize import fmin_bfgs from nose.tools import raises, assert_almost_equal -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning from sklearn.linear_model import LinearRegression, TheilSenRegressor from sklearn.linear_model.theil_sen import _spatial_median, _breakdown_point from sklearn.linear_model.theil_sen import _modified_weiszfeld_step diff --git a/sklearn/linear_model/theil_sen.py b/sklearn/linear_model/theil_sen.py index 2ca8766b0c7df..b4204a381974e 100644 --- a/sklearn/linear_model/theil_sen.py +++ b/sklearn/linear_model/theil_sen.py @@ -19,11 +19,12 @@ from .base import LinearModel from ..base import RegressorMixin -from ..utils import check_random_state, ConvergenceWarning +from ..utils import check_random_state from ..utils import check_X_y, _get_n_jobs from ..utils.random import choice from ..externals.joblib import Parallel, delayed from ..externals.six.moves import xrange as range +from ..exceptions import ConvergenceWarning _EPSILON = np.finfo(np.double).eps diff --git a/sklearn/metrics/base.py b/sklearn/metrics/base.py index 5e9593880fbb5..d286815fc0078 100644 --- a/sklearn/metrics/base.py +++ b/sklearn/metrics/base.py @@ -20,10 +20,6 @@ from ..utils.multiclass import type_of_target -class UndefinedMetricWarning(UserWarning): - pass - - def _average_binary_score(binary_metric, y_true, y_score, average, sample_weight=None): """Average a binary metric for multilabel classification diff --git a/sklearn/metrics/classification.py b/sklearn/metrics/classification.py index 4fbbeb478ca4e..8db21f1f26ad1 100644 --- a/sklearn/metrics/classification.py +++ b/sklearn/metrics/classification.py @@ -38,8 +38,7 @@ from ..utils.validation import _num_samples from ..utils.sparsefuncs import count_nonzero from ..utils.fixes import bincount - -from .base import UndefinedMetricWarning +from ..exceptions import UndefinedMetricWarning def _check_targets(y_true, y_pred): diff --git a/sklearn/metrics/ranking.py b/sklearn/metrics/ranking.py index dc191d4308463..b55c13e39f046 100644 --- a/sklearn/metrics/ranking.py +++ b/sklearn/metrics/ranking.py @@ -31,9 +31,9 @@ from ..utils.fixes import array_equal from ..utils.stats import rankdata from ..utils.sparsefuncs import count_nonzero +from ..exceptions import UndefinedMetricWarning from .base import _average_binary_score -from .base import UndefinedMetricWarning def auc(x, y, reorder=False): diff --git a/sklearn/metrics/tests/test_classification.py b/sklearn/metrics/tests/test_classification.py index 5e4cc6a357e1e..842ff7fe37e86 100644 --- a/sklearn/metrics/tests/test_classification.py +++ b/sklearn/metrics/tests/test_classification.py @@ -46,7 +46,7 @@ from sklearn.metrics.classification import _check_targets -from sklearn.metrics.base import UndefinedMetricWarning +from sklearn.exceptions import UndefinedMetricWarning ############################################################################### diff --git a/sklearn/metrics/tests/test_ranking.py b/sklearn/metrics/tests/test_ranking.py index b43114c7f902e..0fe4b11f03e8e 100644 --- a/sklearn/metrics/tests/test_ranking.py +++ b/sklearn/metrics/tests/test_ranking.py @@ -31,7 +31,7 @@ from sklearn.metrics import roc_auc_score from sklearn.metrics import roc_curve -from sklearn.metrics.base import UndefinedMetricWarning +from sklearn.exceptions import UndefinedMetricWarning ############################################################################### diff --git a/sklearn/neighbors/base.py b/sklearn/neighbors/base.py index 7b9329a035cd3..b328d6019b270 100644 --- a/sklearn/neighbors/base.py +++ b/sklearn/neighbors/base.py @@ -19,12 +19,11 @@ from ..metrics.pairwise import PAIRWISE_DISTANCE_FUNCTIONS from ..utils import check_X_y, check_array, _get_n_jobs, gen_even_slices from ..utils.fixes import argpartition -from ..utils.validation import DataConversionWarning -from ..utils.validation import NotFittedError from ..utils.multiclass import check_classification_targets from ..externals import six from ..externals.joblib import Parallel, delayed - +from ..exceptions import NotFittedError +from ..exceptions import DataConversionWarning VALID_METRICS = dict(ball_tree=BallTree.valid_metrics, kd_tree=KDTree.valid_metrics, @@ -45,14 +44,6 @@ brute=PAIRWISE_DISTANCE_FUNCTIONS.keys()) -class NeighborsWarning(UserWarning): - pass - - -# Make sure that NeighborsWarning are displayed more than once -warnings.simplefilter("always", NeighborsWarning) - - def _check_weights(weights): """Check to make sure weights are valid""" if weights in (None, 'uniform', 'distance'): @@ -362,7 +353,7 @@ class from an array representing our data set and ask who's ) n_samples, _ = X.shape sample_range = np.arange(n_samples)[:, None] - + n_jobs = _get_n_jobs(self.n_jobs) if self._fit_method == 'brute': # for efficiency, use squared euclidean distances @@ -402,7 +393,7 @@ class from an array representing our data set and ask who's dist, neigh_ind = tuple(zip(*result)) result = np.vstack(dist), np.vstack(neigh_ind) else: - result = np.vstack(result) + result = np.vstack(result) else: raise ValueError("internal: _fit_method not recognized") diff --git a/sklearn/preprocessing/tests/test_data.py b/sklearn/preprocessing/tests/test_data.py index b44e66d2657b4..62b40770d107c 100644 --- a/sklearn/preprocessing/tests/test_data.py +++ b/sklearn/preprocessing/tests/test_data.py @@ -48,7 +48,7 @@ from sklearn.preprocessing.data import robust_scale from sklearn.preprocessing.data import add_dummy_feature from sklearn.preprocessing.data import PolynomialFeatures -from sklearn.utils.validation import DataConversionWarning +from sklearn.exceptions import DataConversionWarning from sklearn import datasets diff --git a/sklearn/random_projection.py b/sklearn/random_projection.py index 0dccfd97d74ce..1a1414e3fc823 100644 --- a/sklearn/random_projection.py +++ b/sklearn/random_projection.py @@ -41,8 +41,9 @@ from .utils import check_random_state from .utils.extmath import safe_sparse_dot from .utils.random import sample_without_replacement -from .utils.validation import check_array, NotFittedError -from .utils import DataDimensionalityWarning +from .utils.validation import check_array +from .exceptions import DataDimensionalityWarning +from .exceptions import NotFittedError __all__ = ["SparseRandomProjection", diff --git a/sklearn/svm/base.py b/sklearn/svm/base.py index f6b3257e1344b..edab959ae4ea5 100644 --- a/sklearn/svm/base.py +++ b/sklearn/svm/base.py @@ -7,15 +7,19 @@ from . import libsvm, liblinear from . import libsvm_sparse -from ..base import BaseEstimator, ClassifierMixin, ChangedBehaviorWarning +from ..base import BaseEstimator, ClassifierMixin from ..preprocessing import LabelEncoder from ..multiclass import _ovr_decision_function from ..utils import check_array, check_random_state, column_or_1d -from ..utils import ConvergenceWarning, compute_class_weight, deprecated +from ..utils import compute_class_weight, deprecated from ..utils.extmath import safe_sparse_dot -from ..utils.validation import check_is_fitted, NotFittedError +from ..utils.validation import check_is_fitted from ..utils.multiclass import check_classification_targets from ..externals import six +from ..exceptions import ChangedBehaviorWarning +from ..exceptions import ConvergenceWarning +from ..exceptions import NotFittedError + LIBSVM_IMPL = ['c_svc', 'nu_svc', 'one_class', 'epsilon_svr', 'nu_svr'] diff --git a/sklearn/svm/libsvm_sparse.c b/sklearn/svm/libsvm_sparse.c index e1b9e5af53c65..3f75394245102 100644 --- a/sklearn/svm/libsvm_sparse.c +++ b/sklearn/svm/libsvm_sparse.c @@ -1,4 +1,4 @@ -/* Generated by Cython 0.21.1 */ +/* Generated by Cython 0.21.2 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS @@ -19,7 +19,7 @@ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) #error Cython requires Python 2.6+ or Python 3.2+. #else -#define CYTHON_ABI "0_21_1" +#define CYTHON_ABI "0_21_2" #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -483,7 +483,7 @@ typedef struct { } __Pyx_BufFmt_Context; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":723 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< @@ -492,7 +492,7 @@ typedef struct { */ typedef npy_int8 __pyx_t_5numpy_int8_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":724 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< @@ -501,7 +501,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t; */ typedef npy_int16 __pyx_t_5numpy_int16_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":725 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< @@ -510,7 +510,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t; */ typedef npy_int32 __pyx_t_5numpy_int32_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":726 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< @@ -519,7 +519,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t; */ typedef npy_int64 __pyx_t_5numpy_int64_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":730 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< @@ -528,7 +528,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t; */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":731 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< @@ -537,7 +537,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t; */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":732 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< @@ -546,7 +546,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t; */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":733 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< @@ -555,7 +555,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t; */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":737 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< @@ -564,7 +564,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t; */ typedef npy_float32 __pyx_t_5numpy_float32_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":738 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< @@ -573,7 +573,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t; */ typedef npy_float64 __pyx_t_5numpy_float64_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747 +/* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -582,7 +582,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t; */ typedef npy_long __pyx_t_5numpy_int_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748 +/* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -591,7 +591,7 @@ typedef npy_long __pyx_t_5numpy_int_t; */ typedef npy_longlong __pyx_t_5numpy_long_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":749 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< @@ -600,7 +600,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t; */ typedef npy_longlong __pyx_t_5numpy_longlong_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":751 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< @@ -609,7 +609,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t; */ typedef npy_ulong __pyx_t_5numpy_uint_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":752 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< @@ -618,7 +618,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":753 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< @@ -627,7 +627,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":755 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< @@ -636,7 +636,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; */ typedef npy_intp __pyx_t_5numpy_intp_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":756 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< @@ -645,7 +645,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t; */ typedef npy_uintp __pyx_t_5numpy_uintp_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":758 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< @@ -654,7 +654,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t; */ typedef npy_double __pyx_t_5numpy_float_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":759 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< @@ -663,7 +663,7 @@ typedef npy_double __pyx_t_5numpy_float_t; */ typedef npy_double __pyx_t_5numpy_double_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":760 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< @@ -694,7 +694,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /*--- Type declarations ---*/ -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":762 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< @@ -703,7 +703,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":763 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< @@ -712,7 +712,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":764 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< @@ -721,7 +721,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":766 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< @@ -1115,7 +1115,6 @@ static char __pyx_k_probA[] = "probA"; static char __pyx_k_probB[] = "probB"; static char __pyx_k_range[] = "range"; static char __pyx_k_scipy[] = "scipy"; -static char __pyx_k_utils[] = "utils"; static char __pyx_k_SV_len[] = "SV_len"; static char __pyx_k_T_data[] = "T_data"; static char __pyx_k_arange[] = "arange"; @@ -1146,6 +1145,7 @@ static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_cache_size[] = "cache_size"; static char __pyx_k_csr_matrix[] = "csr_matrix"; static char __pyx_k_dec_values[] = "dec_values"; +static char __pyx_k_exceptions[] = "exceptions"; static char __pyx_k_fit_status[] = "fit_status"; static char __pyx_k_n_class_SV[] = "n_class_SV"; static char __pyx_k_n_features[] = "n_features"; @@ -1170,8 +1170,8 @@ static char __pyx_k_We_ve_run_out_of_of_memory[] = "We've run out of of memory"; static char __pyx_k_libsvm_sparse_predict_proba[] = "libsvm_sparse_predict_proba"; 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_home_andy_checkout_scikit_learn[] = "/home/andy/checkout/scikit-learn/sklearn/svm/libsvm_sparse.pyx"; static char __pyx_k_libsvm_sparse_decision_function[] = "libsvm_sparse_decision_function"; +static char __pyx_k_scikit_learn_sklearn_svm_libsvm[] = "/scikit-learn/sklearn/svm/libsvm_sparse.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"; @@ -1210,10 +1210,10 @@ static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_empty; static PyObject *__pyx_n_s_eps; static PyObject *__pyx_n_s_error_msg; +static PyObject *__pyx_n_s_exceptions; 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_andy_checkout_scikit_learn; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_indices; static PyObject *__pyx_n_s_indptr; @@ -1250,6 +1250,7 @@ static PyObject *__pyx_n_s_rv; static PyObject *__pyx_n_s_sample_weight; static PyObject *__pyx_kp_s_sample_weight_and_X_have_incompa; static PyObject *__pyx_kp_s_sample_weight_has_s_samples_whil; +static PyObject *__pyx_kp_s_scikit_learn_sklearn_svm_libsvm; static PyObject *__pyx_n_s_scipy; static PyObject *__pyx_n_s_set_verbosity_wrap; static PyObject *__pyx_n_s_shrinking; @@ -1262,7 +1263,6 @@ static PyObject *__pyx_n_s_sv_coef_data; static PyObject *__pyx_n_s_svm_type; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static PyObject *__pyx_n_s_utils; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_verbosity; static PyObject *__pyx_n_s_warnings; @@ -3555,7 +3555,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_2libsvm_sparse_predict(C return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":291 +/* "sklearn/svm/libsvm_sparse.pyx":289 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< @@ -3638,116 +3638,116 @@ 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, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 21: if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 22: if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_predict_proba", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __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 = 291; __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 = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 23) { goto __pyx_L5_argtuple_error; @@ -3784,42 +3784,42 @@ 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_As_int(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_kernel_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __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 = 300; __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 = 301; __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 = 301; __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 = 301; __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 = 302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __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 = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __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 = 298; __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 = 299; __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 = 299; __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 = 299; __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 = 300; __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 = 304; __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 = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_shrinking = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_probability = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __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 = 302; __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 = 302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_shrinking = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probability = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_nSV = ((PyArrayObject *)values[20]); __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, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __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 = 289; __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 = 292; __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 = 293; __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 = 294; __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 = 295; __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 = 296; __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 = 297; __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 = 298; __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 = 299; __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 = 303; __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 = 305; __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 = 306; __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 = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_data), __pyx_ptype_5numpy_ndarray, 1, "T_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __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 = 291; __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 = 292; __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 = 293; __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 = 294; __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 = 295; __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 = 296; __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 = 297; __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 = 301; __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 = 303; __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 = 304; __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 = 305; __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); /* function exit code */ @@ -3942,105 +3942,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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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 = 291; __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 = 289; __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_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 = 291; __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 = 289; __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 = 291; __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 = 289; __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":315 + /* "sklearn/svm/libsvm_sparse.pyx":313 * 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 = 315; __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 = 315; __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 = 315; __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 = 315; __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 = 315; __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 = 315; __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 = 315; __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 = 315; __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 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __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 = 315; __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 = 314; __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]; } } @@ -4048,7 +4048,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":316 + /* "sklearn/svm/libsvm_sparse.pyx":314 * 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, # <<<<<<<<<<<<<< @@ -4057,7 +4057,7 @@ 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":324 + /* "sklearn/svm/libsvm_sparse.pyx":322 * -1) # random seed has no effect on predict either * * model = csr_set_model(param, nSV.shape[0], SV_data.data, # <<<<<<<<<<<<<< @@ -4066,7 +4066,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ __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":330 + /* "sklearn/svm/libsvm_sparse.pyx":328 * nSV.data, probA.data, probB.data) * #TODO: use check_model * cdef np.npy_intp n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -4075,23 +4075,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":332 + /* "sklearn/svm/libsvm_sparse.pyx":330 * 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 = 332; __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 = 330; __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 = 332; __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 332; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 330; __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 = 332; __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 = 330; __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); @@ -4099,26 +4099,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 = 332; __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 = 330; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __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_L1_error;} + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __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 = 332; __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 = 330; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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 = 332; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 330; __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_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 = 332; __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 = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4134,13 +4134,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 = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __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":333 + /* "sklearn/svm/libsvm_sparse.pyx":331 * cdef int rv * dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -4154,7 +4154,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p #endif /*try:*/ { - /* "sklearn/svm/libsvm_sparse.pyx":334 + /* "sklearn/svm/libsvm_sparse.pyx":332 * 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, # <<<<<<<<<<<<<< @@ -4164,7 +4164,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":333 + /* "sklearn/svm/libsvm_sparse.pyx":331 * cdef int rv * dec_values = np.empty((T_indptr.shape[0]-1, n_class), dtype=np.float64) * with nogil: # <<<<<<<<<<<<<< @@ -4182,7 +4182,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p } } - /* "sklearn/svm/libsvm_sparse.pyx":338 + /* "sklearn/svm/libsvm_sparse.pyx":336 * T_indptr.shape, T_indptr.data, * model, dec_values.data) * if rv < 0: # <<<<<<<<<<<<<< @@ -4192,21 +4192,21 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __pyx_t_12 = ((__pyx_v_rv < 0) != 0); if (__pyx_t_12) { - /* "sklearn/svm/libsvm_sparse.pyx":339 + /* "sklearn/svm/libsvm_sparse.pyx":337 * 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 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __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 = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm_sparse.pyx":341 + /* "sklearn/svm/libsvm_sparse.pyx":339 * raise MemoryError("We've run out of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -4215,7 +4215,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ free_model_SV(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":342 + /* "sklearn/svm/libsvm_sparse.pyx":340 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -4224,7 +4224,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ free_model(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":343 + /* "sklearn/svm/libsvm_sparse.pyx":341 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -4233,7 +4233,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p */ free_param(__pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":344 + /* "sklearn/svm/libsvm_sparse.pyx":342 * free_model(model) * free_param(param) * return dec_values # <<<<<<<<<<<<<< @@ -4245,7 +4245,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p __pyx_r = ((PyObject *)__pyx_v_dec_values); goto __pyx_L0; - /* "sklearn/svm/libsvm_sparse.pyx":291 + /* "sklearn/svm/libsvm_sparse.pyx":289 * * * def libsvm_sparse_predict_proba( # <<<<<<<<<<<<<< @@ -4303,7 +4303,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_4libsvm_sparse_predict_p return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":349 +/* "sklearn/svm/libsvm_sparse.pyx":347 * * * def libsvm_sparse_decision_function( # <<<<<<<<<<<<<< @@ -4386,116 +4386,116 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_7libsvm_sparse_decision_ case 1: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_T_indices)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 21: if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probA)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 22: if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_probB)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __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_decision_function") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "libsvm_sparse_decision_function") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } else if (PyTuple_GET_SIZE(__pyx_args) != 23) { goto __pyx_L5_argtuple_error; @@ -4532,42 +4532,42 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_7libsvm_sparse_decision_ __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_As_int(values[8]); if (unlikely((__pyx_v_svm_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_kernel_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __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 = 358; __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 = 359; __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 = 359; __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 = 359; __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 = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __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 = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_kernel_type = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_kernel_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __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 = 356; __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 = 357; __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 = 357; __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 = 357; __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 = 358; __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 = 362; __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 = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_shrinking = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_probability = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __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 = 360; __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 = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_shrinking = __Pyx_PyInt_As_int(values[18]); if (unlikely((__pyx_v_shrinking == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_v_probability = __Pyx_PyInt_As_int(values[19]); if (unlikely((__pyx_v_probability == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_nSV = ((PyArrayObject *)values[20]); __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_decision_function", 1, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("libsvm_sparse_decision_function", 1, 23, 23, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("sklearn.svm.libsvm_sparse.libsvm_sparse_decision_function", __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 = 350; __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 = 351; __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 = 352; __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 = 353; __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 = 354; __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 = 355; __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 = 356; __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 = 357; __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 = 361; __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 = 363; __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 = 364; __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 = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T_data), __pyx_ptype_5numpy_ndarray, 1, "T_data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __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 = 349; __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 = 350; __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 = 351; __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 = 352; __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 = 353; __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 = 354; __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 = 355; __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 = 359; __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 = 361; __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 = 362; __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 = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_function(__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); /* function exit code */ @@ -4689,105 +4689,105 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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 = 349; __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 = 347; __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_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 = 349; __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 = 347; __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 = 349; __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 = 347; __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":378 + /* "sklearn/svm/libsvm_sparse.pyx":376 * 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 = 378; __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 = 376; __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 = 378; __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 = 376; __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 = 378; __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 = 376; __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 = 378; __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 = 376; __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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __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 = 378; __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 = 376; __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 = 378; __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 = 376; __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 = 378; __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 = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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_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 = 376; __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 = 378; __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 = 376; __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 = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __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]; } } @@ -4795,7 +4795,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ __pyx_v_class_weight_label = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":379 + /* "sklearn/svm/libsvm_sparse.pyx":377 * 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, # <<<<<<<<<<<<<< @@ -4804,7 +4804,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ */ __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":386 + /* "sklearn/svm/libsvm_sparse.pyx":384 * class_weight_label.data, class_weight.data, -1, -1) * * model = csr_set_model(param, nSV.shape[0], SV_data.data, # <<<<<<<<<<<<<< @@ -4813,7 +4813,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ */ __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":392 + /* "sklearn/svm/libsvm_sparse.pyx":390 * nSV.data, probA.data, probB.data) * * if svm_type > 1: # <<<<<<<<<<<<<< @@ -4823,7 +4823,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ __pyx_t_7 = ((__pyx_v_svm_type > 1) != 0); if (__pyx_t_7) { - /* "sklearn/svm/libsvm_sparse.pyx":393 + /* "sklearn/svm/libsvm_sparse.pyx":391 * * if svm_type > 1: * n_class = 1 # <<<<<<<<<<<<<< @@ -4835,7 +4835,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ } /*else*/ { - /* "sklearn/svm/libsvm_sparse.pyx":395 + /* "sklearn/svm/libsvm_sparse.pyx":393 * n_class = 1 * else: * n_class = get_nr(model) # <<<<<<<<<<<<<< @@ -4844,7 +4844,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ */ __pyx_v_n_class = get_nr(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":396 + /* "sklearn/svm/libsvm_sparse.pyx":394 * else: * n_class = get_nr(model) * n_class = n_class * (n_class - 1) / 2 # <<<<<<<<<<<<<< @@ -4855,23 +4855,23 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ } __pyx_L3:; - /* "sklearn/svm/libsvm_sparse.pyx":398 + /* "sklearn/svm/libsvm_sparse.pyx":396 * n_class = n_class * (n_class - 1) / 2 * * dec_values = np.empty((T_indptr.shape[0] - 1, n_class), dtype=np.float64) # <<<<<<<<<<<<<< * if csr_copy_predict_values(T_data.shape, T_data.data, * T_indices.shape, T_indices.data, */ - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __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 = 396; __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 = 398; __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 = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyInt_From_long(((__pyx_v_T_indptr->dimensions[0]) - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 396; __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 = 398; __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 = 396; __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); @@ -4879,26 +4879,26 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ __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 = 398; __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 = 396; __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 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 398; __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 = 396; __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 = 398; __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 = 396; __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, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_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 = 396; __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_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 = 398; __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 = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; @@ -4914,13 +4914,13 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ } } __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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = 0; __pyx_v_dec_values = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":402 + /* "sklearn/svm/libsvm_sparse.pyx":400 * T_indices.shape, T_indices.data, * T_indptr.shape, T_indptr.data, * model, dec_values.data, n_class) < 0: # <<<<<<<<<<<<<< @@ -4930,21 +4930,21 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ __pyx_t_7 = ((csr_copy_predict_values(__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, __pyx_v_n_class) < 0) != 0); if (__pyx_t_7) { - /* "sklearn/svm/libsvm_sparse.pyx":403 + /* "sklearn/svm/libsvm_sparse.pyx":401 * T_indptr.shape, T_indptr.data, * model, dec_values.data, n_class) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __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 = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "sklearn/svm/libsvm_sparse.pyx":405 + /* "sklearn/svm/libsvm_sparse.pyx":403 * raise MemoryError("We've run out of of memory") * # free model and param * free_model_SV(model) # <<<<<<<<<<<<<< @@ -4953,7 +4953,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ */ free_model_SV(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":406 + /* "sklearn/svm/libsvm_sparse.pyx":404 * # free model and param * free_model_SV(model) * free_model(model) # <<<<<<<<<<<<<< @@ -4962,7 +4962,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ */ free_model(__pyx_v_model); - /* "sklearn/svm/libsvm_sparse.pyx":407 + /* "sklearn/svm/libsvm_sparse.pyx":405 * free_model_SV(model) * free_model(model) * free_param(param) # <<<<<<<<<<<<<< @@ -4971,7 +4971,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ */ free_param(__pyx_v_param); - /* "sklearn/svm/libsvm_sparse.pyx":409 + /* "sklearn/svm/libsvm_sparse.pyx":407 * free_param(param) * * return dec_values # <<<<<<<<<<<<<< @@ -4983,7 +4983,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ __pyx_r = ((PyObject *)__pyx_v_dec_values); goto __pyx_L0; - /* "sklearn/svm/libsvm_sparse.pyx":349 + /* "sklearn/svm/libsvm_sparse.pyx":347 * * * def libsvm_sparse_decision_function( # <<<<<<<<<<<<<< @@ -5041,7 +5041,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_6libsvm_sparse_decision_ return __pyx_r; } -/* "sklearn/svm/libsvm_sparse.pyx":414 +/* "sklearn/svm/libsvm_sparse.pyx":410 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -5062,7 +5062,7 @@ static PyObject *__pyx_pw_7sklearn_3svm_13libsvm_sparse_9set_verbosity_wrap(PyOb __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 = 414; __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 = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5082,14 +5082,14 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_8set_verbosity_wrap(CYTH __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_verbosity_wrap", 0); - /* "sklearn/svm/libsvm_sparse.pyx":418 + /* "sklearn/svm/libsvm_sparse.pyx":414 * Control verbosity of libsvm library * """ * set_verbosity(verbosity) # <<<<<<<<<<<<<< */ set_verbosity(__pyx_v_verbosity); - /* "sklearn/svm/libsvm_sparse.pyx":414 + /* "sklearn/svm/libsvm_sparse.pyx":410 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< @@ -5104,7 +5104,7 @@ static PyObject *__pyx_pf_7sklearn_3svm_13libsvm_sparse_8set_verbosity_wrap(CYTH return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 +/* "../../../usr/local/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -5154,7 +5154,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __Pyx_GIVEREF(__pyx_v_info->obj); } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":200 * # of flags * * if info == NULL: return # <<<<<<<<<<<<<< @@ -5167,7 +5167,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L0; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":203 * * cdef int copy_shape, i, ndim * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -5176,7 +5176,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_endian_detector = 1; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -5185,7 +5185,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":206 * cdef bint little_endian = ((&endian_detector)[0] != 0) * * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< @@ -5194,7 +5194,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":208 * ndim = PyArray_NDIM(self) * * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5204,7 +5204,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":209 * * if sizeof(npy_intp) != sizeof(Py_ssize_t): * copy_shape = 1 # <<<<<<<<<<<<<< @@ -5216,7 +5216,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":211 * copy_shape = 1 * else: * copy_shape = 0 # <<<<<<<<<<<<<< @@ -5227,7 +5227,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L4:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":213 * copy_shape = 0 * * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< @@ -5241,7 +5241,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L6_bool_binop_done; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214 + /* "../../../usr/local/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -5253,7 +5253,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L6_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -5267,7 +5267,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -5281,7 +5281,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P goto __pyx_L9_bool_binop_done; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218 + /* "../../../usr/local/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -5293,7 +5293,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L9_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -5307,7 +5307,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":221 * raise ValueError(u"ndarray is not Fortran contiguous") * * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< @@ -5316,7 +5316,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":222 * * info.buf = PyArray_DATA(self) * info.ndim = ndim # <<<<<<<<<<<<<< @@ -5325,7 +5325,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->ndim = __pyx_v_ndim; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":223 * info.buf = PyArray_DATA(self) * info.ndim = ndim * if copy_shape: # <<<<<<<<<<<<<< @@ -5335,7 +5335,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_1 = (__pyx_v_copy_shape != 0); if (__pyx_t_1) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -5344,7 +5344,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))); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -5353,7 +5353,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228 + /* "../../../usr/local/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -5364,7 +5364,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229 + /* "../../../usr/local/lib/python3.4/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] # <<<<<<<<<<<<<< @@ -5373,7 +5373,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]); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230 + /* "../../../usr/local/lib/python3.4/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] # <<<<<<<<<<<<<< @@ -5386,7 +5386,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":232 * info.shape[i] = PyArray_DIMS(self)[i] * else: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< @@ -5395,7 +5395,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)); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":233 * else: * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< @@ -5406,7 +5406,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L11:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":234 * info.strides = PyArray_STRIDES(self) * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL # <<<<<<<<<<<<<< @@ -5415,7 +5415,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->suboffsets = NULL; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":235 * info.shape = PyArray_DIMS(self) * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< @@ -5424,7 +5424,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":236 * info.suboffsets = NULL * info.itemsize = PyArray_ITEMSIZE(self) * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< @@ -5433,7 +5433,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":239 * * cdef int t * cdef char* f = NULL # <<<<<<<<<<<<<< @@ -5442,7 +5442,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_f = NULL; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":240 * cdef int t * cdef char* f = NULL * cdef dtype descr = self.descr # <<<<<<<<<<<<<< @@ -5454,7 +5454,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":244 * cdef int offset * * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< @@ -5463,7 +5463,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":246 * cdef bint hasfields = PyDataType_HASFIELDS(descr) * * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< @@ -5481,7 +5481,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L15_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":248 * if not hasfields and not copy_shape: * # do not call releasebuffer * info.obj = None # <<<<<<<<<<<<<< @@ -5497,7 +5497,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":251 * else: * # need to call releasebuffer * info.obj = self # <<<<<<<<<<<<<< @@ -5512,7 +5512,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L14:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":253 * info.obj = self * * if not hasfields: # <<<<<<<<<<<<<< @@ -5522,7 +5522,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":254 * * if not hasfields: * t = descr.type_num # <<<<<<<<<<<<<< @@ -5532,7 +5532,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_4 = __pyx_v_descr->type_num; __pyx_v_t = __pyx_t_4; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":255 * if not hasfields: * t = descr.type_num * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< @@ -5552,7 +5552,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } __pyx_L20_next_or:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256 + /* "../../../usr/local/lib/python3.4/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)): # <<<<<<<<<<<<<< @@ -5570,7 +5570,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_L19_bool_binop_done:; if (__pyx_t_1) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -5584,7 +5584,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5593,7 +5593,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ switch (__pyx_v_t) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5604,7 +5604,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_b; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5615,7 +5615,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_B; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5626,7 +5626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_h; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5637,7 +5637,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_H; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5648,7 +5648,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_i; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5659,7 +5659,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_I; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5670,7 +5670,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_l; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5681,7 +5681,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_L; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5692,7 +5692,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_q; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5703,7 +5703,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Q; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5714,7 +5714,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_f; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5725,7 +5725,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_d; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5736,7 +5736,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_g; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5747,7 +5747,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zf; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5758,7 +5758,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zd; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5769,7 +5769,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_v_f = __pyx_k_Zg; break; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -5781,7 +5781,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; default: - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -5807,7 +5807,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P break; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":277 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f # <<<<<<<<<<<<<< @@ -5816,7 +5816,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = __pyx_v_f; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":278 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * info.format = f * return # <<<<<<<<<<<<<< @@ -5828,7 +5828,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":280 * return * else: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< @@ -5837,7 +5837,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_info->format = ((char *)malloc(255)); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -5846,7 +5846,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ (__pyx_v_info->format[0]) = '^'; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -5855,7 +5855,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P */ __pyx_v_offset = 0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283 + /* "../../../usr/local/lib/python3.4/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, # <<<<<<<<<<<<<< @@ -5865,7 +5865,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_f = __pyx_t_7; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":286 * info.format + _buffer_format_string_len, * &offset) * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< @@ -5875,7 +5875,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P (__pyx_v_f[0]) = '\x00'; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194 + /* "../../../usr/local/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -5907,7 +5907,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5931,7 +5931,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s int __pyx_t_1; __Pyx_RefNannySetupContext("__releasebuffer__", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":289 * * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< @@ -5941,7 +5941,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":290 * def __releasebuffer__(ndarray self, Py_buffer* info): * if PyArray_HASFIELDS(self): * stdlib.free(info.format) # <<<<<<<<<<<<<< @@ -5953,7 +5953,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L3:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":291 * if PyArray_HASFIELDS(self): * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< @@ -5963,7 +5963,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":292 * stdlib.free(info.format) * if sizeof(npy_intp) != sizeof(Py_ssize_t): * stdlib.free(info.strides) # <<<<<<<<<<<<<< @@ -5975,7 +5975,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s } __pyx_L4:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":288 * f[0] = c'\0' # Terminate format string * * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< @@ -5987,7 +5987,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s __Pyx_RefNannyFinishContext(); } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6004,7 +6004,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":769 * * cdef inline object PyArray_MultiIterNew1(a): * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< @@ -6018,7 +6018,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":768 * ctypedef npy_cdouble complex_t * * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< @@ -6037,7 +6037,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__ return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6054,7 +6054,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":772 * * cdef inline object PyArray_MultiIterNew2(a, b): * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< @@ -6068,7 +6068,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":771 * return PyArray_MultiIterNew(1, a) * * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< @@ -6087,7 +6087,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__ return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6104,7 +6104,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":775 * * cdef inline object PyArray_MultiIterNew3(a, b, c): * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< @@ -6118,7 +6118,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":774 * return PyArray_MultiIterNew(2, a, b) * * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< @@ -6137,7 +6137,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__ return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6154,7 +6154,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6168,7 +6168,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":777 * return PyArray_MultiIterNew(3, a, b, c) * * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< @@ -6187,7 +6187,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__ return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 +/* "../../../usr/local/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -6204,7 +6204,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6218,7 +6218,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780 + /* "../../../usr/local/lib/python3.4/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): # <<<<<<<<<<<<<< @@ -6237,7 +6237,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__ return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 +/* "../../../usr/local/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -6269,7 +6269,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_util_dtypestring", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":790 * cdef int delta_offset * cdef tuple i * cdef int endian_detector = 1 # <<<<<<<<<<<<<< @@ -6278,7 +6278,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_endian_detector = 1; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":791 * cdef tuple i * cdef int endian_detector = 1 * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< @@ -6287,7 +6287,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6309,7 +6309,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; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":795 * * for childname in descr.names: * fields = descr.fields[childname] # <<<<<<<<<<<<<< @@ -6322,7 +6322,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; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":796 * for childname in descr.names: * fields = descr.fields[childname] * child, new_offset = fields # <<<<<<<<<<<<<< @@ -6361,7 +6361,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; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":798 * child, new_offset = fields * * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< @@ -6378,7 +6378,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -6392,7 +6392,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6412,7 +6412,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L8_next_or:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":802 * * if ((child.byteorder == c'>' and little_endian) or * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< @@ -6430,7 +6430,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_L7_bool_binop_done:; if (__pyx_t_6) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -6444,7 +6444,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":813 * * # Output padding bytes * while offset[0] < new_offset: # <<<<<<<<<<<<<< @@ -6460,7 +6460,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; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":814 * # Output padding bytes * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< @@ -6469,7 +6469,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ (__pyx_v_f[0]) = 120; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":815 * while offset[0] < new_offset: * f[0] = 120 # "x"; pad byte * f += 1 # <<<<<<<<<<<<<< @@ -6478,7 +6478,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx */ __pyx_v_f = (__pyx_v_f + 1); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":816 * f[0] = 120 # "x"; pad byte * f += 1 * offset[0] += 1 # <<<<<<<<<<<<<< @@ -6489,7 +6489,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":818 * offset[0] += 1 * * offset[0] += child.itemsize # <<<<<<<<<<<<<< @@ -6499,7 +6499,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_t_8 = 0; (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":820 * offset[0] += child.itemsize * * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< @@ -6509,7 +6509,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":821 * * if not PyDataType_HASFIELDS(child): * t = child.type_num # <<<<<<<<<<<<<< @@ -6521,7 +6521,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; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":822 * if not PyDataType_HASFIELDS(child): * t = child.type_num * if end - f < 5: # <<<<<<<<<<<<<< @@ -6531,7 +6531,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -6545,7 +6545,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6563,7 +6563,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6581,7 +6581,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6599,7 +6599,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6617,7 +6617,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6635,7 +6635,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6653,7 +6653,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6671,7 +6671,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6689,7 +6689,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6707,7 +6707,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6725,7 +6725,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6743,7 +6743,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6761,7 +6761,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6779,7 +6779,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6799,7 +6799,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6819,7 +6819,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841 + /* "../../../usr/local/lib/python3.4/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 # <<<<<<<<<<<<<< @@ -6839,7 +6839,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx goto __pyx_L15; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842 + /* "../../../usr/local/lib/python3.4/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" # <<<<<<<<<<<<<< @@ -6858,7 +6858,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6881,7 +6881,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L15:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":845 * else: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) * f += 1 # <<<<<<<<<<<<<< @@ -6893,7 +6893,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849 + /* "../../../usr/local/lib/python3.4/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) # <<<<<<<<<<<<<< @@ -6905,7 +6905,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __pyx_L13:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":794 * cdef tuple fields * * for childname in descr.names: # <<<<<<<<<<<<<< @@ -6915,7 +6915,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":850 * # so don't output it * f = _util_dtypestring(child, f, end, offset) * return f # <<<<<<<<<<<<<< @@ -6925,7 +6925,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx __pyx_r = __pyx_v_f; goto __pyx_L0; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783 + /* "../../../usr/local/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -6950,7 +6950,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx return __pyx_r; } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -6965,7 +6965,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); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968 + /* "../../../usr/local/lib/python3.4/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: # <<<<<<<<<<<<<< @@ -6976,7 +6976,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":969 * cdef PyObject* baseptr * if base is None: * baseptr = NULL # <<<<<<<<<<<<<< @@ -6988,7 +6988,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":971 * baseptr = NULL * else: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< @@ -6997,7 +6997,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":972 * else: * Py_INCREF(base) # important to do this before decref below! * baseptr = base # <<<<<<<<<<<<<< @@ -7008,7 +7008,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a } __pyx_L3:; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":973 * Py_INCREF(base) # important to do this before decref below! * baseptr = base * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< @@ -7017,7 +7017,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_XDECREF(__pyx_v_arr->base); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":974 * baseptr = base * Py_XDECREF(arr.base) * arr.base = baseptr # <<<<<<<<<<<<<< @@ -7026,7 +7026,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ __pyx_v_arr->base = __pyx_v_baseptr; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":966 * * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -7038,7 +7038,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __Pyx_RefNannyFinishContext(); } -/* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 +/* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7052,7 +7052,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 0); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":977 * * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: # <<<<<<<<<<<<<< @@ -7062,7 +7062,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) { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":978 * cdef inline object get_array_base(ndarray arr): * if arr.base is NULL: * return None # <<<<<<<<<<<<<< @@ -7076,7 +7076,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py } /*else*/ { - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":980 * return None * else: * return arr.base # <<<<<<<<<<<<<< @@ -7087,7 +7087,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py goto __pyx_L0; } - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -7156,10 +7156,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_n_s_eps, __pyx_k_eps, sizeof(__pyx_k_eps), 0, 0, 1, 1}, {&__pyx_n_s_error_msg, __pyx_k_error_msg, sizeof(__pyx_k_error_msg), 0, 0, 1, 1}, + {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, {&__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_andy_checkout_scikit_learn, __pyx_k_home_andy_checkout_scikit_learn, sizeof(__pyx_k_home_andy_checkout_scikit_learn), 0, 0, 1, 0}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1}, @@ -7196,6 +7196,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_sample_weight, __pyx_k_sample_weight, sizeof(__pyx_k_sample_weight), 0, 0, 1, 1}, {&__pyx_kp_s_sample_weight_and_X_have_incompa, __pyx_k_sample_weight_and_X_have_incompa, sizeof(__pyx_k_sample_weight_and_X_have_incompa), 0, 0, 1, 0}, {&__pyx_kp_s_sample_weight_has_s_samples_whil, __pyx_k_sample_weight_has_s_samples_whil, sizeof(__pyx_k_sample_weight_has_s_samples_whil), 0, 0, 1, 0}, + {&__pyx_kp_s_scikit_learn_sklearn_svm_libsvm, __pyx_k_scikit_learn_sklearn_svm_libsvm, sizeof(__pyx_k_scikit_learn_sklearn_svm_libsvm), 0, 0, 1, 0}, {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1}, {&__pyx_n_s_set_verbosity_wrap, __pyx_k_set_verbosity_wrap, sizeof(__pyx_k_set_verbosity_wrap), 0, 0, 1, 1}, {&__pyx_n_s_shrinking, __pyx_k_shrinking, sizeof(__pyx_k_shrinking), 0, 0, 1, 1}, @@ -7208,7 +7209,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_svm_type, __pyx_k_svm_type, sizeof(__pyx_k_svm_type), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 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_utils, __pyx_k_utils, sizeof(__pyx_k_utils), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_n_s_verbosity, __pyx_k_verbosity, sizeof(__pyx_k_verbosity), 0, 0, 1, 1}, {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, @@ -7294,29 +7294,29 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - /* "sklearn/svm/libsvm_sparse.pyx":339 + /* "sklearn/svm/libsvm_sparse.pyx":337 * model, dec_values.data) * if rv < 0: * raise MemoryError("We've run out of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_memory); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - /* "sklearn/svm/libsvm_sparse.pyx":403 + /* "sklearn/svm/libsvm_sparse.pyx":401 * T_indptr.shape, T_indptr.data, * model, dec_values.data, n_class) < 0: * raise MemoryError("We've run out of of memory") # <<<<<<<<<<<<<< * # free model and param * free_model_SV(model) */ - __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_of_memory); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_We_ve_run_out_of_of_memory); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -7327,7 +7327,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -7338,7 +7338,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -7349,7 +7349,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -7360,7 +7360,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803 + /* "../../../usr/local/lib/python3.4/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") # <<<<<<<<<<<<<< @@ -7371,7 +7371,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":823 * t = child.type_num * if end - f < 5: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< @@ -7392,7 +7392,7 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__15 = PyTuple_Pack(40, __pyx_n_s_n_features, __pyx_n_s_values, __pyx_n_s_indices, __pyx_n_s_indptr, __pyx_n_s_Y, __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_sample_weight, __pyx_n_s_nu, __pyx_n_s_cache_size, __pyx_n_s_p, __pyx_n_s_shrinking, __pyx_n_s_probability, __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_class_weight_label, __pyx_n_s_fit_status, __pyx_n_s_SV_len, __pyx_n_s_n_class, __pyx_n_s_sv_coef_data, __pyx_n_s_support, __pyx_n_s_intercept, __pyx_n_s_nonzero_SV, __pyx_n_s_SV_data, __pyx_n_s_SV_indices, __pyx_n_s_SV_indptr, __pyx_n_s_support_vectors, __pyx_n_s_n_class_SV, __pyx_n_s_probA, __pyx_n_s_probB); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(21, 0, 40, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andy_checkout_scikit_learn, __pyx_n_s_libsvm_sparse_train, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(21, 0, 40, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scikit_learn_sklearn_svm_libsvm, __pyx_n_s_libsvm_sparse_train, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "sklearn/svm/libsvm_sparse.pyx":215 * @@ -7404,43 +7404,43 @@ static int __Pyx_InitCachedConstants(void) { __pyx_tuple__17 = PyTuple_Pack(28, __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, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_class_weight_label, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(23, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andy_checkout_scikit_learn, __pyx_n_s_libsvm_sparse_predict, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(23, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scikit_learn_sklearn_svm_libsvm, __pyx_n_s_libsvm_sparse_predict, 215, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm_sparse.pyx":291 + /* "sklearn/svm/libsvm_sparse.pyx":289 * * * 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_tuple__19 = PyTuple_Pack(29, __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, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_class_weight_label, __pyx_n_s_n_class, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__19 = PyTuple_Pack(29, __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, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_model, __pyx_n_s_class_weight_label, __pyx_n_s_n_class, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(23, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andy_checkout_scikit_learn, __pyx_n_s_libsvm_sparse_predict_proba, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(23, 0, 29, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scikit_learn_sklearn_svm_libsvm, __pyx_n_s_libsvm_sparse_predict_proba, 289, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm_sparse.pyx":349 + /* "sklearn/svm/libsvm_sparse.pyx":347 * * * def libsvm_sparse_decision_function( # <<<<<<<<<<<<<< * np.ndarray[np.float64_t, ndim=1, mode='c'] T_data, * np.ndarray[np.int32_t, ndim=1, mode='c'] T_indices, */ - __pyx_tuple__21 = PyTuple_Pack(28, __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, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_n_class, __pyx_n_s_model, __pyx_n_s_class_weight_label); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__21 = PyTuple_Pack(28, __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, __pyx_n_s_dec_values, __pyx_n_s_param, __pyx_n_s_n_class, __pyx_n_s_model, __pyx_n_s_class_weight_label); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(23, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andy_checkout_scikit_learn, __pyx_n_s_libsvm_sparse_decision_function, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(23, 0, 28, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scikit_learn_sklearn_svm_libsvm, __pyx_n_s_libsvm_sparse_decision_function, 347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "sklearn/svm/libsvm_sparse.pyx":414 + /* "sklearn/svm/libsvm_sparse.pyx":410 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< * """ * Control verbosity of libsvm library */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_verbosity, __pyx_n_s_verbosity); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_verbosity, __pyx_n_s_verbosity); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andy_checkout_scikit_learn, __pyx_n_s_set_verbosity_wrap, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_scikit_learn_sklearn_svm_libsvm, __pyx_n_s_set_verbosity_wrap, 410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -7580,7 +7580,7 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(void) * import numpy as np * cimport numpy as np * from scipy import sparse # <<<<<<<<<<<<<< - * from ..utils import ConvergenceWarning + * from ..exceptions import ConvergenceWarning * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7600,7 +7600,7 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(void) /* "sklearn/svm/libsvm_sparse.pyx":5 * cimport numpy as np * from scipy import sparse - * from ..utils import ConvergenceWarning # <<<<<<<<<<<<<< + * from ..exceptions import ConvergenceWarning # <<<<<<<<<<<<<< * * cdef extern from *: */ @@ -7609,7 +7609,7 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(void) __Pyx_INCREF(__pyx_n_s_ConvergenceWarning); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConvergenceWarning); __Pyx_GIVEREF(__pyx_n_s_ConvergenceWarning); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_utils, __pyx_t_2, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(__pyx_n_s_exceptions, __pyx_t_2, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConvergenceWarning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7651,40 +7651,40 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(void) if (PyDict_SetItem(__pyx_d, __pyx_n_s_libsvm_sparse_predict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":291 + /* "sklearn/svm/libsvm_sparse.pyx":289 * * * 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_sklearn_svm_libsvm_sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __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_sklearn_svm_libsvm_sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_libsvm_sparse_predict_proba, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_libsvm_sparse_predict_proba, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":349 + /* "sklearn/svm/libsvm_sparse.pyx":347 * * * def libsvm_sparse_decision_function( # <<<<<<<<<<<<<< * 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_7libsvm_sparse_decision_function, NULL, __pyx_n_s_sklearn_svm_libsvm_sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_7libsvm_sparse_decision_function, NULL, __pyx_n_s_sklearn_svm_libsvm_sparse); 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); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_libsvm_sparse_decision_function, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyDict_SetItem(__pyx_d, __pyx_n_s_libsvm_sparse_decision_function, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "sklearn/svm/libsvm_sparse.pyx":414 + /* "sklearn/svm/libsvm_sparse.pyx":410 * * * def set_verbosity_wrap(int verbosity): # <<<<<<<<<<<<<< * """ * Control verbosity of libsvm library */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_9set_verbosity_wrap, NULL, __pyx_n_s_sklearn_svm_libsvm_sparse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sklearn_3svm_13libsvm_sparse_9set_verbosity_wrap, NULL, __pyx_n_s_sklearn_svm_libsvm_sparse); 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); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_verbosity_wrap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __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 = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "sklearn/svm/libsvm_sparse.pyx":1 @@ -7697,7 +7697,7 @@ PyMODINIT_FUNC PyInit_libsvm_sparse(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; - /* "../../../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976 + /* "../../../usr/local/lib/python3.4/dist-packages/Cython/Includes/numpy/__init__.pxd":976 * arr.base = baseptr * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< diff --git a/sklearn/svm/libsvm_sparse.pyx b/sklearn/svm/libsvm_sparse.pyx index 049f73196ccd0..625b011b85d70 100644 --- a/sklearn/svm/libsvm_sparse.pyx +++ b/sklearn/svm/libsvm_sparse.pyx @@ -2,7 +2,7 @@ import warnings import numpy as np cimport numpy as np from scipy import sparse -from ..utils import ConvergenceWarning +from ..exceptions import ConvergenceWarning cdef extern from *: ctypedef char* const_char_p "const char*" diff --git a/sklearn/svm/tests/test_sparse.py b/sklearn/svm/tests/test_sparse.py index 75a33fba5055f..1ce9d2dc3b1d2 100644 --- a/sklearn/svm/tests/test_sparse.py +++ b/sklearn/svm/tests/test_sparse.py @@ -8,7 +8,7 @@ from sklearn import datasets, svm, linear_model, base from sklearn.datasets import make_classification, load_digits, make_blobs from sklearn.svm.tests import test_svm -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning from sklearn.utils.extmath import safe_sparse_dot from sklearn.utils.testing import assert_warns, assert_raise_message diff --git a/sklearn/svm/tests/test_svm.py b/sklearn/svm/tests/test_svm.py index d6c52e4496a1f..a12d3f4f0114f 100644 --- a/sklearn/svm/tests/test_svm.py +++ b/sklearn/svm/tests/test_svm.py @@ -12,19 +12,19 @@ from scipy import sparse from nose.tools import assert_raises, assert_true, assert_equal, assert_false -from sklearn.base import ChangedBehaviorWarning from sklearn import svm, linear_model, datasets, metrics, base from sklearn.cross_validation import train_test_split from sklearn.datasets import make_classification, make_blobs from sklearn.metrics import f1_score from sklearn.metrics.pairwise import rbf_kernel from sklearn.utils import check_random_state -from sklearn.utils import ConvergenceWarning -from sklearn.utils.validation import NotFittedError from sklearn.utils.testing import assert_greater, assert_in, assert_less from sklearn.utils.testing import assert_raises_regexp, assert_warns from sklearn.utils.testing import assert_warns_message, assert_raise_message from sklearn.utils.testing import ignore_warnings +from sklearn.exceptions import ChangedBehaviorWarning +from sklearn.exceptions import ConvergenceWarning +from sklearn.exceptions import NotFittedError # toy sample X = [[-2, -1], [-1, -1], [-1, -2], [1, 1], [1, 2], [2, 1]] diff --git a/sklearn/tests/test_grid_search.py b/sklearn/tests/test_grid_search.py index 114a3b65c1b34..3b3caf9d72d2f 100644 --- a/sklearn/tests/test_grid_search.py +++ b/sklearn/tests/test_grid_search.py @@ -33,9 +33,9 @@ from sklearn.datasets import make_classification from sklearn.datasets import make_blobs from sklearn.datasets import make_multilabel_classification -from sklearn.grid_search import (GridSearchCV, RandomizedSearchCV, - ParameterGrid, ParameterSampler, - ChangedBehaviorWarning) +from sklearn.grid_search import GridSearchCV, RandomizedSearchCV +from sklearn.grid_search import ParameterGrid, ParameterSampler +from sklearn.exceptions import ChangedBehaviorWarning from sklearn.svm import LinearSVC, SVC from sklearn.tree import DecisionTreeRegressor from sklearn.tree import DecisionTreeClassifier @@ -44,7 +44,8 @@ from sklearn.metrics import f1_score from sklearn.metrics import make_scorer from sklearn.metrics import roc_auc_score -from sklearn.cross_validation import KFold, StratifiedKFold, FitFailedWarning +from sklearn.cross_validation import KFold, StratifiedKFold +from sklearn.exceptions import FitFailedWarning from sklearn.preprocessing import Imputer from sklearn.pipeline import Pipeline diff --git a/sklearn/tests/test_random_projection.py b/sklearn/tests/test_random_projection.py index 527faede75f31..dcbe97c7d6d7f 100644 --- a/sklearn/tests/test_random_projection.py +++ b/sklearn/tests/test_random_projection.py @@ -20,7 +20,7 @@ from sklearn.utils.testing import assert_in from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_warns -from sklearn.utils import DataDimensionalityWarning +from sklearn.exceptions import DataDimensionalityWarning all_sparse_random_matrix = [sparse_random_matrix] all_dense_random_matrix = [gaussian_random_matrix] diff --git a/sklearn/tree/tests/test_tree.py b/sklearn/tree/tests/test_tree.py index 0573fc0108e17..fa44be7a46c50 100644 --- a/sklearn/tree/tests/test_tree.py +++ b/sklearn/tree/tests/test_tree.py @@ -28,10 +28,11 @@ from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_warns from sklearn.utils.testing import raises +from sklearn.utils.testing import ignore_warnings from sklearn.utils.validation import check_random_state -from sklearn.utils.validation import NotFittedError -from sklearn.utils.testing import ignore_warnings + +from sklearn.exceptions import NotFittedError from sklearn.tree import DecisionTreeClassifier from sklearn.tree import DecisionTreeRegressor @@ -1312,7 +1313,7 @@ def check_presort_sparse(est, X, y): assert_raises(ValueError, est.fit, X, y ) def test_presort_sparse(): - ests = (DecisionTreeClassifier(presort=True), + ests = (DecisionTreeClassifier(presort=True), DecisionTreeRegressor(presort=True)) sparse_matrices = (csr_matrix, csc_matrix, coo_matrix) diff --git a/sklearn/tree/tree.py b/sklearn/tree/tree.py index c20af9da9672c..23c1bacd9cd08 100644 --- a/sklearn/tree/tree.py +++ b/sklearn/tree/tree.py @@ -31,9 +31,8 @@ from ..utils import check_array from ..utils import check_random_state from ..utils import compute_sample_weight -from ..utils.validation import NotFittedError from ..utils.multiclass import check_classification_targets - +from ..exceptions import NotFittedError from ._criterion import Criterion from ._splitter import Splitter diff --git a/sklearn/utils/__init__.py b/sklearn/utils/__init__.py index 398446404a003..cb78040e386a0 100644 --- a/sklearn/utils/__init__.py +++ b/sklearn/utils/__init__.py @@ -12,11 +12,24 @@ assert_all_finite, check_random_state, column_or_1d, check_array, check_consistent_length, check_X_y, indexable, - check_symmetric, DataConversionWarning) + check_symmetric) from .class_weight import compute_class_weight, compute_sample_weight from ..externals.joblib import cpu_count +from .exceptions import ConvergenceWarning +from .exceptions import DataConversionWarning as DataConversionWarning_ +from .utils import deprecated +ConvergenceWarning = deprecated("ConvergenceWarning has been moved " + "into the sklearn.exceptions module. " + "It will not be available here from " + "version 0.19")(ConvergenceWarning) + +DataConversionWarning = deprecated("DataConversionWarning has been moved " + "into the sklearn.exceptions module. " + "It will not be available here from " + "version 0.19")(DataConversionWarning_) + __all__ = ["murmurhash3_32", "as_float_array", "assert_all_finite", "check_array", "check_random_state", @@ -154,7 +167,7 @@ def safe_indexing(X, indices): # Cython typed memoryviews internally used in pandas do not support # readonly buffers. warnings.warn("Copying input dataframe for slicing.", - DataConversionWarning) + DataConversionWarning_) return X.copy().iloc[indices] elif hasattr(X, "shape"): if hasattr(X, 'take') and (hasattr(indices, 'dtype') and @@ -471,9 +484,3 @@ def tosequence(x): return list(x) -class ConvergenceWarning(UserWarning): - """Custom warning to capture convergence problems""" - - -class DataDimensionalityWarning(UserWarning): - """Custom warning to notify potential issues with data dimensionality""" diff --git a/sklearn/utils/estimator_checks.py b/sklearn/utils/estimator_checks.py index 29afe0e1f3329..4e396db755d39 100644 --- a/sklearn/utils/estimator_checks.py +++ b/sklearn/utils/estimator_checks.py @@ -41,8 +41,8 @@ from sklearn.svm.base import BaseLibSVM from sklearn.pipeline import make_pipeline from sklearn.decomposition import NMF, ProjectedGradientNMF -from sklearn.utils.validation import DataConversionWarning -from sklearn.utils import ConvergenceWarning +from sklearn.exceptions import ConvergenceWarning +from sklearn.exceptions import DataConversionWarning from sklearn.cross_validation import train_test_split from sklearn.utils import shuffle diff --git a/sklearn/utils/extmath.py b/sklearn/utils/extmath.py index a1a3bf4d78858..9187b219142e6 100644 --- a/sklearn/utils/extmath.py +++ b/sklearn/utils/extmath.py @@ -24,7 +24,8 @@ from ._logistic_sigmoid import _log_logistic_sigmoid from ..externals.six.moves import xrange from .sparsefuncs_fast import csr_row_norms -from .validation import check_array, NonBLASDotWarning +from .validation import check_array +from ..exceptions import NonBLASDotWarning def norm(x): @@ -101,9 +102,11 @@ def _fast_dot(A, B): if A.dtype != B.dtype or any(x.dtype not in (np.float32, np.float64) for x in [A, B]): - warnings.warn('Data must be of same type. Supported types ' - 'are 32 and 64 bit float. ' - 'Falling back to np.dot.', NonBLASDotWarning) + warnings.warn('Falling back to np.dot. ' + 'Data must be of same type of either ' + '32 or 64 bit float for the BLAS function, gemm, to be ' + 'used for an efficient dot operation. ', + NonBLASDotWarning) raise ValueError if min(A.shape) == 1 or min(B.shape) == 1 or A.ndim != 2 or B.ndim != 2: @@ -145,7 +148,7 @@ def fast_dot(A, B): execute the following lines of code: >> import warnings - >> from sklearn.utils.validation import NonBLASDotWarning + >> from sklearn.exceptions import NonBLASDotWarning >> warnings.simplefilter('always', NonBLASDotWarning) """ try: diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py index 5ef7557e91789..64d816f1068b7 100644 --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -14,28 +14,27 @@ from ..externals import six from ..utils.fixes import signature +from . import deprecated +from ..exceptions import DataConversionWarning as DataConversionWarning_ +from ..exceptions import NonBLASDotWarning +from ..exceptions import NotFittedError as NotFittedError_ -FLOAT_DTYPES = (np.float64, np.float32, np.float16) - - -class DataConversionWarning(UserWarning): - """A warning on implicit data conversions happening in the code""" - pass - -warnings.simplefilter("always", DataConversionWarning) +DataConversionWarning = deprecated("DataConversionWarning has been moved " + "into the sklearn.exceptions module. " + "It will not be available here from " + "version 0.19")(DataConversionWarning_) -class NonBLASDotWarning(UserWarning): - """A warning on implicit dispatch to numpy.dot""" +NonBLASDotWarning = deprecated("NonBLASDotWarning has been moved " + "into the sklearn.exceptions module. " + "It will not be available here from " + "version 0.19")(NonBLASDotWarning) +NotFittedError = deprecated("NotFittedError has been moved into the " + "sklearn.exceptions module. It will not be " + "available here from version 0.19")(NotFittedError_) -class NotFittedError(ValueError, AttributeError): - """Exception class to raise if estimator is used before fitting - - This class inherits from both ValueError and AttributeError to help with - exception handling and backward compatibility. - """ - +FLOAT_DTYPES = (np.float64, np.float32, np.float16) # Silenced by default to reduce verbosity. Turn on at runtime for # performance profiling. @@ -417,7 +416,7 @@ def check_array(array, accept_sparse=None, dtype="numeric", order=None, if warn_on_dtype and dtype_orig is not None and array.dtype != dtype_orig: msg = ("Data with input dtype %s was converted to %s%s." % (dtype_orig, array.dtype, context)) - warnings.warn(msg, DataConversionWarning) + warnings.warn(msg, DataConversionWarning_) return array @@ -545,7 +544,7 @@ def column_or_1d(y, warn=False): warnings.warn("A column-vector y was passed when a 1d array was" " expected. Please change the shape of y to " "(n_samples, ), for example using ravel().", - DataConversionWarning, stacklevel=2) + DataConversionWarning_, stacklevel=2) return np.ravel(y) raise ValueError("bad input shape {0}".format(shape)) @@ -675,7 +674,7 @@ def check_is_fitted(estimator, attributes, msg=None, all_or_any=all): attributes = [attributes] if not all_or_any([hasattr(estimator, attr) for attr in attributes]): - raise NotFittedError(msg % {'name': type(estimator).__name__}) + raise NotFittedError_(msg % {'name': type(estimator).__name__}) def check_non_negative(X, whom): From 09f0fa77455d35973176b4950975efe11f8378ae Mon Sep 17 00:00:00 2001 From: Raghav R V Date: Thu, 11 Jun 2015 03:38:12 +0530 Subject: [PATCH 2/5] DOC/SPHINX Add template for classes which don't have init (Exception classes) --- doc/templates/class_without_init.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/templates/class_without_init.rst diff --git a/doc/templates/class_without_init.rst b/doc/templates/class_without_init.rst new file mode 100644 index 0000000000000..79ff2cf807794 --- /dev/null +++ b/doc/templates/class_without_init.rst @@ -0,0 +1,12 @@ +:mod:`{{module}}`.{{objname}} +{{ underline }}============== + +.. currentmodule:: {{ module }} + +.. autoclass:: {{ objname }} + +.. include:: {{module}}.{{objname}}.examples + +.. raw:: html + +
From e19a981f508f6ea9dffda5c2b813ea0d71add238 Mon Sep 17 00:00:00 2001 From: Raghav R V Date: Mon, 12 Oct 2015 13:46:30 +0200 Subject: [PATCH 3/5] MAINT Deprecated the UndefinedMetricWarning at sklearn.metrics.base --- sklearn/metrics/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sklearn/metrics/base.py b/sklearn/metrics/base.py index d286815fc0078..e84bcc26c8c2c 100644 --- a/sklearn/metrics/base.py +++ b/sklearn/metrics/base.py @@ -1,3 +1,4 @@ + """ Common code for all metrics @@ -19,6 +20,13 @@ from ..utils import check_array, check_consistent_length from ..utils.multiclass import type_of_target +from ..exceptions import UndefinedMetricWarning +from ..utils import deprecated + +UndefinedMetricWarning = deprecated("UndefinedMetricWarning has been moved " + "into the sklearn.exceptions module. " + "It will not be available here from " + "version 0.19")(UndefinedMetricWarning) def _average_binary_score(binary_metric, y_true, y_score, average, sample_weight=None): From 61ae8d56c4af2495aa685518bcab357191a52f19 Mon Sep 17 00:00:00 2001 From: Raghav R V Date: Mon, 19 Oct 2015 17:31:36 +0200 Subject: [PATCH 4/5] MAINT move deprecated into deprecation.py --- sklearn/base.py | 1 + sklearn/utils/__init__.py | 93 ++---------------------------------- sklearn/utils/deprecation.py | 85 ++++++++++++++++++++++++++++++++ sklearn/utils/validation.py | 2 +- 4 files changed, 92 insertions(+), 89 deletions(-) create mode 100644 sklearn/utils/deprecation.py diff --git a/sklearn/base.py b/sklearn/base.py index e9320fd1180e2..88393f3318af2 100644 --- a/sklearn/base.py +++ b/sklearn/base.py @@ -9,6 +9,7 @@ from scipy import sparse from .externals import six from .utils.fixes import signature +from .utils.deprecation import deprecated from .exceptions import ChangedBehaviorWarning diff --git a/sklearn/utils/__init__.py b/sklearn/utils/__init__.py index cb78040e386a0..0dba78b038866 100644 --- a/sklearn/utils/__init__.py +++ b/sklearn/utils/__init__.py @@ -13,11 +13,11 @@ check_random_state, column_or_1d, check_array, check_consistent_length, check_X_y, indexable, check_symmetric) +from .deprecation import deprecated from .class_weight import compute_class_weight, compute_sample_weight from ..externals.joblib import cpu_count -from .exceptions import ConvergenceWarning -from .exceptions import DataConversionWarning as DataConversionWarning_ -from .utils import deprecated +from ..exceptions import ConvergenceWarning +from ..exceptions import DataConversionWarning as DataConversionWarning_ ConvergenceWarning = deprecated("ConvergenceWarning has been moved " @@ -39,88 +39,6 @@ "check_symmetric"] -class deprecated(object): - """Decorator to mark a function or class as deprecated. - - Issue a warning when the function is called/the class is instantiated and - adds a warning to the docstring. - - The optional extra argument will be appended to the deprecation message - and the docstring. Note: to use this with the default value for extra, put - in an empty of parentheses: - - >>> from sklearn.utils import deprecated - >>> deprecated() # doctest: +ELLIPSIS - - - >>> @deprecated() - ... def some_function(): pass - """ - - # Adapted from http://wiki.python.org/moin/PythonDecoratorLibrary, - # but with many changes. - - def __init__(self, extra=''): - """ - Parameters - ---------- - extra: string - to be added to the deprecation messages - - """ - self.extra = extra - - def __call__(self, obj): - if isinstance(obj, type): - return self._decorate_class(obj) - else: - return self._decorate_fun(obj) - - def _decorate_class(self, cls): - msg = "Class %s is deprecated" % cls.__name__ - if self.extra: - msg += "; %s" % self.extra - - # FIXME: we should probably reset __new__ for full generality - init = cls.__init__ - - def wrapped(*args, **kwargs): - warnings.warn(msg, category=DeprecationWarning) - return init(*args, **kwargs) - cls.__init__ = wrapped - - wrapped.__name__ = '__init__' - wrapped.__doc__ = self._update_doc(init.__doc__) - wrapped.deprecated_original = init - - return cls - - def _decorate_fun(self, fun): - """Decorate function fun""" - - msg = "Function %s is deprecated" % fun.__name__ - if self.extra: - msg += "; %s" % self.extra - - def wrapped(*args, **kwargs): - warnings.warn(msg, category=DeprecationWarning) - return fun(*args, **kwargs) - - wrapped.__name__ = fun.__name__ - wrapped.__dict__ = fun.__dict__ - wrapped.__doc__ = self._update_doc(fun.__doc__) - - return wrapped - - def _update_doc(self, olddoc): - newdoc = "DEPRECATED" - if self.extra: - newdoc = "%s: %s" % (newdoc, self.extra) - if olddoc: - newdoc = "%s\n\n%s" % (newdoc, olddoc) - return newdoc - - def safe_mask(X, mask): """Return a mask which is safe to use on X. @@ -422,7 +340,8 @@ def gen_even_slices(n, n_packs, n_samples=None): """ start = 0 if n_packs < 1: - raise ValueError("gen_even_slices got n_packs=%s, must be >=1" % n_packs) + raise ValueError("gen_even_slices got n_packs=%s, must be >=1" + % n_packs) for pack_num in range(n_packs): this_n = n // n_packs if pack_num < n % n_packs: @@ -482,5 +401,3 @@ def tosequence(x): return x else: return list(x) - - diff --git a/sklearn/utils/deprecation.py b/sklearn/utils/deprecation.py new file mode 100644 index 0000000000000..366c4a14c5bc2 --- /dev/null +++ b/sklearn/utils/deprecation.py @@ -0,0 +1,85 @@ +import warnings + +__all__ = ["deprecated", ] + + +class deprecated(object): + """Decorator to mark a function or class as deprecated. + + Issue a warning when the function is called/the class is instantiated and + adds a warning to the docstring. + + The optional extra argument will be appended to the deprecation message + and the docstring. Note: to use this with the default value for extra, put + in an empty of parentheses: + + >>> from sklearn.utils import deprecated + >>> deprecated() # doctest: +ELLIPSIS + + + >>> @deprecated() + ... def some_function(): pass + """ + + # Adapted from http://wiki.python.org/moin/PythonDecoratorLibrary, + # but with many changes. + + def __init__(self, extra=''): + """ + Parameters + ---------- + extra: string + to be added to the deprecation messages + + """ + self.extra = extra + + def __call__(self, obj): + if isinstance(obj, type): + return self._decorate_class(obj) + else: + return self._decorate_fun(obj) + + def _decorate_class(self, cls): + msg = "Class %s is deprecated" % cls.__name__ + if self.extra: + msg += "; %s" % self.extra + + # FIXME: we should probably reset __new__ for full generality + init = cls.__init__ + + def wrapped(*args, **kwargs): + warnings.warn(msg, category=DeprecationWarning) + return init(*args, **kwargs) + cls.__init__ = wrapped + + wrapped.__name__ = '__init__' + wrapped.__doc__ = self._update_doc(init.__doc__) + wrapped.deprecated_original = init + + return cls + + def _decorate_fun(self, fun): + """Decorate function fun""" + + msg = "Function %s is deprecated" % fun.__name__ + if self.extra: + msg += "; %s" % self.extra + + def wrapped(*args, **kwargs): + warnings.warn(msg, category=DeprecationWarning) + return fun(*args, **kwargs) + + wrapped.__name__ = fun.__name__ + wrapped.__dict__ = fun.__dict__ + wrapped.__doc__ = self._update_doc(fun.__doc__) + + return wrapped + + def _update_doc(self, olddoc): + newdoc = "DEPRECATED" + if self.extra: + newdoc = "%s: %s" % (newdoc, self.extra) + if olddoc: + newdoc = "%s\n\n%s" % (newdoc, olddoc) + return newdoc diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py index 64d816f1068b7..544736122528e 100644 --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -14,7 +14,7 @@ from ..externals import six from ..utils.fixes import signature -from . import deprecated +from .deprecation import deprecated from ..exceptions import DataConversionWarning as DataConversionWarning_ from ..exceptions import NonBLASDotWarning from ..exceptions import NotFittedError as NotFittedError_ From 857cb0925434b7708fc309a9df646c0583bb25b4 Mon Sep 17 00:00:00 2001 From: Raghav R V Date: Tue, 20 Oct 2015 00:54:35 +0200 Subject: [PATCH 5/5] FIX/ENH Make the moved class resilient to the deprecation patching --- sklearn/base.py | 5 ++++- sklearn/metrics/base.py | 8 +++++++- sklearn/utils/__init__.py | 9 ++++----- sklearn/utils/tests/test_validation.py | 5 +++-- sklearn/utils/validation.py | 21 +++++++++++++++++---- 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/sklearn/base.py b/sklearn/base.py index 88393f3318af2..e10dfad45e21e 100644 --- a/sklearn/base.py +++ b/sklearn/base.py @@ -10,9 +10,12 @@ from .externals import six from .utils.fixes import signature from .utils.deprecation import deprecated -from .exceptions import ChangedBehaviorWarning +from .exceptions import ChangedBehaviorWarning as ChangedBehaviorWarning_ +class ChangedBehaviorWarning(ChangedBehaviorWarning_): + pass + ChangedBehaviorWarning = deprecated("ChangedBehaviorWarning has been moved " "into the sklearn.exceptions module. " "It will not be available here from " diff --git a/sklearn/metrics/base.py b/sklearn/metrics/base.py index e84bcc26c8c2c..01baecc25b1a6 100644 --- a/sklearn/metrics/base.py +++ b/sklearn/metrics/base.py @@ -20,14 +20,20 @@ from ..utils import check_array, check_consistent_length from ..utils.multiclass import type_of_target -from ..exceptions import UndefinedMetricWarning +from ..exceptions import UndefinedMetricWarning as UndefinedMetricWarning_ from ..utils import deprecated + +class UndefinedMetricWarning(UndefinedMetricWarning_): + pass + + UndefinedMetricWarning = deprecated("UndefinedMetricWarning has been moved " "into the sklearn.exceptions module. " "It will not be available here from " "version 0.19")(UndefinedMetricWarning) + def _average_binary_score(binary_metric, y_true, y_score, average, sample_weight=None): """Average a binary metric for multilabel classification diff --git a/sklearn/utils/__init__.py b/sklearn/utils/__init__.py index 0dba78b038866..bf45b56f07d55 100644 --- a/sklearn/utils/__init__.py +++ b/sklearn/utils/__init__.py @@ -16,19 +16,18 @@ from .deprecation import deprecated from .class_weight import compute_class_weight, compute_sample_weight from ..externals.joblib import cpu_count -from ..exceptions import ConvergenceWarning +from ..exceptions import ConvergenceWarning as ConvergenceWarning_ from ..exceptions import DataConversionWarning as DataConversionWarning_ +class ConvergenceWarning(ConvergenceWarning_): + pass + ConvergenceWarning = deprecated("ConvergenceWarning has been moved " "into the sklearn.exceptions module. " "It will not be available here from " "version 0.19")(ConvergenceWarning) -DataConversionWarning = deprecated("DataConversionWarning has been moved " - "into the sklearn.exceptions module. " - "It will not be available here from " - "version 0.19")(DataConversionWarning_) __all__ = ["murmurhash3_32", "as_float_array", "assert_all_finite", "check_array", diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py index 43a405a8d1093..d577864fb709a 100644 --- a/sklearn/utils/tests/test_validation.py +++ b/sklearn/utils/tests/test_validation.py @@ -26,13 +26,14 @@ from sklearn.svm import SVR from sklearn.datasets import make_blobs from sklearn.utils.validation import ( - NotFittedError, has_fit_parameter, check_is_fitted, check_consistent_length, - DataConversionWarning, ) +from sklearn.exceptions import NotFittedError +from sklearn.exceptions import DataConversionWarning + from sklearn.utils.testing import assert_raise_message diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py index 544736122528e..e62f3b4ba6d47 100644 --- a/sklearn/utils/validation.py +++ b/sklearn/utils/validation.py @@ -16,29 +16,41 @@ from ..utils.fixes import signature from .deprecation import deprecated from ..exceptions import DataConversionWarning as DataConversionWarning_ -from ..exceptions import NonBLASDotWarning +from ..exceptions import NonBLASDotWarning as NonBLASDotWarning_ from ..exceptions import NotFittedError as NotFittedError_ +class DataConversionWarning(DataConversionWarning_): + pass + DataConversionWarning = deprecated("DataConversionWarning has been moved " "into the sklearn.exceptions module. " "It will not be available here from " - "version 0.19")(DataConversionWarning_) + "version 0.19")(DataConversionWarning) + + +class NonBLASDotWarning(NonBLASDotWarning_): + pass NonBLASDotWarning = deprecated("NonBLASDotWarning has been moved " "into the sklearn.exceptions module. " "It will not be available here from " "version 0.19")(NonBLASDotWarning) + +class NotFittedError(NotFittedError_): + pass + NotFittedError = deprecated("NotFittedError has been moved into the " "sklearn.exceptions module. It will not be " - "available here from version 0.19")(NotFittedError_) + "available here from version 0.19")(NotFittedError) + FLOAT_DTYPES = (np.float64, np.float32, np.float16) # Silenced by default to reduce verbosity. Turn on at runtime for # performance profiling. -warnings.simplefilter('ignore', NonBLASDotWarning) +warnings.simplefilter('ignore', NonBLASDotWarning_) def _assert_all_finite(X): @@ -674,6 +686,7 @@ def check_is_fitted(estimator, attributes, msg=None, all_or_any=all): attributes = [attributes] if not all_or_any([hasattr(estimator, attr) for attr in attributes]): + # FIXME NotFittedError_ --> NotFittedError in 0.19 raise NotFittedError_(msg % {'name': type(estimator).__name__})