Skip to content

Instantly share code, notes, and snippets.

@lebigot
Created July 17, 2018 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lebigot/691ca1acf172b688996bd60c431fa0ee to your computer and use it in GitHub Desktop.
Save lebigot/691ca1acf172b688996bd60c431fa0ee to your computer and use it in GitHub Desktop.
List of scikit-learn places with either a raise statement or a function call that contains "warn" or "Warn" (scikit-learn rev. a3f8e65de)

__check_build/__init__.py

  • Line 31, col. 4 in raise_build_error():

      raise ImportError(
          """%s
      ___________________________________________________________________________
      Contents of %s:
      %s
      ___________________________________________________________________________
      It seems that scikit-learn has not been built correctly.
      
      If you have installed scikit-learn from source, please do not forget
      to build the package before using it: run `python setup.py install` or
      `make` in the source directory.
      %s"""
           % (e, local_dir, ''.join(dir_content).strip(), msg))
    

__check_build/setup.py

__init__.py

  • Line 28, col. 0 in <module>:

      warnings.filterwarnings('always', category=DeprecationWarning, module=
          '^{0}\\.'.format(re.escape(__name__)))
    

_build_utils/__init__.py

  • Line 78, col. 16 in maybe_cythonize_extensions():

      raise ValueError(message)
    
  • Line 82, col. 12 in maybe_cythonize_extensions():

      raise
    

_config.py

base.py

  • Line 55, col. 12 in clone():

      raise TypeError(
          "Cannot clone object '%s' (type %s): it does not seem to be a scikit-learn estimator as it does not implement a 'get_params' methods."
           % (repr(estimator), type(estimator)))
    
  • Line 71, col. 12 in clone():

      raise RuntimeError(
          'Cannot clone object %s, as the constructor either does not set or modifies parameter %s'
           % (estimator, name))
    
  • Line 157, col. 16 in BaseEstimator():

      raise RuntimeError(
          "scikit-learn estimators should always specify their parameters in the signature of their __init__ (no varargs). %s with constructor %s doesn't  follow this convention."
           % (cls, init_signature))
    
  • Line 210, col. 16 in BaseEstimator():

      raise ValueError(
          'Invalid parameter %s for estimator %s. Check the list of available parameters with `estimator.get_params().keys()`.'
           % (key, self))
    
  • Line 246, col. 16 in BaseEstimator():

      warnings.warn(
          'Trying to unpickle estimator {0} from version {1} when using version {2}. This might lead to breaking code or invalid results. Use at your own risk.'
          .format(self.__class__.__name__, pickle_version, __version__), UserWarning)
    

calibration.py

  • Line 139, col. 12 in CalibratedClassifierCV():

      raise ValueError(
          'Requesting %d-fold cross-validation but provided less than %d examples for at least one class.'
           % (n_folds, n_folds))
    
  • Line 165, col. 16 in CalibratedClassifierCV():

      warnings.warn(
          '%s does not support sample_weight. Samples weights are only used for the calibration itself.'
           % estimator_name)
    
  • Line 302, col. 12 in _CalibratedClassifier():

      raise RuntimeError(
          'classifier has no decision_function or predict_proba method.')
    
  • Line 348, col. 16 in _CalibratedClassifier():

      raise ValueError('method should be "sigmoid" or "isotonic". Got %s.' % self
          .method)
    
  • Line 563, col. 8 in calibration_curve():

      raise ValueError(
          'y_prob has values outside [0, 1] and normalize is set to False.')
    

cluster/bicluster.py

  • Line 79, col. 8 in _log_normalize():

      raise ValueError(
          'Cannot compute log of a sparse matrix, because log(x) diverges to -infinity as x goes to 0.'
          )
    
  • Line 109, col. 12 in BaseSpectral():

      raise ValueError("Unknown SVD method: '{0}'. svd_method must be one of {1}."
          .format(self.svd_method, legal_svd_methods))
    
  • Line 420, col. 12 in SpectralBiclustering():

      raise ValueError("Unknown method: '{0}'. method must be one of {1}.".format
          (self.method, legal_methods))
    
  • Line 430, col. 16 in SpectralBiclustering():

      raise ValueError(
          'Incorrect parameter n_clusters has value: {}. It should either be a single integer or an iterable with two integers: (n_row_clusters, n_column_clusters)'
          )
    
  • Line 435, col. 12 in SpectralBiclustering():

      raise ValueError(
          'Parameter n_components must be greater than 0, but its value is {}'.
          format(self.n_components))
    
  • Line 438, col. 12 in SpectralBiclustering():

      raise ValueError('Parameter n_best must be greater than 0, but its value is {}'
          .format(self.n_best))
    
  • Line 441, col. 12 in SpectralBiclustering():

      raise ValueError('n_best cannot be larger than n_components, but {} >  {}'.
          format(self.n_best, self.n_components))
    

cluster/mean_shift_.py

  • Line 186, col. 8 in mean_shift():

      raise ValueError(
          'bandwidth needs to be greater than zero or None,            got %f' %
          bandwidth)
    
  • Line 208, col. 8 in mean_shift():

      raise ValueError(
          'No point was within bandwidth=%f of any seed. Try a different seeding strategy                          or increase the bandwidth.'
           % bandwidth)
    
  • Line 284, col. 8 in get_bin_seeds():

      warnings.warn(
          'Binning data failed with provided bin_size=%f, using data points as seeds.'
           % bin_size)
    

cluster/hierarchical.py

  • Line 45, col. 8 in _fix_connectivity():

      raise ValueError('Wrong shape for connectivity matrix: %s when X is %s' % (
          connectivity.shape, X.shape))
    
  • Line 62, col. 8 in _fix_connectivity():

      warnings.warn(
          'the number of connected components of the connectivity matrix is %d > 1. Completing it to avoid stopping the tree early.'
           % n_components, stacklevel=2)
    
  • Line 226, col. 12 in ward_tree():

      warnings.warn(
          'Partial build of the tree is implemented only for structured clustering (i.e. with explicit connectivity). The algorithm will build the full tree and only retain the lower branches required for the specified number of clusters'
          , stacklevel=2)
    
  • Line 248, col. 12 in ward_tree():

      raise ValueError(
          'Cannot provide more clusters than samples. %i n_clusters was asked, and there are %i samples.'
           % (n_clusters, n_samples))
    
  • Line 424, col. 8 in linkage_tree():

      warnings.warn('n_components was deprecated in 0.19will be removed in 0.21',
          DeprecationWarning)
    
  • Line 438, col. 8 in linkage_tree():

      raise ValueError(
          'Unknown linkage option, linkage should be one of %s, but %s was given' %
          (linkage_choices.keys(), linkage))
    
  • Line 446, col. 12 in linkage_tree():

      warnings.warn(
          'Partial build of the tree is implemented only for structured clustering (i.e. with explicit connectivity). The algorithm will build the full tree and only retain the lower branches required for the specified number of clusters'
          , stacklevel=2)
    
  • Line 633, col. 8 in _hc_cut():

      raise ValueError(
          'Cannot extract more clusters than samples: %s clusters where given for a tree with %s leaves.'
           % (n_clusters, n_leaves))
    
  • Line 781, col. 12 in AgglomerativeClustering():

      warnings.warn(
          'Agglomerative "pooling_func" parameter is not used. It has been deprecated in version 0.20 and will beremoved in 0.22'
          , DeprecationWarning)
    
  • Line 788, col. 12 in AgglomerativeClustering():

      raise ValueError(
          'n_clusters should be an integer greater than 0. %s was provided.' %
          str(self.n_clusters))
    
  • Line 792, col. 12 in AgglomerativeClustering():

      raise ValueError(
          '%s was provided as affinity. Ward can only work with euclidean distances.'
           % (self.affinity,))
    
  • Line 797, col. 12 in AgglomerativeClustering():

      raise ValueError('Unknown linkage type %s. Valid options are %s' % (self.
          linkage, _TREE_BUILDERS.keys()))
    
  • Line 952, col. 8 in FeatureAgglomeration():

      raise AttributeError
    

cluster/tests/test_mean_shift.py

  • Line 127, col. 9 in test_bin_seeds():

      warnings.catch_warnings(record=True)
    

cluster/tests/test_k_means.py

  • Line 217, col. 8 in test_k_means_plus_plus_init_2_jobs():

      raise SkipTest('Possible multi-process bug with some BLAS under Python < 3.4')
    
  • Line 347, col. 4 in test_minibatch_init_with_large_k():

      assert_warns(RuntimeWarning, mb_k_means.fit, X)
    
  • Line 373, col. 4 in test_minibatch_k_means_init_multiple_runs_with_explicit_centers():

      assert_warns(RuntimeWarning, mb_k_means.fit, X)
    
  • Line 760, col. 4 in test_k_means_function():

      assert_warns(RuntimeWarning, k_means, X, n_clusters=n_clusters,
          sample_weight=None, init=centers)
    
  • Line 909, col. 4 in test_less_centers_than_unique_points():

      assert_warns_message(ConvergenceWarning, msg, k_means, X, sample_weight=
          None, n_clusters=4)
    

cluster/tests/test_feature_agglomeration.py

  • Line 19, col. 4 in test_feature_agglomeration():

      assert_no_warnings(agglo_mean.fit, X)
    
  • Line 20, col. 4 in test_feature_agglomeration():

      assert_no_warnings(agglo_median.fit, X)
    

cluster/tests/test_dbscan.py

cluster/tests/test_birch.py

  • Line 97, col. 4 in test_n_clusters():

      assert_warns(ConvergenceWarning, brc4.fit, X)
    

cluster/tests/test_affinity_propagation.py

  • Line 96, col. 4 in test_affinity_propagation_fit_non_convergence():

      assert_warns(ConvergenceWarning, af.fit, X)
    
  • Line 106, col. 37 in test_affinity_propagation_equal_mutual_similarities():

      assert_warns_message(UserWarning, 'mutually equal', affinity_propagation, S,
          preference=0)
    
  • Line 114, col. 37 in test_affinity_propagation_equal_mutual_similarities():

      assert_warns_message(UserWarning, 'mutually equal', affinity_propagation, S,
          preference=-10)
    
  • Line 122, col. 37 in test_affinity_propagation_equal_mutual_similarities():

      assert_no_warnings(affinity_propagation, S, preference=[-20, -10])
    
  • Line 136, col. 9 in test_affinity_propagation_predict_non_convergence():

      assert_warns(ConvergenceWarning, AffinityPropagation(preference=-10,
          max_iter=1).fit, X)
    
  • Line 142, col. 8 in test_affinity_propagation_predict_non_convergence():

      assert_warns(ConvergenceWarning, af.predict, to_predict)
    

cluster/tests/__init__.py

cluster/tests/test_hierarchical.py

  • Line 44, col. 42 in test_deprecation_of_n_components_in_linkage_tree():

      assert_warns(DeprecationWarning, linkage_tree, X.T, n_components=10)
    
  • Line 106, col. 13 in test_unstructured_linkage_tree():

      ignore_warnings()
    
  • Line 107, col. 50 in test_unstructured_linkage_tree():

      assert_warns(UserWarning, ward_tree, this_X.T, n_clusters=10)
    
  • Line 114, col. 17 in test_unstructured_linkage_tree():

      ignore_warnings()
    
  • Line 115, col. 54 in test_unstructured_linkage_tree():

      assert_warns(UserWarning, tree_builder, this_X.T, n_clusters=10)
    
  • Line 489, col. 4 in test_connectivity_fixing_non_lil():

      assert_warns(UserWarning, w.fit, x)
    

cluster/tests/common.py

cluster/tests/test_bicluster.py

  • Line 211, col. 4 in test_perfect_checkerboard():

      raise SkipTest(
          'This test is failing on the buildbot, but cannot reproduce. Temporarily disabling it until it can be reproduced and  fixed.'
          )
    

cluster/tests/test_spectral.py

  • Line 116, col. 4 in test_affinities():

      assert_warns_message(UserWarning, 'not fully connected', sp.fit, X)
    

cluster/_feature_agglomeration.py

  • Line 46, col. 12 in AgglomerationTransform():

      raise ValueError('X has a different number of features than during fitting.')
    

cluster/__init__.py

cluster/k_means_.py

  • Line 151, col. 8 in _validate_center_shape():

      raise ValueError(
          'The shape of the initial centers (%s) does not match the number of clusters %i'
           % (centers.shape, n_centers))
    
  • Line 155, col. 8 in _validate_center_shape():

      raise ValueError(
          'The number of features of the initial centers %s does not match the number of features of the data %s.'
           % (centers.shape[1], X.shape[1]))
    
  • Line 178, col. 12 in _check_sample_weight():

      raise ValueError('n_samples=%d should be == len(sample_weight)=%d' % (
          n_samples, len(sample_weight)))
    
  • Line 300, col. 8 in k_means():

      raise ValueError(
          'Invalid number of initializations. n_init=%d must be bigger than zero.' %
          n_init)
    
  • Line 305, col. 8 in k_means():

      raise ValueError(
          'Number of iterations should be a positive number, got %d instead' %
          max_iter)
    
  • Line 314, col. 8 in k_means():

      raise ValueError('n_samples=%d should be >= n_clusters=%d' % (_num_samples(
          X), n_clusters))
    
  • Line 329, col. 8 in k_means():

      raise ValueError(
          "precompute_distances should be 'auto' or True/False, but a value of %r was passed"
           % precompute_distances)
    
  • Line 339, col. 12 in k_means():

      warnings.warn(
          'Explicit initial center position passed: performing only one init in k-means instead of n_init=%d'
           % n_init, RuntimeWarning, stacklevel=2)
    
  • Line 369, col. 8 in k_means():

      raise ValueError("Algorithm must be 'auto', 'full' or 'elkan', got %s" %
          str(algorithm))
    
  • Line 414, col. 8 in k_means():

      warnings.warn(
          'Number of distinct clusters ({}) found smaller than n_clusters ({}). Possibly due to duplicate points in X.'
          .format(distinct_clusters, n_clusters), ConvergenceWarning, stacklevel=2)
    
  • Line 430, col. 8 in _kmeans_single_elkan():

      raise TypeError("algorithm='elkan' not supported for sparse input X")
    
  • Line 733, col. 12 in _init_centroids():

      warnings.warn('init_size=%d should be larger than k=%d. Setting it to 3*k' %
          (init_size, k), RuntimeWarning, stacklevel=2)
    
  • Line 743, col. 8 in _init_centroids():

      raise ValueError('n_samples=%d should be larger than k=%d' % (n_samples, k))
    
  • Line 760, col. 8 in _init_centroids():

      raise ValueError(
          "the init parameter for the k-means should be 'k-means++' or 'random' or an ndarray, '%s' (type '%s') was passed."
           % (init, type(init)))
    
  • Line 935, col. 12 in KMeans():

      raise ValueError(
          'Incorrect number of features. Got %d features, expected %d' % (
          n_features, expected_n_features))
    
  • Line 1458, col. 12 in MiniBatchKMeans():

      raise ValueError('n_samples=%d should be >= n_clusters=%d' % (n_samples,
          self.n_clusters))
    
  • Line 1467, col. 16 in MiniBatchKMeans():

      warnings.warn(
          'Explicit initial center position passed: performing only one init in MiniBatchKMeans instead of n_init=%d'
           % self.n_init, RuntimeWarning, stacklevel=2)
    

cluster/affinity_propagation_.py

  • Line 112, col. 8 in affinity_propagation():

      raise ValueError('S must be a square array (shape=%s)' % repr(S.shape))
    
  • Line 117, col. 8 in affinity_propagation():

      raise ValueError('damping must be >= 0.5 and < 1')
    
  • Line 125, col. 8 in affinity_propagation():

      warnings.warn(
          'All samples have mutually equal similarities. Returning arbitrary cluster center(s).'
          )
    
  • Line 223, col. 8 in affinity_propagation():

      warnings.warn(
          'Affinity propagation did not converge, this model will not have any cluster centers.'
          , ConvergenceWarning)
    
  • Line 373, col. 12 in AffinityPropagation():

      raise ValueError(
          "Affinity must be 'precomputed' or 'euclidean'. Got %s instead" % str(
          self.affinity))
    
  • Line 403, col. 12 in AffinityPropagation():

      raise ValueError("Predict method is not supported when affinity='precomputed'."
          )
    
  • Line 409, col. 12 in AffinityPropagation():

      warnings.warn(
          "This model does not have any cluster centers because affinity propagation did not converge. Labeling every sample as '-1'."
          , ConvergenceWarning)
    

cluster/setup.py

cluster/spectral.py

  • Line 155, col. 8 in discretize():

      raise LinAlgError('SVD did not converge')
    
  • Line 251, col. 8 in spectral_clustering():

      raise ValueError(
          "The 'assign_labels' parameter should be 'kmeans' or 'discretize', but '%s' was given"
           % assign_labels)
    
  • Line 443, col. 12 in SpectralClustering():

      warnings.warn(
          'The spectral clustering API has changed. ``fit``now constructs an affinity matrix from data. To use a custom affinity matrix, set ``affinity=precomputed``.'
          )
    

cluster/birch.py

  • Line 457, col. 12 in Birch():

      raise ValueError('Branching_factor should be greater than one.')
    
  • Line 548, col. 12 in Birch():

      raise NotFittedError('Fit training data before predicting')
    
  • Line 551, col. 12 in Birch():

      raise ValueError(
          'Training data and predicted data do not have same number of features.')
    
  • Line 616, col. 12 in Birch():

      raise ValueError('n_clusters should be an instance of ClusterMixin or an int')
    
  • Line 626, col. 16 in Birch():

      warnings.warn(
          'Number of subclusters found (%d) by Birch is less than (%d). Decrease the threshold.'
           % (len(centroids), self.n_clusters), ConvergenceWarning)
    

cluster/dbscan_.py

  • Line 118, col. 8 in dbscan():

      raise ValueError('eps must be positive.')
    

compose/_target.py

  • Line 118, col. 12 in TransformedTargetRegressor():

      raise ValueError(
          "'transformer' and functions 'func'/'inverse_func' cannot both be set.")
    
  • Line 124, col. 16 in TransformedTargetRegressor():

      raise ValueError(
          "When 'func' is provided, 'inverse_func' must also be provided")
    
  • Line 140, col. 16 in TransformedTargetRegressor():

      warnings.warn(
          "The provided functions or transformer are not strictly inverse of each other. If you are sure you want to proceed regardless, set 'check_inverse=False'"
          , UserWarning)
    

compose/tests/test_target.py

  • Line 55, col. 4 in test_transform_target_regressor_invertible():

      assert_warns_message(UserWarning,
          'The provided functions or transformer are not strictly inverse of each other.'
          , regr.fit, X, y)
    
  • Line 61, col. 4 in test_transform_target_regressor_invertible():

      assert_no_warnings(regr.fit, X, y)
    

compose/tests/__init__.py

compose/tests/test_column_transformer.py

  • Line 68, col. 8 in TransRaise():

      raise ValueError('specific message')
    
  • Line 71, col. 8 in TransRaise():

      raise ValueError('specific message')
    

compose/__init__.py

compose/_column_transformer.py

  • Line 234, col. 16 in ColumnTransformer():

      raise TypeError(
          "All estimators should implement fit and transform, or can be 'drop' or 'passthrough' specifiers. '%s' (type %s) doesn't."
           % (t, type(t)))
    
  • Line 249, col. 12 in ColumnTransformer():

      raise ValueError(
          "The remainder keyword needs to be one of 'drop', 'passthrough', or estimator. '%s' was passed instead"
           % self.remainder)
    
  • Line 289, col. 16 in ColumnTransformer():

      raise NotImplementedError(
          "get_feature_names is not yet supported when using a 'passthrough' transformer."
          )
    
  • Line 293, col. 16 in ColumnTransformer():

      raise AttributeError(
          'Transformer %s (type %s) does not provide get_feature_names.' % (str(
          name), type(trans).__name__))
    
  • Line 333, col. 16 in ColumnTransformer():

      raise ValueError(
          "The output of the '{0}' transformer should be 2D (scipy matrix, array, or pandas DataFrame)."
          .format(name))
    
  • Line 353, col. 16 in ColumnTransformer():

      raise ValueError(_ERR_MSG_1DCOLUMN)
    
  • Line 355, col. 16 in ColumnTransformer():

      raise
    
  • Line 525, col. 8 in _get_column():

      raise ValueError(
          'No valid specification of the columns. Only a scalar, list or slice of all integers or all strings, or boolean mask is allowed'
          )
    
  • Line 534, col. 12 in _get_column():

      raise ValueError(
          'Specifying the columns using strings is only supported for pandas DataFrames'
          )
    
  • Line 566, col. 12 in _get_column_indices():

      raise ValueError(
          'Specifying the columns using strings is only supported for pandas DataFrames'
          )
    
  • Line 589, col. 8 in _get_column_indices():

      raise ValueError(
          'No valid specification of the columns. Only a scalar, list or slice of all integers or all strings, or boolean mask is allowed'
          )
    
  • Line 665, col. 8 in make_column_transformer():

      raise TypeError('Unknown keyword arguments: "{}"'.format(list(kwargs.keys()
          )[0]))
    

covariance/graph_lasso_.py

  • Line 257, col. 16 in graphical_lasso():

      raise FloatingPointError(
          'Non SPD result: the system is too ill-conditioned for this solver')
    
  • Line 260, col. 12 in graphical_lasso():

      warnings.warn(
          'graphical_lasso: did not converge after %i iteration: dual gap: %.3e' %
          (max_iter, d_gap), ConvergenceWarning)
    
  • Line 266, col. 8 in graphical_lasso():

      raise e
    
  • Line 623, col. 17 in GraphicalLassoCV():

      warnings.catch_warnings()
    
  • Line 627, col. 16 in GraphicalLassoCV():

      warnings.simplefilter('ignore', ConvergenceWarning)
    

covariance/robust_covariance.py

  • Line 164, col. 8 in _c_step():

      warnings.warn('Warning! det > previous_det (%.15f > %.15f)' % (det,
          previous_det), RuntimeWarning)
    
  • Line 268, col. 8 in select_candidates():

      raise TypeError(
          "Invalid 'n_trials' parameter, expected tuple or  integer, got %s (%s)" %
          (n_trials, type(n_trials)))
    
  • Line 622, col. 12 in MinCovDet():

      warnings.warn(
          'The covariance matrix associated to your dataset is not full rank')
    
  • Line 681, col. 12 in MinCovDet():

      raise ValueError(
          'The covariance matrix of the support data is equal to 0, try to increase support_fraction'
          )
    

covariance/tests/test_graph_lasso.py

  • Line 23, col. 1 in test_graph_lasso():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 67, col. 1 in test_graph_lasso_iris():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 92, col. 1 in test_graph_lasso_iris_singular():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 120, col. 1 in test_graph_lasso_cv():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 159, col. 4 in test_deprecated_grid_scores():

      assert_warns_message(DeprecationWarning, depr_message, lambda : graph_lasso
          .grid_scores)
    
  • Line 143, col. 1 in test_deprecated_grid_scores():

      ignore_warnings(category=DeprecationWarning)
    

covariance/tests/__init__.py

covariance/tests/test_covariance.py

  • Line 61, col. 4 in test_covariance():

      assert_warns(UserWarning, cov.fit, X_1sample)
    
  • Line 179, col. 4 in test_ledoit_wolf():

      assert_warns(UserWarning, lw.fit, X_1sample)
    
  • Line 298, col. 4 in test_oas():

      assert_warns(UserWarning, oa.fit, X_1sample)
    

covariance/tests/test_robust_covariance.py

covariance/tests/test_graphical_lasso.py

  • Line 154, col. 4 in test_deprecated_grid_scores():

      assert_warns_message(DeprecationWarning, depr_message, lambda :
          graphical_lasso.grid_scores)
    

covariance/tests/test_elliptic_envelope.py

  • Line 48, col. 4 in test_raw_values_deprecation():

      assert_warns_message(DeprecationWarning,
          'raw_values parameter is deprecated in 0.20 and will be removed in 0.22.',
          clf.decision_function, X, raw_values=True)
    
  • Line 57, col. 4 in test_threshold_deprecation():

      assert_warns_message(DeprecationWarning,
          'threshold_ attribute is deprecated in 0.20 and will be removed in 0.22.',
          getattr, clf, 'threshold_')
    

covariance/__init__.py

covariance/elliptic_envelope.py

  • Line 144, col. 12 in EllipticEnvelope():

      warnings.warn(
          'raw_values parameter is deprecated in 0.20 and will be removed in 0.22.',
          DeprecationWarning)
    
  • Line 216, col. 8 in EllipticEnvelope():

      warnings.warn(
          'threshold_ attribute is deprecated in 0.20 and will be removed in 0.22.',
          DeprecationWarning)
    

covariance/empirical_covariance_.py

  • Line 76, col. 8 in empirical_covariance():

      warnings.warn(
          'Only one sample available. You may want to reshape your data array')
    
  • Line 254, col. 12 in EmpiricalCovariance():

      raise NotImplementedError('Only spectral and frobenius norms are implemented')
    

covariance/shrunk_covariance_.py

  • Line 190, col. 8 in ledoit_wolf_shrinkage():

      warnings.warn(
          'Only one sample available. You may want to reshape your data array')
    
  • Line 289, col. 8 in ledoit_wolf():

      warnings.warn(
          'Only one sample available. You may want to reshape your data array')
    
  • Line 447, col. 8 in oas():

      warnings.warn(
          'Only one sample available. You may want to reshape your data array')
    

cross_decomposition/tests/test_pls.py

  • Line 270, col. 4 in test_convergence_fail():

      assert_warns(ConvergenceWarning, pls_bynipals.fit, X, Y)
    

cross_decomposition/tests/__init__.py

cross_decomposition/__init__.py

cross_decomposition/cca_.py

cross_decomposition/pls_.py

  • Line 78, col. 12 in _nipals_twoblocks_inner_loop():

      warnings.warn('Maximum number of iterations reached', ConvergenceWarning)
    
  • Line 262, col. 12 in _PLS():

      raise ValueError('Invalid number of components: %d' % self.n_components)
    
  • Line 265, col. 12 in _PLS():

      raise ValueError("Got algorithm %s when only 'svd' and 'nipals' are known" %
          self.algorithm)
    
  • Line 268, col. 12 in _PLS():

      raise ValueError(
          'Incompatible configuration: mode B is not implemented with svd algorithm')
    
  • Line 271, col. 12 in _PLS():

      raise ValueError('The deflation mode is unknown')
    
  • Line 291, col. 16 in _PLS():

      warnings.warn('Y residual constant at iteration %s' % k)
    
  • Line 317, col. 16 in _PLS():

      warnings.warn('X scores are null at iteration %s' % k)
    
  • Line 811, col. 12 in PLSSVD():

      raise ValueError(
          'Invalid number of components n_components=%d with X of shape %s and Y of shape %s.'
           % (self.n_components, str(X.shape), str(Y.shape)))
    

datasets/kddcup99.py

  • Line 370, col. 12 in _fetch_brute_kddcup99():

      raise IOError('Data not found and `download_if_missing` is False')
    
  • Line 389, col. 12 in _mkdirp():

      raise
    

datasets/olivetti_faces.py

  • Line 115, col. 12 in fetch_olivetti_faces():

      raise IOError('Data not found and `download_if_missing` is False')
    

datasets/svmlight_format.py

  • Line 154, col. 8 in _gen_open():

      raise TypeError('expected {str, int, file-like}, got %s' % type(f))
    
  • Line 285, col. 8 in load_svmlight_files():

      raise ValueError('n_features is required when offset or length is specified.')
    
  • Line 303, col. 8 in load_svmlight_files():

      raise ValueError(
          'n_features was set to {}, but input file contains {} features'.format(
          n_features, n_f))
    
  • Line 435, col. 12 in dump_svmlight_file():

      raise ValueError('comment string contains NUL byte')
    
  • Line 440, col. 12 in dump_svmlight_file():

      raise ValueError('expected y of shape (n_samples, 1), got %r' % (yval.shape,))
    
  • Line 444, col. 12 in dump_svmlight_file():

      raise ValueError('expected y of shape (n_samples,), got %r' % (yval.shape,))
    
  • Line 449, col. 8 in dump_svmlight_file():

      raise ValueError(
          'X.shape[0] and y.shape[0] should be the same, got %r and %r instead.' %
          (Xval.shape[0], yval.shape[0]))
    
  • Line 472, col. 12 in dump_svmlight_file():

      raise ValueError('expected query_id of shape (n_samples,), got %r' % (
          query_id.shape,))
    

datasets/samples_generator.py

  • Line 160, col. 8 in make_classification():

      raise ValueError(
          'Number of informative, redundant and repeated features must sum to less than the number of total features'
          )
    
  • Line 164, col. 8 in make_classification():

      raise ValueError(
          'n_classes * n_clusters_per_class must be smaller or equal 2 ** n_informative'
          )
    
  • Line 167, col. 8 in make_classification():

      raise ValueError('Weights specified but incompatible with number of classes.')
    
  • Line 401, col. 8 in make_multilabel_classification():

      raise ValueError("return_indicator must be either 'sparse', 'dense' or False.")
    
  • Line 617, col. 8 in make_circles():

      raise ValueError("'factor' has to be between 0 and 1.")
    
  • Line 792, col. 12 in make_blobs():

      raise ValueError('Parameter `centers` must be array-like. Got {!r} instead'
          .format(centers))
    
  • Line 795, col. 12 in make_blobs():

      raise ValueError(
          'Length of `n_samples` not consistent with number of centers. Got n_samples = {} and centers = {}'
          .format(n_samples, centers))
    
  • Line 805, col. 8 in make_blobs():

      raise ValueError(
          'Length of `clusters_std` not consistent with number of centers. Got centers = {} and cluster_std = {}'
          .format(centers, cluster_std))
    
  • Line 892, col. 8 in make_friedman1():

      raise ValueError('n_features must be at least five.')
    
  • Line 1472, col. 8 in make_gaussian_quantiles():

      raise ValueError('n_samples must be at least n_classes')
    

datasets/mlcomp.py

  • Line 69, col. 12 in load_mlcomp():

      raise ValueError('MLCOMP_DATASETS_HOME env variable is undefined')
    
  • Line 76, col. 8 in load_mlcomp():

      raise ValueError('Could not find folder: ' + mlcomp_root)
    
  • Line 96, col. 12 in load_mlcomp():

      raise ValueError('Could not find dataset with metadata line: ' +
          expected_name_line)
    
  • Line 103, col. 8 in load_mlcomp():

      raise ValueError(dataset_path + ' is not a valid MLComp dataset')
    
  • Line 113, col. 8 in load_mlcomp():

      raise ValueError('No loader implemented for format: ' + format)
    

datasets/covtype.py

  • Line 116, col. 8 in fetch_covtype():

      raise IOError('Data not found and `download_if_missing` is False')
    

datasets/tests/test_california_housing.py

  • Line 20, col. 8 in test_fetch():

      raise SkipTest('California housing dataset can not be loaded.')
    

datasets/tests/test_common.py

datasets/tests/test_lfw.py

  • Line 47, col. 8 in setup_module():

      raise SkipTest('PIL not installed.')
    
  • Line 70, col. 16 in setup_module():

      raise SkipTest('PIL not installed')
    

datasets/tests/test_mldata.py

datasets/tests/test_rcv1.py

  • Line 24, col. 12 in test_fetch_rcv1():

      raise SkipTest('Download RCV1 dataset to run this test.')
    

datasets/tests/test_kddcup99.py

  • Line 19, col. 8 in test_percent10():

      raise SkipTest('kddcup99 dataset can not be loaded.')
    
  • Line 53, col. 8 in test_shuffle():

      raise SkipTest('kddcup99 dataset can not be loaded.')
    

datasets/tests/__init__.py

datasets/tests/test_covtype.py

  • Line 20, col. 8 in test_fetch():

      raise SkipTest('Covertype dataset can not be loaded.')
    

datasets/tests/test_svmlight_format.py

datasets/tests/test_20news.py

  • Line 19, col. 8 in test_20news():

      raise SkipTest('Download 20 newsgroups to run this test')
    
  • Line 53, col. 8 in test_20news_length_consistency():

      raise SkipTest('Download 20 newsgroups to run this test')
    
  • Line 66, col. 8 in test_20news_vectorized():

      raise SkipTest('Download 20 newsgroups to run this test')
    

datasets/tests/test_samples_generator.py

datasets/tests/test_base.py

  • Line 131, col. 8 in test_load_sample_images():

      warnings.warn('Could not load sample images, PIL is not available.')
    
  • Line 155, col. 8 in test_load_sample_image():

      warnings.warn('Could not load sample images, PIL is not available.')
    
  • Line 163, col. 8 in test_load_missing_sample_image_error():

      warnings.warn('Could not load sample images, PIL is not available.')
    

datasets/lfw.py

  • Line 109, col. 16 in check_fetch_lfw():

      raise IOError('%s is missing' % target_filepath)
    
  • Line 126, col. 16 in check_fetch_lfw():

      raise IOError('%s is missing' % archive_path)
    
  • Line 175, col. 12 in _load_imgs():

      raise RuntimeError(
          'Failed to read the image file %s, Please make sure that libjpeg is installed'
           % file_path)
    
  • Line 219, col. 8 in _fetch_lfw_people():

      raise ValueError('min_faces_per_person=%d is too restrictive' %
          min_faces_per_person)
    
  • Line 385, col. 12 in _fetch_lfw_pairs():

      raise ValueError('invalid line %d: %r' % (i + 1, components))
    
  • Line 507, col. 8 in fetch_lfw_pairs():

      raise ValueError("subset='%s' is invalid: should be one of %r" % (subset,
          list(sorted(label_filenames.keys()))))
    

datasets/__init__.py

datasets/rcv1.py

  • Line 262, col. 8 in fetch_rcv1():

      raise ValueError(
          "Unknown subset parameter. Got '%s' instead of one of ('all', 'train', test')"
           % subset)
    

datasets/twenty_newsgroups.py

  • Line 219, col. 12 in fetch_20newsgroups():

      raise IOError('20Newsgroups dataset not found')
    
  • Line 237, col. 8 in fetch_20newsgroups():

      raise ValueError("subset can only be 'train', 'test' or 'all', got '%s'" %
          subset)
    
  • Line 381, col. 8 in fetch_20newsgroups_vectorized():

      raise ValueError(
          "%r is not a valid subset: should be one of ['train', 'test', 'all']" %
          subset)
    

datasets/setup.py

datasets/mldata.py

  • Line 158, col. 12 in fetch_mldata():

      raise
    
  • Line 165, col. 12 in fetch_mldata():

      raise
    

datasets/species_distributions.py

  • Line 239, col. 12 in fetch_species_distributions():

      raise IOError('Data not found and `download_if_missing` is False')
    

datasets/california_housing.py

  • Line 108, col. 12 in fetch_california_housing():

      raise IOError('Data not found and `download_if_missing` is False')
    

datasets/base.py

  • Line 833, col. 8 in load_sample_image():

      raise AttributeError('Cannot find sample image: %s' % image_name)
    
  • Line 906, col. 8 in _fetch_remote():

      raise IOError(
          '{} has an SHA256 checksum ({}) differing from expected ({}), file may be corrupted.'
          .format(file_path, checksum, remote.checksum))
    

decomposition/dict_learning.py

  • Line 105, col. 8 in _sparse_encode():

      raise ValueError(
          'Dictionary and X have different numbers of features:dictionary.shape: {} X.shape{}'
          .format(dictionary.shape, X.shape))
    
  • Line 168, col. 12 in _sparse_encode():

      raise ValueError('Positive constraint not supported for "omp" coding method.')
    
  • Line 176, col. 8 in _sparse_encode():

      raise ValueError(
          'Sparse coding method must be "lasso_lars" "lasso_cd",  "lasso", "threshold" or "omp", got %s.'
           % algorithm)
    
  • Line 518, col. 8 in dict_learning():

      raise ValueError('Coding method %r not supported as a fit algorithm.' % method)
    
  • Line 729, col. 8 in dict_learning_online():

      raise ValueError('Coding method not supported as a fit algorithm.')
    

decomposition/factor_analysis.py

  • Line 136, col. 12 in FactorAnalysis():

      raise ValueError(
          'SVD method %s is not supported. Please consider the documentation' %
          svd_method)
    
  • Line 176, col. 16 in FactorAnalysis():

      raise ValueError(
          'noise_variance_init dimension does not with number of features : %d != %d'
           % (len(self.noise_variance_init), n_features))
    
  • Line 201, col. 12 in FactorAnalysis():

      raise ValueError(
          'SVD method %s is not supported. Please consider the documentation' %
          self.svd_method)
    
  • Line 225, col. 12 in FactorAnalysis():

      warnings.warn('FactorAnalysis did not converge.' + ' You might want' +
          ' to increase the number of iterations.', ConvergenceWarning)
    

decomposition/kernel_pca.py

  • Line 136, col. 12 in KernelPCA():

      raise ValueError('Cannot fit_inverse_transform with a precomputed kernel.')
    
  • Line 215, col. 12 in KernelPCA():

      raise NotImplementedError(
          'Inverse transform not implemented for sparse matrices!')
    
  • Line 305, col. 12 in KernelPCA():

      raise NotFittedError(
          'The fit_inverse_transform parameter was not set to True when instantiating and hence the inverse transform is not available.'
          )
    

decomposition/online_lda.py

  • Line 294, col. 12 in LatentDirichletAllocation():

      warnings.warn(
          'n_topics has been renamed to n_components in version 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 301, col. 12 in LatentDirichletAllocation():

      raise ValueError("Invalid 'n_components' parameter: %r" % self._n_components)
    
  • Line 305, col. 12 in LatentDirichletAllocation():

      raise ValueError("Invalid 'total_samples' parameter: %r" % self.total_samples)
    
  • Line 309, col. 12 in LatentDirichletAllocation():

      raise ValueError("Invalid 'learning_offset' parameter: %r" % self.
          learning_offset)
    
  • Line 313, col. 12 in LatentDirichletAllocation():

      raise ValueError("Invalid 'learning_method' parameter: %r" % self.
          learning_method)
    
  • Line 495, col. 12 in LatentDirichletAllocation():

      raise ValueError(
          'The provided data has %d dimensions while the model was trained with feature size %d.'
           % (n_features, self.components_.shape[1]))
    
  • Line 596, col. 12 in LatentDirichletAllocation():

      raise NotFittedError(
          "no 'components_' attribute in model. Please fit model first.")
    
  • Line 603, col. 12 in LatentDirichletAllocation():

      raise ValueError(
          'The provided data has %d dimensions while the model was trained with feature size %d.'
           % (n_features, self.components_.shape[1]))
    
  • Line 752, col. 12 in LatentDirichletAllocation():

      raise NotFittedError(
          "no 'components_' attribute in model. Please fit model first.")
    
  • Line 763, col. 16 in LatentDirichletAllocation():

      raise ValueError('Number of samples in X and doc_topic_distr do not match.')
    
  • Line 767, col. 16 in LatentDirichletAllocation():

      raise ValueError('Number of topics does not match.')
    
  • Line 809, col. 12 in LatentDirichletAllocation():

      warnings.warn(
          "Argument 'doc_topic_distr' is deprecated and is being ignored as of 0.19. Support for this argument will be removed in 0.21."
          , DeprecationWarning)
    

decomposition/fastica_.py

  • Line 119, col. 8 in _ica_par():

      warnings.warn(
          'FastICA did not converge. Consider increasing tolerance or the maximum number of iterations.'
          , ConvergenceWarning)
    
  • Line 278, col. 8 in fastica():

      raise ValueError('alpha must be in [1,2]')
    
  • Line 291, col. 8 in fastica():

      raise exc(
          "Unknown function %r; should be one of 'logcosh', 'exp', 'cube' or callable"
           % fun)
    
  • Line 299, col. 8 in fastica():

      warnings.warn('Ignoring n_components with whiten=False.')
    
  • Line 305, col. 8 in fastica():

      warnings.warn('n_components is too large: it will be set to %s' % n_components)
    
  • Line 334, col. 12 in fastica():

      raise ValueError('w_init has invalid shape -- should be %(shape)s' % {
          'shape': (n_components, n_components)})
    
  • Line 348, col. 8 in fastica():

      raise ValueError('Invalid algorithm: must be either `parallel` or `deflation`.'
          )
    
  • Line 459, col. 12 in FastICA():

      raise ValueError('max_iter should be greater than 1, got (max_iter={})'.
          format(max_iter))
    
  • Line 564, col. 12 in FastICA():

      warnings.warn(
          'The parameter y on transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    

decomposition/tests/test_dict_learning.py

  • Line 127, col. 13 in test_dict_learning_lassocd_readonly_data():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 329, col. 12 in test_sparse_encode_positivity():

      raise
    
  • Line 358, col. 11 in test_sparse_encode_error_default_sparsity():

      ignore_warnings(sparse_encode)(X, D, algorithm='omp', n_nonzero_coefs=None)
    

decomposition/tests/test_fastica.py

  • Line 142, col. 4 in test_fastica_nowhiten():

      assert_warns(UserWarning, ica.fit, m)
    
  • Line 168, col. 4 in test_fastica_convergence_fail():

      assert_warns(ConvergenceWarning, ica.fit, m.T)
    
  • Line 252, col. 17 in test_inverse_transform():

      warnings.catch_warnings(record=True)
    

decomposition/tests/test_truncated_svd.py

decomposition/tests/__init__.py

decomposition/tests/test_nmf.py

  • Line 86, col. 1 in test_nmf_fit_nn_output():

      ignore_warnings(category=UserWarning)
    
  • Line 218, col. 4 in test_non_negative_factorization_checking():

      assert_no_warnings(nnmf, A, A, A, np.int64(1))
    
  • Line 321, col. 1 in test_nmf_multiplicative_update_sparse():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 448, col. 1 in test_nmf_decreasing():

      ignore_warnings(category=ConvergenceWarning)
    

decomposition/tests/test_online_lda.py

  • Line 359, col. 4 in test_doc_topic_distr_deprecation():

      assert_warns(DeprecationWarning, lda.perplexity, X, distr1)
    
  • Line 360, col. 4 in test_doc_topic_distr_deprecation():

      assert_warns(DeprecationWarning, lda.perplexity, X, distr2)
    
  • Line 423, col. 4 in test_lda_n_topics_deprecation():

      assert_warns(DeprecationWarning, lda.fit, X)
    

decomposition/tests/test_kernel_pca.py

decomposition/tests/test_sparse_pca.py

  • Line 76, col. 4 in test_fit_transform():

      assert_warns_message(DeprecationWarning, warning_msg, spca_lars.transform,
          Y, ridge_alpha=0.01)
    
  • Line 78, col. 4 in test_fit_transform():

      assert_warns_message(DeprecationWarning, warning_msg, spca_lars.transform,
          Y, ridge_alpha=None)
    
  • Line 145, col. 4 in test_mini_batch_fit_transform():

      raise SkipTest('skipping mini_batch_fit_transform.')
    

decomposition/tests/test_factor_analysis.py

  • Line 75, col. 4 in test_factor_analysis():

      assert_warns(ConvergenceWarning, fa1.fit, X)
    

decomposition/tests/test_incremental_pca.py

decomposition/tests/test_pca.py

  • Line 145, col. 4 in test_no_empty_slice_warning():

      assert_no_warnings(pca.fit, X)
    

decomposition/incremental_pca.py

  • Line 220, col. 12 in IncrementalPCA():

      raise ValueError(
          'n_components=%r invalid for n_features=%d, need more rows than columns for IncrementalPCA processing'
           % (self.n_components, n_features))
    
  • Line 224, col. 12 in IncrementalPCA():

      raise ValueError(
          'n_components=%r must be less or equal to the batch number of samples %d.'
           % (self.n_components, n_samples))
    
  • Line 232, col. 12 in IncrementalPCA():

      raise ValueError(
          'Number of input features has changed from %i to %i between calls to partial_fit! Try setting n_components to a fixed value.'
           % (self.components_.shape[0], self.n_components_))
    

decomposition/__init__.py

decomposition/sparse_pca.py

  • Line 173, col. 12 in SparsePCA():

      warnings.warn(
          'The ridge_alpha parameter on transform() is deprecated since 0.19 and will be removed in 0.21. Specify ridge_alpha in the SparsePCA constructor.'
          , DeprecationWarning)
    

decomposition/truncated_svd.py

  • Line 173, col. 16 in TruncatedSVD():

      raise ValueError('n_components must be < n_features; got %d >= %d' % (k,
          n_features))
    
  • Line 179, col. 12 in TruncatedSVD():

      raise ValueError('unknown algorithm %r' % self.algorithm)
    

decomposition/setup.py

decomposition/pca.py

  • Line 60, col. 8 in _assess_dimension_():

      raise ValueError('The tested rank cannot exceed the rank of the dataset')
    
  • Line 377, col. 12 in PCA():

      raise TypeError(
          'PCA does not support sparse input. See TruncatedSVD for a possible alternative.'
          )
    
  • Line 410, col. 12 in PCA():

      raise ValueError("Unrecognized svd_solver='{0}'".format(self._fit_svd_solver))
    
  • Line 419, col. 16 in PCA():

      raise ValueError(
          "n_components='mle' is only supported if n_samples >= n_features")
    
  • Line 422, col. 12 in PCA():

      raise ValueError(
          "n_components=%r must be between 0 and min(n_samples, n_features)=%r with svd_solver='full'"
           % (n_components, min(n_samples, n_features)))
    
  • Line 428, col. 16 in PCA():

      raise ValueError(
          'n_components=%r must be of type int when greater than or equal to 1, was of type=%r'
           % (n_components, type(n_components)))
    
  • Line 483, col. 12 in PCA():

      raise ValueError("n_components=%r cannot be a string with svd_solver='%s'" %
          (n_components, svd_solver))
    
  • Line 487, col. 12 in PCA():

      raise ValueError(
          "n_components=%r must be between 1 and min(n_samples, n_features)=%r with svd_solver='%s'"
           % (n_components, min(n_samples, n_features), svd_solver))
    
  • Line 493, col. 12 in PCA():

      raise ValueError(
          'n_components=%r must be of type int when greater than or equal to 1, was of type=%r'
           % (n_components, type(n_components)))
    
  • Line 498, col. 12 in PCA():

      raise ValueError(
          "n_components=%r must be strictly less than min(n_samples, n_features)=%r with svd_solver='%s'"
           % (n_components, min(n_samples, n_features), svd_solver))
    

decomposition/nmf.py

  • Line 62, col. 8 in _check_init():

      raise ValueError(
          'Array with wrong shape passed to %s. Expected %s, but got %s ' % (whom,
          shape, np.shape(A)))
    
  • Line 66, col. 8 in _check_init():

      raise ValueError('Array passed to %s is full of zeros.' % whom)
    
  • Line 205, col. 8 in _check_string_param():

      raise ValueError('Invalid solver parameter: got %r instead of one of %r' %
          (solver, allowed_solver))
    
  • Line 211, col. 8 in _check_string_param():

      raise ValueError(
          'Invalid regularization parameter: got %r instead of one of %r' % (
          regularization, allowed_regularization))
    
  • Line 217, col. 8 in _check_string_param():

      raise ValueError(
          'Invalid beta_loss parameter: solver %r does not handle beta_loss = %r' %
          (solver, beta_loss))
    
  • Line 222, col. 8 in _check_string_param():

      warnings.warn(
          "The multiplicative update ('mu') solver cannot update zeros present in the initialization, and so leads to poorer results when used jointly with init='nndsvd'. You may try init='nndsvda' or init='nndsvdar' instead."
          , UserWarning)
    
  • Line 241, col. 8 in _beta_loss_to_float():

      raise ValueError(
          'Invalid beta_loss parameter: got %r instead of one of %r, or a float.' %
          (beta_loss, allowed_beta_loss.keys()))
    
  • Line 378, col. 8 in _initialize_nmf():

      raise ValueError('Invalid init parameter: got %r instead of one of %r' % (
          init, (None, 'random', 'nndsvd', 'nndsvda', 'nndsvdar')))
    
  • Line 994, col. 8 in non_negative_factorization():

      raise ValueError(
          'When beta_loss <= 0 and X contains zeros, the solver may diverge. Please add small values to X, or use a positive beta_loss.'
          )
    
  • Line 1003, col. 8 in non_negative_factorization():

      raise ValueError(
          'Number of components must be a positive integer; got (n_components=%r)' %
          n_components)
    
  • Line 1006, col. 8 in non_negative_factorization():

      raise ValueError(
          'Maximum number of iterations must be a positive integer; got (max_iter=%r)'
           % max_iter)
    
  • Line 1009, col. 8 in non_negative_factorization():

      raise ValueError(
          'Tolerance for stopping criteria must be positive; got (tol=%r)' % tol)
    
  • Line 1046, col. 8 in non_negative_factorization():

      raise ValueError("Invalid solver parameter '%s'." % solver)
    
  • Line 1049, col. 8 in non_negative_factorization():

      warnings.warn(
          'Maximum number of iteration %d reached. Increase it to improve convergence.'
           % max_iter, ConvergenceWarning)
    

decomposition/base.py

discriminant_analysis.py

  • Line 63, col. 12 in _cov():

      raise ValueError('unknown shrinkage parameter')
    
  • Line 66, col. 12 in _cov():

      raise ValueError('shrinkage parameter must be between 0 and 1')
    
  • Line 69, col. 8 in _cov():

      raise TypeError('shrinkage must be of string or int type')
    
  • Line 388, col. 12 in LinearDiscriminantAnalysis():

      warnings.warn('Variables are collinear.')
    
  • Line 439, col. 12 in LinearDiscriminantAnalysis():

      raise ValueError('priors must be non-negative')
    
  • Line 441, col. 12 in LinearDiscriminantAnalysis():

      warnings.warn('The priors do not sum to 1. Renormalizing', UserWarning)
    
  • Line 454, col. 16 in LinearDiscriminantAnalysis():

      raise NotImplementedError('shrinkage not supported')
    
  • Line 461, col. 12 in LinearDiscriminantAnalysis():

      raise ValueError(
          "unknown solver {} (valid solvers are 'svd', 'lsqr', and 'eigen').".
          format(self.solver))
    
  • Line 483, col. 12 in LinearDiscriminantAnalysis():

      raise NotImplementedError(
          "transform not implemented for 'lsqr' solver (use 'svd' or 'eigen').")
    
  • Line 656, col. 12 in QuadraticDiscriminantAnalysis():

      raise ValueError(
          'The number of classes has to be greater than one; got %d class' %
          n_classes)
    
  • Line 666, col. 12 in QuadraticDiscriminantAnalysis():

      warnings.warn(
          "'store_covariances' was renamed to store_covariance in version 0.19 and will be removed in 0.21."
          , DeprecationWarning)
    
  • Line 679, col. 16 in QuadraticDiscriminantAnalysis():

      raise ValueError(
          'y has only 1 sample in class %s, covariance is ill defined.' % str(
          self.classes_[ind]))
    
  • Line 686, col. 16 in QuadraticDiscriminantAnalysis():

      warnings.warn('Variables are collinear')
    

dummy.py

  • Line 110, col. 12 in DummyClassifier():

      raise ValueError('Unknown strategy type.')
    
  • Line 114, col. 12 in DummyClassifier():

      warnings.warn(
          'A local copy of the target data has been converted to a numpy array. Predicting on sparse target data with the uniform strategy would not save memory and would be slower.'
          , UserWarning)
    
  • Line 135, col. 16 in DummyClassifier():

      raise ValueError(
          'Constant target value has to be specified when the constant strategy is used.'
          )
    
  • Line 140, col. 20 in DummyClassifier():

      raise ValueError('Constant target value should have shape (%d, 1).' % self.
          n_outputs_)
    
  • Line 152, col. 12 in DummyClassifier():

      raise ValueError('The constant target value must be present in training data')
    
  • Line 207, col. 16 in DummyClassifier():

      raise ValueError(
          'Sparse target prediction is not supported with the uniform strategy')
    
  • Line 390, col. 12 in DummyRegressor():

      raise ValueError(
          "Unknown strategy type: %s, expected 'mean', 'median', 'quantile' or 'constant'"
           % self.strategy)
    
  • Line 396, col. 12 in DummyRegressor():

      raise ValueError('y must not be empty.')
    
  • Line 418, col. 16 in DummyRegressor():

      raise ValueError(
          'Quantile must be a scalar in the range [0.0, 1.0], but got %s.' % self
          .quantile)
    
  • Line 431, col. 16 in DummyRegressor():

      raise TypeError(
          'Constant target value has to be specified when the constant strategy is used.'
          )
    
  • Line 439, col. 16 in DummyRegressor():

      raise ValueError('Constant target value should have shape (%d, 1).' % y.
          shape[1])
    

ensemble/bagging.py

  • Line 75, col. 8 in _parallel_build_estimators():

      raise ValueError("The base estimator doesn't support sample weight")
    
  • Line 306, col. 12 in BaseBagging():

      raise ValueError('max_samples must be in (0, n_samples]')
    
  • Line 318, col. 12 in BaseBagging():

      raise ValueError('max_features must be in (0, n_features]')
    
  • Line 325, col. 12 in BaseBagging():

      raise ValueError('Out of bag estimation only available if bootstrap=True')
    
  • Line 329, col. 12 in BaseBagging():

      raise ValueError('Out of bag estimate only available if warm_start=False')
    
  • Line 343, col. 12 in BaseBagging():

      raise ValueError(
          'n_estimators=%d must be larger or equal to len(estimators_)=%d when warm_start==True'
           % (self.n_estimators, len(self.estimators_)))
    
  • Line 348, col. 12 in BaseBagging():

      warn(
          'Warm-start fitting without increasing n_estimators does not fit new trees.'
          )
    
  • Line 609, col. 12 in BaggingClassifier():

      warn(
          'Some inputs do not have OOB scores. This probably means too few estimators were used to compute any reliable oob estimates.'
          )
    
  • Line 680, col. 12 in BaggingClassifier():

      raise ValueError(
          'Number of features of the model must match the input. Model n_features is {0} and input n_features is {1}.'
          .format(self.n_features_, X.shape[1]))
    
  • Line 730, col. 16 in BaggingClassifier():

      raise ValueError(
          'Number of features of the model must match the input. Model n_features is {0} and input n_features is {1} '
          .format(self.n_features_, X.shape[1]))
    
  • Line 788, col. 12 in BaggingClassifier():

      raise ValueError(
          'Number of features of the model must match the input. Model n_features is {0} and input n_features is {1} '
          .format(self.n_features_, X.shape[1]))
    
  • Line 1005, col. 12 in BaggingRegressor():

      warn(
          'Some inputs do not have OOB scores. This probably means too few estimators were used to compute any reliable oob estimates.'
          )
    

ensemble/gradient_boosting.py

  • Line 70, col. 12 in QuantileEstimator():

      raise ValueError('`alpha` must be in (0, 1.0) but was %r' % alpha)
    
  • Line 118, col. 12 in LogOddsEstimator():

      raise ValueError('y contains non binary labels.')
    
  • Line 191, col. 8 in LossFunction():

      raise NotImplementedError()
    
  • Line 267, col. 12 in RegressionLossFunction():

      raise ValueError('``n_classes`` must be 1 for regression but was %r' %
          n_classes)
    
  • Line 453, col. 8 in ClassificationLossFunction():

      raise TypeError('%s does not support predict_proba' % type(self).__name__)
    
  • Line 471, col. 12 in BinomialDeviance():

      raise ValueError('{0:s} requires 2 classes; got {1:d} class(es)'.format(
          self.__class__.__name__, n_classes))
    
  • Line 539, col. 12 in MultinomialDeviance():

      raise ValueError('{0:s} requires more than 2 classes.'.format(self.
          __class__.__name__))
    
  • Line 604, col. 12 in ExponentialLoss():

      raise ValueError('{0:s} requires 2 classes; got {1:d} class(es)'.format(
          self.__class__.__name__, n_classes))
    
  • Line 813, col. 12 in BaseGradientBoosting():

      raise ValueError('n_estimators must be greater than 0 but was %r' % self.
          n_estimators)
    
  • Line 817, col. 12 in BaseGradientBoosting():

      raise ValueError('learning_rate must be greater than 0 but was %r' % self.
          learning_rate)
    
  • Line 822, col. 12 in BaseGradientBoosting():

      raise ValueError("Loss '{0:s}' not supported. ".format(self.loss))
    
  • Line 837, col. 12 in BaseGradientBoosting():

      raise ValueError('subsample must be in (0,1] but was %r' % self.subsample)
    
  • Line 843, col. 20 in BaseGradientBoosting():

      raise ValueError('init="%s" is not supported' % self.init)
    
  • Line 847, col. 20 in BaseGradientBoosting():

      raise ValueError(
          'init=%r must be valid BaseEstimator and support both fit and predict' %
          self.init)
    
  • Line 852, col. 12 in BaseGradientBoosting():

      raise ValueError('alpha must be in (0.0, 1.0) but was %r' % self.alpha)
    
  • Line 868, col. 16 in BaseGradientBoosting():

      raise ValueError(
          "Invalid value for max_features: %r. Allowed string values are 'auto', 'sqrt' or 'log2'."
           % self.max_features)
    
  • Line 880, col. 16 in BaseGradientBoosting():

      raise ValueError('max_features must be in (0, n_features]')
    
  • Line 886, col. 12 in BaseGradientBoosting():

      raise ValueError(
          'n_iter_no_change should either be None or an integer. %r was passed' %
          self.n_iter_no_change)
    
  • Line 892, col. 12 in BaseGradientBoosting():

      raise ValueError("'presort' should be in {}. Got {!r} instead.".format(
          allowed_presort, self.presort))
    
  • Line 931, col. 12 in BaseGradientBoosting():

      raise ValueError('resize with smaller n_estimators %d < %d' % (
          total_n_estimators, self.estimators_[0]))
    
  • Line 1035, col. 16 in BaseGradientBoosting():

      raise ValueError(
          'n_estimators=%d must be larger or equal to estimators_.shape[0]=%d when warm_start==True'
           % (self.n_estimators, self.estimators_.shape[0]))
    
  • Line 1049, col. 12 in BaseGradientBoosting():

      raise ValueError('Presorting is not supported for sparse matrices.')
    
  • Line 1172, col. 8 in BaseGradientBoosting():

      raise NotImplementedError()
    
  • Line 1179, col. 12 in BaseGradientBoosting():

      raise ValueError('X.shape[1] should be {0:d}, not {1:d}.'.format(self.
          n_features_, X.shape[1]))
    
  • Line 1561, col. 12 in GradientBoostingClassifier():

      raise ValueError(
          'y contains %d class after sample_weight trimmed classes with zero weights, while a minimum of 2 classes are required.'
           % n_trim_classes)
    
  • Line 1683, col. 12 in GradientBoostingClassifier():

      raise
    
  • Line 1685, col. 12 in GradientBoostingClassifier():

      raise AttributeError('loss=%r does not support predict_proba' % self.loss)
    
  • Line 1734, col. 12 in GradientBoostingClassifier():

      raise
    
  • Line 1736, col. 12 in GradientBoostingClassifier():

      raise AttributeError('loss=%r does not support predict_proba' % self.loss)
    

ensemble/tests/test_partial_dependence.py

ensemble/tests/test_forest.py

  • Line 390, col. 8 in check_oob_score():

      assert_warns(UserWarning, est.fit, X, y)
    
  • Line 927, col. 9 in test_1d_input():

      ignore_warnings()
    
  • Line 1017, col. 4 in check_class_weight_errors():

      assert_warns(UserWarning, clf.fit, X, y)
    
  • Line 1018, col. 4 in check_class_weight_errors():

      assert_warns(UserWarning, clf.fit, X, _y)
    
  • Line 1118, col. 4 in check_warm_start_equal_n_estimators():

      assert_warns(UserWarning, clf_2.fit, X, y)
    
  • Line 1156, col. 4 in check_warm_start_oob():

      ignore_warnings(clf_3.fit)(X, y)
    
  • Line 1213, col. 14 in test_min_impurity_split():

      assert_warns_message(DeprecationWarning, 'min_impurity_decrease', est.fit, X, y
          )
    

ensemble/tests/test_bagging.py

  • Line 328, col. 8 in test_oob_score_classification():

      assert_warns(UserWarning, BaggingClassifier(base_estimator=base_estimator,
          n_estimators=1, bootstrap=True, oob_score=True, random_state=rng).fit,
          X_train, y_train)
    
  • Line 357, col. 4 in test_oob_score_regression():

      assert_warns(UserWarning, BaggingRegressor(base_estimator=
          DecisionTreeRegressor(), n_estimators=1, bootstrap=True, oob_score=True,
          random_state=rng).fit, X_train, y_train)
    
  • Line 637, col. 4 in test_warm_start_equal_n_estimators():

      assert_warns_message(UserWarning,
          'Warm-start fitting without increasing n_estimators does not', clf.fit,
          X_train, y_train)
    

ensemble/tests/__init__.py

ensemble/tests/test_gradient_boosting_loss_functions.py

ensemble/tests/test_weight_boosting.py

ensemble/tests/test_gradient_boosting.py

  • Line 580, col. 13 in test_staged_functions_defensive():

      warnings.catch_warnings(record=True)
    
  • Line 670, col. 4 in test_shape_y():

      assert_warns(DataConversionWarning, clf.fit, X, y_)
    
  • Line 1120, col. 10 in test_min_impurity_split():

      assert_warns_message(DeprecationWarning, 'min_impurity_decrease', est.fit, X, y
          )
    

ensemble/tests/test_iforest.py

  • Line 59, col. 9 in test_iforest():

      ignore_warnings()
    
  • Line 106, col. 4 in test_iforest_error():

      assert_warns_message(UserWarning,
          'max_samples will be set to n_samples for estimation', IsolationForest(
          max_samples=1000).fit, X)
    
  • Line 112, col. 9 in test_iforest_error():

      pytest.warns(None)
    
  • Line 117, col. 9 in test_iforest_error():

      pytest.warns(None)
    
  • Line 144, col. 4 in test_max_samples_attribute():

      assert_warns_message(UserWarning,
          'max_samples will be set to n_samples for estimation', clf.fit, X)
    
  • Line 260, col. 4 in test_deprecation():

      assert_warns_message(DeprecationWarning,
          'default contamination parameter 0.1 will change in version 0.22 to "auto"'
          , IsolationForest)
    
  • Line 266, col. 4 in test_deprecation():

      assert_warns_message(DeprecationWarning,
          'threshold_ attribute is deprecated in 0.20 and will be removed in 0.22.',
          getattr, clf, 'threshold_')
    

ensemble/tests/test_base.py

ensemble/tests/test_voting_classifier.py

  • Line 193, col. 8 in test_predict_proba_on_toy_problem():

      raise AssertionError(
          'AttributeError for voting == "hard" and with predict_proba not raised')
    
  • Line 420, col. 10 in test_transform():

      assert_warns_message(DeprecationWarning, warn_msg, eclf1.transform, X)
    

ensemble/voting_classifier.py

  • Line 158, col. 12 in VotingClassifier():

      raise NotImplementedError(
          'Multilabel and multi-output classification is not supported.')
    
  • Line 162, col. 12 in VotingClassifier():

      raise ValueError("Voting must be 'soft' or 'hard'; got (voting=%r)" % self.
          voting)
    
  • Line 166, col. 12 in VotingClassifier():

      raise AttributeError(
          'Invalid `estimators` attribute, `estimators` should be a list of (string, estimator) tuples'
          )
    
  • Line 172, col. 12 in VotingClassifier():

      raise ValueError(
          'Number of classifiers and weights must be equal; got %d weights, %d estimators'
           % (len(self.weights), len(self.estimators)))
    
  • Line 179, col. 20 in VotingClassifier():

      raise ValueError(
          "Underlying estimator '%s' does not support sample weights." % name)
    
  • Line 186, col. 12 in VotingClassifier():

      raise ValueError(
          'All estimators are None. At least one is required to be a classifier!')
    
  • Line 250, col. 12 in VotingClassifier():

      raise AttributeError('predict_proba is not available when voting=%r' % self
          .voting)
    
  • Line 301, col. 16 in VotingClassifier():

      warnings.warn(
          "'flatten_transform' default value will be changed to True in 0.21. To silence this warning you may explicitly set flatten_transform=False."
          , DeprecationWarning)
    

ensemble/weight_boosting.py

  • Line 98, col. 12 in BaseWeightBoosting():

      raise ValueError('learning_rate must be greater than zero')
    
  • Line 123, col. 16 in BaseWeightBoosting():

      raise ValueError(
          'Attempting to fit with a non-positive weighted number of samples.')
    
  • Line 247, col. 12 in BaseWeightBoosting():

      raise ValueError(
          'Estimator not fitted, call `fit` before `feature_importances_`.')
    
  • Line 257, col. 12 in BaseWeightBoosting():

      raise AttributeError(
          'Unable to compute feature importances since base_estimator does not have a feature_importances_ attribute'
          )
    
  • Line 409, col. 12 in AdaBoostClassifier():

      raise ValueError('algorithm %s is not supported' % self.algorithm)
    
  • Line 422, col. 16 in AdaBoostClassifier():

      raise TypeError(
          """AdaBoostClassifier with algorithm='SAMME.R' requires that the weak learner supports the calculation of class probabilities with a predict_proba method.
      Please change the base estimator or set algorithm='SAMME' instead."""
          )
    
  • Line 429, col. 12 in AdaBoostClassifier():

      raise ValueError("%s doesn't support sample_weight." % self.base_estimator_
          .__class__.__name__)
    
  • Line 565, col. 16 in AdaBoostClassifier():

      raise ValueError(
          'BaseClassifier in AdaBoostClassifier ensemble is worse than random, ensemble can not be fit.'
          )
    
  • Line 956, col. 12 in AdaBoostRegressor():

      raise ValueError("loss must be 'linear', 'square', or 'exponential'")
    

ensemble/__init__.py

ensemble/setup.py

ensemble/forest.py

  • Line 115, col. 17 in _parallel_build_trees():

      warnings.catch_warnings()
    
  • Line 116, col. 16 in _parallel_build_trees():

      warnings.simplefilter('ignore', DeprecationWarning)
    
  • Line 260, col. 12 in BaseForest():

      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)
    
  • Line 287, col. 12 in BaseForest():

      raise ValueError('Out of bag estimation only available if bootstrap=True')
    
  • Line 299, col. 12 in BaseForest():

      raise ValueError(
          'n_estimators=%d must be larger or equal to len(estimators_)=%d when warm_start==True'
           % (self.n_estimators, len(self.estimators_)))
    
  • Line 304, col. 12 in BaseForest():

      warn(
          'Warm-start fitting without increasing n_estimators does not fit new trees.'
          )
    
  • Line 353, col. 12 in BaseForest():

      raise NotFittedError(
          'Estimator not fitted, call `fit` before exploiting the model.')
    
  • Line 452, col. 16 in ForestClassifier():

      warn(
          'Some inputs do not have OOB scores. This probably means too few trees were used to compute any reliable oob estimates.'
          )
    
  • Line 492, col. 20 in ForestClassifier():

      raise ValueError(
          'Valid presets for class_weight include "balanced" and "balanced_subsample". Given "%s".'
           % self.class_weight)
    
  • Line 496, col. 20 in ForestClassifier():

      warn(
          'class_weight presets "balanced" or "balanced_subsample" are not recommended for warm_start if the fitted data differs from the full dataset. In order to use "balanced" weights, use compute_class_weight("balanced", classes, y). In place of y you can use a large enough sample of the full training set target to properly estimate the class frequency distributions. Pass the resulting weights as the class_weight parameter.'
          )
    
  • Line 723, col. 12 in ForestRegressor():

      warn(
          'Some inputs do not have OOB scores. This probably means too few trees were used to compute any reliable oob estimates.'
          )
    
  • Line 1876, col. 8 in RandomTreesEmbedding():

      raise NotImplementedError('OOB score not supported by tree embedding')
    

ensemble/base.py

  • Line 104, col. 12 in BaseEnsemble():

      raise ValueError('n_estimators must be an integer, got {0}.'.format(type(
          self.n_estimators)))
    
  • Line 108, col. 12 in BaseEnsemble():

      raise ValueError('n_estimators must be greater than zero, got {0}.'.format(
          self.n_estimators))
    
  • Line 117, col. 12 in BaseEnsemble():

      raise ValueError('base_estimator cannot be None')
    

ensemble/partial_dependence.py

  • Line 51, col. 8 in _grid_from_X():

      raise ValueError('percentile must be tuple of len 2')
    
  • Line 53, col. 8 in _grid_from_X():

      raise ValueError('percentile values must be in [0, 1]')
    
  • Line 124, col. 8 in partial_dependence():

      raise ValueError('gbrt has to be an instance of BaseGradientBoosting')
    
  • Line 127, col. 8 in partial_dependence():

      raise ValueError('Either grid or X must be specified')
    
  • Line 133, col. 8 in partial_dependence():

      raise ValueError('target_variables must be in [0, %d]' % (gbrt.n_features_ - 1)
          )
    
  • Line 148, col. 12 in partial_dependence():

      raise ValueError('grid must be 2d but is %dd' % grid.ndim)
    
  • Line 246, col. 8 in plot_partial_dependence():

      raise ValueError('gbrt has to be an instance of BaseGradientBoosting')
    
  • Line 252, col. 12 in plot_partial_dependence():

      raise ValueError('label is not given for multi-class PDP')
    
  • Line 255, col. 12 in plot_partial_dependence():

      raise ValueError('label %s not in ``gbrt.classes_``' % str(label))
    
  • Line 262, col. 8 in plot_partial_dependence():

      raise ValueError('X.shape[1] does not match gbrt.n_features_')
    
  • Line 281, col. 16 in plot_partial_dependence():

      raise ValueError('Feature %s not in feature_names' % fx)
    
  • Line 292, col. 12 in plot_partial_dependence():

      raise ValueError('features must be either int, str, or tuple of int/str')
    
  • Line 295, col. 12 in plot_partial_dependence():

      raise ValueError('target features must be either one or two')
    
  • Line 310, col. 8 in plot_partial_dependence():

      raise ValueError(
          'All entries of features must be less than len(feature_names) = {0}, got {1}.'
          .format(len(feature_names), i))
    

ensemble/iforest.py

  • Line 155, col. 12 in IsolationForest():

      warnings.warn(
          'default contamination parameter 0.1 will change in version 0.22 to "auto". This will change the predict method behavior.'
          , DeprecationWarning)
    
  • Line 162, col. 8 in IsolationForest():

      raise NotImplementedError('OOB score not supported by iforest')
    
  • Line 197, col. 16 in IsolationForest():

      raise ValueError(
          'max_samples (%s) is not supported.Valid choices are: "auto", int orfloat'
           % self.max_samples)
    
  • Line 203, col. 16 in IsolationForest():

      warn(
          'max_samples (%s) is greater than the total number of samples (%s). max_samples will be set to n_samples for estimation.'
           % (self.max_samples, n_samples))
    
  • Line 212, col. 16 in IsolationForest():

      raise ValueError('max_samples must be in (0, 1], got %r' % self.max_samples)
    
  • Line 321, col. 12 in IsolationForest():

      raise ValueError(
          'Number of features of the model must match the input. Model n_features is {0} and input n_features is {1}.'
          .format(self.n_features_, X.shape[1]))
    
  • Line 358, col. 8 in IsolationForest():

      warnings.warn(
          'threshold_ attribute is deprecated in 0.20 and will be removed in 0.22.',
          DeprecationWarning)
    

exceptions.py

feature_extraction/tests/test_dict_vectorizer.py

feature_extraction/tests/test_image.py

feature_extraction/tests/__init__.py

feature_extraction/tests/test_text.py

  • Line 366, col. 4 in test_tfidf_no_smoothing():

      clean_warning_registry()
    
  • Line 367, col. 9 in test_tfidf_no_smoothing():

      warnings.catch_warnings(record=True)
    
  • Line 372, col. 12 in test_tfidf_no_smoothing():

      assert_warns_message(RuntimeWarning, in_warning_message, tr.fit_transform, X
          ).toarray()
    
  • Line 375, col. 8 in test_tfidf_no_smoothing():

      raise SkipTest(u'Numpy does not provide div 0 warnings.')
    
  • Line 505, col. 1 in test_hashing_vectorizer():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 687, col. 1 in test_hashed_binary_occurrences():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 822, col. 1 in test_vectorizer_unicode():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1076, col. 9 in test_tfidf_vectorizer_type():

      pytest.warns(expected_warning_cls, match=warning_msg_match)
    

feature_extraction/tests/test_feature_hasher.py

  • Line 23, col. 1 in test_feature_hasher_strings():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 113, col. 1 in test_hasher_alternate_sign():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 135, col. 1 in test_hash_collisions():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 154, col. 1 in test_hasher_negative():

      ignore_warnings(category=DeprecationWarning)
    

feature_extraction/__init__.py

feature_extraction/dict_vectorizer.py

  • Line 184, col. 12 in DictVectorizer():

      raise ValueError('Sample sequence X is empty.')
    

feature_extraction/setup.py

feature_extraction/text.py

  • Line 108, col. 8 in _check_stop_list():

      raise ValueError(u'not a built-in stop list: %s' % stop)
    
  • Line 141, col. 12 in VectorizerMixin():

      raise ValueError(
          u'np.nan is an invalid document, expected byte or unicode string.')
    
  • Line 250, col. 12 in VectorizerMixin():

      raise ValueError(u'Invalid value for "strip_accents": %s' % self.strip_accents)
    
  • Line 291, col. 12 in VectorizerMixin():

      raise ValueError(u'%s is not a valid tokenization scheme/analyzer' % self.
          analyzer)
    
  • Line 304, col. 24 in VectorizerMixin():

      raise ValueError(msg)
    
  • Line 309, col. 20 in VectorizerMixin():

      raise ValueError(u'Vocabulary contains repeated indices.')
    
  • Line 314, col. 24 in VectorizerMixin():

      raise ValueError(msg)
    
  • Line 316, col. 16 in VectorizerMixin():

      raise ValueError(u'empty vocabulary passed to fit')
    
  • Line 328, col. 12 in VectorizerMixin():

      raise ValueError(u'Vocabulary is empty')
    
  • Line 334, col. 12 in VectorizerMixin():

      raise ValueError(
          u'Invalid value for ngram_range=%s lower boundary larger than the upper boundary.'
           % str(self.ngram_range))
    
  • Line 549, col. 12 in HashingVectorizer():

      raise ValueError(
          u'Iterable over raw text documents expected, string object received.')
    
  • Line 574, col. 12 in HashingVectorizer():

      raise ValueError(
          u'Iterable over raw text documents expected, string object received.')
    
  • Line 812, col. 12 in CountVectorizer():

      raise ValueError(u'negative value for max_df or min_df')
    
  • Line 817, col. 16 in CountVectorizer():

      raise ValueError(u'max_features=%r, neither a positive integer nor None' %
          max_features)
    
  • Line 876, col. 12 in CountVectorizer():

      raise ValueError(
          u'After pruning, no terms remain. Try a lower min_df or a higher max_df.')
    
  • Line 917, col. 16 in CountVectorizer():

      raise ValueError(
          u'empty vocabulary; perhaps the documents only contain stop words')
    
  • Line 924, col. 16 in CountVectorizer():

      raise ValueError(
          u'sparse CSR array has {} non-zero elements and requires 64 bit indexing,  which is unsupported with scipy {}. Please upgrade to scipy >=0.14'
          .format(indptr[-1], u'.'.join(sp_version)))
    
  • Line 977, col. 12 in CountVectorizer():

      raise ValueError(
          u'Iterable over raw text documents expected, string object received.')
    
  • Line 1004, col. 16 in CountVectorizer():

      raise ValueError(u'max_df corresponds to < documents than min_df')
    
  • Line 1032, col. 12 in CountVectorizer():

      raise ValueError(
          u'Iterable over raw text documents expected, string object received.')
    
  • Line 1237, col. 16 in TfidfTransformer():

      raise ValueError(
          u'Input has n_features=%d while the model has been trained with n_features=%d'
           % (n_features, expected_n_features))
    
  • Line 1511, col. 16 in TfidfVectorizer():

      raise ValueError(u'idf length = %d must be equal to vocabulary size = %d' %
          (len(value), len(self.vocabulary)))
    
  • Line 1518, col. 12 in TfidfVectorizer():

      warnings.warn(
          u"Only {} 'dtype' should be used. {} 'dtype' will be converted to np.float64."
          .format(FLOAT_DTYPES, self.dtype), UserWarning)
    

feature_extraction/hashing.py

  • Line 91, col. 12 in FeatureHasher():

      warnings.warn(
          'the option non_negative=True has been deprecated in 0.19 and will be removed in version 0.21.'
          , DeprecationWarning)
    
  • Line 106, col. 12 in FeatureHasher():

      raise TypeError('n_features must be integral, got %r (%s).' % (n_features,
          type(n_features)))
    
  • Line 109, col. 12 in FeatureHasher():

      raise ValueError('Invalid number of features (%d).' % n_features)
    
  • Line 112, col. 12 in FeatureHasher():

      raise ValueError("input_type must be 'dict', 'pair' or 'string', got %r." %
          input_type)
    
  • Line 163, col. 12 in FeatureHasher():

      raise ValueError('Cannot vectorize empty sequence.')
    

feature_extraction/image.py

  • Line 239, col. 12 in _compute_n_patches():

      raise ValueError('Invalid value for max_patches: %r' % max_patches)
    
  • Line 366, col. 8 in extract_patches_2d():

      raise ValueError(
          'Height of the patch should be less than the height of the image.')
    
  • Line 370, col. 8 in extract_patches_2d():

      raise ValueError(
          'Width of the patch should be less than the width of the image.')
    

feature_extraction/stop_words.py

feature_selection/rfe.py

  • Line 161, col. 12 in RFE():

      raise ValueError('Step must be >0')
    
  • Line 187, col. 16 in RFE():

      raise RuntimeError(
          'The classifier does not expose "coef_" or "feature_importances_" attributes'
          )
    
  • Line 425, col. 12 in RFECV():

      raise ValueError('Step must be >0')
    

feature_selection/tests/test_variance_threshold.py

feature_selection/tests/test_rfe.py

  • Line 151, col. 4 in test_rfecv():

      ignore_warnings(rfecv.fit)(X, y)
    

feature_selection/tests/test_from_model.py

feature_selection/tests/__init__.py

feature_selection/tests/test_feature_select.py

  • Line 248, col. 17 in test_select_kbest_zero():

      assert_warns_message(UserWarning, 'No features were selected',
          univariate_filter.transform, X)
    
  • Line 420, col. 13 in test_select_fdr_regression():

      warnings.catch_warnings(record=True)
    
  • Line 482, col. 13 in test_selectkbest_tiebreaking():

      ignore_warnings(sel.fit_transform)([X], y)
    
  • Line 487, col. 13 in test_selectkbest_tiebreaking():

      ignore_warnings(sel.fit_transform)([X], y)
    
  • Line 499, col. 13 in test_selectpercentile_tiebreaking():

      ignore_warnings(sel.fit_transform)([X], y)
    
  • Line 504, col. 13 in test_selectpercentile_tiebreaking():

      ignore_warnings(sel.fit_transform)([X], y)
    
  • Line 562, col. 8 in test_nans():

      ignore_warnings(select.fit)(X, y)
    
  • Line 592, col. 4 in test_f_classif_constant_feature():

      assert_warns(UserWarning, f_classif, X, y)
    
  • Line 611, col. 21 in test_no_feature_selected():

      assert_warns_message(UserWarning, 'No features were selected', selector.
          transform, X)
    

feature_selection/tests/test_chi2.py

  • Line 75, col. 4 in test_chi2_unused_feature():

      clean_warning_registry()
    
  • Line 76, col. 9 in test_chi2_unused_feature():

      warnings.catch_warnings(record=True)
    
  • Line 77, col. 8 in test_chi2_unused_feature():

      warnings.simplefilter('always')
    
  • Line 81, col. 16 in test_chi2_unused_feature():

      raise AssertionError('Found unexpected warning %s' % w)
    

feature_selection/tests/test_base.py

feature_selection/tests/test_mutual_info.py

feature_selection/__init__.py

feature_selection/variance_threshold.py

  • Line 75, col. 12 in VarianceThreshold():

      raise ValueError(msg.format(self.threshold))
    

feature_selection/univariate_selection.py

  • Line 112, col. 8 in f_oneway():

      warnings.warn('Features %s are constant.' % constant_features_idx, UserWarning)
    
  • Line 215, col. 8 in chi2():

      raise ValueError('Input X must be non-negative.')
    
  • Line 343, col. 12 in _BaseFilter():

      raise TypeError(
          'The score function should be a callable, %s (%s) was passed.' % (self.
          score_func, type(self.score_func)))
    
  • Line 416, col. 12 in SelectPercentile():

      raise ValueError('percentile should be >=0, <=100; got %r' % self.percentile)
    
  • Line 490, col. 12 in SelectKBest():

      raise ValueError(
          "k should be >=0, <= n_features = %d; got %r. Use k='all' to return all features."
           % (X.shape[1], self.k))
    
  • Line 740, col. 12 in GenericUnivariateSelect():

      raise ValueError(
          'The mode passed should be one of %s, %r, (type %s) was passed.' % (
          self._selection_modes.keys(), self.mode, type(self.mode)))
    

feature_selection/mutual_info_.py

  • Line 267, col. 8 in _estimate_mi():

      raise ValueError("Sparse matrix `X` can't have continuous features.")
    

feature_selection/base.py

  • Line 78, col. 12 in SelectorMixin():

      warn(
          'No features were selected: either the data is too noisy or the selection test too strict.'
          , UserWarning)
    
  • Line 83, col. 12 in SelectorMixin():

      raise ValueError('X has a different shape than during fitting.')
    
  • Line 116, col. 12 in SelectorMixin():

      raise ValueError('X has a different shape than during fitting.')
    

feature_selection/from_model.py

  • Line 27, col. 8 in _get_feature_importances():

      raise ValueError(
          'The underlying estimator %s has no `coef_` or `feature_importances_` attribute. Either pass a fitted estimator to SelectFromModel or call fit before calling transform.'
           % estimator.__class__.__name__)
    
  • Line 60, col. 16 in _calculate_threshold():

      raise ValueError('Unknown reference: ' + reference)
    
  • Line 71, col. 12 in _calculate_threshold():

      raise ValueError("Expected threshold='mean' or threshold='median' got %s" %
          threshold)
    
  • Line 139, col. 12 in SelectFromModel():

      raise ValueError(
          'Either fit SelectFromModel before transform or set "prefit=True" and pass a fitted estimator to the constructor.'
          )
    
  • Line 165, col. 12 in SelectFromModel():

      raise NotFittedError("Since 'prefit=True', call transform directly")
    
  • Line 196, col. 12 in SelectFromModel():

      raise NotFittedError("Since 'prefit=True', call transform directly")
    

gaussian_process/gpr.py

  • Line 197, col. 16 in GaussianProcessRegressor():

      raise ValueError(
          'alpha must be a scalar or an array with same number of entries as y.(%d != %d)'
           % (self.alpha.shape[0], y.shape[0]))
    
  • Line 224, col. 20 in GaussianProcessRegressor():

      raise ValueError(
          'Multiple optimizer restarts (n_restarts_optimizer>0) requires that all bounds are finite.'
          )
    
  • Line 257, col. 12 in GaussianProcessRegressor():

      raise
    
  • Line 296, col. 12 in GaussianProcessRegressor():

      raise RuntimeError(
          'Not returning standard deviation of predictions when returning full covariance.'
          )
    
  • Line 343, col. 20 in GaussianProcessRegressor():

      warnings.warn(
          'Predicted variances smaller than 0. Setting those variances to 0.')
    
  • Line 413, col. 16 in GaussianProcessRegressor():

      raise ValueError('Gradient can only be evaluated for theta!=None')
    
  • Line 464, col. 16 in GaussianProcessRegressor():

      warnings.warn('fmin_l_bfgs_b terminated abnormally with the  state: %s' %
          convergence_dict, ConvergenceWarning)
    
  • Line 471, col. 12 in GaussianProcessRegressor():

      raise ValueError('Unknown optimizer %s.' % self.optimizer)
    

gaussian_process/tests/__init__.py

gaussian_process/tests/test_gpr.py

gaussian_process/tests/test_kernels.py

gaussian_process/tests/test_gpc.py

gaussian_process/correlation_models.py

  • Line 55, col. 8 in absolute_exponential():

      raise ValueError('Length of theta must be 1 or %s' % n_features)
    
  • Line 100, col. 8 in squared_exponential():

      raise ValueError('Length of theta must be 1 or %s' % n_features)
    
  • Line 147, col. 8 in generalized_exponential():

      raise Exception('Length of theta must be 2 or %s' % (n_features + 1))
    
  • Line 237, col. 8 in cubic():

      raise Exception('Length of theta must be 1 or ' + str(n_features))
    
  • Line 289, col. 8 in linear():

      raise Exception('Length of theta must be 1 or %s' % n_features)
    

gaussian_process/__init__.py

gaussian_process/regression_models.py

gaussian_process/gpc.py

  • Line 190, col. 12 in _BinaryGaussianProcessClassifierLaplace():

      raise ValueError(
          '%s supports only binary classification. y contains classes %s' % (self
          .__class__.__name__, self.classes_))
    
  • Line 194, col. 12 in _BinaryGaussianProcessClassifierLaplace():

      raise ValueError('{0:s} requires 2 classes; got {1:d} class'.format(self.
          __class__.__name__, self.classes_.size))
    
  • Line 218, col. 20 in _BinaryGaussianProcessClassifierLaplace():

      raise ValueError(
          'Multiple optimizer restarts (n_restarts_optimizer>0) requires that all bounds are finite.'
          )
    
  • Line 334, col. 16 in _BinaryGaussianProcessClassifierLaplace():

      raise ValueError('Gradient can only be evaluated for theta!=None')
    
  • Line 432, col. 16 in _BinaryGaussianProcessClassifierLaplace():

      warnings.warn('fmin_l_bfgs_b terminated abnormally with the  state: %s' %
          convergence_dict, ConvergenceWarning)
    
  • Line 439, col. 12 in _BinaryGaussianProcessClassifierLaplace():

      raise ValueError('Unknown optimizer %s.' % self.optimizer)
    
  • Line 602, col. 12 in GaussianProcessClassifier():

      raise ValueError(
          'GaussianProcessClassifier requires 2 or more distinct classes; got %d class (only class %s is present)'
           % (self.n_classes_, self.classes_[0]))
    
  • Line 616, col. 16 in GaussianProcessClassifier():

      raise ValueError('Unknown multi-class mode %s' % self.multi_class)
    
  • Line 663, col. 12 in GaussianProcessClassifier():

      raise ValueError(
          'one_vs_one multi-class mode does not support predicting probability estimates. Use one_vs_rest mode instead.'
          )
    
  • Line 714, col. 16 in GaussianProcessClassifier():

      raise ValueError('Gradient can only be evaluated for theta!=None')
    
  • Line 724, col. 16 in GaussianProcessClassifier():

      raise NotImplementedError(
          'Gradient of log-marginal-likelihood not implemented for multi-class GPC.')
    
  • Line 740, col. 16 in GaussianProcessClassifier():

      raise ValueError(
          'Shape of theta must be either %d or %d. Obtained theta with shape %d.' %
          (n_dims, n_dims * self.classes_.shape[0], theta.shape[0]))
    

gaussian_process/kernels.py

  • Line 39, col. 8 in _check_length_scale():

      raise ValueError('length_scale cannot be of dimension greater than 1')
    
  • Line 41, col. 8 in _check_length_scale():

      raise ValueError(
          'Anisotropic kernel must have the same number of dimensions as data (%d!=%d)'
           % (length_scale.shape[0], X.shape[1]))
    
  • Line 100, col. 20 in Hyperparameter():

      raise ValueError(
          'Bounds on %s should have either 1 or %d dimensions. Given are %d' % (
          name, n_elements, bounds.shape[0]))
    
  • Line 155, col. 12 in Kernel():

      raise RuntimeError(
          "scikit-learn kernels should always specify their parameters in the signature of their __init__ (no varargs). %s doesn't follow this convention."
           % (cls,))
    
  • Line 185, col. 20 in Kernel():

      raise ValueError(
          'Invalid parameter %s for kernel %s. Check the list of available parameters with `kernel.get_params().keys()`.'
           % (name, self))
    
  • Line 194, col. 20 in Kernel():

      raise ValueError(
          'Invalid parameter %s for kernel %s. Check the list of available parameters with `kernel.get_params().keys()`.'
           % (key, self.__class__.__name__))
    
  • Line 275, col. 12 in Kernel():

      raise ValueError(
          'theta has not the correct number of entries. Should be %d; given are %d' %
          (i, len(theta)))
    
  • Line 1011, col. 12 in ConstantKernel():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    
  • Line 1103, col. 12 in WhiteKernel():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    
  • Line 1223, col. 16 in RBF():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    
  • Line 1332, col. 16 in Matern():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    
  • Line 1485, col. 16 in RationalQuadratic():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    
  • Line 1598, col. 16 in ExpSineSquared():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    
  • Line 1698, col. 16 in DotProduct():

      raise ValueError('Gradient can only be evaluated when Y is None.')
    

impute.py

  • Line 67, col. 13 in _most_frequent():

      warnings.catch_warnings()
    
  • Line 71, col. 12 in _most_frequent():

      warnings.simplefilter('ignore', RuntimeWarning)
    
  • Line 161, col. 12 in SimpleImputer():

      raise ValueError('Can only use these strategies: {0}  got strategy={1}'.
          format(allowed_strategies, self.strategy))
    
  • Line 180, col. 16 in SimpleImputer():

      raise ValueError(
          'Cannot use {0} strategy with non-numeric data. Received datatype :{1}.'
          .format(self.strategy, X.dtype.kind))
    
  • Line 184, col. 16 in SimpleImputer():

      raise ve
    
  • Line 187, col. 12 in SimpleImputer():

      raise ValueError(
          'SimpleImputer does not support data with dtype {0}. Please provide either a numeric array (with a floating point or integer dtype) or categorical data represented either as an array with integer dtype or an array of string values with an object dtype.'
          .format(X.dtype))
    
  • Line 225, col. 12 in SimpleImputer():

      raise ValueError(
          "'fill_value'={0} is invalid. Expected a numerical value when imputing numerical data"
          .format(fill_value))
    
  • Line 384, col. 12 in SimpleImputer():

      raise ValueError('X has %d features per sample, expected %d' % (X.shape[1],
          self.statistics_.shape[0]))
    
  • Line 400, col. 20 in SimpleImputer():

      warnings.warn('Deleting features without observed values: %s' % missing)
    
  • Line 611, col. 12 in ChainedImputer():

      raise ValueError(
          'If fit_mode is False, then an already-fitted predictor should be passed in.'
          )
    
  • Line 721, col. 12 in ChainedImputer():

      raise ValueError(
          "Got an invalid imputation order: '{0}'. It must be one of the following: 'roman', 'arabic', 'ascending', 'descending', or 'random'."
          .format(self.imputation_order))
    

isotonic.py

  • Line 69, col. 12 in check_increasing():

      warnings.warn(
          'Confidence interval of the Spearman correlation coefficient spans zero. Determination of ``increasing`` may be suspect.'
          )
    
  • Line 221, col. 12 in IsotonicRegression():

      raise ValueError('X should be a 1d array')
    
  • Line 228, col. 12 in IsotonicRegression():

      raise ValueError(
          "The argument ``out_of_bounds`` must be in 'nan', 'clip', 'raise'; got {0}"
          .format(self.out_of_bounds))
    
  • Line 350, col. 12 in IsotonicRegression():

      raise ValueError('Isotonic regression input should be a 1d array')
    
  • Line 354, col. 12 in IsotonicRegression():

      raise ValueError(
          "The argument ``out_of_bounds`` must be in 'nan', 'clip', 'raise'; got {0}"
          .format(self.out_of_bounds))
    

kernel_approximation.py

  • Line 241, col. 12 in SkewedChi2Sampler():

      raise ValueError('X may not contain entries smaller than -skewedness.')
    
  • Line 316, col. 16 in AdditiveChi2Sampler():

      raise ValueError(
          'If sample_steps is not in [1, 2, 3], you need to provide sample_interval')
    
  • Line 345, col. 12 in AdditiveChi2Sampler():

      raise ValueError('Entries of X must be non-negative.')
    
  • Line 530, col. 12 in Nystroem():

      warnings.warn(
          """n_components > n_samples. This is not possible.
      n_components was set to n_samples, which results in inefficient evaluation of the full kernel."""
          )
    
  • Line 591, col. 16 in Nystroem():

      warnings.warn(
          'Passing gamma, coef0 or degree to Nystroem when using a callable kernel is deprecated in version 0.19 and will raise an error in 0.21, as they are ignored. Use kernel_params instead.'
          , DeprecationWarning)
    

kernel_ridge.py

linear_model/ransac.py

  • Line 254, col. 16 in RANSACRegressor():

      raise ValueError('Absolute number of samples must be an integer value.')
    
  • Line 258, col. 12 in RANSACRegressor():

      raise ValueError('Value for `min_samples` must be scalar and positive.')
    
  • Line 261, col. 12 in RANSACRegressor():

      raise ValueError(
          '`min_samples` may not be larger than number of samples: n_samples = %d.' %
          X.shape[0])
    
  • Line 265, col. 12 in RANSACRegressor():

      raise ValueError('`stop_probability` must be in range [0, 1].')
    
  • Line 291, col. 12 in RANSACRegressor():

      raise ValueError(
          "loss should be 'absolute_loss', 'squared_loss' or a callable.Got %s. " %
          self.loss)
    
  • Line 308, col. 12 in RANSACRegressor():

      raise ValueError(
          '%s does not support sample_weight. Samples weights are only used for the calibration itself.'
           % estimator_name)
    
  • Line 412, col. 16 in RANSACRegressor():

      raise ValueError(
          'RANSAC skipped more iterations than `max_skips` without finding a valid consensus set. Iterations were skipped because each randomly chosen sub-sample failed the passing criteria. See estimator attributes for diagnostics (n_skips*).'
          )
    
  • Line 419, col. 16 in RANSACRegressor():

      raise ValueError(
          'RANSAC could not find a valid consensus set. All `max_trials` iterations were skipped because each randomly chosen sub-sample failed the passing criteria. See estimator attributes for diagnostics (n_skips*).'
          )
    
  • Line 427, col. 16 in RANSACRegressor():

      warnings.warn(
          'RANSAC found a valid consensus set but exited early due to skipping more iterations than `max_skips`. See estimator attributes for diagnostics (n_skips*).'
          , ConvergenceWarning)
    

linear_model/perceptron.py

linear_model/least_angle.py

  • Line 148, col. 8 in lars_path():

      warnings.warn(
          'positive option is broken for Least Angle Regression (LAR). Use method="lasso". This option will be removed in version 0.22.'
          , DeprecationWarning)
    
  • Line 304, col. 16 in lars_path():

      warnings.warn(
          'Regressors in active set degenerate. Dropping a regressor, after %i iterations, i.e. alpha=%.3e, with an active set of %i regressors, and the smallest cholesky pivot element being %.3e. Reduce max_iter or increase eps parameters.'
           % (n_iter, alpha, n_active, diag), ConvergenceWarning)
    
  • Line 331, col. 12 in lars_path():

      warnings.warn(
          'Early stopping the lars path, as the residues are small and the current value of alpha is no longer well controlled. %i iterations, alpha=%.3e, previous alpha=%.3e, with an active set of %i regressors.'
           % (n_iter, alpha, prev_alpha, n_active), ConvergenceWarning)
    
  • Line 1114, col. 12 in LarsCV():

      warnings.warn(
          "Parameter 'precompute' cannot be an array in %s. Automatically switch to 'auto' instead."
           % self.__class__.__name__)
    
  • Line 1488, col. 12 in LassoLarsIC():

      raise ValueError('criterion should be either bic or aic')
    

linear_model/logistic.py

  • Line 429, col. 8 in _check_solver_option():

      raise ValueError(
          'Logistic Regression supports only liblinear, newton-cg, lbfgs, sag and saga solvers, got %s'
           % solver)
    
  • Line 434, col. 8 in _check_solver_option():

      raise ValueError('multi_class should be either multinomial or ovr, got %s' %
          multi_class)
    
  • Line 438, col. 8 in _check_solver_option():

      raise ValueError('Solver %s does not support a multinomial backend.' % solver)
    
  • Line 443, col. 12 in _check_solver_option():

      raise ValueError('Solver %s supports only l2 penalties, got %s penalty.' %
          (solver, penalty))
    
  • Line 447, col. 12 in _check_solver_option():

      raise ValueError('Solver %s supports only dual=False, got dual=%s' % (
          solver, dual))
    
  • Line 608, col. 12 in logistic_regression_path():

      raise ValueError('To fit OvR, use the pos_class argument')
    
  • Line 662, col. 16 in logistic_regression_path():

      raise ValueError(
          'Initialization coef is of shape %d, expected shape %d or %d' % (coef.
          size, n_features, w0.size))
    
  • Line 675, col. 16 in logistic_regression_path():

      raise ValueError(
          'Initialization coef is of shape (%d, %d), expected shape (%d, %d) or (%d, %d)'
           % (coef.shape[0], coef.shape[1], classes.size, n_features, classes.
          size, n_features + 1))
    
  • Line 719, col. 16 in logistic_regression_path():

      warnings.warn('lbfgs failed to converge. Increase the number of iterations.',
          ConvergenceWarning)
    
  • Line 757, col. 12 in logistic_regression_path():

      raise ValueError(
          "solver must be one of {'liblinear', 'lbfgs', 'newton-cg', 'sag'}, got '%s' instead"
           % solver)
    
  • Line 933, col. 8 in _log_reg_scoring_path():

      raise ValueError('multi_class should be either multinomial or ovr, got %d' %
          multi_class)
    
  • Line 1210, col. 12 in LogisticRegression():

      raise ValueError('Penalty term must be positive; got (C=%r)' % self.C)
    
  • Line 1213, col. 12 in LogisticRegression():

      raise ValueError(
          'Maximum number of iteration must be positive; got (max_iter=%r)' %
          self.max_iter)
    
  • Line 1216, col. 12 in LogisticRegression():

      raise ValueError(
          'Tolerance for stopping criteria must be positive; got (tol=%r)' % self.tol
          )
    
  • Line 1235, col. 16 in LogisticRegression():

      warnings.warn(
          "'n_jobs' > 1 does not have any effect when 'solver' is set to 'liblinear'. Got 'n_jobs' = {}."
          .format(self.n_jobs))
    
  • Line 1254, col. 12 in LogisticRegression():

      raise ValueError(
          'This solver needs samples of at least 2 classes in the data, but the data contains only one class: %r'
           % classes_[0])
    
  • Line 1342, col. 12 in LogisticRegression():

      raise NotFittedError('Call fit before prediction')
    
  • Line 1618, col. 12 in LogisticRegressionCV():

      raise ValueError(
          'Maximum number of iteration must be positive; got (max_iter=%r)' %
          self.max_iter)
    
  • Line 1621, col. 12 in LogisticRegressionCV():

      raise ValueError(
          'Tolerance for stopping criteria must be positive; got (tol=%r)' % self.tol
          )
    
  • Line 1655, col. 12 in LogisticRegressionCV():

      raise ValueError(
          'This solver needs samples of at least 2 classes in the data, but the data contains only one class: %r'
           % classes[0])
    
  • Line 1825, col. 12 in LogisticRegressionCV():

      warnings.warn(
          'The long-standing behavior to use the accuracy score has changed. The scoring parameter is now used. This warning will disappear in version 0.22.'
          , ChangedBehaviorWarning)
    

linear_model/coordinate_descent.py

  • Line 79, col. 8 in _alpha_grid():

      raise ValueError(
          'Automatic alpha grid generation is not supported for l1_ratio=0. Please supply a grid by providing your estimator with the appropriate `alphas=` argument.'
          )
    
  • Line 403, col. 8 in enet_path():

      raise ValueError('positive=True is not allowed for multi-output (y.ndim != 1)')
    
  • Line 440, col. 8 in enet_path():

      raise ValueError('selection should be either random or cyclic.')
    
  • Line 479, col. 12 in enet_path():

      raise ValueError(
          "Precompute should be one of True, False, 'auto' or array-like. Got %r" %
          precompute)
    
  • Line 486, col. 12 in enet_path():

      warnings.warn('Objective did not converge.' + ' You might want' +
          ' to increase the number of iterations.' +
          ' Fitting data with very small alpha' +
          ' may cause precision problems.', ConvergenceWarning)
    
  • Line 696, col. 12 in ElasticNet():

      warnings.warn(
          'With alpha=0, this algorithm does not converge well. You are advised to use the LinearRegression estimator'
          , stacklevel=2)
    
  • Line 701, col. 12 in ElasticNet():

      raise ValueError(
          'precompute should be one of True, False or array-like. Got %r' % self.
          precompute)
    
  • Line 730, col. 12 in ElasticNet():

      raise ValueError('selection should be either random or cyclic.')
    
  • Line 1091, col. 12 in LinearModelCV():

      raise ValueError('y has 0 samples: %r' % y)
    
  • Line 1104, col. 16 in LinearModelCV():

      raise ValueError('For multi-task outputs, use MultiTask%sCV' % model_str)
    
  • Line 1109, col. 16 in LinearModelCV():

      raise TypeError('X should be dense but a sparse matrix waspassed')
    
  • Line 1112, col. 16 in LinearModelCV():

      raise ValueError('For mono-task outputs, use %sCV' % model_str)
    
  • Line 1120, col. 12 in LinearModelCV():

      raise ValueError('selection should be either random or cyclic.')
    
  • Line 1150, col. 12 in LinearModelCV():

      raise ValueError('X and y have inconsistent dimensions (%d != %d)' % (X.
          shape[0], y.shape[0]))
    
  • Line 1759, col. 12 in MultiTaskElasticNet():

      raise ValueError('For mono-task outputs, use %s' % model_str)
    
  • Line 1765, col. 12 in MultiTaskElasticNet():

      raise ValueError('X and y have inconsistent dimensions (%d != %d)' % (
          n_samples, y.shape[0]))
    
  • Line 1781, col. 12 in MultiTaskElasticNet():

      raise ValueError('selection should be either random or cyclic.')
    
  • Line 1792, col. 12 in MultiTaskElasticNet():

      warnings.warn(
          'Objective did not converge, you might want to increase the number of iterations'
          , ConvergenceWarning)
    

linear_model/tests/test_logistic.py

  • Line 124, col. 9 in test_logistic_cv_mock_scorer():

      pytest.warns(ChangedBehaviorWarning)
    
  • Line 135, col. 9 in test_logistic_cv_score_does_not_warn_by_default():

      pytest.warns(None)
    
  • Line 145, col. 4 in test_lr_liblinear_warning():

      assert_warns_message(UserWarning,
          "'n_jobs' > 1 does not have any effect when 'solver' is set to 'liblinear'. Got 'n_jobs' = 2."
          , lr.fit, iris.data, target)
    
  • Line 368, col. 4 in test_logistic_regression_path_convergence_fail():

      assert_warns(ConvergenceWarning, logistic_regression_path, X, y, Cs=Cs, tol
          =0.0, max_iter=1, random_state=0, verbose=1)
    
  • Line 764, col. 13 in test_logistic_regression_sample_weights():

      ignore_warnings()
    
  • Line 1090, col. 16 in test_max_iter():

      assert_warns(ConvergenceWarning, lr.fit, X, y_bin)
    
  • Line 1157, col. 9 in test_warm_start():

      ignore_warnings(category=ConvergenceWarning)
    

linear_model/tests/test_sgd.py

  • Line 322, col. 5 in CommonTest():

      ignore_warnings(ConvergenceWarning)
    
  • Line 1305, col. 14 in test_tol_parameter():

      assert_warns(ConvergenceWarning, model_3.fit, X, y)
    
  • Line 1318, col. 4 in test_future_and_deprecation_warnings():

      assert_warns_message(FutureWarning, msg_future, init)
    
  • Line 1322, col. 4 in test_future_and_deprecation_warnings():

      assert_warns_message(DeprecationWarning, msg_deprecation, init, 6, 0, 5)
    
  • Line 1325, col. 4 in test_future_and_deprecation_warnings():

      assert_no_warnings(init, 100, None, None)
    
  • Line 1326, col. 4 in test_future_and_deprecation_warnings():

      assert_no_warnings(init, None, 0.001, None)
    
  • Line 1327, col. 4 in test_future_and_deprecation_warnings():

      assert_no_warnings(init, 100, 0.001, None)
    
  • Line 1330, col. 4 in test_future_and_deprecation_warnings():

      assert_no_warnings(init, None, None, None, True)
    
  • Line 1333, col. 1 in test_tol_and_max_iter_default_values():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    

linear_model/tests/test_huber.py

linear_model/tests/test_bayes.py

  • Line 22, col. 4 in test_bayesian_on_diabetes():

      raise SkipTest('test_bayesian_on_diabetes is broken')
    

linear_model/tests/test_theil_sen.py

  • Line 162, col. 4 in test_spatial_median_2d():

      assert_warns(ConvergenceWarning, _spatial_median, X, max_iter=30, tol=0.0)
    

linear_model/tests/test_ridge.py

  • Line 152, col. 4 in test_ridge_regression_convergence_fail():

      assert_warns(ConvergenceWarning, ridge_regression, X, y, alpha=1.0, solver=
          'sparse_cg', tol=0.0, max_iter=None, verbose=1)
    
  • Line 821, col. 4 in test_ridge_fit_intercept_sparse():

      assert_warns(UserWarning, sparse.fit, X_csr, y)
    

linear_model/tests/test_passive_aggressive.py

linear_model/tests/__init__.py

linear_model/tests/test_randomized_l1.py

  • Line 36, col. 1 in test_lasso_stability_path():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 49, col. 1 in test_randomized_lasso_error_memory():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 63, col. 1 in test_randomized_lasso():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 133, col. 1 in test_randomized_logistic():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 163, col. 1 in test_randomized_logistic_sparse():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 197, col. 4 in test_warning_raised():

      assert_warns_message(DeprecationWarning,
          'The function lasso_stability_path is deprecated in 0.19 and will be removed in 0.21.'
          , lasso_stability_path, X, y, scaling=scaling, random_state=42,
          n_resampling=30)
    
  • Line 203, col. 4 in test_warning_raised():

      assert_warns_message(DeprecationWarning,
          'Class RandomizedLasso is deprecated; The class RandomizedLasso is deprecated in 0.19 and will be removed in 0.21.'
          , RandomizedLasso, verbose=False, alpha=[1, 0.8], random_state=42,
          scaling=scaling, selection_threshold=selection_threshold, memory=tempdir)
    
  • Line 211, col. 4 in test_warning_raised():

      assert_warns_message(DeprecationWarning,
          'The class RandomizedLogisticRegression is deprecated in 0.19 and will be removed in 0.21.'
          , RandomizedLogisticRegression, verbose=False, C=1.0, random_state=42,
          scaling=scaling, n_resampling=50, tol=0.001)
    

linear_model/tests/test_least_angle.py

  • Line 186, col. 15 in test_lars_precompute():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 353, col. 4 in test_lasso_lars_vs_lasso_cd_ill_conditioned2():

      assert_warns(ConvergenceWarning, lars.fit, X, y)
    
  • Line 430, col. 9 in test_lars_cv_max_iter():

      warnings.catch_warnings(record=True)
    
  • Line 490, col. 9 in test_lars_path_positive_constraint():

      warnings.catch_warnings(record=True)
    

linear_model/tests/test_ransac.py

  • Line 234, col. 4 in test_ransac_warn_exceed_max_skips():

      assert_warns(ConvergenceWarning, ransac_estimator.fit, X, y)
    

linear_model/tests/test_coordinate_descent.py

  • Line 247, col. 4 in test_enet_path():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 258, col. 4 in test_enet_path():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 275, col. 4 in test_enet_path():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 307, col. 4 in test_warm_start():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 308, col. 4 in test_warm_start():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 311, col. 4 in test_warm_start():

      ignore_warnings(clf2.fit)(X, y)
    
  • Line 320, col. 4 in test_lasso_alpha_warning():

      assert_warns(UserWarning, clf.fit, X, Y)
    
  • Line 407, col. 4 in test_multi_task_lasso_and_enet():

      assert_warns_message(ConvergenceWarning, 'did not converge', clf.fit, X, Y)
    
  • Line 702, col. 4 in test_overrided_gram_matrix():

      assert_warns_message(UserWarning,
          'Gram matrix was provided but X was centered to fit intercept, or X was normalized : recomputing Gram matrix.'
          , clf.fit, X, y)
    
  • Line 739, col. 16 in test_enet_float_precision():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 752, col. 16 in test_enet_float_precision():

      ignore_warnings(clf_precompute.fit)(X, y)
    
  • Line 795, col. 9 in test_enet_l1_ratio():

      ignore_warnings()
    
  • Line 802, col. 9 in test_enet_l1_ratio():

      ignore_warnings()
    

linear_model/tests/test_sparse_coordinate_descent.py

  • Line 63, col. 4 in test_enet_toy_list_input():

      ignore_warnings(clf.fit)(X, Y)
    
  • Line 241, col. 4 in test_path_parameters():

      ignore_warnings(clf.fit)(X, y)
    
  • Line 246, col. 4 in test_path_parameters():

      ignore_warnings(clf.fit)(X.toarray(), y)
    
  • Line 254, col. 8 in test_same_output_sparse_dense_lasso_and_enet_cv():

      ignore_warnings(clfs.fit)(X, y)
    
  • Line 256, col. 8 in test_same_output_sparse_dense_lasso_and_enet_cv():

      ignore_warnings(clfd.fit)(X.toarray(), y)
    
  • Line 263, col. 8 in test_same_output_sparse_dense_lasso_and_enet_cv():

      ignore_warnings(clfs.fit)(X, y)
    
  • Line 265, col. 8 in test_same_output_sparse_dense_lasso_and_enet_cv():

      ignore_warnings(clfd.fit)(X.toarray(), y)
    
  • Line 283, col. 8 in test_same_multiple_output_sparse_dense():

      ignore_warnings(l.fit)(X, y)
    
  • Line 289, col. 8 in test_same_multiple_output_sparse_dense():

      ignore_warnings(l_sp.fit)(X_sp, y)
    

linear_model/tests/test_perceptron.py

linear_model/tests/test_sag.py

  • Line 125, col. 8 in sag_sparse():

      raise ZeroDivisionError(
          'Sparse sag does not handle the case step_size * alpha == 1')
    

linear_model/tests/test_base.py

linear_model/tests/test_omp.py

  • Line 156, col. 4 in test_identical_regressors():

      assert_warns(RuntimeWarning, orthogonal_mp, newX, newy, 2)
    
  • Line 177, col. 18 in test_no_atoms():

      ignore_warnings(orthogonal_mp)(X, y_empty, 1)
    
  • Line 178, col. 23 in test_no_atoms():

      ignore_warnings(orthogonal_mp)(G, Xy_empty, 1)
    

linear_model/randomized_l1.py

  • Line 43, col. 8 in _resample_model():

      raise ValueError("'scaling' should be between 0 and 1. Got %r instead." %
          scaling)
    
  • Line 111, col. 12 in BaseRandomizedLinearModel():

      raise ValueError(
          "'memory' should either be a string or a sklearn.externals.joblib.Memory instance, got 'memory={!r}' instead."
          .format(type(memory)))
    
  • Line 133, col. 8 in BaseRandomizedLinearModel():

      raise NotImplementedError
    
  • Line 165, col. 9 in _randomized_lasso():

      warnings.catch_warnings()
    
  • Line 166, col. 8 in _randomized_lasso():

      warnings.simplefilter('ignore', ConvergenceWarning)
    
  • Line 374, col. 8 in _randomized_logistic():

      raise ValueError(
          'C should be 1-dimensional array-like, but got a {}-dimensional array-like instead: {}.'
          .format(C.ndim, C))
    
  • Line 551, col. 9 in _lasso_stability_path():

      warnings.catch_warnings()
    
  • Line 552, col. 8 in _lasso_stability_path():

      warnings.simplefilter('ignore', ConvergenceWarning)
    
  • Line 630, col. 8 in lasso_stability_path():

      raise ValueError(
          "Parameter 'scaling' should be between 0 and 1. Got %r instead." % scaling)
    

linear_model/__init__.py

linear_model/setup.py

linear_model/sag.py

  • Line 71, col. 8 in get_auto_step_size():

      raise ValueError(
          "Unknown loss function for SAG solver, got %s instead of 'log' or 'squared'"
           % loss)
    
  • Line 311, col. 8 in sag_solver():

      raise ZeroDivisionError(
          'Current sag implementation does not handle the case step_size * alpha_scaled == 1'
          )
    
  • Line 331, col. 8 in sag_solver():

      warnings.warn('The max_iter was reached which means the coef_ did not converge'
          , ConvergenceWarning)
    

linear_model/bayes.py

linear_model/omp.py

  • Line 96, col. 12 in _cholesky_omp():

      warnings.warn(premature, RuntimeWarning, stacklevel=2)
    
  • Line 110, col. 16 in _cholesky_omp():

      warnings.warn(premature, RuntimeWarning, stacklevel=2)
    
  • Line 220, col. 12 in _gram_omp():

      warnings.warn(premature, RuntimeWarning, stacklevel=3)
    
  • Line 232, col. 16 in _gram_omp():

      warnings.warn(premature, RuntimeWarning, stacklevel=3)
    
  • Line 358, col. 8 in orthogonal_mp():

      raise ValueError('Epsilon cannot be negative')
    
  • Line 360, col. 8 in orthogonal_mp():

      raise ValueError('The number of atoms must be positive')
    
  • Line 362, col. 8 in orthogonal_mp():

      raise ValueError(
          'The number of atoms cannot be more than the number of features')
    
  • Line 501, col. 8 in orthogonal_mp_gram():

      raise ValueError(
          'Gram OMP needs the precomputed norms in order to evaluate the error sum of squares.'
          )
    
  • Line 504, col. 8 in orthogonal_mp_gram():

      raise ValueError('Epsilon cannot be negative')
    
  • Line 506, col. 8 in orthogonal_mp_gram():

      raise ValueError('The number of atoms must be positive')
    
  • Line 508, col. 8 in orthogonal_mp_gram():

      raise ValueError(
          'The number of atoms cannot be more than the number of features')
    

linear_model/passive_aggressive.py

  • Line 218, col. 12 in PassiveAggressiveClassifier():

      raise ValueError(
          "class_weight 'balanced' is not supported for partial_fit. For 'balanced' weights, use `sklearn.utils.compute_class_weight` with `class_weight='balanced'`. In place of y you can use a large enough subset of the full training set target to properly estimate the class frequency distributions. Pass the resulting weights as the class_weight parameter."
          )
    

linear_model/stochastic_gradient.py

  • Line 93, col. 12 in BaseSGD():

      raise ValueError('shuffle must be either True or False')
    
  • Line 95, col. 12 in BaseSGD():

      raise ValueError('early_stopping must be either True or False')
    
  • Line 97, col. 12 in BaseSGD():

      raise ValueError('early_stopping should be False with partial_fit')
    
  • Line 99, col. 12 in BaseSGD():

      raise ValueError('max_iter must be > zero. Got %f' % self.max_iter)
    
  • Line 101, col. 12 in BaseSGD():

      raise ValueError('l1_ratio must be in [0, 1]')
    
  • Line 103, col. 12 in BaseSGD():

      raise ValueError('alpha must be >= 0')
    
  • Line 105, col. 12 in BaseSGD():

      raise ValueError('n_iter_no_change must be >= 1')
    
  • Line 107, col. 12 in BaseSGD():

      raise ValueError('validation_fraction must be in ]0, 1[')
    
  • Line 110, col. 16 in BaseSGD():

      raise ValueError('eta0 must be > 0')
    
  • Line 112, col. 12 in BaseSGD():

      raise ValueError(
          "alpha must be > 0 since learning_rate is 'optimal'. alpha is used to compute the optimal learning rate."
          )
    
  • Line 121, col. 12 in BaseSGD():

      raise ValueError('The loss %s is not supported. ' % self.loss)
    
  • Line 128, col. 12 in BaseSGD():

      warnings.warn(
          'n_iter parameter is deprecated in 0.19 and will be removed in 0.21. Use max_iter and tol instead.'
          , DeprecationWarning)
    
  • Line 137, col. 16 in BaseSGD():

      warnings.warn(
          'max_iter and tol parameters have been added in %s in 0.19. If both are left unset, they default to max_iter=5 and tol=None. If tol is not None, max_iter defaults to max_iter=1000. From 0.21, default max_iter will be 1000, and default tol will be 1e-3.'
           % type(self).__name__, FutureWarning)
    
  • Line 161, col. 12 in BaseSGD():

      raise ValueError('The loss %s is not supported. ' % loss)
    
  • Line 167, col. 12 in BaseSGD():

      raise ValueError('learning rate %s is not supported. ' % learning_rate)
    
  • Line 175, col. 12 in BaseSGD():

      raise ValueError('Penalty %s is not supported. ' % penalty)
    
  • Line 187, col. 12 in BaseSGD():

      raise ValueError('Shapes of X and sample_weight do not match.')
    
  • Line 198, col. 20 in BaseSGD():

      raise ValueError('Provided ``coef_`` does not match dataset. ')
    
  • Line 209, col. 20 in BaseSGD():

      raise ValueError('Provided intercept_init does not match dataset.')
    
  • Line 222, col. 20 in BaseSGD():

      raise ValueError('Provided coef_init does not match dataset.')
    
  • Line 234, col. 20 in BaseSGD():

      raise ValueError('Provided intercept_init does not match dataset.')
    
  • Line 282, col. 12 in BaseSGD():

      raise ValueError(
          'Splitting %d samples into a train set and a validation set with validation_fraction=%r led to an empty set (%d and %d samples). Please either change validation_fraction, increase number of samples, or disable early_stopping.'
           % (n_samples, self.validation_fraction, X_train.shape[0], X_val.shape[0]))
    
  • Line 514, col. 12 in BaseSGDClassifier():

      raise ValueError('Number of features %d does not match previous data %d.' %
          (n_features, self.coef_.shape[-1]))
    
  • Line 533, col. 12 in BaseSGDClassifier():

      raise ValueError(
          'The number of classes has to be greater than one; got %d class' %
          n_classes)
    
  • Line 576, col. 12 in BaseSGDClassifier():

      warnings.warn(
          'Maximum number of iteration reached before convergence. Consider increasing max_iter to improve the fit.'
          , ConvergenceWarning)
    
  • Line 670, col. 12 in BaseSGDClassifier():

      raise ValueError(
          "class_weight '{0}' is not supported for partial_fit. In order to use 'balanced' weights, use compute_class_weight('{0}', classes, y). In place of y you can us a large enough sample of the full training set target to properly estimate the class frequency distributions. Pass the resulting weights as the class_weight parameter."
          .format(self.class_weight))
    
  • Line 962, col. 12 in SGDClassifier():

      raise AttributeError('probability estimates are not available for loss=%r' %
          self.loss)
    
  • Line 1043, col. 12 in SGDClassifier():

      raise NotImplementedError(
          "predict_(log_)proba only supported when loss='log' or loss='modified_huber' (%r given)"
           % self.loss)
    
  • Line 1119, col. 12 in BaseSGDRegressor():

      raise ValueError('Number of features %d does not match previous data %d.' %
          (n_features, self.coef_.shape[-1]))
    
  • Line 1187, col. 12 in BaseSGDRegressor():

      warnings.warn(
          'Maximum number of iteration reached before convergence. Consider increasing max_iter to improve the fit.'
          , ConvergenceWarning)
    

linear_model/huber.py

  • Line 240, col. 12 in HuberRegressor():

      raise ValueError('epsilon should be greater than or equal to 1.0, got %f' %
          self.epsilon)
    
  • Line 268, col. 12 in HuberRegressor():

      raise ValueError(
          'HuberRegressor convergence failed: l-BFGS-b solver terminated with %s' %
          dict_['task'].decode('ascii'))
    

linear_model/ridge.py

  • Line 73, col. 12 in _solve_sparse_cg():

      raise ValueError('Failed with error code %d' % info)
    
  • Line 76, col. 12 in _solve_sparse_cg():

      warnings.warn('sparse_cg did not converge after %d iterations.' % info,
          ConvergenceWarning)
    
  • Line 155, col. 12 in _solve_cholesky_kernel():

      warnings.warn(
          'Singular matrix in solving dual problem. Using least-squares solution instead.'
          )
    
  • Line 320, col. 12 in ridge_regression():

      warnings.warn(
          "In Ridge, only 'sag' solver can currently fit the intercept when X is sparse. Solver has been automatically changed into 'sag'."
          )
    
  • Line 341, col. 8 in ridge_regression():

      raise ValueError('Target y has the wrong shape %s' % str(y.shape))
    
  • Line 351, col. 8 in ridge_regression():

      raise ValueError(
          'Number of samples in X and y does not correspond: %d != %d' % (
          n_samples, n_samples_))
    
  • Line 365, col. 12 in ridge_regression():

      raise ValueError('Sample weights must be 1D array or scalar')
    
  • Line 375, col. 8 in ridge_regression():

      raise ValueError(
          'Number of targets and number of penalties do not correspond: %d != %d' %
          (alpha.size, n_targets))
    
  • Line 383, col. 8 in ridge_regression():

      raise ValueError('Solver %s not understood' % solver)
    
  • Line 437, col. 12 in ridge_regression():

      raise TypeError('SVD solver does not support sparse inputs currently')
    
  • Line 483, col. 12 in _BaseRidge():

      raise ValueError('Sample weights must be 1D array or scalar')
    
  • Line 821, col. 12 in RidgeClassifier():

      raise ValueError("%s doesn't support multi-label classification" % self.
          __class__.__name__)
    
  • Line 944, col. 12 in _RidgeGCV():

      raise TypeError('SVD not supported for sparse matrices')
    
  • Line 1016, col. 12 in _RidgeGCV():

      warnings.warn(
          'non-uniform sample weights unsupported for svd, forcing usage of eigen')
    
  • Line 1030, col. 12 in _RidgeGCV():

      raise ValueError('bad gcv_mode "%s"' % gcv_mode)
    
  • Line 1046, col. 12 in _RidgeGCV():

      raise ValueError(
          'alphas cannot be negative. Got {} containing some negative value instead.'
          .format(self.alphas))
    
  • Line 1133, col. 16 in _BaseRidgeCV():

      raise ValueError('cv!=None and store_cv_values=True  are incompatible')
    

linear_model/theil_sen.py

  • Line 126, col. 8 in _spatial_median():

      warnings.warn(
          'Maximum number of iterations {max_iter} reached in spatial median for TheilSen regressor.'
          .format(max_iter=max_iter), ConvergenceWarning)
    
  • Line 307, col. 16 in TheilSenRegressor():

      raise ValueError(
          'Invalid parameter since n_subsamples > n_samples ({0} > {1}).'.format(
          n_subsamples, n_samples))
    
  • Line 313, col. 20 in TheilSenRegressor():

      raise ValueError(
          'Invalid parameter since n_features{0} > n_subsamples ({1} > {2}).'.
          format(plus_1, n_dim, n_samples))
    
  • Line 318, col. 20 in TheilSenRegressor():

      raise ValueError(
          'Invalid parameter since n_subsamples != n_samples ({0} != {1}) while n_samples < n_features.'
          .format(n_subsamples, n_samples))
    
  • Line 326, col. 12 in TheilSenRegressor():

      raise ValueError('Subpopulation must be strictly positive ({0} <= 0).'.
          format(self.max_subpopulation))
    

linear_model/base.py

  • Line 246, col. 12 in LinearClassifierMixin():

      raise NotFittedError('This %(name)s instance is not fitted yet' % {'name':
          type(self).__name__})
    
  • Line 253, col. 12 in LinearClassifierMixin():

      raise ValueError('X has %d features per sample; expecting %d' % (X.shape[1],
          n_features))
    
  • Line 434, col. 12 in LinearRegression():

      raise ValueError('Sample weights must be 1D array or scalar')
    
  • Line 484, col. 8 in _pre_fit():

      warnings.warn(
          'Gram matrix was provided but X was centered to fit intercept, or X was normalized : recomputing Gram matrix.'
          , UserWarning)
    

manifold/locally_linear.py

  • Line 166, col. 12 in null_space():

      raise ValueError(
          "Error in determining null-space with ARPACK. Error message: '%s'. Note that method='arpack' can fail when the weight matrix is singular or otherwise ill-behaved.  method='dense' is recommended. See online documentation for more information."
           % msg)
    
  • Line 183, col. 8 in null_space():

      raise ValueError("Unrecognized eigen_solver '%s'" % eigen_solver)
    
  • Line 285, col. 8 in locally_linear_embedding():

      raise ValueError("unrecognized eigen_solver '%s'" % eigen_solver)
    
  • Line 288, col. 8 in locally_linear_embedding():

      raise ValueError("unrecognized method '%s'" % method)
    
  • Line 297, col. 8 in locally_linear_embedding():

      raise ValueError(
          'output dimension must be less than or equal to input dimension')
    
  • Line 300, col. 8 in locally_linear_embedding():

      raise ValueError(
          'Expected n_neighbors <= n_samples,  but n_samples = %d, n_neighbors = %d'
           % (N, n_neighbors))
    
  • Line 307, col. 8 in locally_linear_embedding():

      raise ValueError('n_neighbors must be positive')
    
  • Line 328, col. 12 in locally_linear_embedding():

      raise ValueError(
          "for method='hessian', n_neighbors must be greater than [n_components * (n_components + 3) / 2]"
          )
    
  • Line 378, col. 12 in locally_linear_embedding():

      raise ValueError('modified LLE requires n_neighbors >= n_components')
    

manifold/t_sne.py

  • Line 453, col. 8 in trustworthiness():

      warnings.warn(
          "The flag 'precomputed' has been deprecated in version 0.20 and will be removed in 0.22. See 'metric' parameter instead."
          , DeprecationWarning)
    
  • Line 671, col. 12 in TSNE():

      raise ValueError("'method' must be 'barnes_hut' or 'exact'")
    
  • Line 673, col. 12 in TSNE():

      raise ValueError("'angle' must be between 0.0 - 1.0")
    
  • Line 676, col. 16 in TSNE():

      raise ValueError(
          'The parameter init="pca" cannot be used with metric="precomputed".')
    
  • Line 679, col. 16 in TSNE():

      raise ValueError('X should be a square distance matrix')
    
  • Line 681, col. 16 in TSNE():

      raise ValueError(
          'All distances should be positive, the precomputed distances given as X is not correct'
          )
    
  • Line 685, col. 12 in TSNE():

      raise TypeError(
          'A sparse matrix was passed, but dense data is required for method="barnes_hut". Use X.toarray() to convert to a dense numpy array if the array is small enough for it to fit in memory. Otherwise consider dimensionality reduction techniques (e.g. TruncatedSVD)'
          )
    
  • Line 698, col. 12 in TSNE():

      raise ValueError(
          "'n_components' should be inferior to 4 for the barnes_hut algorithm as it relies on quad-tree or oct-tree."
          )
    
  • Line 704, col. 12 in TSNE():

      raise ValueError('early_exaggeration must be at least 1, but is {}'.format(
          self.early_exaggeration))
    
  • Line 708, col. 12 in TSNE():

      raise ValueError('n_iter should be at least 250')
    
  • Line 729, col. 20 in TSNE():

      raise ValueError(
          'All distances should be positive, the metric given is not correct')
    
  • Line 794, col. 12 in TSNE():

      raise ValueError("'init' must be 'pca', 'random', or a numpy array")
    

manifold/mds.py

  • Line 85, col. 12 in _smacof_single():

      raise ValueError('init matrix should be of shape (%d, %d)' % (n_samples,
          n_components))
    
  • Line 240, col. 12 in smacof():

      warnings.warn(
          'Explicit initial positions passed: performing only one init of the MDS instead of %d'
           % n_init)
    
  • Line 411, col. 12 in MDS():

      warnings.warn(
          "The MDS API has changed. ``fit`` now constructs an dissimilarity matrix from data. To use a custom dissimilarity matrix, set ``dissimilarity='precomputed'``."
          )
    
  • Line 421, col. 12 in MDS():

      raise ValueError(
          "Proximity must be 'precomputed' or 'euclidean'. Got %s instead" % str(
          self.dissimilarity))
    

manifold/tests/test_isomap.py

manifold/tests/test_mds.py

manifold/tests/__init__.py

manifold/tests/test_t_sne.py

manifold/tests/test_spectral_embedding.py

  • Line 170, col. 8 in test_spectral_embedding_amg_solver():

      raise SkipTest('pyamg not available.')
    

manifold/tests/test_locally_linear.py

manifold/__init__.py

manifold/isomap.py

manifold/setup.py

manifold/spectral_embedding_.py

  • Line 219, col. 12 in spectral_embedding():

      raise ValueError(
          "The eigen_solver was set to 'amg', but pyamg is not available.")
    
  • Line 225, col. 8 in spectral_embedding():

      raise ValueError(
          "Unknown value for eigen_solver: '%s'.Should be 'amg', 'arpack', or 'lobpcg'"
           % eigen_solver)
    
  • Line 237, col. 8 in spectral_embedding():

      warnings.warn(
          'Graph is not fully connected, spectral embedding may not work as expected.'
          )
    
  • Line 288, col. 12 in spectral_embedding():

      warnings.warn('AMG works better for sparse matrices')
    
  • Line 303, col. 12 in spectral_embedding():

      raise ValueError
    
  • Line 331, col. 16 in spectral_embedding():

      raise ValueError
    
  • Line 453, col. 16 in SpectralEmbedding():

      warnings.warn(
          'Nearest neighbors affinity currently does not support sparse input, falling back to rbf affinity'
          )
    
  • Line 502, col. 16 in SpectralEmbedding():

      raise ValueError(
          "%s is not a valid affinity. Expected 'precomputed', 'rbf', 'nearest_neighbors' or a callable."
           % self.affinity)
    
  • Line 506, col. 12 in SpectralEmbedding():

      raise ValueError(
          "'affinity' is expected to be an affinity name or a callable. Got: %s" %
          self.affinity)
    

metrics/cluster/bicluster.py

metrics/cluster/unsupervised.py

  • Line 34, col. 8 in check_number_of_labels():

      raise ValueError(
          'Number of labels is %d. Valid values are 2 to n_samples - 1 (inclusive)' %
          n_labels)
    

metrics/cluster/tests/test_supervised.py

metrics/cluster/tests/test_common.py

metrics/cluster/tests/__init__.py

metrics/cluster/tests/test_bicluster.py

metrics/cluster/tests/test_unsupervised.py

metrics/cluster/__init__.py

metrics/cluster/setup.py

metrics/cluster/supervised.py

  • Line 50, col. 8 in check_clusterings():

      raise ValueError('labels_true must be 1D: shape is %r' % (labels_true.shape,))
    
  • Line 53, col. 8 in check_clusterings():

      raise ValueError('labels_pred must be 1D: shape is %r' % (labels_pred.shape,))
    
  • Line 56, col. 8 in check_clusterings():

      raise ValueError(
          'labels_true and labels_pred must have same size, got %d and %d' % (
          labels_true.shape[0], labels_pred.shape[0]))
    
  • Line 95, col. 8 in contingency_matrix():

      raise ValueError("Cannot set 'eps' when sparse=True")
    
  • Line 604, col. 8 in mutual_info_score():

      raise ValueError("Unsupported type for 'contingency': %s" % type(contingency))
    

metrics/regression.py

  • Line 86, col. 8 in _check_reg_targets():

      raise ValueError('y_true and y_pred have different number of output ({0}!={1})'
          .format(y_true.shape[1], y_pred.shape[1]))
    
  • Line 94, col. 12 in _check_reg_targets():

      raise ValueError(
          "Allowed 'multioutput' string values are {}. You provided multioutput={!r}"
          .format(allowed_multioutput_str, multioutput))
    
  • Line 101, col. 12 in _check_reg_targets():

      raise ValueError('Custom weights are useful only in multi-output cases.')
    
  • Line 104, col. 12 in _check_reg_targets():

      raise ValueError(
          'There must be equally many custom weights (%d) as outputs (%d).' % (
          len(multioutput), n_outputs))
    
  • Line 314, col. 8 in mean_squared_log_error():

      raise ValueError(
          'Mean Squared Logarithmic Error cannot be used when targets contain negative values.'
          )
    
  • Line 351, col. 8 in median_absolute_error():

      raise ValueError('Multioutput not supported in median_absolute_error')
    

metrics/classification.py

  • Line 80, col. 8 in _check_targets():

      raise ValueError(
          "Classification metrics can't handle a mix of {0} and {1} targets".
          format(type_true, type_pred))
    
  • Line 88, col. 8 in _check_targets():

      raise ValueError('{0} is not supported'.format(y_type))
    
  • Line 255, col. 8 in confusion_matrix():

      raise ValueError('%s is not supported' % y_type)
    
  • Line 262, col. 12 in confusion_matrix():

      raise ValueError('At least one label specified must be in y_true')
    
  • Line 371, col. 8 in cohen_kappa_score():

      raise ValueError('Unknown kappa weighting type.')
    
  • Line 528, col. 8 in matthews_corrcoef():

      raise ValueError('%s is not supported' % y_type)
    
  • Line 877, col. 4 in _prf_divide():

      warnings.warn(msg, UndefinedMetricWarning, stacklevel=2)
    
  • Line 1025, col. 8 in precision_recall_fscore_support():

      raise ValueError('average has to be one of ' + str(average_options))
    
  • Line 1028, col. 8 in precision_recall_fscore_support():

      raise ValueError('beta should be >0 in the F-beta score')
    
  • Line 1041, col. 20 in precision_recall_fscore_support():

      raise ValueError('pos_label=%r is not a valid label: %r' % (pos_label,
          present_labels))
    
  • Line 1045, col. 12 in precision_recall_fscore_support():

      raise ValueError(
          "Target is %s but average='binary'. Please choose another average setting."
           % y_type)
    
  • Line 1048, col. 8 in precision_recall_fscore_support():

      warnings.warn(
          "Note that pos_label (set to %r) is ignored when average != 'binary' (got %r). You may use labels=[pos_label] to specify a single positive class."
           % (pos_label, average), UserWarning)
    
  • Line 1070, col. 16 in precision_recall_fscore_support():

      raise ValueError('All labels must be in [0, n labels). Got %d > %d' % (np.
          max(labels), np.max(present_labels)))
    
  • Line 1074, col. 16 in precision_recall_fscore_support():

      raise ValueError('All labels must be in [0, n labels). Got %d < 0' % np.min
          (labels))
    
  • Line 1091, col. 8 in precision_recall_fscore_support():

      raise ValueError(
          'Sample-based precision, recall, fscore is not meaningful outside multilabel classification. See the accuracy_score instead.'
          )
    
  • Line 1422, col. 8 in balanced_accuracy_score():

      raise ValueError(
          'Balanced accuracy is only meaningful for binary classification problems.')
    
  • Line 1510, col. 12 in classification_report():

      warnings.warn('labels size, {0}, does not match size of target_names, {1}'.
          format(len(labels), len(target_names)))
    
  • Line 1515, col. 12 in classification_report():

      raise ValueError(
          'Number of classes, {0}, does not match size of target_names, {1}. Try specifying the labels parameter'
          .format(len(labels), len(target_names)))
    
  • Line 1665, col. 8 in hamming_loss():

      raise ValueError('{0} is not supported'.format(y_type))
    
  • Line 1744, col. 12 in log_loss():

      raise ValueError(
          'y_true contains only one label ({0}). Please provide the true labels explicitly through the labels argument.'
          .format(lb.classes_[0]))
    
  • Line 1748, col. 12 in log_loss():

      raise ValueError(
          'The labels array needs to contain at least two labels for log_loss, got {0}.'
          .format(lb.classes_))
    
  • Line 1772, col. 12 in log_loss():

      raise ValueError(
          'y_true and y_pred contain different number of classes {0}, {1}. Please provide the true labels explicitly through the labels argument. Classes found in y_true: {2}'
          .format(transformed_labels.shape[1], y_pred.shape[1], lb.classes_))
    
  • Line 1780, col. 12 in log_loss():

      raise ValueError(
          'The number of classes in labels is different from that in y_pred. Classes found in labels: {0}'
          .format(lb.classes_))
    
  • Line 1883, col. 12 in hinge_loss():

      raise ValueError(
          'Please include all labels in y_true or pass labels as third argument')
    
  • Line 1909, col. 12 in hinge_loss():

      raise TypeError('pred_decision should be an array of floats.')
    
  • Line 1924, col. 8 in _check_binary_probabilistic_predictions():

      raise ValueError(
          'Only binary classification is supported. Provided labels %s.' % labels)
    
  • Line 1928, col. 8 in _check_binary_probabilistic_predictions():

      raise ValueError('y_prob contains values greater than 1.')
    
  • Line 1931, col. 8 in _check_binary_probabilistic_predictions():

      raise ValueError('y_prob contains values less than 0.')
    

metrics/tests/test_common.py

  • Line 476, col. 9 in test_sample_order_invariance():

      ignore_warnings()
    
  • Line 538, col. 9 in test_format_invariance_with_1d_vectors():

      ignore_warnings()
    
  • Line 610, col. 9 in test_classification_invariance_string_vs_numbers_labels():

      ignore_warnings()
    
  • Line 656, col. 9 in test_thresholded_invariance_string_vs_numbers_labels():

      ignore_warnings()
    
  • Line 943, col. 8 in check_averaging():

      raise ValueError('Metric is not recorded as having an average option')
    

metrics/tests/test_score_objects.py

metrics/tests/__init__.py

metrics/tests/test_ranking.py

  • Line 277, col. 27 in test_roc_curve_one_label():

      assert_warns(w, roc_curve, y_true, y_pred)
    
  • Line 285, col. 27 in test_roc_curve_one_label():

      assert_warns(w, roc_curve, [(1 - x) for x in y_true], y_pred)
    
  • Line 340, col. 18 in test_roc_curve_toydata():

      assert_warns(UndefinedMetricWarning, roc_curve, y_true, y_score)
    
  • Line 348, col. 18 in test_roc_curve_toydata():

      assert_warns(UndefinedMetricWarning, roc_curve, y_true, y_score)
    
  • Line 469, col. 4 in test_deprecated_auc_reorder():

      assert_warns_message(DeprecationWarning, depr_message, auc, [1, 2], [2, 3],
          reorder=True)
    
  • Line 493, col. 4 in test_auc_score_non_binary_class():

      clean_warning_registry()
    
  • Line 494, col. 9 in test_auc_score_non_binary_class():

      warnings.catch_warnings(record=True)
    

metrics/tests/test_pairwise.py

  • Line 89, col. 4 in test_pairwise_distances():

      assert_warns(DeprecationWarning, manhattan_distances, X, Y, size_threshold=10)
    
  • Line 142, col. 9 in test_pairwise_boolean_distance():

      ignore_warnings(category=DataConversionWarning)
    
  • Line 197, col. 16 in check_pairwise_parallel():

      raise
    
  • Line 405, col. 4 in test_pairwise_distances_argmin_min():

      assert_warns_message(DeprecationWarning, 'version 0.22',
          pairwise_distances_argmin_min, X, Y, batch_size=500, metric='euclidean')
    

metrics/tests/test_classification.py

  • Line 324, col. 4 in test_precision_recall_f_unused_pos_label():

      assert_warns_message(UserWarning,
          "Note that pos_label (set to 2) is ignored when average != 'binary' (got 'macro'). You may use labels=[pos_label] to specify a single positive class."
          , precision_recall_fscore_support, [1, 2, 1], [1, 2, 2], pos_label=2,
          average='macro')
    
  • Line 446, col. 10 in test_matthews_corrcoef():

      assert_warns_div0(matthews_corrcoef, [0, 0, 0, 0], [0, 0, 0, 0])
    
  • Line 452, col. 10 in test_matthews_corrcoef():

      assert_warns_div0(matthews_corrcoef, y_true, ['a'] * len(y_true))
    
  • Line 494, col. 10 in test_matthews_corrcoef_multiclass():

      assert_warns_message(RuntimeWarning, 'invalid value encountered',
          matthews_corrcoef, y_true, y_pred)
    
  • Line 517, col. 10 in test_matthews_corrcoef_multiclass():

      assert_warns_message(RuntimeWarning, 'invalid value encountered',
          matthews_corrcoef, y_true, y_pred, sample_weight)
    
  • Line 867, col. 4 in test_classification_report_labels_target_names_unequal_length():

      assert_warns_message(UserWarning,
          'labels size, 2, does not match size of target_names, 3',
          classification_report, y_true, y_pred, labels=[0, 2], target_names=
          target_names)
    
  • Line 1174, col. 17 in test_precision_recall_f1_no_labels():

      assert_warns(UndefinedMetricWarning, precision_recall_fscore_support,
          y_true, y_pred, average=average, beta=beta)
    
  • Line 1183, col. 12 in test_precision_recall_f1_no_labels():

      assert_warns(UndefinedMetricWarning, fbeta_score, y_true, y_pred, beta=beta,
          average=average)
    
  • Line 1203, col. 17 in test_precision_recall_f1_no_labels_average_none():

      assert_warns(UndefinedMetricWarning, precision_recall_fscore_support,
          y_true, y_pred, average=None, beta=beta)
    
  • Line 1211, col. 12 in test_precision_recall_f1_no_labels_average_none():

      assert_warns(UndefinedMetricWarning, fbeta_score, y_true, y_pred, beta=beta,
          average=None)
    
  • Line 1263, col. 4 in test_recall_warnings():

      assert_no_warnings(recall_score, np.array([[1, 1], [1, 1]]), np.array([[0, 
          0], [0, 0]]), average='micro')
    
  • Line 1267, col. 4 in test_recall_warnings():

      clean_warning_registry()
    
  • Line 1268, col. 9 in test_recall_warnings():

      warnings.catch_warnings(record=True)
    
  • Line 1269, col. 8 in test_recall_warnings():

      warnings.simplefilter('always')
    
  • Line 1279, col. 4 in test_precision_warnings():

      clean_warning_registry()
    
  • Line 1280, col. 9 in test_precision_warnings():

      warnings.catch_warnings(record=True)
    
  • Line 1281, col. 8 in test_precision_warnings():

      warnings.simplefilter('always')
    
  • Line 1290, col. 4 in test_precision_warnings():

      assert_no_warnings(precision_score, np.array([[0, 0], [0, 0]]), np.array([[
          1, 1], [1, 1]]), average='micro')
    
  • Line 1297, col. 4 in test_fscore_warnings():

      clean_warning_registry()
    
  • Line 1298, col. 9 in test_fscore_warnings():

      warnings.catch_warnings(record=True)
    
  • Line 1299, col. 8 in test_fscore_warnings():

      warnings.simplefilter('always')
    

metrics/tests/test_regression.py

metrics/__init__.py

metrics/setup.py

metrics/pairwise.py

  • Line 117, col. 12 in check_pairwise_arrays():

      raise ValueError(
          'Precomputed metric requires shape (n_queries, n_indexed). Got (%d, %d) for %d indexed.'
           % (X.shape[0], X.shape[1], Y.shape[0]))
    
  • Line 122, col. 8 in check_pairwise_arrays():

      raise ValueError(
          'Incompatible dimension for X and Y matrices: X.shape[1] == %d while Y.shape[1] == %d'
           % (X.shape[1], Y.shape[1]))
    
  • Line 158, col. 8 in check_paired_arrays():

      raise ValueError(
          'X and Y should be of same shape. They were respectively %r and %r long.' %
          (X.shape, Y.shape))
    
  • Line 231, col. 12 in euclidean_distances():

      raise ValueError('Incompatible dimensions for X and X_norm_squared')
    
  • Line 242, col. 12 in euclidean_distances():

      raise ValueError('Incompatible dimensions for Y and Y_norm_squared')
    
  • Line 342, col. 8 in pairwise_distances_argmin_min():

      warnings.warn(
          "'batch_size' is ignored. It was deprecated in version 0.20 and will be removed in version 0.22. Use sklearn.set_config(working_memory=...) instead."
          , DeprecationWarning)
    
  • Line 500, col. 8 in manhattan_distances():

      warnings.warn(
          'Use of the "size_threshold" is deprecated in 0.19 and it will be removed version 0.21 of scikit-learn'
          , DeprecationWarning)
    
  • Line 507, col. 12 in manhattan_distances():

      raise TypeError('sum_over_features=%r not supported for sparse matrices' %
          sum_over_features)
    
  • Line 696, col. 8 in paired_distances():

      raise ValueError('Unknown distance %s' % metric)
    
  • Line 961, col. 8 in additive_chi2_kernel():

      raise ValueError('additive_chi2 does not support sparse matrices.')
    
  • Line 964, col. 8 in additive_chi2_kernel():

      raise ValueError('X contains negative values.')
    
  • Line 966, col. 8 in additive_chi2_kernel():

      raise ValueError('Y contains negative values.')
    
  • Line 1131, col. 8 in _check_chunk_size():

      raise TypeError(
          'reduce_func returned %r. Expected sequence(s) of length %d.' % (
          reduced if is_tuple else reduced[0], chunk_size))
    
  • Line 1138, col. 8 in _check_chunk_size():

      raise ValueError(
          'reduce_func returned object of length %s. Expected same length as input: %d.'
           % (actual_size if is_tuple else actual_size[0], chunk_size))
    
  • Line 1383, col. 8 in pairwise_distances():

      raise ValueError(
          "Unknown metric %s. Valid metrics are %s, or 'precomputed', or a callable"
           % (metric, _VALID_METRICS))
    
  • Line 1396, col. 12 in pairwise_distances():

      raise TypeError('scipy distance metrics do not support sparse matrices.')
    
  • Line 1564, col. 8 in pairwise_kernels():

      raise ValueError('Unknown kernel %r' % metric)
    

metrics/ranking.py

  • Line 94, col. 8 in auc():

      raise ValueError(
          'At least 2 points are needed to compute area under curve, but x.shape = %s'
           % x.shape)
    
  • Line 98, col. 8 in auc():

      warnings.warn(
          "The 'reorder' parameter has been deprecated in version 0.20 and will be removed in 0.22. It is recommended not to set 'reorder' and ensure that x is monotonic increasing or monotonic decreasing."
          , DeprecationWarning)
    
  • Line 116, col. 16 in auc():

      raise ValueError('x is neither increasing nor decreasing : {}.'.format(x))
    
  • Line 303, col. 12 in roc_auc_score():

      raise ValueError(
          'Only one class present in y_true. ROC AUC score is not defined in that case.'
          )
    
  • Line 311, col. 12 in roc_auc_score():

      raise ValueError('Expected max_frp in range ]0, 1], got: %r' % max_fpr)
    
  • Line 376, col. 8 in _binary_clf_curve():

      raise ValueError('{0} format is not supported'.format(y_type))
    
  • Line 395, col. 8 in _binary_clf_curve():

      raise ValueError('Data is not binary and pos_label is not specified')
    
  • Line 624, col. 8 in roc_curve():

      warnings.warn(
          'No negative samples in y_true, false positive value should be meaningless'
          , UndefinedMetricWarning)
    
  • Line 632, col. 8 in roc_curve():

      warnings.warn(
          'No positive samples in y_true, true positive value should be meaningless',
          UndefinedMetricWarning)
    
  • Line 690, col. 8 in label_ranking_average_precision_score():

      raise ValueError('y_true and y_score have different shape')
    
  • Line 696, col. 8 in label_ranking_average_precision_score():

      raise ValueError('{0} format is not supported'.format(y_type))
    
  • Line 775, col. 8 in coverage_error():

      raise ValueError('{0} format is not supported'.format(y_type))
    
  • Line 778, col. 8 in coverage_error():

      raise ValueError('y_true and y_score have different shape')
    
  • Line 834, col. 8 in label_ranking_loss():

      raise ValueError('{0} format is not supported'.format(y_type))
    
  • Line 837, col. 8 in label_ranking_loss():

      raise ValueError('y_true and y_score have different shape')
    

metrics/base.py

  • Line 67, col. 8 in _average_binary_score():

      raise ValueError('average has to be one of {0}'.format(average_options))
    
  • Line 72, col. 8 in _average_binary_score():

      raise ValueError('{0} format is not supported'.format(y_type))
    

metrics/scorer.py

  • Line 170, col. 12 in _ThresholdScorer():

      raise ValueError('{0} format is not supported'.format(y_type))
    
  • Line 218, col. 12 in get_scorer():

      raise ValueError('%r is not a valid scoring value. Valid options are %s' %
          (scoring, sorted(SCORERS.keys())))
    
  • Line 257, col. 8 in check_scoring():

      raise TypeError(
          "estimator should be an estimator implementing 'fit' method, %r was passed"
           % estimator)
    
  • Line 268, col. 12 in check_scoring():

      raise ValueError(
          'scoring value %r looks like it is a metric function rather than a scorer. A scorer should require an estimator as its first parameter. Please use `make_scorer` to convert a metric to a scorer.'
           % scoring)
    
  • Line 280, col. 12 in check_scoring():

      raise TypeError(
          "If no scoring is specified, the estimator passed should have a 'score' method. The estimator %r does not."
           % estimator)
    
  • Line 285, col. 8 in check_scoring():

      raise ValueError(
          'For evaluating multiple scores, use sklearn.model_selection.cross_validate instead. {0} was passed.'
          .format(scoring))
    
  • Line 289, col. 8 in check_scoring():

      raise ValueError(
          'scoring value should either be a callable, string or None. %r was passed'
           % scoring)
    
  • Line 349, col. 16 in _check_multimetric_scoring():

      raise ValueError(err_msg)
    
  • Line 352, col. 16 in _check_multimetric_scoring():

      raise ValueError(err_msg + 
          'Duplicate elements were found in the given list. %r' % repr(scoring))
    
  • Line 357, col. 24 in _check_multimetric_scoring():

      raise ValueError(err_msg + 
          'One or more of the elements were callables. Use a dict of score name mapped to the scorer callable. Got %r'
           % repr(scoring))
    
  • Line 363, col. 24 in _check_multimetric_scoring():

      raise ValueError(err_msg + 
          'Non-string types were found in the given list. Got %r' % repr(scoring))
    
  • Line 370, col. 16 in _check_multimetric_scoring():

      raise ValueError(err_msg + 'Empty list was given. %r' % repr(scoring))
    
  • Line 376, col. 16 in _check_multimetric_scoring():

      raise ValueError(
          'Non-string types were found in the keys of the given dict. scoring=%r' %
          repr(scoring))
    
  • Line 379, col. 16 in _check_multimetric_scoring():

      raise ValueError('An empty dict was passed. %r' % repr(scoring))
    
  • Line 384, col. 12 in _check_multimetric_scoring():

      raise ValueError(err_msg_generic)
    
  • Line 443, col. 8 in make_scorer():

      raise ValueError(
          'Set either needs_proba or needs_threshold to True, but not both.')
    

mixture/tests/test_mixture.py

mixture/tests/test_bayesian_mixture.py

  • Line 284, col. 1 in test_monotonic_likelihood():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 370, col. 1 in test_check_covariance_precision():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 403, col. 1 in test_invariant_translation():

      ignore_warnings(category=ConvergenceWarning)
    

mixture/tests/__init__.py

mixture/tests/test_gaussian_mixture.py

  • Line 672, col. 8 in test_gaussian_mixture_fit_convergence_warning():

      assert_warns_message(ConvergenceWarning, 
          'Initialization %d did not converge. Try different init parameters, or increase max_iter, tol or check for degenerate data.'
           % max_iter, g.fit, X)
    
  • Line 781, col. 9 in test_warm_start():

      warnings.catch_warnings()
    
  • Line 782, col. 8 in test_warm_start():

      warnings.simplefilter('ignore', ConvergenceWarning)
    
  • Line 800, col. 9 in test_warm_start():

      warnings.catch_warnings()
    
  • Line 801, col. 8 in test_warm_start():

      warnings.simplefilter('ignore', ConvergenceWarning)
    
  • Line 826, col. 9 in test_score():

      warnings.catch_warnings()
    
  • Line 827, col. 8 in test_score():

      warnings.simplefilter('ignore', ConvergenceWarning)
    
  • Line 873, col. 13 in test_monotonic_likelihood():

      warnings.catch_warnings()
    
  • Line 874, col. 12 in test_monotonic_likelihood():

      warnings.simplefilter('ignore', ConvergenceWarning)
    
  • Line 905, col. 13 in test_regularisation():

      warnings.catch_warnings()
    
  • Line 906, col. 12 in test_regularisation():

      warnings.simplefilter('ignore', RuntimeWarning)
    
  • Line 991, col. 1 in test_init():

      ignore_warnings(category=ConvergenceWarning)
    

mixture/__init__.py

mixture/bayesian_mixture.py

  • Line 339, col. 12 in BayesianGaussianMixture():

      raise ValueError(
          "Invalid value for 'covariance_type': %s 'covariance_type' should be in ['spherical', 'tied', 'diag', 'full']"
           % self.covariance_type)
    
  • Line 346, col. 12 in BayesianGaussianMixture():

      raise ValueError(
          "Invalid value for 'weight_concentration_prior_type': %s 'weight_concentration_prior_type' should be in ['dirichlet_process', 'dirichlet_distribution']"
           % self.weight_concentration_prior_type)
    
  • Line 365, col. 12 in BayesianGaussianMixture():

      raise ValueError(
          "The parameter 'weight_concentration_prior' should be greater than 0., but got %.3f."
           % self.weight_concentration_prior)
    
  • Line 383, col. 12 in BayesianGaussianMixture():

      raise ValueError(
          "The parameter 'mean_precision_prior' should be greater than 0., but got %.3f."
           % self.mean_precision_prior)
    
  • Line 409, col. 12 in BayesianGaussianMixture():

      raise ValueError(
          "The parameter 'degrees_of_freedom_prior' should be greater than %d, but got %.3f."
           % (n_features - 1, self.degrees_of_freedom_prior))
    
  • Line 450, col. 12 in BayesianGaussianMixture():

      raise ValueError(
          "The parameter 'spherical covariance_prior' should be greater than 0., but got %.3f."
           % self.covariance_prior)
    

mixture/gaussian_mixture.py

  • Line 43, col. 8 in _check_weights():

      raise ValueError(
          "The parameter 'weights' should be in the range [0, 1], but got max value %.5f, min value %.5f"
           % (np.min(weights), np.max(weights)))
    
  • Line 49, col. 8 in _check_weights():

      raise ValueError(
          "The parameter 'weights' should be normalized, but got sum(weights) = %.5f"
           % np.sum(weights))
    
  • Line 80, col. 8 in _check_precision_positivity():

      raise ValueError("'%s precision' should be positive" % covariance_type)
    
  • Line 88, col. 8 in _check_precision_matrix():

      raise ValueError("'%s precision' should be symmetric, positive-definite" %
          covariance_type)
    
  • Line 320, col. 16 in _compute_precision_cholesky():

      raise ValueError(estimate_precision_error_message)
    
  • Line 329, col. 12 in _compute_precision_cholesky():

      raise ValueError(estimate_precision_error_message)
    
  • Line 334, col. 12 in _compute_precision_cholesky():

      raise ValueError(estimate_precision_error_message)
    
  • Line 606, col. 12 in GaussianMixture():

      raise ValueError(
          "Invalid value for 'covariance_type': %s 'covariance_type' should be in ['spherical', 'tied', 'diag', 'full']"
           % self.covariance_type)
    

mixture/base.py

  • Line 37, col. 8 in _check_shape():

      raise ValueError(
          "The parameter '%s' should have the shape of %s, but got %s" % (name,
          param_shape, param.shape))
    
  • Line 57, col. 8 in _check_X():

      raise ValueError(
          'Expected n_samples >= n_components but got n_components = %d, n_samples = %d'
           % (n_components, X.shape[0]))
    
  • Line 61, col. 8 in _check_X():

      raise ValueError(
          'Expected the input data X have %d features, but got %d features' % (
          n_features, X.shape[1]))
    
  • Line 96, col. 12 in BaseMixture():

      raise ValueError(
          "Invalid value for 'n_components': %d Estimation requires at least one component"
           % self.n_components)
    
  • Line 101, col. 12 in BaseMixture():

      raise ValueError(
          "Invalid value for 'tol': %.5f Tolerance used by the EM must be non-negative"
           % self.tol)
    
  • Line 106, col. 12 in BaseMixture():

      raise ValueError(
          "Invalid value for 'n_init': %d Estimation requires at least one run" %
          self.n_init)
    
  • Line 111, col. 12 in BaseMixture():

      raise ValueError(
          "Invalid value for 'max_iter': %d Estimation requires at least one iteration"
           % self.max_iter)
    
  • Line 116, col. 12 in BaseMixture():

      raise ValueError(
          "Invalid value for 'reg_covar': %.5f regularization on covariance must be non-negative"
           % self.reg_covar)
    
  • Line 155, col. 12 in BaseMixture():

      raise ValueError("Unimplemented initialization method '%s'" % self.init_params)
    
  • Line 260, col. 12 in BaseMixture():

      warnings.warn(
          'Initialization %d did not converge. Try different init parameters, or increase max_iter, tol or check for degenerate data.'
           % (init + 1), ConvergenceWarning)
    
  • Line 409, col. 12 in BaseMixture():

      raise ValueError(
          "Invalid value for 'n_samples': %d . The sampling requires at least one sample."
           % self.n_components)
    

model_selection/_search.py

  • Line 97, col. 12 in ParameterGrid():

      raise TypeError('Parameter grid is not a dict or a list ({!r})'.format(
          param_grid))
    
  • Line 108, col. 16 in ParameterGrid():

      raise TypeError('Parameter grid is not a dict ({!r})'.format(grid))
    
  • Line 112, col. 20 in ParameterGrid():

      raise TypeError('Parameter grid value is not iterable (key={!r}, value={!r})'
          .format(key, grid[key]))
    
  • Line 184, col. 8 in ParameterGrid():

      raise IndexError('ParameterGrid index out of range')
    
  • Line 267, col. 16 in ParameterSampler():

      warnings.warn(
          'The total space of parameters %d is smaller than n_iter=%d. Running %d iterations. For exhaustive searches, use GridSearchCV.'
           % (grid_size, self.n_iter, grid_size), UserWarning)
    
  • Line 373, col. 16 in _check_param_grid():

      raise ValueError('Parameter array should be one-dimensional.')
    
  • Line 377, col. 16 in _check_param_grid():

      raise ValueError(
          'Parameter values for parameter ({0}) need to be a sequence(but not a string) or np.ndarray.'
          .format(name))
    
  • Line 382, col. 16 in _check_param_grid():

      raise ValueError(
          'Parameter values for parameter ({0}) need to be a non-empty sequence.'
          .format(name))
    
  • Line 457, col. 12 in BaseSearchCV():

      raise ValueError(
          "No score function explicitly defined, and the estimator doesn't provide one %s"
           % self.best_estimator_)
    
  • Line 465, col. 12 in BaseSearchCV():

      raise NotFittedError(
          'This %s instance was initialized with refit=False. %s is available only after refitting on the best parameters. You can refit an estimator manually using the ``best_parameters_`` attribute'
           % (type(self).__name__, method_name))
    
  • Line 605, col. 12 in BaseSearchCV():

      warnings.warn(
          '"fit_params" as a constructor argument was deprecated in version 0.19 and will be removed in version 0.21. Pass fit parameters to the "fit" method instead.'
          , DeprecationWarning)
    
  • Line 610, col. 16 in BaseSearchCV():

      warnings.warn(
          'Ignoring fit_params passed as a constructor argument in favor of keyword arguments to the "fit" method.'
          , RuntimeWarning)
    
  • Line 626, col. 16 in BaseSearchCV():

      raise ValueError(
          'For multi-metric scoring, the parameter refit must be set to a scorer key to refit an estimator with the best parameter setting on the whole data and make the best_* attributes available for that metric. If this is not needed, refit should be set to False explicitly. %r was passed.'
           % self.refit)
    
  • Line 733, col. 16 in BaseSearchCV():

      warnings.warn(
          'The default of the `iid` parameter will change from True to False in version 0.22 and will be removed in 0.24. This will change numeric results when test-set sizes are unequal.'
          , DeprecationWarning)
    
  • Line 758, col. 24 in BaseSearchCV():

      results.add_warning(key, message, FutureWarning)
    

model_selection/tests/test_split.py

  • Line 103, col. 12 in MockClassifier():

      raise ValueError('X cannot be d')
    
  • Line 273, col. 4 in test_kfold_valueerrors():

      assert_warns_message(Warning, 'The least populated class', next, skf_3.
          split(X2, y))
    
  • Line 279, col. 9 in test_kfold_valueerrors():

      warnings.catch_warnings()
    
  • Line 280, col. 8 in test_kfold_valueerrors():

      warnings.simplefilter('ignore')
    
  • Line 484, col. 16 in test_shuffle_kfold_stratifiedkfold_reproducibility():

      raise AssertionError(
          'The splits for data, %s, are same even when random state is not set' %
          data)
    
  • Line 1309, col. 9 in test_group_kfold():

      warnings.catch_warnings()
    
  • Line 1310, col. 8 in test_group_kfold():

      warnings.simplefilter('ignore', DeprecationWarning)
    
  • Line 1412, col. 4 in test_train_test_default_warning():

      assert_warns(FutureWarning, ShuffleSplit, train_size=0.75)
    
  • Line 1413, col. 4 in test_train_test_default_warning():

      assert_warns(FutureWarning, GroupShuffleSplit, train_size=0.75)
    
  • Line 1414, col. 4 in test_train_test_default_warning():

      assert_warns(FutureWarning, StratifiedShuffleSplit, train_size=0.75)
    
  • Line 1415, col. 4 in test_train_test_default_warning():

      assert_warns(FutureWarning, train_test_split, range(3), train_size=0.75)
    

model_selection/tests/test_validation.py

  • Line 104, col. 8 in MockImprovingEstimator():

      raise NotImplementedError
    
  • Line 144, col. 8 in MockEstimatorWithParameter():

      raise NotImplementedError
    
  • Line 165, col. 8 in MockEstimatorWithSingleFitCallAllowed():

      raise NotImplementedError
    
  • Line 194, col. 12 in MockClassifier():

      raise ValueError('X cannot be d')
    
  • Line 402, col. 22 in test_cross_validate_return_train_score_warn():

      assert_no_warnings(cross_validate, estimator, X, y, return_train_score=val)
    
  • Line 410, col. 18 in test_cross_validate_return_train_score_warn():

      assert_warns_message(FutureWarning, msg, result['warn'].get, 'train_score')
    
  • Line 629, col. 9 in test_cross_val_score_score_func():

      warnings.catch_warnings(record=True)
    
  • Line 826, col. 4 in test_cross_val_predict():

      assert_warns_message(RuntimeWarning, warning_message, cross_val_predict,
          LogisticRegression(), X, y, method='predict_proba', cv=KFold(2))
    
  • Line 984, col. 13 in test_learning_curve():

      warnings.catch_warnings(record=True)
    
  • Line 990, col. 12 in test_learning_curve():

      raise RuntimeError('Unexpected warning: %r' % w[0].message)
    
  • Line 1000, col. 13 in test_learning_curve():

      warnings.catch_warnings(record=True)
    
  • Line 1007, col. 12 in test_learning_curve():

      raise RuntimeError('Unexpected warning: %r' % w[0].message)
    
  • Line 1132, col. 24 in test_learning_curve_remove_duplicate_sample_sizes():

      assert_warns(RuntimeWarning, learning_curve, estimator, X, y, cv=3,
          train_sizes=np.linspace(0.33, 1.0, 3))
    
  • Line 1192, col. 9 in test_validation_curve():

      warnings.catch_warnings(record=True)
    
  • Line 1198, col. 8 in test_validation_curve():

      raise RuntimeError('Unexpected warning: %r' % w[0].message)
    
  • Line 1453, col. 4 in test_fit_and_score():

      assert_warns(FitFailedWarning, _fit_and_score, *fit_and_score_args, **
          fit_and_score_kwargs)
    
  • Line 1463, col. 4 in test_fit_and_score():

      assert_warns_message(FitFailedWarning, warning_message, _fit_and_score, *
          fit_and_score_args, **fit_and_score_kwargs)
    
  • Line 1477, col. 8 in test_fit_and_score():

      assert_warns_message(FutureWarning, warning_message, _fit_and_score, *
          fit_and_score_args)
    

model_selection/tests/test_search.py

  • Line 120, col. 8 in LinearSVCNoScore():

      raise AttributeError
    
  • Line 241, col. 4 in test_grid_search_fit_params_deprecation():

      assert_warns(DeprecationWarning, grid_search.fit, X, y)
    
  • Line 262, col. 4 in test_grid_search_fit_params_two_places():

      assert_warns_message(RuntimeWarning, expected_warning, grid_search.fit, X,
          y, spam=np.ones(10))
    
  • Line 369, col. 23 in test_return_train_score_warn():

      ignore_warnings(estimator.fit, category=ConvergenceWarning)
    
  • Line 371, col. 26 in test_return_train_score_warn():

      assert_no_warnings(fit_func, X, y)
    
  • Line 381, col. 22 in test_return_train_score_warn():

      assert_warns_message(FutureWarning, msg, result['warn'].get, key)
    
  • Line 388, col. 12 in test_return_train_score_warn():

      assert_no_warnings(result['warn'].get, key)
    
  • Line 888, col. 1 in test_search_iid_param():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1127, col. 0 in test_search_cv_timing():

      ignore_warnings()
    
  • Line 1311, col. 12 in FailingClassifier():

      raise ValueError('Failing classifier failed as required')
    
  • Line 1332, col. 4 in test_grid_search_failing_classifier():

      assert_warns(FitFailedWarning, gs.fit, X, y)
    
  • Line 1348, col. 4 in test_grid_search_failing_classifier():

      assert_warns(FitFailedWarning, gs.fit, X, y)
    
  • Line 1389, col. 4 in test_parameters_sampler_replacement():

      assert_warns_message(UserWarning, expected_warning, list, sampler)
    
  • Line 1548, col. 4 in test_deprecated_grid_search_iid():

      assert_no_warnings(grid.fit, X, y)
    
  • Line 1552, col. 4 in test_deprecated_grid_search_iid():

      assert_warns_message(DeprecationWarning, depr_message, grid.fit, X, y)
    
  • Line 1556, col. 4 in test_deprecated_grid_search_iid():

      assert_warns_message(DeprecationWarning, depr_message, grid.fit, X, y)
    
  • Line 1560, col. 4 in test_deprecated_grid_search_iid():

      assert_no_warnings(grid.fit, X, y)
    

model_selection/tests/__init__.py

model_selection/tests/common.py

model_selection/__init__.py

model_selection/_validation.py

  • Line 251, col. 16 in cross_validate():

      ret.add_warning(key, message, FutureWarning)
    
  • Line 495, col. 12 in _fit_and_score():

      raise
    
  • Line 497, col. 12 in _fit_and_score():

      warnings.warn(
          "From version 0.22, errors during fit will result in a cross validation score of NaN by default. Use error_score='raise' if you want an exception raised or error_score=np.nan to adopt the behavior from version 0.22."
          , FutureWarning)
    
  • Line 503, col. 12 in _fit_and_score():

      raise
    
  • Line 515, col. 12 in _fit_and_score():

      warnings.warn(
          """Estimator fit failed. The score on this train-test partition for these parameters will be set to %f. Details: 
      %s"""
           % (error_score, format_exception_only(type(e), e)[0]), FitFailedWarning)
    
  • Line 521, col. 12 in _fit_and_score():

      raise ValueError(
          "error_score must be the string 'raise' or a numeric value. (Hint: if using 'raise', please make sure that it has been spelled correctly.)"
          )
    
  • Line 581, col. 12 in _score():

      raise ValueError(
          'scoring must return a number, got %s (%s) instead. (scorer=%r)' % (str
          (score), type(score), scorer))
    
  • Line 607, col. 12 in _multimetric_score():

      raise ValueError(
          'scoring must return a number, got %s (%s) instead. (scorer=%s)' % (str
          (score), type(score), name))
    
  • Line 739, col. 8 in cross_val_predict():

      raise ValueError('cross_val_predict only works for partitions')
    
  • Line 814, col. 12 in _fit_and_predict():

      warnings.warn(
          'Number of classes in training fold ({}) does not match total number of classes ({}). Results may not be appropriate for your use case. {}'
          .format(len(estimator.classes_), n_classes, recommendation), RuntimeWarning
          )
    
  • Line 827, col. 20 in _fit_and_predict():

      raise ValueError(
          'Output shape {} of {} does not match number of classes ({}) in fold. Irregular decision_function outputs are not currently supported by cross_val_predict'
          .format(predictions.shape, method, len(estimator.classes_), recommendation)
          )
    
  • Line 837, col. 20 in _fit_and_predict():

      raise ValueError(
          'Only {} class/es in training fold, this is not supported for decision_function with imbalanced folds. {}'
          .format(len(estimator.classes_), recommendation))
    
  • Line 1135, col. 8 in learning_curve():

      raise ValueError(
          'An estimator must support the partial_fit interface to exploit incremental learning'
          )
    
  • Line 1216, col. 12 in _translate_train_sizes():

      raise ValueError(
          'train_sizes has been interpreted as fractions of the maximum number of training samples and must be within (0, 1], but is within [%f, %f].'
           % (n_min_required_samples, n_max_required_samples))
    
  • Line 1228, col. 12 in _translate_train_sizes():

      raise ValueError(
          'train_sizes has been interpreted as absolute numbers of training samples and must be within (0, %d], but is within [%d, %d].'
           % (n_max_training_samples, n_min_required_samples, n_max_required_samples)
          )
    
  • Line 1237, col. 8 in _translate_train_sizes():

      warnings.warn(
          "Removed duplicate entries from 'train_sizes'. Number of ticks will be less than the size of 'train_sizes' %d instead of %d)."
           % (train_sizes_abs.shape[0], n_ticks), RuntimeWarning)
    

model_selection/_split.py

  • Line 108, col. 8 in BaseCrossValidator():

      raise NotImplementedError
    
  • Line 188, col. 12 in LeaveOneOut():

      raise ValueError("The 'X' parameter should not be None.")
    
  • Line 259, col. 12 in LeavePOut():

      raise ValueError("The 'X' parameter should not be None.")
    
  • Line 269, col. 12 in _BaseKFold():

      raise ValueError(
          'The number of folds must be of Integral type. %s of type %s was passed.' %
          (n_splits, type(n_splits)))
    
  • Line 275, col. 12 in _BaseKFold():

      raise ValueError(
          'k-fold cross-validation requires at least one train/test split by setting n_splits=2 or more, got n_splits={0}.'
          .format(n_splits))
    
  • Line 281, col. 12 in _BaseKFold():

      raise TypeError('shuffle must be True or False; got {0}'.format(shuffle))
    
  • Line 315, col. 12 in _BaseKFold():

      raise ValueError(
          'Cannot have number of splits n_splits={0} greater than the number of samples: n_samples={1}.'
          .format(self.n_splits, n_samples))
    
  • Line 481, col. 12 in GroupKFold():

      raise ValueError("The 'groups' parameter should not be None.")
    
  • Line 488, col. 12 in GroupKFold():

      raise ValueError(
          'Cannot have number of splits n_splits=%d greater than the number of groups: %d.'
           % (self.n_splits, n_groups))
    
  • Line 579, col. 12 in StratifiedKFold():

      raise ValueError('Supported target types are: {}. Got {!r} instead.'.format
          (allowed_target_types, type_of_target_y))
    
  • Line 589, col. 12 in StratifiedKFold():

      raise ValueError(
          'n_splits=%d cannot be greater than the number of members in each class.' %
          self.n_splits)
    
  • Line 593, col. 12 in StratifiedKFold():

      warnings.warn(
          'The least populated class in y has only %d members, which is too few. The minimum number of members in any class cannot be less than n_splits=%d.'
           % (min_groups, self.n_splits), Warning)
    
  • Line 750, col. 12 in TimeSeriesSplit():

      raise ValueError(
          'Cannot have number of folds ={0} greater than the number of samples: {1}.'
          .format(n_folds, n_samples))
    
  • Line 810, col. 12 in LeaveOneGroupOut():

      raise ValueError("The 'groups' parameter should not be None.")
    
  • Line 815, col. 12 in LeaveOneGroupOut():

      raise ValueError(
          'The groups parameter contains fewer than 2 unique groups (%s). LeaveOneGroupOut expects at least 2.'
           % unique_groups)
    
  • Line 844, col. 12 in LeaveOneGroupOut():

      raise ValueError("The 'groups' parameter should not be None.")
    
  • Line 909, col. 12 in LeavePGroupsOut():

      raise ValueError("The 'groups' parameter should not be None.")
    
  • Line 913, col. 12 in LeavePGroupsOut():

      raise ValueError(
          'The groups parameter contains fewer than (or equal to) n_groups (%d) numbers of unique groups (%s). LeavePGroupsOut expects that at least n_groups + 1 (%d) unique groups be present'
           % (self.n_groups, unique_groups, self.n_groups + 1))
    
  • Line 948, col. 12 in LeavePGroupsOut():

      raise ValueError("The 'groups' parameter should not be None.")
    
  • Line 979, col. 12 in _RepeatedSplits():

      raise ValueError('Number of repetitions must be of Integral type.')
    
  • Line 982, col. 12 in _RepeatedSplits():

      raise ValueError('Number of repetitions must be greater than 0.')
    
  • Line 985, col. 12 in _RepeatedSplits():

      raise ValueError('cvargs must not contain random_state or shuffle.')
    
  • Line 1365, col. 16 in GroupShuffleSplit():

      warnings.warn(
          'From version 0.21, test_size will always complement train_size unless both are specified.'
          , FutureWarning)
    
  • Line 1379, col. 12 in GroupShuffleSplit():

      raise ValueError("The 'groups' parameter should not be None.")
    
  • Line 1542, col. 12 in StratifiedShuffleSplit():

      raise ValueError(
          'The least populated class in y has only 1 member, which is too few. The minimum number of groups for any class cannot be less than 2.'
          )
    
  • Line 1548, col. 12 in StratifiedShuffleSplit():

      raise ValueError(
          'The train_size = %d should be greater or equal to the number of classes = %d'
           % (n_train, n_classes))
    
  • Line 1552, col. 12 in StratifiedShuffleSplit():

      raise ValueError(
          'The test_size = %d should be greater or equal to the number of classes = %d'
           % (n_test, n_classes))
    
  • Line 1632, col. 12 in _validate_shuffle_split_init():

      warnings.warn(
          'From version 0.21, test_size will always complement train_size unless both are specified.'
          , FutureWarning)
    
  • Line 1639, col. 8 in _validate_shuffle_split_init():

      raise ValueError('test_size and train_size can not both be None')
    
  • Line 1644, col. 16 in _validate_shuffle_split_init():

      raise ValueError('test_size=%f should be smaller than 1.0 or be an integer' %
          test_size)
    
  • Line 1649, col. 12 in _validate_shuffle_split_init():

      raise ValueError('Invalid value for test_size: %r' % test_size)
    
  • Line 1654, col. 16 in _validate_shuffle_split_init():

      raise ValueError(
          'train_size=%f should be smaller than 1.0 or be an integer' % train_size)
    
  • Line 1658, col. 16 in _validate_shuffle_split_init():

      raise ValueError(
          'The sum of test_size and train_size = %f, should be smaller than 1.0. Reduce test_size and/or train_size.'
           % (train_size + test_size))
    
  • Line 1664, col. 12 in _validate_shuffle_split_init():

      raise ValueError('Invalid value for train_size: %r' % train_size)
    
  • Line 1675, col. 8 in _validate_shuffle_split():

      raise ValueError(
          'test_size=%d should be smaller than the number of samples %d' % (
          test_size, n_samples))
    
  • Line 1681, col. 8 in _validate_shuffle_split():

      raise ValueError(
          'train_size=%d should be smaller than the number of samples %d' % (
          train_size, n_samples))
    
  • Line 1703, col. 8 in _validate_shuffle_split():

      raise ValueError(
          'The sum of train_size and test_size = %d, should be smaller than the number of samples %d. Reduce test_size and/or train_size.'
           % (n_train + n_test, n_samples))
    
  • Line 1908, col. 12 in check_cv():

      raise ValueError(
          'Expected cv as an integer, cross-validation object (from sklearn.model_selection) or an iterable. Got %s.'
           % cv)
    
  • Line 2006, col. 8 in train_test_split():

      raise ValueError('At least one array required as input')
    
  • Line 2014, col. 8 in train_test_split():

      raise TypeError('Invalid parameters passed: %s' % str(options))
    
  • Line 2019, col. 12 in train_test_split():

      warnings.warn(
          'From version 0.21, test_size will always complement train_size unless both are specified.'
          , FutureWarning)
    
  • Line 2031, col. 12 in train_test_split():

      raise ValueError(
          'Stratified train/test split is not implemented for shuffle=False')
    
  • Line 2081, col. 8 in _build_repr():

      warnings.simplefilter('always', DeprecationWarning)
    
  • Line 2083, col. 17 in _build_repr():

      warnings.catch_warnings(record=True)
    
  • Line 2089, col. 12 in _build_repr():

      warnings.filters.pop(0)
    

multiclass.py

  • Line 75, col. 12 in _fit_binary():

      warnings.warn('Label %s is present in all training examples.' % str(classes[c])
          )
    
  • Line 106, col. 8 in _check_estimator():

      raise ValueError(
          'The base estimator should implement decision_function or predict_proba!')
    
  • Line 248, col. 16 in OneVsRestClassifier():

      raise ValueError("Base estimator {0}, doesn't have partial_fit method".
          format(self.estimator))
    
  • Line 261, col. 12 in OneVsRestClassifier():

      raise ValueError(('Mini-batch contains {0} while classes ' +
          'must be subset of {1}').format(np.unique(y), self.classes_))
    
  • Line 388, col. 12 in OneVsRestClassifier():

      raise AttributeError("Base estimator doesn't have a coef_ attribute.")
    
  • Line 399, col. 12 in OneVsRestClassifier():

      raise AttributeError("Base estimator doesn't have an intercept_ attribute.")
    
  • Line 498, col. 12 in OneVsOneClassifier():

      raise ValueError(
          'OneVsOneClassifier can not be fit when only one class is present.')
    
  • Line 549, col. 12 in OneVsOneClassifier():

      raise ValueError('Mini-batch contains {0} while it must be subset of {1}'.
          format(np.unique(y), self.classes_))
    
  • Line 724, col. 12 in OutputCodeClassifier():

      raise ValueError('code_size should be greater than 0, got {0}'.format(self.
          code_size))
    

multioutput.py

  • Line 106, col. 12 in MultiOutputEstimator():

      raise ValueError(
          'y must have at least two dimensions for multi-output regression but has only one.'
          )
    
  • Line 111, col. 12 in MultiOutputEstimator():

      raise ValueError('Underlying estimator does not support sample weights.')
    
  • Line 148, col. 12 in MultiOutputEstimator():

      raise ValueError('The base estimator should implement a fit method')
    
  • Line 158, col. 12 in MultiOutputEstimator():

      raise ValueError(
          'y must have at least two dimensions for multi-output regression but has only one.'
          )
    
  • Line 163, col. 12 in MultiOutputEstimator():

      raise ValueError('Underlying estimator does not support sample weights.')
    
  • Line 189, col. 12 in MultiOutputEstimator():

      raise ValueError('The base estimator should implement a predict method')
    
  • Line 333, col. 12 in MultiOutputClassifier():

      raise ValueError('The base estimator should implementpredict_proba method')
    
  • Line 359, col. 12 in MultiOutputClassifier():

      raise ValueError(
          'y must have at least two dimensions for multi target classification but has only one'
          )
    
  • Line 362, col. 12 in MultiOutputClassifier():

      raise ValueError(
          'The number of outputs of Y for fit {0} and score {1} should be same'.
          format(n_outputs_, y.shape[1]))
    
  • Line 402, col. 16 in _BaseChain():

      raise ValueError('invalid order')
    

naive_bayes.py

  • Line 371, col. 20 in GaussianNB():

      raise ValueError('Number of priors must match number of classes.')
    
  • Line 375, col. 20 in GaussianNB():

      raise ValueError('The sum of the priors should be 1.')
    
  • Line 378, col. 20 in GaussianNB():

      raise ValueError('Priors must be non-negative.')
    
  • Line 387, col. 16 in GaussianNB():

      raise ValueError(msg % (X.shape[1], self.theta_.shape[1]))
    
  • Line 397, col. 12 in GaussianNB():

      raise ValueError(
          'The target label(s) %s in y do not exist in the initial classes %s' %
          (unique_y[~unique_y_in_classes], classes))
    
  • Line 460, col. 16 in BaseDiscreteNB():

      raise ValueError('Number of priors must match number of classes.')
    
  • Line 472, col. 12 in BaseDiscreteNB():

      raise ValueError('Smoothing parameter alpha = %.1e. alpha should be > 0.' %
          np.min(self.alpha))
    
  • Line 476, col. 16 in BaseDiscreteNB():

      raise ValueError(
          'alpha should be a scalar or a numpy array with shape [n_features]')
    
  • Line 479, col. 12 in BaseDiscreteNB():

      warnings.warn(
          'alpha too small will result in numeric errors, setting alpha = %.1e' %
          _ALPHA_MIN)
    
  • Line 532, col. 12 in BaseDiscreteNB():

      raise ValueError(msg % (n_features, self.coef_.shape[-1]))
    
  • Line 542, col. 12 in BaseDiscreteNB():

      raise ValueError(msg % (X.shape[0], y.shape[0]))
    
  • Line 714, col. 12 in MultinomialNB():

      raise ValueError('Input X must be non-negative')
    
  • Line 812, col. 12 in ComplementNB():

      raise ValueError('Input X must be non-negative')
    
  • Line 945, col. 12 in BernoulliNB():

      raise ValueError('Expected input with %d features, got %d instead' % (
          n_features, n_features_X))
    

neighbors/lof.py

  • Line 148, col. 12 in LocalOutlierFactor():

      warnings.warn(
          'default contamination parameter 0.1 will change in version 0.22 to "auto". This will change the predict method behavior.'
          , DeprecationWarning)
    
  • Line 189, col. 16 in LocalOutlierFactor():

      raise ValueError('contamination must be in (0, 0.5], got: %f' % self.
          contamination)
    
  • Line 196, col. 12 in LocalOutlierFactor():

      warnings.warn(
          'n_neighbors (%s) is greater than the total number of samples (%s). n_neighbors will be set to (n_samples - 1) for estimation.'
           % (self.n_neighbors, n_samples))
    

neighbors/regression.py

  • Line 149, col. 12 in KNeighborsRegressor():

      raise ValueError(
          'Sparse matrices not supported for prediction with precomputed kernels. Densify your matrix.'
          )
    
  • Line 323, col. 12 in RadiusNeighborsRegressor():

      warnings.warn(empty_warning_msg)
    

neighbors/approximate.py

  • Line 78, col. 12 in ProjectionToHashMixin():

      raise ValueError(
          'Require reduced dimensionality to be a multiple of 8 for hashing')
    
  • Line 218, col. 8 in LSHForest():

      warnings.warn(
          'LSHForest has poor performance and has been deprecated in 0.19. It will be removed in version 0.21.'
          , DeprecationWarning)
    
  • Line 286, col. 12 in LSHForest():

      warnings.warn(
          'Number of candidates is not sufficient to retrieve %i neighbors with min_hash_match = %i. Candidates are filled up uniformly from unselected indices.'
           % (n_neighbors, self.min_hash_match))
    
  • Line 429, col. 12 in LSHForest():

      raise ValueError('estimator should be fitted.')
    
  • Line 489, col. 12 in LSHForest():

      raise ValueError('estimator should be fitted.')
    
  • Line 526, col. 12 in LSHForest():

      raise ValueError('Number of features in X and fitted array does not match.')
    

neighbors/unsupervised.py

neighbors/classification.py

  • Line 365, col. 12 in RadiusNeighborsClassifier():

      raise ValueError(
          'No neighbors found for test samples %r, you can try using larger radius, give a label for outliers, or consider removing them from your dataset.'
           % outliers)
    

neighbors/graph.py

  • Line 18, col. 12 in _check_params():

      raise ValueError(
          'Got %s for %s, while the estimator has %s for the same parameter.' % (
          func_param, param_name, est_params[param_name]))
    

neighbors/kde.py

  • Line 92, col. 12 in KernelDensity():

      raise ValueError('bandwidth must be positive')
    
  • Line 94, col. 12 in KernelDensity():

      raise ValueError("invalid kernel: '{0}'".format(kernel))
    
  • Line 106, col. 16 in KernelDensity():

      raise ValueError("invalid metric: '{0}'".format(metric))
    
  • Line 109, col. 16 in KernelDensity():

      raise ValueError("invalid metric for {0}: '{1}'".format(TREE_DICT[algorithm
          ], metric))
    
  • Line 114, col. 12 in KernelDensity():

      raise ValueError("invalid algorithm: '{0}'".format(algorithm))
    
  • Line 134, col. 16 in KernelDensity():

      raise ValueError('the shape of sample_weight must be ({0},), but was {1}'.
          format(X.shape[0], sample_weight.shape))
    
  • Line 139, col. 16 in KernelDensity():

      raise ValueError('sample_weight must have positive values')
    
  • Line 218, col. 12 in KernelDensity():

      raise NotImplementedError()
    

neighbors/tests/test_nearest_centroid.py

neighbors/tests/test_kde.py

  • Line 32, col. 8 in compute_kernel_slow():

      raise ValueError('kernel not recognized')
    

neighbors/tests/test_dist_metrics.py

neighbors/tests/test_lof.py

  • Line 121, col. 4 in test_n_neighbors_attribute():

      assert_warns_message(UserWarning,
          'n_neighbors will be set to (n_samples - 1)', clf.fit, X)
    
  • Line 147, col. 4 in test_deprecation():

      assert_warns_message(DeprecationWarning,
          'default contamination parameter 0.1 will change in version 0.22 to "auto"'
          , neighbors.LocalOutlierFactor)
    

neighbors/tests/test_kd_tree.py

  • Line 112, col. 8 in compute_kernel_slow():

      raise ValueError('kernel not recognized')
    

neighbors/tests/test_approximate.py

  • Line 30, col. 4 in test_lsh_forest_deprecation():

      assert_warns_message(DeprecationWarning,
          'LSHForest has poor performance and has been deprecated in 0.19. It will be removed in version 0.21.'
          , LSHForest)
    
  • Line 48, col. 15 in test_neighbors_accuracy_with_n_candidates():

      ignore_warnings(LSHForest, category=DeprecationWarning)(n_candidates=
          n_candidates, random_state=0)
    
  • Line 50, col. 8 in test_neighbors_accuracy_with_n_candidates():

      ignore_warnings(lshf.fit)(X)
    
  • Line 85, col. 15 in test_neighbors_accuracy_with_n_estimators():

      ignore_warnings(LSHForest, category=DeprecationWarning)(n_candidates=500,
          n_estimators=t)
    
  • Line 87, col. 8 in test_neighbors_accuracy_with_n_estimators():

      ignore_warnings(lshf.fit)(X)
    
  • Line 120, col. 11 in test_kneighbors():

      ignore_warnings(LSHForest, category=DeprecationWarning)(min_hash_match=0)
    
  • Line 125, col. 4 in test_kneighbors():

      ignore_warnings(lshf.fit)(X)
    
  • Line 172, col. 11 in test_radius_neighbors():

      ignore_warnings(LSHForest, category=DeprecationWarning)()
    
  • Line 176, col. 4 in test_radius_neighbors():

      ignore_warnings(lshf.fit)(X)
    
  • Line 246, col. 11 in test_radius_neighbors_boundary_handling():

      ignore_warnings(LSHForest, category=DeprecationWarning)(min_hash_match=0,
          n_candidates=n_points, random_state=42).fit(X)
    
  • Line 304, col. 11 in test_distances():

      ignore_warnings(LSHForest, category=DeprecationWarning)()
    
  • Line 305, col. 4 in test_distances():

      ignore_warnings(lshf.fit)(X)
    
  • Line 330, col. 11 in test_fit():

      ignore_warnings(LSHForest, category=DeprecationWarning)(n_estimators=
          n_estimators)
    
  • Line 332, col. 4 in test_fit():

      ignore_warnings(lshf.fit)(X)
    
  • Line 360, col. 11 in test_partial_fit():

      ignore_warnings(LSHForest, category=DeprecationWarning)()
    
  • Line 363, col. 4 in test_partial_fit():

      ignore_warnings(lshf.partial_fit)(X)
    
  • Line 366, col. 4 in test_partial_fit():

      ignore_warnings(lshf.fit)(X)
    
  • Line 372, col. 4 in test_partial_fit():

      ignore_warnings(lshf.partial_fit)(X_partial_fit)
    
  • Line 397, col. 11 in test_hash_functions():

      ignore_warnings(LSHForest, category=DeprecationWarning)(n_estimators=
          n_estimators, random_state=rng.randint(0, np.iinfo(np.int32).max))
    
  • Line 400, col. 4 in test_hash_functions():

      ignore_warnings(lshf.fit)(X)
    
  • Line 425, col. 11 in test_candidates():

      ignore_warnings(LSHForest, category=DeprecationWarning)(min_hash_match=32)
    
  • Line 427, col. 4 in test_candidates():

      ignore_warnings(lshf.fit)(X_train)
    
  • Line 434, col. 4 in test_candidates():

      assert_warns_message(UserWarning, message, lshf.kneighbors, X_test,
          n_neighbors=3)
    
  • Line 440, col. 11 in test_candidates():

      ignore_warnings(LSHForest, category=DeprecationWarning)(min_hash_match=31)
    
  • Line 442, col. 4 in test_candidates():

      ignore_warnings(lshf.fit)(X_train)
    
  • Line 449, col. 4 in test_candidates():

      assert_warns_message(UserWarning, message, lshf.kneighbors, X_test,
          n_neighbors=5)
    
  • Line 463, col. 15 in test_graphs():

      ignore_warnings(LSHForest, category=DeprecationWarning)(min_hash_match=0)
    
  • Line 465, col. 8 in test_graphs():

      ignore_warnings(lshf.fit)(X)
    
  • Line 479, col. 20 in test_sparse_input():

      ignore_warnings(LSHForest, category=DeprecationWarning)(radius=1,
          random_state=0).fit(X1)
    
  • Line 481, col. 19 in test_sparse_input():

      ignore_warnings(LSHForest, category=DeprecationWarning)(radius=1,
          random_state=0).fit(X1.A)
    

neighbors/tests/__init__.py

neighbors/tests/test_neighbors.py

  • Line 51, col. 29 in <module>:

      ignore_warnings(neighbors.kneighbors_graph)
    
  • Line 52, col. 35 in <module>:

      ignore_warnings(neighbors.radius_neighbors_graph)
    
  • Line 689, col. 15 in test_radius_neighbors_regressor():

      assert_warns_message(UserWarning, empty_warning_msg, neigh.predict, X_test_nan)
    
  • Line 1086, col. 4 in test_metric_params_interface():

      assert_warns(SyntaxWarning, neighbors.KNeighborsClassifier, metric_params={
          'p': 3})
    
  • Line 1358, col. 1 in test_pairwise_boolean_distance():

      ignore_warnings(category=DataConversionWarning)
    

neighbors/tests/test_quad_tree.py

neighbors/tests/test_ball_tree.py

  • Line 144, col. 8 in compute_kernel_slow():

      raise ValueError('kernel not recognized')
    

neighbors/__init__.py

neighbors/setup.py

neighbors/nearest_centroid.py

  • Line 99, col. 12 in NearestCentroid():

      raise ValueError('Precomputed is not supported.')
    
  • Line 108, col. 12 in NearestCentroid():

      raise ValueError('threshold shrinking not supported for sparse input')
    
  • Line 118, col. 12 in NearestCentroid():

      raise ValueError(
          'The number of classes has to be greater than one; got %d class' %
          n_classes)
    
  • Line 141, col. 20 in NearestCentroid():

      warnings.warn(
          'Averaging for metrics other than euclidean and manhattan not supported. The average is set to be the mean.'
          )
    

neighbors/base.py

  • Line 56, col. 8 in _check_weights():

      raise ValueError(
          "weights not recognized: should be 'uniform', 'distance', or a callable function"
          )
    
  • Line 100, col. 8 in _get_weights():

      raise ValueError(
          "weights not recognized: should be 'uniform', 'distance', or a callable function"
          )
    
  • Line 125, col. 12 in NeighborsBase():

      raise ValueError("unrecognized algorithm: '%s'" % self.algorithm)
    
  • Line 141, col. 16 in NeighborsBase():

      raise ValueError("kd_tree algorithm does not support callable metric '%s'" %
          self.metric)
    
  • Line 145, col. 12 in NeighborsBase():

      raise ValueError("Metric '%s' not valid for algorithm '%s'" % (self.metric,
          self.algorithm))
    
  • Line 149, col. 12 in NeighborsBase():

      warnings.warn(
          'Parameter p is found in metric_params. The corresponding parameter from __init__ is ignored.'
          , SyntaxWarning, stacklevel=3)
    
  • Line 157, col. 12 in NeighborsBase():

      raise ValueError('p must be greater than one for minkowski metric')
    
  • Line 175, col. 16 in NeighborsBase():

      raise ValueError('p must be greater than one for minkowski metric')
    
  • Line 208, col. 12 in NeighborsBase():

      raise ValueError('n_samples must be greater than 0')
    
  • Line 212, col. 16 in NeighborsBase():

      warnings.warn('cannot use tree with sparse input: using brute force')
    
  • Line 217, col. 16 in NeighborsBase():

      raise ValueError("metric '%s' not valid for sparse input" % self.
          effective_metric_)
    
  • Line 254, col. 12 in NeighborsBase():

      raise ValueError("algorithm = '%s' not recognized" % self.algorithm)
    
  • Line 259, col. 16 in NeighborsBase():

      raise ValueError('Expected n_neighbors > 0. Got %d' % self.n_neighbors)
    
  • Line 265, col. 20 in NeighborsBase():

      raise TypeError('n_neighbors does not take %s value, enter integer value' %
          type(self.n_neighbors))
    
  • Line 373, col. 12 in KNeighborsMixin():

      raise ValueError('Expected n_neighbors > 0. Got %d' % n_neighbors)
    
  • Line 379, col. 16 in KNeighborsMixin():

      raise TypeError('n_neighbors does not take %s value, enter integer value' %
          type(n_neighbors))
    
  • Line 396, col. 12 in KNeighborsMixin():

      raise ValueError(
          'Expected n_neighbors <= n_samples,  but n_samples = %d, n_neighbors = %d'
           % (train_size, n_neighbors))
    
  • Line 422, col. 16 in KNeighborsMixin():

      raise ValueError(
          "%s does not work with sparse matrices. Densify the data, or set algorithm='brute'"
           % self._fit_method)
    
  • Line 431, col. 12 in KNeighborsMixin():

      raise ValueError('internal: _fit_method not recognized')
    
  • Line 537, col. 12 in KNeighborsMixin():

      raise ValueError(
          'Unsupported mode, must be one of "connectivity" or "distance" but got "%s" instead'
           % mode)
    
  • Line 696, col. 16 in RadiusNeighborsMixin():

      raise ValueError(
          "%s does not work with sparse matrices. Densify the data, or set algorithm='brute'"
           % self._fit_method)
    
  • Line 712, col. 12 in RadiusNeighborsMixin():

      raise ValueError('internal: _fit_method not recognized')
    
  • Line 797, col. 12 in RadiusNeighborsMixin():

      raise ValueError(
          'Unsupported mode, must be one of "connectivity", or "distance" but got %s instead'
           % mode)
    
  • Line 852, col. 16 in SupervisedIntegerMixin():

      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)
    

neural_network/_base.py

neural_network/multilayer_perceptron.py

  • Line 321, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('hidden_layer_sizes must be > 0, got %s.' % hidden_layer_sizes
          )
    
  • Line 351, col. 16 in BaseMultilayerPerceptron():

      warnings.warn(
          'Got `batch_size` less than 1 or larger than sample size. It is going to be clipped'
          )
    
  • Line 381, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('shuffle must be either True or False, got %s.' % self.shuffle
          )
    
  • Line 384, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('max_iter must be > 0, got %s.' % self.max_iter)
    
  • Line 386, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('alpha must be >= 0, got %s.' % self.alpha)
    
  • Line 389, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('learning_rate_init must be > 0, got %s.' % self.learning_rate
          )
    
  • Line 392, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('momentum must be >= 0 and <= 1, got %s' % self.momentum)
    
  • Line 395, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('nesterovs_momentum must be either True or False, got %s.' %
          self.nesterovs_momentum)
    
  • Line 398, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('early_stopping must be either True or False, got %s.' %
          self.early_stopping)
    
  • Line 401, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('validation_fraction must be >= 0 and < 1, got %s' % self.
          validation_fraction)
    
  • Line 404, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('beta_1 must be >= 0 and < 1, got %s' % self.beta_1)
    
  • Line 407, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('beta_2 must be >= 0 and < 1, got %s' % self.beta_2)
    
  • Line 410, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('epsilon must be > 0, got %s.' % self.epsilon)
    
  • Line 412, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('n_iter_no_change must be > 0, got %s.' % self.
          n_iter_no_change)
    
  • Line 418, col. 12 in BaseMultilayerPerceptron():

      raise ValueError(
          "The activation '%s' is not supported. Supported activations are %s." %
          (self.activation, supported_activations))
    
  • Line 422, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('learning rate %s is not supported. ' % self.learning_rate)
    
  • Line 426, col. 12 in BaseMultilayerPerceptron():

      raise ValueError('The solver %s is not supported.  Expected one of: %s' % (
          self.solver, ', '.join(supported_solvers)))
    
  • Line 559, col. 20 in BaseMultilayerPerceptron():

      warnings.warn(
          "Stochastic Optimizer: Maximum iterations (%d) reached and the optimization hasn't converged yet."
           % self.max_iter, ConvergenceWarning)
    
  • Line 564, col. 12 in BaseMultilayerPerceptron():

      warnings.warn('Training interrupted by user.')
    
  • Line 637, col. 12 in BaseMultilayerPerceptron():

      raise AttributeError(
          'partial_fit is only available for stochastic optimizers. %s is not stochastic.'
           % self.solver)
    
  • Line 925, col. 16 in MLPClassifier():

      raise ValueError(
          'warm_start can only be used where `y` has the same classes as in the previous call to fit. Previously got %s, `y` has %s'
           % (self.classes_, classes))
    
  • Line 932, col. 16 in MLPClassifier():

      raise ValueError(
          "`y` has classes not in `self.classes_`. `self.classes_` has %s. 'y' has %s."
           % (self.classes_, classes))
    
  • Line 1004, col. 12 in MLPClassifier():

      raise AttributeError(
          'partial_fit is only available for stochastic optimizer. %s is not stochastic'
           % self.solver)
    

neural_network/tests/test_mlp.py

  • Line 70, col. 13 in test_alpha():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 278, col. 13 in test_learning_rate_warmstart():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 339, col. 13 in test_partial_fit_classification():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 372, col. 13 in test_partial_fit_regression():

      warnings.catch_warnings(record=True)
    
  • Line 436, col. 9 in test_predict_proba_binary():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 459, col. 9 in test_predict_proba_multiclass():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 534, col. 9 in test_verbose_sgd():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 568, col. 1 in test_warm_start():

      ignore_warnings(category=RuntimeWarning)
    
  • Line 613, col. 1 in test_n_iter_no_change_inf():

      ignore_warnings(category=ConvergenceWarning)
    

neural_network/tests/__init__.py

neural_network/tests/test_rbm.py

neural_network/tests/test_stochastic_optimizers.py

neural_network/__init__.py

neural_network/_stochastic_optimizers.py

neural_network/rbm.py

pipeline.py

  • Line 165, col. 16 in Pipeline():

      raise TypeError(
          "All intermediate steps should be transformers and implement fit and transform. '%s' (type %s) doesn't"
           % (t, type(t)))
    
  • Line 171, col. 12 in Pipeline():

      raise TypeError(
          "Last step of Pipeline should implement fit. '%s' (type %s) doesn't" %
          (estimator, type(estimator)))
    
  • Line 580, col. 8 in make_pipeline():

      raise TypeError('Unknown keyword arguments: "{}"'.format(list(kwargs.keys()
          )[0]))
    
  • Line 700, col. 16 in FeatureUnion():

      raise TypeError(
          "All estimators should implement fit and transform. '%s' (type %s) doesn't"
           % (t, type(t)))
    
  • Line 724, col. 16 in FeatureUnion():

      raise AttributeError(
          'Transformer %s (type %s) does not provide get_feature_names.' % (str(
          name), type(trans).__name__))
    
  • Line 866, col. 8 in make_union():

      raise TypeError('Unknown keyword arguments: "{}"'.format(list(kwargs.keys()
          )[0]))
    

preprocessing/_encoders.py

  • Line 54, col. 24 in _BaseEncoder():

      raise ValueError(
          'Unsorted categories are not supported for numerical categories')
    
  • Line 57, col. 16 in _BaseEncoder():

      raise ValueError(
          'Shape mismatch: if n_values is an array, it has to be of shape (n_features,).'
          )
    
  • Line 73, col. 24 in _BaseEncoder():

      raise ValueError(msg)
    
  • Line 97, col. 20 in _BaseEncoder():

      raise ValueError(msg)
    
  • Line 312, col. 12 in OneHotEncoder():

      warnings.warn(msg, DeprecationWarning)
    
  • Line 327, col. 20 in OneHotEncoder():

      warnings.warn(msg, DeprecationWarning)
    
  • Line 349, col. 20 in OneHotEncoder():

      warnings.warn(msg, FutureWarning)
    
  • Line 357, col. 16 in OneHotEncoder():

      warnings.warn(
          "The 'categorical_features' keyword is deprecated in version 0.20 and will be removed in 0.22. The passed value of 'all' is the default and can simply be removed."
          , DeprecationWarning)
    
  • Line 364, col. 20 in OneHotEncoder():

      raise ValueError(
          "The 'categorical_features' keyword is deprecated, and cannot be used together with specifying 'categories'."
          )
    
  • Line 368, col. 16 in OneHotEncoder():

      warnings.warn(
          "The 'categorical_features' keyword is deprecated in version 0.20 and will be removed in 0.22. You can use the ColumnTransformer instead."
          , DeprecationWarning)
    
  • Line 392, col. 12 in OneHotEncoder():

      raise ValueError(msg)
    
  • Line 410, col. 12 in OneHotEncoder():

      raise ValueError('X needs to contain only non-negative integers.')
    
  • Line 417, col. 16 in OneHotEncoder():

      raise ValueError('Feature out of bounds for n_values=%d' % self.n_values)
    
  • Line 425, col. 16 in OneHotEncoder():

      raise TypeError(
          "Wrong type for parameter `n_values`. Expected 'auto', int or array of ints, got %r"
           % type(X))
    
  • Line 429, col. 16 in OneHotEncoder():

      raise ValueError(
          'Shape mismatch: if n_values is an array, it has to be of shape (n_features,).'
          )
    
  • Line 474, col. 12 in OneHotEncoder():

      raise ValueError(msg)
    
  • Line 489, col. 12 in OneHotEncoder():

      raise ValueError('X needs to contain only non-negative integers.')
    
  • Line 494, col. 12 in OneHotEncoder():

      raise ValueError(
          'X has different shape than during fitting. Expected %d, got %d.' % (
          indices.shape[0] - 1, n_features))
    
  • Line 506, col. 16 in OneHotEncoder():

      raise ValueError('handle_unknown should be either error or unknown got %s' %
          self.handle_unknown)
    
  • Line 509, col. 16 in OneHotEncoder():

      raise ValueError('unknown categorical feature present %s during transform.' %
          X.ravel()[~mask])
    
  • Line 606, col. 12 in OneHotEncoder():

      raise ValueError(msg.format(n_transformed_features, X.shape[1]))
    
  • Line 769, col. 12 in OrdinalEncoder():

      raise ValueError(msg.format(n_features, X.shape[1]))
    

preprocessing/tests/test_common.py

  • Line 65, col. 9 in test_missing_value_handling():

      pytest.warns(None)
    
  • Line 73, col. 9 in test_missing_value_handling():

      pytest.warns(None)
    
  • Line 91, col. 13 in test_missing_value_handling():

      pytest.warns(None)
    
  • Line 106, col. 13 in test_missing_value_handling():

      pytest.warns(None)
    
  • Line 118, col. 17 in test_missing_value_handling():

      pytest.warns(None)
    
  • Line 119, col. 16 in test_missing_value_handling():

      warnings.simplefilter('ignore', PendingDeprecationWarning)
    
  • Line 123, col. 17 in test_missing_value_handling():

      pytest.warns(None)
    
  • Line 124, col. 16 in test_missing_value_handling():

      warnings.simplefilter('ignore', PendingDeprecationWarning)
    

preprocessing/tests/test_label.py

  • Line 340, col. 13 in test_multilabel_binarizer_unknown_class():

      assert_warns_message(UserWarning, w, mlb.fit(y).transform, [[4, 1], [2, 0]])
    
  • Line 346, col. 13 in test_multilabel_binarizer_unknown_class():

      assert_warns_message(UserWarning, w, mlb.fit(y).transform, [[4, 1], [2, 0]])
    

preprocessing/tests/test_encoders.py

  • Line 33, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 49, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 57, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 71, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 81, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 84, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 90, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=FutureWarning)
    
  • Line 94, col. 9 in test_one_hot_encoder_sparse():

      ignore_warnings(category=FutureWarning)
    
  • Line 103, col. 9 in test_one_hot_encoder_dense():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 121, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_warns_message(FutureWarning, 'handling of integer', enc.fit, X)
    
  • Line 124, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_warns_message(FutureWarning, 'handling of integer', enc.fit_transform, X
          )
    
  • Line 128, col. 13 in test_one_hot_encoder_deprecationwarnings():

      ignore_warnings(category=FutureWarning)
    
  • Line 135, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_warns(DeprecationWarning, lambda : enc.active_features_)
    
  • Line 136, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_warns(DeprecationWarning, lambda : enc.feature_indices_)
    
  • Line 137, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_warns(DeprecationWarning, lambda : enc.n_values_)
    
  • Line 141, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_no_warnings(enc.fit, X)
    
  • Line 143, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_no_warnings(enc.fit_transform, X)
    
  • Line 149, col. 8 in test_one_hot_encoder_deprecationwarnings():

      assert_warns(DeprecationWarning, enc.fit, X)
    
  • Line 153, col. 4 in test_one_hot_encoder_deprecationwarnings():

      assert_warns(DeprecationWarning, enc.fit, X)
    
  • Line 164, col. 9 in test_one_hot_encoder_force_new_behaviour():

      ignore_warnings(category=FutureWarning)
    
  • Line 183, col. 9 in _run_one_hot():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 185, col. 9 in _run_one_hot():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 234, col. 4 in test_one_hot_encoder_handle_unknown():

      assert_warns(FutureWarning, oh.fit, X)
    
  • Line 531, col. 4 in test_one_hot_encoder_warning():

      np.testing.assert_no_warnings(enc.fit_transform, X)
    

preprocessing/tests/test_function_transformer.py

  • Line 52, col. 18 in test_delegate_to_func():

      assert_warns_message(DeprecationWarning, 'pass_y is deprecated',
          FunctionTransformer(_make_func(args_store, kwargs_store), pass_y=True).
          transform, X, y)
    
  • Line 151, col. 8 in test_check_inverse():

      assert_warns_message(UserWarning,
          "The provided functions are not strictly inverse of each other. If you are sure you want to proceed regardless, set 'check_inverse=False'."
          , trans.fit, X)
    
  • Line 163, col. 13 in test_check_inverse():

      assert_no_warnings(trans.fit_transform, X)
    
  • Line 170, col. 4 in test_check_inverse():

      assert_no_warnings(trans.fit, X_dense)
    
  • Line 173, col. 4 in test_check_inverse():

      assert_no_warnings(trans.fit, X_dense)
    
  • Line 184, col. 9 in test_function_transformer_future_warning():

      pytest.warns(expected_warning)
    

preprocessing/tests/test_imputation.py

preprocessing/tests/__init__.py

preprocessing/tests/test_discretization.py

  • Line 114, col. 4 in test_same_min_max():

      warnings.simplefilter('always')
    
  • Line 120, col. 4 in test_same_min_max():

      assert_warns_message(UserWarning,
          'Feature 0 is constant and will be replaced with 0.', est.fit, X)
    

preprocessing/tests/test_data.py

  • Line 244, col. 19 in test_standard_scaler_numerical_stability():

      assert_no_warnings(scale, x)
    
  • Line 248, col. 19 in test_standard_scaler_numerical_stability():

      assert_warns_message(UserWarning, w, scale, x)
    
  • Line 254, col. 15 in test_standard_scaler_numerical_stability():

      assert_warns_message(UserWarning, w, scale, x)
    
  • Line 258, col. 21 in test_standard_scaler_numerical_stability():

      assert_no_warnings(scale, x)
    
  • Line 264, col. 19 in test_standard_scaler_numerical_stability():

      assert_warns_message(UserWarning, w, scale, x_big)
    
  • Line 268, col. 21 in test_standard_scaler_numerical_stability():

      assert_warns_message(UserWarning, w, scale, x_big, with_std=False)
    
  • Line 792, col. 4 in test_scaler_int():

      clean_warning_registry()
    
  • Line 793, col. 9 in test_scaler_int():

      warnings.catch_warnings(record=True)
    
  • Line 799, col. 4 in test_scaler_int():

      clean_warning_registry()
    
  • Line 800, col. 9 in test_scaler_int():

      warnings.catch_warnings(record=True)
    
  • Line 805, col. 4 in test_scaler_int():

      clean_warning_registry()
    
  • Line 806, col. 9 in test_scaler_int():

      warnings.catch_warnings(record=True)
    
  • Line 811, col. 4 in test_scaler_int():

      clean_warning_registry()
    
  • Line 812, col. 9 in test_scaler_int():

      warnings.catch_warnings(record=True)
    
  • Line 1124, col. 4 in test_quantile_transform_sparse_ignore_zeros():

      assert_warns_message(UserWarning,
          "'ignore_implicit_zeros' takes effect only with sparse matrix. This parameter has no effect."
          , transformer.fit, X)
    
  • Line 1552, col. 4 in test_warning_scaling_integers():

      clean_warning_registry()
    
  • Line 1553, col. 4 in test_warning_scaling_integers():

      assert_warns_message(DataConversionWarning, w, scale, X)
    
  • Line 1554, col. 4 in test_warning_scaling_integers():

      assert_warns_message(DataConversionWarning, w, StandardScaler().fit, X)
    
  • Line 1555, col. 4 in test_warning_scaling_integers():

      assert_warns_message(DataConversionWarning, w, MinMaxScaler().fit, X)
    

preprocessing/tests/test_base.py

preprocessing/__init__.py

preprocessing/_discretization.py

  • Line 142, col. 12 in KBinsDiscretizer():

      raise ValueError("Valid options for 'encode' are {}. Got encode={!r} instead."
          .format(valid_encode, self.encode))
    
  • Line 147, col. 12 in KBinsDiscretizer():

      raise ValueError(
          "Valid options for 'strategy' are {}. Got strategy={!r} instead.".
          format(valid_strategy, self.strategy))
    
  • Line 160, col. 16 in KBinsDiscretizer():

      warnings.warn('Feature %d is constant and will be replaced with 0.' % jj)
    
  • Line 201, col. 16 in KBinsDiscretizer():

      raise ValueError(
          '{} received an invalid n_bins type. Received {}, expected int.'.format
          (KBinsDiscretizer.__name__, type(orig_bins).__name__))
    
  • Line 206, col. 16 in KBinsDiscretizer():

      raise ValueError(
          '{} received an invalid number of bins. Received {}, expected at least 2.'
          .format(KBinsDiscretizer.__name__, orig_bins))
    
  • Line 215, col. 12 in KBinsDiscretizer():

      raise ValueError('n_bins must be a scalar or array of shape (n_features,).')
    
  • Line 223, col. 12 in KBinsDiscretizer():

      raise ValueError(
          '{} received an invalid number of bins at indices {}. Number of bins must be at least 2, and must be an int.'
          .format(KBinsDiscretizer.__name__, indices))
    
  • Line 247, col. 12 in KBinsDiscretizer():

      raise ValueError('Incorrect number of features. Expecting {}, received {}.'
          .format(n_features, Xt.shape[1]))
    
  • Line 288, col. 12 in KBinsDiscretizer():

      raise ValueError(
          "inverse_transform only supports 'encode = ordinal'. Got encode={!r} instead."
          .format(self.encode))
    
  • Line 295, col. 12 in KBinsDiscretizer():

      raise ValueError('Incorrect number of features. Expecting {}, received {}.'
          .format(n_features, Xinv.shape[1]))
    

preprocessing/imputation.py

  • Line 145, col. 12 in Imputer():

      raise ValueError('Can only use these strategies: {0}  got strategy={1}'.
          format(allowed_strategies, self.strategy))
    
  • Line 150, col. 12 in Imputer():

      raise ValueError(
          'Can only impute missing values on axis 0 and 1,  got axis={0}'.format(
          self.axis))
    
  • Line 312, col. 16 in Imputer():

      raise ValueError('X has %d features per sample, expected %d' % (X.shape[1],
          self.statistics_.shape[0]))
    
  • Line 343, col. 16 in Imputer():

      warnings.warn('Deleting features without observed values: %s' % missing)
    
  • Line 347, col. 12 in Imputer():

      raise ValueError('Some rows only contain missing values: %s' % missing)
    

preprocessing/label.py

  • Line 52, col. 12 in _encode_numpy():

      raise ValueError('y contains previously unseen labels: %s' % str(diff))
    
  • Line 70, col. 12 in _encode_python():

      raise ValueError('y contains previously unseen labels: %s' % str(e))
    
  • Line 280, col. 12 in LabelEncoder():

      raise ValueError('y contains previously unseen labels: %s' % str(diff))
    
  • Line 379, col. 12 in LabelBinarizer():

      raise ValueError('neg_label={0} must be strictly less than pos_label={1}.'.
          format(neg_label, pos_label))
    
  • Line 383, col. 12 in LabelBinarizer():

      raise ValueError(
          'Sparse binarization is only supported with non zero pos_label and zero neg_label, got pos_label={0} and neg_label={1}'
          .format(pos_label, neg_label))
    
  • Line 407, col. 12 in LabelBinarizer():

      raise ValueError(
          'Multioutput target data is not supported with label binarization')
    
  • Line 410, col. 12 in LabelBinarizer():

      raise ValueError('y has 0 samples: %r' % y)
    
  • Line 461, col. 12 in LabelBinarizer():

      raise ValueError('The object was not fitted with multilabel input.')
    
  • Line 584, col. 12 in label_binarize():

      raise ValueError('y has 0 samples: %r' % y)
    
  • Line 586, col. 8 in label_binarize():

      raise ValueError('neg_label={0} must be strictly less than pos_label={1}.'.
          format(neg_label, pos_label))
    
  • Line 590, col. 8 in label_binarize():

      raise ValueError(
          'Sparse binarization is only supported with non zero pos_label and zero neg_label, got pos_label={0} and neg_label={1}'
          .format(pos_label, neg_label))
    
  • Line 602, col. 8 in label_binarize():

      raise ValueError(
          'Multioutput target data is not supported with label binarization')
    
  • Line 605, col. 8 in label_binarize():

      raise ValueError('The type of target data is not known')
    
  • Line 624, col. 8 in label_binarize():

      raise ValueError('classes {0} missmatch with the labels {1}found in the data'
          .format(classes, unique_labels(y)))
    
  • Line 647, col. 8 in label_binarize():

      raise ValueError('%s target data is not supported with label binarization' %
          y_type)
    
  • Line 724, col. 8 in _inverse_binarize_thresholding():

      raise ValueError("output_type='binary', but y.shape = {0}".format(y.shape))
    
  • Line 728, col. 8 in _inverse_binarize_thresholding():

      raise ValueError(
          'The number of class is not equal to the number of dimension of y.')
    
  • Line 761, col. 8 in _inverse_binarize_thresholding():

      raise ValueError('{0} format is not supported'.format(output_type))
    
  • Line 929, col. 12 in MultiLabelBinarizer():

      warnings.warn('unknown class(es) {0} will be ignored'.format(sorted(unknown,
          key=str)))
    
  • Line 953, col. 12 in MultiLabelBinarizer():

      raise ValueError('Expected indicator for {0} classes, but got {1}'.format(
          len(self.classes_), yt.shape[1]))
    
  • Line 959, col. 16 in MultiLabelBinarizer():

      raise ValueError('Expected only 0s and 1s in label indicator.')
    
  • Line 965, col. 16 in MultiLabelBinarizer():

      raise ValueError('Expected only 0s and 1s in label indicator. Also got {0}'
          .format(unexpected))
    

preprocessing/base.py

  • Line 48, col. 8 in _transform_selected():

      raise ValueError(
          'The retain_order option can only be set to True for dense matrices.')
    
  • Line 79, col. 12 in _transform_selected():

      raise ValueError(
          'The retain_order option can only be set to True if the dimensions of the input array match the dimensions of the transformed array.'
          )
    

preprocessing/data.py

  • Line 147, col. 12 in scale():

      raise ValueError(
          'Cannot center sparse matrices: pass `with_mean=False` instead See docstring for motivation and alternatives.'
          )
    
  • Line 151, col. 12 in scale():

      raise ValueError('Can only scale sparse matrix on axis=0,  got axis=%d' % axis)
    
  • Line 175, col. 16 in scale():

      warnings.warn(
          'Numerical issues were encountered when centering the data and might not be solved. Dataset may contain too large values. You may need to prescale your features.'
          )
    
  • Line 192, col. 20 in scale():

      warnings.warn(
          'Numerical issues were encountered when scaling the data and might not be solved. The standard deviation of the data is probably very close to 0. '
          )
    
  • Line 341, col. 12 in MinMaxScaler():

      raise ValueError(
          'Minimum of desired feature range must be smaller than maximum. Got %s.' %
          str(feature_range))
    
  • Line 345, col. 12 in MinMaxScaler():

      raise TypeError(
          'MinMaxScaler does no support sparse input. You may consider to use MaxAbsScaler instead.'
          )
    
  • Line 656, col. 16 in StandardScaler():

      raise ValueError(
          'Cannot center sparse matrices: pass `with_mean=False` instead. See docstring for motivation and alternatives.'
          )
    
  • Line 734, col. 12 in StandardScaler():

      warnings.warn(
          'The parameter y on transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 747, col. 16 in StandardScaler():

      raise ValueError(
          'Cannot center sparse matrices: pass `with_mean=False` instead. See docstring for motivation and alternatives.'
          )
    
  • Line 779, col. 16 in StandardScaler():

      raise ValueError(
          'Cannot uncenter sparse matrices: pass `with_mean=False` instead See docstring for motivation and alternatives.'
          )
    
  • Line 1111, col. 12 in RobustScaler():

      raise ValueError('Invalid quantile range: %s' % str(self.quantile_range))
    
  • Line 1116, col. 16 in RobustScaler():

      raise ValueError(
          'Cannot center sparse matrices: use `with_centering=False` instead. See docstring for motivation and alternatives.'
          )
    
  • Line 1431, col. 12 in PolynomialFeatures():

      raise ValueError('X shape does not match training shape')
    
  • Line 1506, col. 8 in normalize():

      raise ValueError("'%s' is not a supported norm" % norm)
    
  • Line 1513, col. 8 in normalize():

      raise ValueError("'%d' is not a supported axis" % axis)
    
  • Line 1522, col. 12 in normalize():

      raise NotImplementedError(
          "return_norm=True is not implemented for sparse matrices with norm 'l1' or norm 'l2'"
          )
    
  • Line 1629, col. 12 in Normalizer():

      warnings.warn(
          'The parameter y on transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 1667, col. 12 in binarize():

      raise ValueError('Cannot binarize a sparse matrix with threshold < 0')
    
  • Line 1755, col. 12 in Binarizer():

      warnings.warn(
          'The parameter y on transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 1811, col. 12 in KernelCenterer():

      warnings.warn(
          'The parameter y on transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 1998, col. 12 in QuantileTransformer():

      warnings.warn(
          "'ignore_implicit_zeros' takes effect only with sparse matrix. This parameter has no effect."
          )
    
  • Line 2078, col. 12 in QuantileTransformer():

      raise ValueError(
          "Invalid value for 'n_quantiles': %d. The number of quantiles must be at least one."
           % self.n_quantiles)
    
  • Line 2083, col. 12 in QuantileTransformer():

      raise ValueError(
          "Invalid value for 'subsample': %d. The number of subsamples must be at least one."
           % self.subsample)
    
  • Line 2088, col. 12 in QuantileTransformer():

      raise ValueError(
          'The number of quantiles cannot be greater than the number of samples used. Got {} quantiles and {} samples.'
          .format(self.n_quantiles, self.subsample))
    
  • Line 2180, col. 16 in QuantileTransformer():

      raise ValueError(
          'QuantileTransformer only accepts non-negative sparse matrices.')
    
  • Line 2185, col. 12 in QuantileTransformer():

      raise ValueError(
          "'output_distribution' has to be either 'normal' or 'uniform'. Got '{}' instead."
          .format(self.output_distribution))
    
  • Line 2196, col. 12 in QuantileTransformer():

      raise ValueError(
          'X does not have the same number of features as the previously fitted data. Got {} instead of {}.'
          .format(X.shape[1], self.quantiles_.shape[1]))
    
  • Line 2388, col. 8 in quantile_transform():

      raise ValueError('axis should be either equal to 0 or 1. Got axis={}'.
          format(axis))
    
  • Line 2580, col. 13 in PowerTransformer():

      np.warnings.catch_warnings()
    
  • Line 2581, col. 12 in PowerTransformer():

      np.warnings.filterwarnings('ignore', 'All-NaN (slice|axis) encountered')
    
  • Line 2585, col. 16 in PowerTransformer():

      raise ValueError(
          'The Box-Cox transformation can only be applied to strictly positive data')
    
  • Line 2589, col. 12 in PowerTransformer():

      raise ValueError(
          'Input data has a different number of features than fitting data. Should have {n}, data has {m}'
          .format(n=len(self.lambdas_), m=X.shape[1]))
    
  • Line 2595, col. 12 in PowerTransformer():

      raise ValueError("'method' must be one of {}, got {} instead.".format(
          valid_methods, self.method))
    
  • Line 2680, col. 8 in CategoricalEncoder():

      raise RuntimeError(
          'CategoricalEncoder briefly existed in 0.20dev. Its functionality has been rolled into the OneHotEncoder and OrdinalEncoder. This stub will be removed in version 0.21.'
          )
    

preprocessing/_function_transformer.py

  • Line 97, col. 12 in FunctionTransformer():

      warnings.warn(
          'The default validate=True will be replaced by validate=False in 0.22.',
          FutureWarning)
    
  • Line 114, col. 12 in FunctionTransformer():

      warnings.warn(
          "The provided functions are not strictly inverse of each other. If you are sure you want to proceed regardless, set 'check_inverse=False'."
          , UserWarning)
    
  • Line 156, col. 12 in FunctionTransformer():

      warnings.warn(
          'The parameter y on transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 179, col. 12 in FunctionTransformer():

      warnings.warn(
          'The parameter y on inverse_transform() is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    
  • Line 195, col. 12 in FunctionTransformer():

      warnings.warn(
          'The parameter pass_y is deprecated since 0.19 and will be removed in 0.21'
          , DeprecationWarning)
    

random_projection.py

  • Line 123, col. 8 in johnson_lindenstrauss_min_dim():

      raise ValueError('The JL bound is defined for eps in ]0, 1[, got %r' % eps)
    
  • Line 127, col. 8 in johnson_lindenstrauss_min_dim():

      raise ValueError(
          'The JL bound is defined for n_samples greater than zero, got %r' %
          n_samples)
    
  • Line 141, col. 8 in _check_density():

      raise ValueError('Expected density in range ]0, 1], got: %r' % density)
    
  • Line 149, col. 8 in _check_input_size():

      raise ValueError('n_components must be strictly positive, got %d' %
          n_components)
    
  • Line 152, col. 8 in _check_input_size():

      raise ValueError('n_features must be strictly positive, got %d' % n_components)
    
  • Line 357, col. 16 in BaseRandomProjection():

      raise ValueError(
          'eps=%f and n_samples=%d lead to a target dimension of %d which is invalid'
           % (self.eps, n_samples, self.n_components_))
    
  • Line 363, col. 16 in BaseRandomProjection():

      raise ValueError(
          'eps=%f and n_samples=%d lead to a target dimension of %d which is larger than the original space with n_features=%d'
           % (self.eps, n_samples, self.n_components_, n_features))
    
  • Line 370, col. 16 in BaseRandomProjection():

      raise ValueError('n_components must be greater than 0, got %s' % self.
          n_components)
    
  • Line 374, col. 16 in BaseRandomProjection():

      warnings.warn(
          'The number of components is higher than the number of features: n_features < n_components (%s < %s).The dimensionality of the problem will not be reduced.'
           % (n_features, self.n_components), DataDimensionalityWarning)
    
  • Line 414, col. 12 in BaseRandomProjection():

      raise ValueError(
          'Impossible to perform projection:X at fit stage had a different number of features. (%s != %s)'
           % (X.shape[1], self.components_.shape[1]))
    

semi_supervised/tests/__init__.py

semi_supervised/tests/test_label_propagation.py

  • Line 77, col. 13 in test_alpha_deprecation():

      assert_warns(DeprecationWarning, lp_0.fit, X, y)
    
  • Line 157, col. 4 in test_convergence_warning():

      assert_warns(ConvergenceWarning, mdl.fit, X, y)
    
  • Line 161, col. 4 in test_convergence_warning():

      assert_warns(ConvergenceWarning, mdl.fit, X, y)
    
  • Line 165, col. 4 in test_convergence_warning():

      assert_no_warnings(mdl.fit, X, y)
    
  • Line 168, col. 4 in test_convergence_warning():

      assert_no_warnings(mdl.fit, X, y)
    

semi_supervised/__init__.py

semi_supervised/label_propagation.py

  • Line 147, col. 12 in BaseLabelPropagation():

      raise ValueError(
          '%s is not a valid kernel. Only rbf and knn or an explicit function  are supported at this time.'
           % self.kernel)
    
  • Line 153, col. 8 in BaseLabelPropagation():

      raise NotImplementedError(
          'Graph construction must be implemented to fit a label propagation model.')
    
  • Line 244, col. 12 in BaseLabelPropagation():

      raise ValueError(
          'alpha=%s is invalid: it must be inside the open interval (0, 1)' % alpha)
    
  • Line 288, col. 12 in BaseLabelPropagation():

      warnings.warn('max_iter=%d was reached without convergence.' % self.
          max_iter, category=ConvergenceWarning)
    
  • Line 410, col. 12 in LabelPropagation():

      warnings.warn('alpha is deprecated since 0.19 and will be removed in 0.21.',
          DeprecationWarning)
    

setup.py

  • Line 73, col. 8 in configuration():

      warnings.warn(BlasNotFoundError.__doc__)
    

svm/tests/test_sparse.py

  • Line 336, col. 4 in test_timeout():

      assert_warns(ConvergenceWarning, sp.fit, X_sp, Y)
    
  • Line 341, col. 9 in test_consistent_proba():

      ignore_warnings(category=ConvergenceWarning)
    
  • Line 344, col. 9 in test_consistent_proba():

      ignore_warnings(category=ConvergenceWarning)
    

svm/tests/test_bounds.py

svm/tests/__init__.py

svm/tests/test_svm.py

  • Line 586, col. 4 in test_linearsvx_loss_penalty_deprecations():

      assert_warns_message(DeprecationWarning, msg % ('l1', 'hinge', "loss='l1'",
          '1.0'), svm.LinearSVC(loss='l1').fit, X, y)
    
  • Line 591, col. 4 in test_linearsvx_loss_penalty_deprecations():

      assert_warns_message(DeprecationWarning, msg % ('l2', 'squared_hinge',
          "loss='l2'", '1.0'), svm.LinearSVC(loss='l2').fit, X, y)
    
  • Line 597, col. 4 in test_linearsvx_loss_penalty_deprecations():

      assert_warns_message(DeprecationWarning, msg % ('l1', 'epsilon_insensitive',
          "loss='l1'", '1.0'), svm.LinearSVR(loss='l1').fit, X, y)
    
  • Line 603, col. 4 in test_linearsvx_loss_penalty_deprecations():

      assert_warns_message(DeprecationWarning, msg % ('l2',
          'squared_epsilon_insensitive', "loss='l2'", '1.0'), svm.LinearSVR(loss=
          'l2').fit, X, y)
    
  • Line 849, col. 4 in test_timeout():

      assert_warns(ConvergenceWarning, a.fit, X, Y)
    
  • Line 878, col. 4 in test_linear_svm_convergence_warnings():

      assert_warns(ConvergenceWarning, lsvc.fit, X, Y)
    
  • Line 882, col. 4 in test_linear_svm_convergence_warnings():

      assert_warns(ConvergenceWarning, lsvr.fit, iris.data, iris.target)
    
  • Line 998, col. 4 in test_gamma_auto():

      assert_warns_message(FutureWarning, msg, svm.SVC().fit, X, y)
    
  • Line 1000, col. 4 in test_gamma_auto():

      assert_no_warnings(svm.SVC(kernel='linear').fit, X, y)
    
  • Line 1001, col. 4 in test_gamma_auto():

      assert_no_warnings(svm.SVC(kernel='precomputed').fit, X, y)
    
  • Line 1008, col. 4 in test_gamma_scale():

      assert_no_warnings(clf.fit, X, y)
    
  • Line 1014, col. 4 in test_gamma_scale():

      assert_no_warnings(clf.fit, X, y)
    

svm/__init__.py

svm/setup.py

svm/classes.py

  • Line 219, col. 12 in LinearSVC():

      warnings.warn(msg % (old_loss, self.loss, old_loss, '1.0'), DeprecationWarning)
    
  • Line 224, col. 12 in LinearSVC():

      raise ValueError('Penalty term must be positive; got (C=%r)' % self.C)
    
  • Line 407, col. 12 in LinearSVR():

      warnings.warn(msg % (old_loss, self.loss, old_loss, '1.0'), DeprecationWarning)
    
  • Line 412, col. 12 in LinearSVR():

      raise ValueError('Penalty term must be positive; got (C=%r)' % self.C)
    
  • Line 1136, col. 12 in OneClassSVM():

      warnings.warn(
          'The random_state parameter is deprecated and will be removed in version 0.22.'
          , DeprecationWarning)
    

svm/bounds.py

  • Line 55, col. 8 in l1_min_c():

      raise ValueError('loss type not in ("squared_hinge", "log", "l2")')
    
  • Line 68, col. 8 in l1_min_c():

      raise ValueError(
          'Ill-posed l1_min_c calculation: l1 will always select zero coefficients for this data'
          )
    

svm/base.py

  • Line 79, col. 12 in BaseLibSVM():

      raise ValueError('impl should be one of %s, %s was given' % (LIBSVM_IMPL,
          self._impl))
    
  • Line 85, col. 12 in BaseLibSVM():

      raise ValueError(msg)
    
  • Line 144, col. 12 in BaseLibSVM():

      raise TypeError('Sparse precomputed kernels are not supported.')
    
  • Line 159, col. 12 in BaseLibSVM():

      raise ValueError('X and y have incompatible shapes.\n' + 
          'X has %s samples, but y has %s.' % (X.shape[0], y.shape[0]))
    
  • Line 164, col. 12 in BaseLibSVM():

      raise ValueError('X.shape[0] should be equal to X.shape[1]')
    
  • Line 167, col. 12 in BaseLibSVM():

      raise ValueError(
          """sample_weight and X have incompatible shapes: %r vs %r
      Note: Sparse matrices cannot be indexed w/boolean masks (use `indices=True` in CV)."""
           % (sample_weight.shape, X.shape))
    
  • Line 192, col. 20 in BaseLibSVM():

      warnings.warn(
          "The default value of gamma will change from 'auto' to 'scale' in version 0.22 to account better for unscaled features. Set gamma explicitly to 'auto' or 'scale' to avoid this warning."
          , FutureWarning)
    
  • Line 236, col. 15 in BaseLibSVM():

      column_or_1d(y, warn=True).astype(np.float64)
    
  • Line 241, col. 12 in BaseLibSVM():

      warnings.warn(
          'Solver terminated early (max_iter=%i).  Consider pre-processing your data with StandardScaler or MinMaxScaler.'
           % self.max_iter, ConvergenceWarning)
    
  • Line 255, col. 16 in BaseLibSVM():

      raise ValueError('X.shape[0] should be equal to X.shape[1]')
    
  • Line 273, col. 8 in BaseLibSVM():

      self._warn_from_fit_status()
    
  • Line 295, col. 8 in BaseLibSVM():

      self._warn_from_fit_status()
    
  • Line 339, col. 16 in BaseLibSVM():

      raise ValueError(
          'X.shape[1] = %d should be equal to %d, the number of samples at training time'
           % (X.shape[1], self.shape_fit_[0]))
    
  • Line 465, col. 12 in BaseLibSVM():

      raise ValueError('cannot use sparse input in %r trained on dense data' %
          type(self).__name__)
    
  • Line 472, col. 16 in BaseLibSVM():

      raise ValueError(
          'X.shape[1] = %d should be equal to %d, the number of samples at training time'
           % (X.shape[1], self.shape_fit_[0]))
    
  • Line 476, col. 12 in BaseLibSVM():

      raise ValueError(
          'X.shape[1] = %d should be equal to %d, the number of features at training time'
           % (n_features, self.shape_fit_[1]))
    
  • Line 484, col. 12 in BaseLibSVM():

      raise AttributeError('coef_ is only available when using a linear kernel')
    
  • Line 523, col. 12 in BaseSVC():

      raise ValueError(
          'The number of classes has to be greater than one; got %d class' % len(cls)
          )
    
  • Line 576, col. 12 in BaseSVC():

      raise AttributeError('predict_proba is not available when  probability=False')
    
  • Line 579, col. 12 in BaseSVC():

      raise AttributeError('predict_proba only implemented for SVC and NuSVC')
    
  • Line 615, col. 12 in BaseSVC():

      raise NotFittedError(
          'predict_proba is not available when fitted with probability=False')
    
  • Line 744, col. 8 in _get_liblinear_solver_type():

      raise ValueError(
          '`multi_class` must be one of `ovr`, `crammer_singer`, got %r' %
          multi_class)
    
  • Line 764, col. 4 in _get_liblinear_solver_type():

      raise ValueError(
          'Unsupported set of arguments: %s, Parameters: penalty=%r, loss=%r, dual=%r'
           % (error_string, penalty, loss, dual))
    
  • Line 870, col. 12 in _fit_liblinear():

      raise ValueError(
          'This solver needs samples of at least 2 classes in the data, but the data contains only one class: %r'
           % classes_[0])
    
  • Line 887, col. 12 in _fit_liblinear():

      raise ValueError(
          'Intercept scaling is %r but needs to be greater than 0. To disable fitting an intercept, set fit_intercept=False.'
           % intercept_scaling)
    
  • Line 921, col. 8 in _fit_liblinear():

      warnings.warn(
          'Liblinear failed to converge, increase the number of iterations.',
          ConvergenceWarning)
    

tests/test_metaestimators.py

  • Line 56, col. 16 in test_metaestimator_delegation():

      raise AttributeError('%r is hidden' % obj.hidden_method)
    

tests/test_common.py

  • Line 95, col. 9 in test_non_meta_estimators():

      ignore_warnings(category=(DeprecationWarning, ConvergenceWarning,
          UserWarning, FutureWarning))
    
  • Line 106, col. 9 in test_no_attributes_set_in_init():

      ignore_warnings(category=(DeprecationWarning, ConvergenceWarning,
          UserWarning, FutureWarning))
    
  • Line 125, col. 8 in test_configure():

      clean_warning_registry()
    
  • Line 126, col. 13 in test_configure():

      warnings.catch_warnings()
    
  • Line 129, col. 12 in test_configure():

      warnings.simplefilter('ignore', UserWarning)
    
  • Line 140, col. 4 in _tested_linear_classifiers():

      clean_warning_registry()
    
  • Line 141, col. 9 in _tested_linear_classifiers():

      warnings.catch_warnings(record=True)
    
  • Line 167, col. 16 in test_import_all_consistency():

      raise AttributeError("Module '{0}' has no attribute '{1}'".format(modname,
          name))
    

tests/test_multioutput.py

tests/test_isotonic.py

  • Line 34, col. 20 in test_check_increasing_small_number_of_samples():

      assert_no_warnings(check_increasing, x, y)
    
  • Line 43, col. 20 in test_check_increasing_up():

      assert_no_warnings(check_increasing, x, y)
    
  • Line 52, col. 20 in test_check_increasing_up_extreme():

      assert_no_warnings(check_increasing, x, y)
    
  • Line 61, col. 20 in test_check_increasing_down():

      assert_no_warnings(check_increasing, x, y)
    
  • Line 70, col. 20 in test_check_increasing_down_extreme():

      assert_no_warnings(check_increasing, x, y)
    
  • Line 79, col. 20 in test_check_ci_warn():

      assert_warns_message(UserWarning, 'interval', check_increasing, x, y)
    
  • Line 207, col. 9 in test_isotonic_regression_auto_decreasing():

      warnings.catch_warnings(record=True)
    
  • Line 208, col. 8 in test_isotonic_regression_auto_decreasing():

      warnings.simplefilter('always')
    
  • Line 226, col. 9 in test_isotonic_regression_auto_increasing():

      warnings.catch_warnings(record=True)
    
  • Line 227, col. 8 in test_isotonic_regression_auto_increasing():

      warnings.simplefilter('always')
    

tests/test_docstring_parameters.py

  • Line 72, col. 8 in test_docstring_parameters():

      raise SkipTest(
          'numpydoc is required to test the docstrings, as well as python version >= 3.5'
          )
    
  • Line 81, col. 13 in test_docstring_parameters():

      warnings.catch_warnings(record=True)
    
  • Line 92, col. 17 in test_docstring_parameters():

      warnings.catch_warnings(record=True)
    
  • Line 95, col. 16 in test_docstring_parameters():

      raise RuntimeError("""Error for __init__ of %s in %s:
      %s""" % (cls, name, w[0])
          )
    
  • Line 139, col. 8 in test_docstring_parameters():

      raise AssertionError('Docstring Error: ' + msg)
    
  • Line 142, col. 1 in test_tabs():

      ignore_warnings(category=DeprecationWarning)
    

tests/__init__.py

tests/test_dummy.py

  • Line 528, col. 4 in test_uniform_strategy_sparse_target_warning():

      assert_warns_message(UserWarning,
          'the uniform strategy would not save memory', clf.fit, X, y)
    

tests/test_check_build.py

tests/test_discriminant_analysis.py

  • Line 111, col. 4 in test_lda_priors():

      assert_warns(UserWarning, clf.fit, X, y)
    
  • Line 322, col. 4 in test_qda_deprecation():

      assert_warns_message(DeprecationWarning,
          "'store_covariances' was renamed to store_covariance in version 0.19 and will be removed in 0.21."
          , clf.fit, X, y)
    
  • Line 327, col. 4 in test_qda_deprecation():

      assert_warns_message(DeprecationWarning,
          'Attribute ``covariances_`` was deprecated in version 0.19 and will be removed in 0.21. Use ``covariance_`` instead'
          , getattr, clf, 'covariances_')
    
  • Line 337, col. 9 in test_qda_regularization():

      ignore_warnings()
    
  • Line 343, col. 9 in test_qda_regularization():

      ignore_warnings()
    
  • Line 350, col. 9 in test_qda_regularization():

      ignore_warnings()
    

tests/test_multiclass.py

  • Line 202, col. 4 in test_ovr_always_present():

      assert_warns(UserWarning, ovr.fit, X, y)
    
  • Line 214, col. 4 in test_ovr_always_present():

      assert_warns(UserWarning, ovr.fit, X, y)
    

tests/test_config.py

  • Line 50, col. 12 in test_config_context_exception():

      raise ValueError()
    

tests/test_kernel_ridge.py

  • Line 44, col. 4 in test_kernel_ridge_singular_kernel():

      ignore_warnings(kr.fit)(X, y)
    

tests/test_calibration.py

tests/test_naive_bayes.py

  • Line 639, col. 4 in test_alpha():

      assert_warns(UserWarning, nb.partial_fit, X, y, classes=[0, 1])
    
  • Line 640, col. 4 in test_alpha():

      assert_warns(UserWarning, nb.fit, X, y)
    
  • Line 645, col. 4 in test_alpha():

      assert_warns(UserWarning, nb.partial_fit, X, y, classes=[0, 1])
    
  • Line 646, col. 4 in test_alpha():

      assert_warns(UserWarning, nb.fit, X, y)
    
  • Line 653, col. 4 in test_alpha():

      assert_warns(UserWarning, nb.fit, X, y)
    
  • Line 658, col. 4 in test_alpha():

      assert_warns(UserWarning, nb.fit, X, y)
    

tests/test_base.py

  • Line 314, col. 20 in test_pickle_version_warning_is_not_raised_with_matching_version():

      assert_no_warnings(pickle.loads, tree_pickle)
    
  • Line 342, col. 4 in test_pickle_version_warning_is_issued_upon_different_version():

      assert_warns_message(UserWarning, message, pickle.loads, tree_pickle_other)
    
  • Line 361, col. 4 in test_pickle_version_warning_is_issued_when_no_version_info_in_pickle():

      assert_warns_message(UserWarning, message, pickle.loads, tree_pickle_noversion)
    
  • Line 372, col. 8 in test_pickle_version_no_warning_is_issued_with_non_sklearn_estimator():

      assert_no_warnings(pickle.loads, tree_pickle_noversion)
    
  • Line 436, col. 1 in test_pickling_works_when_getstate_is_overwritten_in_the_child_class():

      ignore_warnings(category=UserWarning)
    

tests/test_init.py

tests/test_impute.py

  • Line 95, col. 9 in test_imputation_deletion_warning():

      pytest.warns(UserWarning, match='Deleting')
    

tests/test_pipeline.py

  • Line 203, col. 12 in test_pipeline_init():

      assert_no_warnings(clone, pipe)
    
  • Line 449, col. 10 in test_feature_union():

      assert_no_warnings(clone, fs)
    

tests/test_random_projection.py

  • Line 343, col. 8 in test_warning_n_components_greater_than_n_features():

      assert_warns(DataDimensionalityWarning, RandomProjection(n_components=
          n_features + 1).fit, data)
    

tests/test_kernel_approximation.py

  • Line 257, col. 8 in test_nystroem_callable():

      assert_warns_message(DeprecationWarning, msg, ny.fit, X)
    

tree/tree.py

  • Line 122, col. 20 in BaseDecisionTree():

      raise ValueError('No support for np.int64 index based sparse matrices')
    
  • Line 178, col. 16 in BaseDecisionTree():

      raise ValueError(
          'min_samples_leaf must be at least 1 or in (0, 0.5], got %s' % self.
          min_samples_leaf)
    
  • Line 184, col. 16 in BaseDecisionTree():

      raise ValueError(
          'min_samples_leaf must be at least 1 or in (0, 0.5], got %s' % self.
          min_samples_leaf)
    
  • Line 191, col. 16 in BaseDecisionTree():

      raise ValueError(
          'min_samples_split must be an integer greater than 1 or a float in (0.0, 1.0]; got the integer %s'
           % self.min_samples_split)
    
  • Line 198, col. 16 in BaseDecisionTree():

      raise ValueError(
          'min_samples_split must be an integer greater than 1 or a float in (0.0, 1.0]; got the float %s'
           % self.min_samples_split)
    
  • Line 218, col. 16 in BaseDecisionTree():

      raise ValueError(
          'Invalid value for max_features. Allowed string values are "auto", "sqrt" or "log2".'
          )
    
  • Line 235, col. 12 in BaseDecisionTree():

      raise ValueError('Number of labels=%d does not match number of samples=%d' %
          (len(y), n_samples))
    
  • Line 238, col. 12 in BaseDecisionTree():

      raise ValueError('min_weight_fraction_leaf must in [0, 0.5]')
    
  • Line 240, col. 12 in BaseDecisionTree():

      raise ValueError('max_depth must be greater than zero. ')
    
  • Line 242, col. 12 in BaseDecisionTree():

      raise ValueError('max_features must be in (0, n_features]')
    
  • Line 244, col. 12 in BaseDecisionTree():

      raise ValueError('max_leaf_nodes must be integral number but was %r' %
          max_leaf_nodes)
    
  • Line 247, col. 12 in BaseDecisionTree():

      raise ValueError('max_leaf_nodes {0} must be either None or larger than 1'.
          format(max_leaf_nodes))
    
  • Line 256, col. 16 in BaseDecisionTree():

      raise ValueError('Sample weights array has more than one dimension: %d' %
          len(sample_weight.shape))
    
  • Line 260, col. 16 in BaseDecisionTree():

      raise ValueError('Number of weights=%d does not match number of samples=%d' %
          (len(sample_weight), n_samples))
    
  • Line 279, col. 12 in BaseDecisionTree():

      warnings.warn(
          'The min_impurity_split parameter is deprecated and will be removed in version 0.21. Use the min_impurity_decrease parameter instead.'
          , DeprecationWarning)
    
  • Line 288, col. 12 in BaseDecisionTree():

      raise ValueError('min_impurity_split must be greater than or equal to 0')
    
  • Line 292, col. 12 in BaseDecisionTree():

      raise ValueError('min_impurity_decrease must be greater than or equal to 0')
    
  • Line 297, col. 12 in BaseDecisionTree():

      raise ValueError("'presort' should be in {}. Got {!r} instead.".format(
          allowed_presort, self.presort))
    
  • Line 301, col. 12 in BaseDecisionTree():

      raise ValueError('Presorting is not supported for sparse matrices.')
    
  • Line 320, col. 12 in BaseDecisionTree():

      raise ValueError(
          "The shape of X (X.shape = {}) doesn't match the shape of X_idx_sorted (X_idx_sorted.shape = {})"
          .format(X.shape, X_idx_sorted.shape))
    
  • Line 379, col. 16 in BaseDecisionTree():

      raise ValueError('No support for np.int64 index based sparse matrices')
    
  • Line 384, col. 12 in BaseDecisionTree():

      raise ValueError(
          'Number of features of the model must match the input. Model n_features is %s and input n_features is %s '
           % (self.n_features_, n_features))
    

tree/tests/test_tree.py

  • Line 530, col. 13 in test_error():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 811, col. 12 in test_min_impurity_split():

      assert_warns(DeprecationWarning, est.fit, X, y)
    
  • Line 828, col. 8 in test_min_impurity_split():

      assert_warns_message(DeprecationWarning, 'Use the min_impurity_decrease',
          est.fit, X, y)
    
  • Line 1552, col. 9 in test_1d_input():

      ignore_warnings()
    

tree/tests/__init__.py

tree/tests/test_export.py

tree/__init__.py

tree/export.py

  • Line 318, col. 12 in export_graphviz():

      raise ValueError('Invalid node_id %s' % _tree.TREE_LEAF)
    
  • Line 413, col. 16 in export_graphviz():

      raise ValueError("'precision' should be greater or equal to 0. Got {} instead."
          .format(precision))
    
  • Line 416, col. 12 in export_graphviz():

      raise ValueError("'precision' should be an integer. Got {} instead.".format
          (type(precision)))
    
  • Line 424, col. 16 in export_graphviz():

      raise ValueError(
          'Length of feature_names, %d does not match number of features, %d' % (
          len(feature_names), decision_tree.n_features_))
    

tree/setup.py

utils/optimize.py

  • Line 50, col. 8 in _line_search_wolfe12():

      raise _LineSearchError()
    
  • Line 195, col. 16 in newton_cg():

      warnings.warn('Line Search failed')
    
  • Line 202, col. 8 in newton_cg():

      warnings.warn(
          'newton-cg failed to converge. Increase the number of iterations.',
          ConvergenceWarning)
    

utils/fixes.py

  • Line 51, col. 8 in <module>:

      raise TypeError(
          'Divide not working with dtype: https://github.com/numpy/numpy/issues/3484'
          )
    
  • Line 119, col. 12 in _arg_min_or_max_axis():

      raise ValueError("Can't apply the operation along a zero-sized dimension.")
    
  • Line 156, col. 12 in _arg_min_or_max():

      raise ValueError("Sparse matrices do not support an 'out' parameter.")
    
  • Line 163, col. 16 in _arg_min_or_max():

      raise ValueError("Can't apply the operation to an empty matrix.")
    
  • Line 225, col. 16 in makedirs():

      raise
    

utils/deprecation.py

  • Line 58, col. 12 in deprecated():

      warnings.warn(msg, category=DeprecationWarning)
    
  • Line 77, col. 12 in deprecated():

      warnings.warn(msg, category=DeprecationWarning)
    
  • Line 99, col. 8 in _is_deprecated():

      raise NotImplementedError('This is only available for python3.5 or above')
    
  • Line 125, col. 12 in DeprecationDict():

      warnings.warn(*warn_args, **warn_kwargs)
    

utils/estimator_checks.py

  • Line 165, col. 12 in check_supervised_y_no_nan():

      raise ValueError(
          'Estimator {0} raised error as expected, but does not match expected error message'
          .format(name))
    
  • Line 169, col. 8 in check_supervised_y_no_nan():

      raise ValueError(
          'Estimator {0} should have raised error on fitting array y with NaN value.'
          .format(name))
    
  • Line 150, col. 1 in check_supervised_y_no_nan():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 304, col. 12 in check_estimator():

      warnings.warn(str(exception), SkipTestWarning)
    
  • Line 476, col. 9 in check_estimator_sparse_data():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 481, col. 13 in check_estimator_sparse_data():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 488, col. 17 in check_estimator_sparse_data():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 502, col. 20 in check_estimator_sparse_data():

      raise AssertionError(msg % (name, matrix_format))
    
  • Line 508, col. 20 in check_estimator_sparse_data():

      raise
    
  • Line 513, col. 12 in check_estimator_sparse_data():

      raise
    
  • Line 532, col. 16 in check_sample_weights_pandas_series():

      raise ValueError(
          "Estimator {0} raises error if 'sample_weight' parameter is of type pandas.Series"
          .format(name))
    
  • Line 536, col. 12 in check_sample_weights_pandas_series():

      raise SkipTest(
          'pandas is not installed: not testing for input of type pandas.Series to class weight.'
          )
    
  • Line 516, col. 1 in check_sample_weights_pandas_series():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 540, col. 1 in check_sample_weights_list():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 577, col. 12 in check_dtype_object():

      raise
    
  • Line 556, col. 1 in check_dtype_object():

      ignore_warnings(category=(DeprecationWarning, FutureWarning, UserWarning))
    
  • Line 638, col. 1 in check_dont_overwrite_parameters():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 689, col. 1 in check_fit2d_predict1d():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 760, col. 12 in check_methods_subset_invariance():

      raise SkipTest(msg)
    
  • Line 731, col. 1 in check_methods_subset_invariance():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 794, col. 12 in check_fit2d_1sample():

      raise e
    
  • Line 828, col. 12 in check_fit2d_1feature():

      raise e
    
  • Line 849, col. 1 in check_transformer_general():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 866, col. 1 in check_transformer_data_not_an_array():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 879, col. 1 in check_transformers_unfitted():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 899, col. 8 in _check_transformer():

      raise SkipTest(msg)
    
  • Line 977, col. 8 in check_pipeline_consistency():

      raise SkipTest(msg)
    
  • Line 1059, col. 1 in check_estimators_empty_data_messages():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1102, col. 13 in check_estimators_nan_inf():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1112, col. 20 in check_estimators_nan_inf():

      raise e
    
  • Line 1116, col. 16 in check_estimators_nan_inf():

      raise exc
    
  • Line 1118, col. 16 in check_estimators_nan_inf():

      raise AssertionError(error_string_fit, estimator)
    
  • Line 1130, col. 24 in check_estimators_nan_inf():

      raise e
    
  • Line 1135, col. 20 in check_estimators_nan_inf():

      raise AssertionError(error_string_predict, estimator)
    
  • Line 1145, col. 24 in check_estimators_nan_inf():

      raise e
    
  • Line 1150, col. 20 in check_estimators_nan_inf():

      raise AssertionError(error_string_transform, estimator)
    
  • Line 1082, col. 1 in check_estimators_nan_inf():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1200, col. 1 in check_estimators_partial_fit_n_features():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1260, col. 9 in check_clustering():

      warnings.catch_warnings(record=True)
    
  • Line 1226, col. 1 in check_clustering():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1287, col. 1 in check_clusterer_compute_labels_predict():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1314, col. 9 in check_classifiers_one_label():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1323, col. 16 in check_classifiers_one_label():

      raise e
    
  • Line 1329, col. 12 in check_classifiers_one_label():

      raise exc
    
  • Line 1335, col. 12 in check_classifiers_one_label():

      raise exc
    
  • Line 1304, col. 1 in check_classifiers_one_label():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1519, col. 1 in check_estimators_fit_returns_self():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1590, col. 9 in check_supervised_y_2d():

      warnings.catch_warnings(record=True)
    
  • Line 1591, col. 8 in check_supervised_y_2d():

      warnings.simplefilter('always', DataConversionWarning)
    
  • Line 1592, col. 8 in check_supervised_y_2d():

      warnings.simplefilter('ignore', RuntimeWarning)
    
  • Line 1573, col. 1 in check_supervised_y_2d():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1688, col. 1 in check_regressors_int():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1716, col. 1 in check_regressors_train():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1782, col. 8 in check_regressors_no_decision_function():

      assert_warns_message(DeprecationWarning, msg, func, X)
    
  • Line 1789, col. 8 in check_class_weight_classifiers():

      raise SkipTest('Not testing NuSVC class weight as it is ignored.')
    
  • Line 1793, col. 8 in check_class_weight_classifiers():

      raise SkipTest
    
  • Line 1785, col. 1 in check_class_weight_classifiers():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1830, col. 1 in check_class_weight_balanced_classifiers():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1850, col. 1 in check_class_weight_balanced_linear_classifier():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1884, col. 1 in check_estimators_overwrite_params():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1922, col. 1 in check_no_attributes_set_in_init():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1951, col. 1 in check_sparsify_coefficients():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 1974, col. 1 in check_classifier_data_not_an_array():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1983, col. 1 in check_regressor_data_not_an_array():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 1994, col. 8 in check_estimators_data_not_an_array():

      raise SkipTest(
          'Skipping check_estimators_data_not_an_array for cross decomposition module as estimators are not deterministic.'
          )
    
  • Line 1991, col. 1 in check_estimators_data_not_an_array():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 2019, col. 9 in check_parameters_default_constructible():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 2096, col. 1 in check_non_transformer_estimators_n_iter():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 2132, col. 1 in check_transformer_n_iter():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 2158, col. 1 in check_get_params_invariance():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 2183, col. 1 in check_classifiers_regression_target():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    
  • Line 2194, col. 1 in check_decision_proba_consistency():

      ignore_warnings(category=(DeprecationWarning, FutureWarning))
    

utils/multiclass.py

  • Line 74, col. 8 in unique_labels():

      raise ValueError('No argument has been passed.')
    
  • Line 82, col. 8 in unique_labels():

      raise ValueError('Mix type of y not allowed, got types %s' % ys_types)
    
  • Line 90, col. 8 in unique_labels():

      raise ValueError(
          'Multi-label binary indicator input with different numbers of labels')
    
  • Line 96, col. 8 in unique_labels():

      raise ValueError('Unknown label type: %s' % repr(ys))
    
  • Line 102, col. 8 in unique_labels():

      raise ValueError('Mix of label input types (string and number)')
    
  • Line 171, col. 8 in check_classification_targets():

      raise ValueError('Unknown label type: %r' % y_type)
    
  • Line 242, col. 8 in type_of_target():

      raise ValueError(
          'Expected array-like (array or non-string sequence), got %r' % y)
    
  • Line 247, col. 8 in type_of_target():

      raise ValueError("y cannot be class 'SparseSeries'.")
    
  • Line 262, col. 12 in type_of_target():

      raise ValueError(
          'You appear to be using a legacy multi-label data representation. Sequence of sequences are no longer supported; use a binary array or sparse matrix instead.'
          )
    
  • Line 308, col. 8 in _check_partial_fit_first_call():

      raise ValueError('classes must be passed on the first call to partial_fit.')
    
  • Line 314, col. 16 in _check_partial_fit_first_call():

      raise ValueError(
          '`classes=%r` is not the same as on last call to partial_fit, was: %r' %
          (classes, clf.classes_))
    

utils/graph.py

utils/sparsetools/tests/__init__.py

utils/sparsetools/__init__.py

utils/sparsetools/setup.py

utils/tests/test_deprecation.py

  • Line 43, col. 4 in test_deprecated():

      assert_warns_message(DeprecationWarning, 'qwerty', MockClass1)
    
  • Line 44, col. 4 in test_deprecated():

      assert_warns_message(DeprecationWarning, 'mockclass2_method', MockClass2().
          method)
    
  • Line 46, col. 4 in test_deprecated():

      assert_warns_message(DeprecationWarning, 'deprecated', MockClass3)
    
  • Line 47, col. 10 in test_deprecated():

      assert_warns_message(DeprecationWarning, 'deprecated', mock_function)
    
  • Line 53, col. 8 in test_is_deprecated():

      raise SkipTest('This test will run only on python3.5 and above')
    
  • Line 69, col. 4 in test_deprecationdict():

      dd.add_warning('a', 'hello')
    
  • Line 70, col. 4 in test_deprecationdict():

      dd.add_warning('b', 'world', DeprecationWarning)
    
  • Line 71, col. 16 in test_deprecationdict():

      assert_warns_message(UserWarning, 'hello', dd.get, 'a', 1)
    
  • Line 75, col. 16 in test_deprecationdict():

      assert_warns_message(UserWarning, 'hello', dd.__getitem__, 'a')
    
  • Line 76, col. 16 in test_deprecationdict():

      assert_warns_message(DeprecationWarning, 'world', dd.__getitem__, 'b')
    
  • Line 78, col. 16 in test_deprecationdict():

      assert_no_warnings(dd.get, 'c')
    

utils/tests/test_bench.py

utils/tests/test_utils.py

  • Line 53, col. 9 in test_deprecated():

      warnings.catch_warnings(record=True)
    
  • Line 54, col. 8 in test_deprecated():

      warnings.simplefilter('always')
    
  • Line 69, col. 9 in test_deprecated():

      warnings.catch_warnings(record=True)
    
  • Line 70, col. 8 in test_deprecated():

      warnings.simplefilter('always')
    
  • Line 197, col. 8 in test_safe_indexing_pandas():

      raise SkipTest('Pandas not found')
    
  • Line 213, col. 13 in test_safe_indexing_pandas():

      warnings.catch_warnings(record=True)
    
  • Line 301, col. 19 in test_get_chunk_n_rows():

      assert_warns_message(UserWarning, warning, *args, **kw)
    
  • Line 305, col. 13 in test_get_chunk_n_rows():

      check_warning(get_chunk_n_rows, row_bytes=row_bytes, max_n_rows=max_n_rows,
          working_memory=working_memory)
    
  • Line 313, col. 17 in test_get_chunk_n_rows():

      check_warning(get_chunk_n_rows, row_bytes=row_bytes, max_n_rows=max_n_rows)
    

utils/tests/test_metaestimators.py

utils/tests/test_seq_dataset.py

utils/tests/test_stats.py

  • Line 21, col. 9 in test_cases_rankdata():

      ignore_warnings()
    

utils/tests/test_validation.py

  • Line 254, col. 13 in test_check_array():

      warnings.catch_warnings(record=True)
    
  • Line 295, col. 4 in test_check_array():

      assert_warns_message(FutureWarning,
          "arrays of strings will be interpreted as decimal numbers if parameter 'dtype' is 'numeric'. It is recommended that you convert the array to type np.float64 before passing it to check_array."
          , check_array, X_str, 'numeric')
    
  • Line 301, col. 4 in test_check_array():

      assert_warns_message(FutureWarning,
          "arrays of strings will be interpreted as decimal numbers if parameter 'dtype' is 'numeric'. It is recommended that you convert the array to type np.float64 before passing it to check_array."
          , check_array, np.array(X_str, dtype='U'), 'numeric')
    
  • Line 307, col. 4 in test_check_array():

      assert_warns_message(FutureWarning,
          "arrays of strings will be interpreted as decimal numbers if parameter 'dtype' is 'numeric'. It is recommended that you convert the array to type np.float64 before passing it to check_array."
          , check_array, np.array(X_str, dtype='S'), 'numeric')
    
  • Line 316, col. 4 in test_check_array():

      assert_warns_message(FutureWarning,
          "arrays of strings will be interpreted as decimal numbers if parameter 'dtype' is 'numeric'. It is recommended that you convert the array to type np.float64 before passing it to check_array."
          , check_array, X_bytes, 'numeric')
    
  • Line 322, col. 4 in test_check_array():

      assert_warns_message(FutureWarning,
          "arrays of strings will be interpreted as decimal numbers if parameter 'dtype' is 'numeric'. It is recommended that you convert the array to type np.float64 before passing it to check_array."
          , check_array, np.array(X_bytes, dtype='V1'), 'numeric')
    
  • Line 373, col. 20 in test_check_array_dtype_warning():

      assert_no_warnings(check_array, X, dtype=np.float64, accept_sparse=True)
    
  • Line 377, col. 20 in test_check_array_dtype_warning():

      assert_warns(DataConversionWarning, check_array, X, dtype=np.float64,
          accept_sparse=True, warn_on_dtype=True)
    
  • Line 383, col. 20 in test_check_array_dtype_warning():

      assert_warns_message(DataConversionWarning, 'SomeEstimator', check_array, X,
          dtype=[np.float64, np.float32], accept_sparse=True, warn_on_dtype=True,
          estimator='SomeEstimator')
    
  • Line 392, col. 31 in test_check_array_dtype_warning():

      assert_warns_message(DataConversionWarning, 'KNeighborsClassifier',
          check_X_y, X, y, dtype=np.float64, accept_sparse=True, warn_on_dtype=
          True, estimator=KNeighborsClassifier())
    
  • Line 400, col. 20 in test_check_array_dtype_warning():

      assert_no_warnings(check_array, X, dtype=np.float64, accept_sparse=True,
          warn_on_dtype=True)
    
  • Line 403, col. 20 in test_check_array_dtype_warning():

      assert_no_warnings(check_array, X, dtype=np.float64, accept_sparse=True,
          warn_on_dtype=False)
    
  • Line 408, col. 20 in test_check_array_dtype_warning():

      assert_no_warnings(check_array, X, dtype=[np.float64, np.float32],
          accept_sparse=True)
    
  • Line 414, col. 20 in test_check_array_dtype_warning():

      assert_no_warnings(check_array, X, dtype=[np.float64, np.float32],
          accept_sparse=['csr', 'dok'], copy=True)
    
  • Line 421, col. 16 in test_check_array_dtype_warning():

      assert_no_warnings(check_array, X_csc_float32, dtype=[np.float64, np.
          float32], accept_sparse=['csr', 'dok'], copy=False)
    
  • Line 458, col. 4 in test_check_array_accept_sparse_type_exception():

      assert_warns(DeprecationWarning, check_array, X, accept_sparse=None)
    
  • Line 635, col. 8 in test_check_symmetric():

      assert_warns(UserWarning, check_symmetric, arr)
    
  • Line 705, col. 8 in test_check_dataframe_fit_attribute():

      raise SkipTest('Pandas not found')
    
  • Line 723, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_warns_message(DataConversionWarning,
          'Data with input dtype object were all converted to float64.',
          check_array, df, dtype=np.float64, warn_on_dtype=True)
    
  • Line 727, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_warns(DataConversionWarning, check_array, df, dtype='numeric',
          warn_on_dtype=True)
    
  • Line 729, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_no_warnings(check_array, df, dtype='object', warn_on_dtype=True)
    
  • Line 733, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_warns(DataConversionWarning, check_array, df_mixed, dtype=np.float64,
          warn_on_dtype=True)
    
  • Line 735, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_warns(DataConversionWarning, check_array, df_mixed, dtype='numeric',
          warn_on_dtype=True)
    
  • Line 737, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_warns(DataConversionWarning, check_array, df_mixed, dtype=object,
          warn_on_dtype=True)
    
  • Line 743, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_warns(DataConversionWarning, check_array, df_mixed_numeric, dtype=
          'numeric', warn_on_dtype=True)
    
  • Line 745, col. 4 in test_check_dataframe_warns_on_dtype():

      assert_no_warnings(check_array, df_mixed_numeric.astype(int), dtype=
          'numeric', warn_on_dtype=True)
    

utils/tests/test_optimize.py

utils/tests/test_shortest_path.py

utils/tests/test_fast_dict.py

utils/tests/__init__.py

utils/tests/test_class_weight.py

utils/tests/test_estimator_checks.py

  • Line 99, col. 12 in NoSparseClassifier():

      raise ValueError('Nonsensical Error')
    
  • Line 115, col. 12 in CorrectNotFittedErrorClassifier():

      raise CorrectNotFittedError('estimator is not fitted yet')
    
  • Line 130, col. 12 in NoSampleWeightPandasSeriesType():

      raise ValueError(
          "Estimator does not accept 'sample_weight'of type pandas.Series")
    
  • Line 176, col. 20 in LargeSparseNotSupportedClassifier():

      raise ValueError("Estimator doesn't support 64-bit indices")
    
  • Line 180, col. 20 in LargeSparseNotSupportedClassifier():

      raise ValueError("Estimator doesn't support 64-bit indices")
    
  • Line 197, col. 12 in SparseTransformer():

      raise ValueError('Bad number of features')
    
  • Line 320, col. 13 in test_check_estimator_clones():

      ignore_warnings(category=FutureWarning)
    
  • Line 330, col. 13 in test_check_estimator_clones():

      ignore_warnings(category=FutureWarning)
    

utils/tests/test_multiclass.py

  • Line 302, col. 8 in test_type_of_target():

      raise SkipTest('Pandas not found')
    

utils/tests/test_fixes.py

utils/tests/test_sparsefuncs.py

utils/tests/test_murmurhash.py

utils/tests/test_linear_assignment.py

utils/tests/test_graph.py

  • Line 11, col. 1 in test_graph_laplacian():

      ignore_warnings(category=DeprecationWarning)
    

utils/tests/test_extmath.py

  • Line 192, col. 4 in test_norm_squared_norm():

      assert_warns_message(UserWarning,
          'Array type is integer, np.dot may overflow. Data should be float type to avoid this issue'
          , squared_norm, X.astype(int))
    
  • Line 376, col. 8 in test_randomized_svd_sparse_warnings():

      assert_warns_message(sparse.SparseEfficiencyWarning,
          'Calculating SVD of a {} is expensive. csr_matrix is more efficient.'.
          format(cls.__name__), randomized_svd, X, n_components, n_iter=1,
          power_iteration_normalizer='none')
    
  • Line 672, col. 8 in test_stable_cumsum():

      raise SkipTest('Sum is as unstable as cumsum for numpy < 1.9')
    
  • Line 675, col. 4 in test_stable_cumsum():

      assert_warns(RuntimeWarning, stable_cumsum, r, rtol=0, atol=0)
    

utils/tests/test_random.py

  • Line 101, col. 12 in check_sample_int_distribution():

      raise AssertionError(
          'number of combinations != number of expected (%s != %s)' % (len(output
          ), n_expected))
    

utils/tests/test_testing.py

  • Line 96, col. 8 in test_assert_raise_message():

      raise ValueError(message)
    
  • Line 126, col. 8 in test_ignore_warning():

      warnings.warn('deprecation warning', DeprecationWarning)
    
  • Line 129, col. 8 in test_ignore_warning():

      warnings.warn('deprecation warning', DeprecationWarning)
    
  • Line 130, col. 8 in test_ignore_warning():

      warnings.warn('deprecation warning')
    
  • Line 133, col. 4 in test_ignore_warning():

      assert_no_warnings(ignore_warnings(_warning_function))
    
  • Line 134, col. 4 in test_ignore_warning():

      assert_no_warnings(ignore_warnings(_warning_function, category=
          DeprecationWarning))
    
  • Line 136, col. 4 in test_ignore_warning():

      assert_warns(DeprecationWarning, ignore_warnings(_warning_function,
          category=UserWarning))
    
  • Line 138, col. 4 in test_ignore_warning():

      assert_warns(UserWarning, ignore_warnings(_multiple_warning_function,
          category=DeprecationWarning))
    
  • Line 141, col. 4 in test_ignore_warning():

      assert_warns(DeprecationWarning, ignore_warnings(_multiple_warning_function,
          category=UserWarning))
    
  • Line 144, col. 4 in test_ignore_warning():

      assert_no_warnings(ignore_warnings(_warning_function, category=(
          DeprecationWarning, UserWarning)))
    
  • Line 151, col. 8 in test_ignore_warning():

      _warning_function()
    
  • Line 152, col. 8 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 156, col. 8 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 154, col. 5 in test_ignore_warning():

      ignore_warnings(category=(DeprecationWarning, UserWarning))
    
  • Line 160, col. 8 in test_ignore_warning():

      _warning_function()
    
  • Line 158, col. 5 in test_ignore_warning():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 164, col. 8 in test_ignore_warning():

      _warning_function()
    
  • Line 162, col. 5 in test_ignore_warning():

      ignore_warnings(category=UserWarning)
    
  • Line 168, col. 8 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 166, col. 5 in test_ignore_warning():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 172, col. 8 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 170, col. 5 in test_ignore_warning():

      ignore_warnings(category=UserWarning)
    
  • Line 174, col. 4 in test_ignore_warning():

      assert_no_warnings(decorator_no_warning)
    
  • Line 175, col. 4 in test_ignore_warning():

      assert_no_warnings(decorator_no_warning_multiple)
    
  • Line 176, col. 4 in test_ignore_warning():

      assert_no_warnings(decorator_no_deprecation_warning)
    
  • Line 177, col. 4 in test_ignore_warning():

      assert_warns(DeprecationWarning, decorator_no_user_warning)
    
  • Line 178, col. 4 in test_ignore_warning():

      assert_warns(UserWarning, decorator_no_deprecation_multiple_warning)
    
  • Line 179, col. 4 in test_ignore_warning():

      assert_warns(DeprecationWarning, decorator_no_user_multiple_warning)
    
  • Line 183, col. 13 in test_ignore_warning():

      ignore_warnings()
    
  • Line 184, col. 12 in test_ignore_warning():

      _warning_function()
    
  • Line 187, col. 13 in test_ignore_warning():

      ignore_warnings(category=(DeprecationWarning, UserWarning))
    
  • Line 188, col. 12 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 191, col. 13 in test_ignore_warning():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 192, col. 12 in test_ignore_warning():

      _warning_function()
    
  • Line 195, col. 13 in test_ignore_warning():

      ignore_warnings(category=UserWarning)
    
  • Line 196, col. 12 in test_ignore_warning():

      _warning_function()
    
  • Line 199, col. 13 in test_ignore_warning():

      ignore_warnings(category=DeprecationWarning)
    
  • Line 200, col. 12 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 203, col. 13 in test_ignore_warning():

      ignore_warnings(category=UserWarning)
    
  • Line 204, col. 12 in test_ignore_warning():

      _multiple_warning_function()
    
  • Line 206, col. 4 in test_ignore_warning():

      assert_no_warnings(context_manager_no_warning)
    
  • Line 207, col. 4 in test_ignore_warning():

      assert_no_warnings(context_manager_no_warning_multiple)
    
  • Line 208, col. 4 in test_ignore_warning():

      assert_no_warnings(context_manager_no_deprecation_warning)
    
  • Line 209, col. 4 in test_ignore_warning():

      assert_warns(DeprecationWarning, context_manager_no_user_warning)
    
  • Line 210, col. 4 in test_ignore_warning():

      assert_warns(UserWarning, context_manager_no_deprecation_multiple_warning)
    
  • Line 211, col. 4 in test_ignore_warning():

      assert_warns(DeprecationWarning, context_manager_no_user_multiple_warning)
    
  • Line 217, col. 12 in TestWarns():

      warnings.warn('yo')
    
  • Line 220, col. 13 in TestWarns():

      warnings.catch_warnings()
    
  • Line 221, col. 12 in TestWarns():

      warnings.simplefilter('ignore', UserWarning)
    
  • Line 233, col. 12 in TestWarns():

      warnings.warn('yo', DeprecationWarning)
    
  • Line 240, col. 16 in TestWarns():

      assert_warns(UserWarning, f)
    
  • Line 248, col. 12 in TestWarns():

      raise AssertionError('wrong warning caught by assert_warn')
    
  • Line 438, col. 8 in test_check_docstring_parameters():

      raise SkipTest('numpydoc is required to test the docstrings')
    

utils/__init__.py

  • Line 65, col. 12 in Bunch():

      raise AttributeError(key)
    
  • Line 155, col. 12 in safe_indexing():

      warnings.warn('Copying input dataframe for slicing.', DataConversionWarning)
    
  • Line 245, col. 8 in resample():

      raise ValueError('Unexpected kw arguments: %r' % options.keys())
    
  • Line 256, col. 8 in resample():

      raise ValueError(
          'Cannot sample %d out of arrays with dim %d when replace is False' % (
          max_n_samples, n_samples))
    
  • Line 421, col. 8 in gen_even_slices():

      raise ValueError('gen_even_slices got n_packs=%s, must be >=1' % n_packs)
    
  • Line 469, col. 8 in _get_n_jobs():

      raise ValueError('Parameter n_jobs == 0 has no meaning.')
    
  • Line 513, col. 8 in indices_to_mask():

      raise ValueError('mask_length must be greater than max(indices)')
    
  • Line 553, col. 8 in get_chunk_n_rows():

      warnings.warn(
          'Could not adhere to working_memory config. Currently %.0fMiB, %.0fMiB required.'
           % (working_memory, np.ceil(row_bytes * 2 ** -20)))
    

utils/random.py

  • Line 150, col. 12 in random_choice_csc():

      raise ValueError('class dtype %s is not supported' % classes[j].dtype)
    
  • Line 162, col. 12 in random_choice_csc():

      raise ValueError('Probability array at index {0} does not sum to one'.format(j)
          )
    
  • Line 166, col. 12 in random_choice_csc():

      raise ValueError(
          'classes[{0}] (length {1}) and class_probability[{0}] (length {2}) have different length.'
          .format(j, classes[j].shape[0], class_prob_j.shape[0]))
    

utils/bench.py

utils/_scipy_sparse_lsqr_backport.py

utils/setup.py

utils/_unittest_backport.py

  • Line 69, col. 8 in _BaseTestCaseContext():

      raise self.test_case.failureException(msg)
    
  • Line 93, col. 16 in _AssertRaisesBaseContext():

      raise TypeError('%s() arg 1 must be %s' % (name, self._base_type_str))
    
  • Line 96, col. 16 in _AssertRaisesBaseContext():

      warnings.warn('callable is None', DeprecationWarning, 3)
    
  • Line 102, col. 20 in _AssertRaisesBaseContext():

      warnings.warn('%r is an invalid keyword argument for this function' % next(
          iter(kwargs)), DeprecationWarning, 3)
    

utils/mocking.py

utils/stats.py

utils/class_weight.py

  • Line 42, col. 8 in compute_class_weight():

      raise ValueError('classes should include all valid labels that can be in y')
    
  • Line 52, col. 12 in compute_class_weight():

      raise ValueError('classes should have valid labels that are in y')
    
  • Line 61, col. 12 in compute_class_weight():

      raise ValueError("class_weight must be dict, 'balanced', or None, got: %r" %
          class_weight)
    
  • Line 66, col. 16 in compute_class_weight():

      raise ValueError('Class label {} not present.'.format(c))
    
  • Line 119, col. 12 in compute_sample_weight():

      raise ValueError(
          'The only valid preset for class_weight is "balanced". Given "%s".' %
          class_weight)
    
  • Line 123, col. 8 in compute_sample_weight():

      raise ValueError(
          'The only valid class_weight for subsampling is "balanced". Given "%s".' %
          class_weight)
    
  • Line 128, col. 12 in compute_sample_weight():

      raise ValueError(
          'For multi-output, class_weight should be a list of dicts, or a valid string.'
          )
    
  • Line 131, col. 12 in compute_sample_weight():

      raise ValueError(
          'For multi-output, number of elements in class_weight should match number of outputs.'
          )
    

utils/metaestimators.py

  • Line 63, col. 12 in _BaseComposition():

      raise ValueError('Names provided are not unique: {0!r}'.format(list(names)))
    
  • Line 67, col. 12 in _BaseComposition():

      raise ValueError('Estimator names conflict with constructor arguments: {0!r}'
          .format(sorted(invalid_names)))
    
  • Line 71, col. 12 in _BaseComposition():

      raise ValueError('Estimator names must not contain __: got {0!r}'.format(
          invalid_names))
    
  • Line 190, col. 12 in _safe_split():

      raise ValueError(
          'Precomputed kernels or affinity matrices have to be passed as arrays or sparse matrices.'
          )
    
  • Line 194, col. 12 in _safe_split():

      raise ValueError('X should be a square kernel matrix')
    

utils/extmath.py

  • Line 48, col. 8 in squared_norm():

      warnings.warn(
          'Array type is integer, np.dot may overflow. Data should be float type to avoid this issue'
          , UserWarning)
    
  • Line 310, col. 8 in randomized_svd():

      warnings.warn(
          'Calculating SVD of a {} is expensive. csr_matrix is more efficient.'.
          format(type(M).__name__), sparse.SparseEfficiencyWarning)
    
  • Line 642, col. 12 in make_nonnegative():

      raise ValueError(
          'Cannot make the data matrix nonnegative because it is sparse. Adding a value to every entry would make it no longer sparse.'
          )
    
  • Line 772, col. 8 in stable_cumsum():

      warnings.warn(
          'cumsum was found to be unstable: its last element does not correspond to sum'
          , RuntimeWarning)
    

utils/testing.py

  • Line 140, col. 4 in assert_warns():

      clean_warning_registry()
    
  • Line 141, col. 9 in assert_warns():

      warnings.catch_warnings(record=True)
    
  • Line 143, col. 8 in assert_warns():

      warnings.simplefilter('always')
    
  • Line 153, col. 12 in assert_warns():

      raise AssertionError('No warning raised when calling %s' % func.__name__)
    
  • Line 158, col. 12 in assert_warns():

      raise AssertionError('%s did not give warning: %s( is %s)' % (func.__name__,
          warning_class, w))
    
  • Line 189, col. 4 in assert_warns_message():

      clean_warning_registry()
    
  • Line 190, col. 9 in assert_warns_message():

      warnings.catch_warnings(record=True)
    
  • Line 192, col. 8 in assert_warns_message():

      warnings.simplefilter('always')
    
  • Line 195, col. 12 in assert_warns_message():

      warnings.simplefilter('ignore', np.VisibleDeprecationWarning)
    
  • Line 200, col. 12 in assert_warns_message():

      raise AssertionError('No warning raised when calling %s' % func.__name__)
    
  • Line 205, col. 12 in assert_warns_message():

      raise AssertionError('No warning raised for %s with class %s' % (func.
          __name__, warning_class))
    
  • Line 225, col. 12 in assert_warns_message():

      raise AssertionError(
          "Did not receive the message you expected ('%s') for <%s>, got: '%s'" %
          (message, func.__name__, msg))
    
  • Line 240, col. 12 in assert_warns_div0():

      assert_warns(RuntimeWarning, np.divide, 1, np.zeros(1))
    
  • Line 244, col. 15 in assert_warns_div0():

      assert_warns_message(RuntimeWarning, 'invalid value encountered', func, *
          args, **kw)
    
  • Line 252, col. 4 in assert_no_warnings():

      clean_warning_registry()
    
  • Line 253, col. 9 in assert_no_warnings():

      warnings.catch_warnings(record=True)
    
  • Line 254, col. 8 in assert_no_warnings():

      warnings.simplefilter('always')
    
  • Line 263, col. 12 in assert_no_warnings():

      raise AssertionError('Got warnings when calling %s: [%s]' % (func.__name__,
          ', '.join(str(warning) for warning in w)))
    
  • Line 294, col. 15 in ignore_warnings():

      _IgnoreWarnings(category=category)(obj)
    
  • Line 296, col. 15 in ignore_warnings():

      _IgnoreWarnings(category=category)
    
  • Line 323, col. 12 in _IgnoreWarnings():

      clean_warning_registry()
    
  • Line 324, col. 17 in _IgnoreWarnings():

      warnings.catch_warnings()
    
  • Line 325, col. 16 in _IgnoreWarnings():

      warnings.simplefilter('ignore', self.category)
    
  • Line 341, col. 12 in _IgnoreWarnings():

      raise RuntimeError('Cannot enter %r twice' % self)
    
  • Line 346, col. 8 in _IgnoreWarnings():

      clean_warning_registry()
    
  • Line 347, col. 8 in _IgnoreWarnings():

      warnings.simplefilter('ignore', self.category)
    
  • Line 351, col. 12 in _IgnoreWarnings():

      raise RuntimeError('Cannot exit %r without entering first' % self)
    
  • Line 355, col. 8 in _IgnoreWarnings():

      clean_warning_registry()
    
  • Line 391, col. 12 in assert_raise_message():

      raise AssertionError(
          'Error message does not include the expected string: %r. Observed error message: %r'
           % (message, error_message))
    
  • Line 401, col. 8 in assert_raise_message():

      raise AssertionError('%s not raised by %s' % (names, function.__name__))
    
  • Line 442, col. 8 in assert_allclose_dense_sparse():

      raise ValueError(
          'Can only compare two sparse matrices, not a sparse matrix and an array.')
    
  • Line 521, col. 12 in mock_mldata_urlopen():

      raise HTTPError(urlname, 404, dataset_name + ' is not available', [], None)
    
  • Line 655, col. 12 in all_estimators():

      raise ValueError(
          "Parameter type_filter must be 'classifier', 'regressor', 'transformer', 'cluster' or None, got %s."
           % repr(type_filter))
    
  • Line 684, col. 12 in if_matplotlib():

      raise SkipTest('Matplotlib not available.')
    
  • Line 742, col. 8 in check_skip_network():

      raise SkipTest('Text tutorial requires large dataset download')
    
  • Line 757, col. 12 in _delete_folder():

      warnings.warn('Could not delete temporary folder %s' % folder_path)
    
  • Line 874, col. 13 in check_docstring_parameters():

      warnings.catch_warnings(record=True)
    
  • Line 881, col. 12 in check_docstring_parameters():

      raise RuntimeError('Error for %s:\n%s' % (func_name, w[0]))
    

utils/arpack.py

utils/sparsefuncs.py

  • Line 19, col. 4 in _raise_typeerror():

      raise TypeError(err)
    
  • Line 24, col. 8 in _raise_error_wrong_axis():

      raise ValueError('Unknown axis value: %d. Use 0 for rows, or 1 for columns' %
          axis)
    
  • Line 225, col. 12 in inplace_swap_row_csc():

      raise TypeError('m and n should be valid integers')
    
  • Line 254, col. 12 in inplace_swap_row_csr():

      raise TypeError('m and n should be valid integers')
    
  • Line 351, col. 8 in _min_or_max_axis():

      raise ValueError('zero-size array to reduction operation')
    
  • Line 374, col. 12 in _sparse_min_or_max():

      raise ValueError('zero-size array to reduction operation')
    
  • Line 387, col. 8 in _sparse_min_or_max():

      raise ValueError('invalid axis, use 0 for rows, or 1 for columns')
    
  • Line 456, col. 8 in count_nonzero():

      raise TypeError('Expected CSR sparse format, got {0}'.format(X.format))
    
  • Line 480, col. 8 in count_nonzero():

      raise ValueError('Unsupported axis: {0}'.format(axis))
    
  • Line 527, col. 8 in csc_median_axis_0():

      raise TypeError('Expected matrix of CSC format, got %s' % X.format)
    

utils/linear_assignment_.py

utils/validation.py

  • Line 34, col. 0 in <module>:

      warnings.simplefilter('ignore', NonBLASDotWarning)
    
  • Line 56, col. 12 in _assert_all_finite():

      raise ValueError(msg_err.format(type_err, X.dtype))
    
  • Line 131, col. 8 in _num_samples():

      raise TypeError('Expected sequence or array-like, got estimator %s' % x)
    
  • Line 137, col. 12 in _num_samples():

      raise TypeError('Expected sequence or array-like, got %s' % type(x))
    
  • Line 141, col. 12 in _num_samples():

      raise TypeError(
          'Singleton array %r cannot be considered a valid collection.' % x)
    
  • Line 206, col. 8 in check_memory():

      raise ValueError(
          "'memory' should be None, a string or have the same interface as sklearn.externals.joblib.Memory. Got memory='{}' instead."
          .format(memory))
    
  • Line 226, col. 8 in check_consistent_length():

      raise ValueError(
          'Found input variables with inconsistent numbers of samples: %r' % [int
          (l) for l in lengths])
    
  • Line 310, col. 8 in _ensure_sparse_format():

      raise TypeError(
          'A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.'
          )
    
  • Line 315, col. 12 in _ensure_sparse_format():

      raise ValueError(
          "When providing 'accept_sparse' as a tuple or list, it must contain at least one string value."
          )
    
  • Line 325, col. 8 in _ensure_sparse_format():

      raise ValueError(
          "Parameter 'accept_sparse' should be a string, boolean or list of strings. You provided 'accept_sparse={}'."
          .format(accept_sparse))
    
  • Line 338, col. 12 in _ensure_sparse_format():

      warnings.warn("Can't check %s sparse matrix for nan or inf." % spmatrix.format)
    
  • Line 350, col. 8 in _ensure_no_complex_data():

      raise ValueError("""Complex data not supported
      {}
      """.format(array))
    
  • Line 450, col. 8 in check_array():

      warnings.warn(
          "Passing 'None' to parameter 'accept_sparse' in methods check_array and check_X_y is deprecated in version 0.19 and will be removed in 0.21. Use 'accept_sparse=False'  instead."
          , DeprecationWarning)
    
  • Line 492, col. 8 in check_array():

      raise ValueError(
          'force_all_finite should be a bool or "allow-nan". Got {!r} instead'.
          format(force_all_finite))
    
  • Line 516, col. 13 in check_array():

      warnings.catch_warnings()
    
  • Line 518, col. 16 in check_array():

      warnings.simplefilter('error', ComplexWarning)
    
  • Line 521, col. 16 in check_array():

      raise ValueError("""Complex data not supported
      {}
      """.format(array))
    
  • Line 533, col. 16 in check_array():

      raise ValueError(
          """Expected 2D array, got scalar array instead:
      array={}.
      Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample."""
          .format(array))
    
  • Line 540, col. 16 in check_array():

      raise ValueError(
          """Expected 2D array, got 1D array instead:
      array={}.
      Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample."""
          .format(array))
    
  • Line 548, col. 12 in check_array():

      warnings.warn(
          "Beginning in version 0.22, arrays of strings will be interpreted as decimal numbers if parameter 'dtype' is 'numeric'. It is recommended that you convert the array to type np.float64 before passing it to check_array."
          , FutureWarning)
    
  • Line 559, col. 12 in check_array():

      raise ValueError('Found array with dim %d. %s expected <= 2.' % (array.ndim,
          estimator_name))
    
  • Line 569, col. 12 in check_array():

      raise ValueError(
          'Found array with %d sample(s) (shape=%s) while a minimum of %d is required%s.'
           % (n_samples, shape_repr, ensure_min_samples, context))
    
  • Line 577, col. 12 in check_array():

      raise ValueError(
          'Found array with %d feature(s) (shape=%s) while a minimum of %d is required%s.'
           % (n_features, shape_repr, ensure_min_features, context))
    
  • Line 585, col. 8 in check_array():

      warnings.warn(msg, DataConversionWarning)
    
  • Line 598, col. 8 in check_array():

      warnings.warn(msg, DataConversionWarning, stacklevel=3)
    
  • Line 618, col. 20 in _check_large_sparse():

      raise ValueError(
          'Scipy version %s does not support large indices, please upgrade your scipy to 0.14.0 or above'
           % scipy_version)
    
  • Line 621, col. 16 in _check_large_sparse():

      raise ValueError(
          'Only sparse matrices with 32-bit integer indices are accepted. Got %s indices.'
           % indices_datatype)
    
  • Line 777, col. 12 in column_or_1d():

      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)
    
  • Line 783, col. 4 in column_or_1d():

      raise ValueError('bad input shape {0}'.format(shape))
    
  • Line 803, col. 4 in check_random_state():

      raise ValueError(
          '%r cannot be used to seed a numpy.random.RandomState instance' % seed)
    
  • Line 862, col. 8 in check_symmetric():

      raise ValueError('array must be 2-dimensional and square. shape = {0}'.
          format(array.shape))
    
  • Line 876, col. 12 in check_symmetric():

      raise ValueError('Array must be symmetric')
    
  • Line 878, col. 12 in check_symmetric():

      warnings.warn(
          'Array is not symmetric, and will be converted to symmetric by average with its transpose.'
          )
    
  • Line 931, col. 8 in check_is_fitted():

      raise TypeError('%s is not an estimator instance.' % estimator)
    
  • Line 937, col. 8 in check_is_fitted():

      raise NotFittedError(msg % {'name': type(estimator).__name__})
    
  • Line 954, col. 8 in check_non_negative():

      raise ValueError('Negative values in data passed to %s' % whom)
    
@srinu328
Copy link

i want line 558 error and line 173 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment