Module Expr Str Import alias Import alias Import alias identifier Import alias identifier ClassDef bases NameLoad body Expr Str Pass decorator_list Expr Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareIn AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index Str UnaryOpNot Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad Num body Return Str Assign NameStore Call AttributeLoad Str attr GeneratorExp BinOpMod Str NameLoad comprehension NameStore NameLoad If CompareEq Call NameLoad NameLoad Num body AugAssignAdd NameStore Str Return BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Raise Call NameLoad BinOpMod Str NameLoad If BoolOpAnd UnaryOpNot Call NameLoad NameLoad Str UnaryOpNot Call NameLoad NameLoad Str body If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad If Call NameLoad NameLoad Str body If CompareEq Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad BinOpMod Str NameLoad Return SubscriptLoad AttributeLoad NameLoad attr Index Num orelse Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If CompareIn NameLoad ListLoad NameLoad NameLoad body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad If BoolOpAnd Call NameLoad NameLoad TupleLoad NameLoad NameLoad CompareNotIn AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore NameLoad If CompareNotEq NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If BoolOpAnd NameLoad UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body If UnaryOpNot Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr orelse Expr Call NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad body Expr Str If BoolOpOr CompareNotEq AttributeLoad NameLoad attr Num CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpSub NameLoad AttributeLoad NameLoad attr If CompareNotIn AttributeLoad NameLoad attr ListLoad Str Str Str body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr CompareLt Call NameLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr keyword NameLoad If UnaryOpNot NameLoad body If NameLoad body Raise Call NameLoad Str If NameLoad body Expr Call AttributeLoad NameLoad attr Str If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpAdd Str AttributeLoad NameLoad attr Assign NameStore Call Call NameLoad BinOpMult Num BinOpAdd NameLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore BinOpMult Num BinOpAdd NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad AttributeLoad NameLoad attr body Return AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If Call NameLoad NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str NameLoad NameLoad NameLoad NameLoad NameLoad Num Num NameLoad body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad Assign NameStore CompareEq NameLoad Str Assign NameStore Call NameLoad NameLoad Str NameLoad If UnaryOpNot Call NameLoad NameLoad Str body Assign NameStore NameLoad If NameLoad body If BoolOpAnd CompareIsNot NameLoad NameLoad CompareEq AttributeLoad NameLoad attr Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore NameLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIn NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore SubscriptLoad NameLoad Index Num If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If NameLoad body If CompareEq AttributeLoad NameLoad attr Num body If CompareGtE NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If BoolOpAnd NameLoad CompareEq AttributeLoad AttributeLoad NameLoad attr attr Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd UnaryOpNot NameLoad CompareGtE AttributeLoad NameLoad attr Num body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr If NameLoad body Expr Call NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr If CompareGt NameLoad Num body Assign NameStore Call NameLoad NameLoad If CompareLt NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad If BoolOpAnd CompareGt NameLoad Num CompareEq AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareLt NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad If BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad CompareNotEq AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list
N/A N/A Utilities for input validation N/A warnings N/A numbers N/A numpy np N/A scipy.sparse sp DataConversionWarning N/A UserWarning N/A N/A A warning on implicit data conversions happening in the code N/A N/A N/A N/A N/A warnings simplefilter always DataConversionWarning _assert_all_finite N/A N/A X N/A N/A N/A Like assert_all_finite, but only for ndarray. N/A X N/A N/A np asanyarray X N/A N/A N/A N/A N/A X dtype char N/A N/A np typecodes N/A AllFloat N/A N/A N/A np isfinite N/A N/A X sum N/A N/A N/A N/A N/A np isfinite X all N/A N/A N/A ValueError N/A Input contains NaN, infinity or a value too large for %r. N/A X dtype N/A _shape_repr N/A N/A shape N/A N/A N/A Return a platform independent reprensentation of an array shape
    Under Python 2, the `long` type introduces an 'L' suffix when using the
    default %r format for tuples of integers (typically used to store the shape
    of an array).
    Under Windows 64 bit (and Python 2), the `long` type is used by default
    in numpy shapes even when the integer dimensions are well below 32 bit.
    The platform specific type causes string messages or doctests to change
    from one platform to another which is not desirable.
    Under Python 3, there is no more `long` type so the `L` suffix is never
    introduced in string representation.
    >>> _shape_repr((1, 2))
    '(1, 2)'
    >>> one = 2 ** 64 / 2 ** 64  # force an upcast to `long` under Python 2
    >>> _shape_repr((one, 2 * one))
    '(1, 2)'
    >>> _shape_repr((1,))
    '(1,)'
    >>> _shape_repr(())
    '()'
     N/A N/A N/A len shape 0 N/A N/A () N/A joined N/A N/A ,  join N/A N/A %d e N/A e shape N/A N/A N/A len shape 1 N/A N/A joined , N/A N/A (%s) joined N/A _num_samples N/A N/A x N/A N/A N/A Return number of samples in array-like x. N/A N/A hasattr x fit N/A N/A N/A TypeError N/A Expected sequence or array-like, got estimator %s x N/A N/A N/A N/A hasattr x __len__ N/A N/A hasattr x shape N/A N/A N/A hasattr x __array__ N/A N/A x N/A N/A np asarray x N/A N/A N/A TypeError N/A Expected sequence or array-like, got %s N/A type x N/A N/A hasattr x shape N/A N/A N/A N/A len N/A x shape 0 N/A N/A N/A TypeError N/A Singleton array %r cannot be considered a valid collection. x N/A N/A N/A x shape N/A 0 N/A N/A N/A len x N/A _ensure_sparse_format N/A N/A spmatrix accept_sparse dtype copy force_all_finite N/A N/A N/A Convert a sparse matrix to a given format.
    Checks the sparse format of spmatrix and converts if necessary.
    Parameters
    ----------
    spmatrix : scipy sparse matrix
        Input to validate and convert.
    accept_sparse : string, list of string or None (default=None)
        String[s] representing allowed sparse matrix formats ('csc',
        'csr', 'coo', 'dok', 'bsr', 'lil', 'dia'). None means that sparse
        matrix input will raise an error.  If the input is sparse but not in
        the allowed format, it will be converted to the first listed format.
    dtype : string, type or None (default=none)
        Data type of result. If None, the dtype of the input is preserved.
    copy : boolean (default=False)
        Whether a forced copy will be triggered. If copy=False, a copy might
        be triggered by a conversion.
    force_all_finite : boolean (default=True)
        Whether to raise an error on np.inf and np.nan in X.
    Returns
    -------
    spmatrix_converted : scipy sparse matrix.
        Matrix that is ensured to have an allowed type.
     N/A N/A accept_sparse N/A None False N/A N/A N/A TypeError A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array. N/A N/A dtype None N/A N/A dtype N/A spmatrix dtype N/A changed_format False N/A N/A N/A isinstance accept_sparse N/A list tuple N/A N/A spmatrix format accept_sparse N/A N/A spmatrix N/A N/A spmatrix asformat N/A accept_sparse N/A 0 N/A changed_format True N/A N/A dtype N/A spmatrix dtype N/A N/A spmatrix N/A N/A spmatrix astype dtype N/A N/A N/A copy N/A changed_format N/A N/A spmatrix N/A N/A spmatrix copy N/A force_all_finite N/A N/A N/A N/A hasattr spmatrix data N/A N/A N/A N/A warnings warn N/A Can't check %s sparse matrix for nan or inf. N/A spmatrix format N/A N/A N/A _assert_all_finite N/A spmatrix data N/A spmatrix N/A check_symmetric N/A N/A array tol raise_warning raise_exception N/A 1e-10 True False N/A N/A Make sure that array is 2D, square and symmetric.
    If the array is not symmetric, then a symmetrized version is returned.
    Optionally, a warning or exception is raised if the matrix is not
    symmetric.
    Parameters
    ----------
    array : nd-array or sparse matrix
        Input object to check / convert. Must be two-dimensional and square,
        otherwise a ValueError will be raised.
    tol : float
        Absolute tolerance for equivalence of arrays. Default = 1E-10.
    raise_warning : boolean (default=True)
        If True then raise a warning if conversion is required.
    raise_exception : boolean (default=False)
        If True then raise an exception if array is not symmetric.
    Returns
    -------
    array_sym : ndarray or sparse matrix
        Symmetrized version of the input array, i.e. the average of array
        and array.transpose(). If sparse, then duplicate entries are first
        summed and zeros are eliminated.
     N/A N/A N/A N/A array ndim 2 N/A N/A N/A array shape N/A 0 N/A N/A array shape N/A 1 N/A N/A N/A ValueError N/A N/A array must be 2-dimensional and square. shape = {0} format N/A array shape N/A N/A N/A sp issparse array N/A N/A diff N/A array N/A array T N/A N/A N/A diff format N/A csr csc coo N/A N/A diff N/A N/A diff tocsr N/A symmetric N/A N/A np all N/A N/A abs N/A diff data tol N/A N/A symmetric N/A N/A np allclose array N/A array T atol tol N/A N/A symmetric N/A N/A raise_exception N/A N/A N/A ValueError Array must be symmetric N/A raise_warning N/A N/A N/A N/A warnings warn Array is not symmetric, and will be converted to symmetric by average with its transpose. N/A N/A N/A sp issparse array N/A N/A conversion N/A to N/A array format N/A array N/A N/A getattr N/A 0.5 N/A array N/A array T conversion N/A N/A array N/A 0.5 N/A array N/A array T N/A array N/A check_random_state N/A N/A seed N/A N/A N/A Turn seed into a np.random.RandomState instance
    If seed is None, return the RandomState singleton used by np.random.
    If seed is an int, return a new RandomState instance seeded with seed.
    If seed is already a RandomState instance, return it.
    Otherwise raise ValueError.
     N/A N/A N/A seed None N/A seed N/A np random N/A N/A N/A N/A N/A np random mtrand _rand N/A N/A isinstance seed N/A N/A numbers Integral N/A np integer N/A N/A N/A N/A N/A np random RandomState seed N/A N/A isinstance seed N/A N/A np random RandomState N/A N/A seed N/A N/A ValueError N/A %r cannot be used to seed a numpy.random.RandomState instance seed N/A check_array N/A N/A array accept_sparse dtype order copy force_all_finite ensure_2d allow_nd ensure_min_samples ensure_min_features warn_on_dtype N/A None numeric None False True True False 1 1 False N/A N/A Input validation on an array, list, sparse matrix or similar.
    By default, the input is converted to an at least 2nd numpy array.
    If the dtype of the array is object, attempt converting to float,
    raising on failure.
    Parameters
    ----------
    array : object
        Input object to check / convert.
    accept_sparse : string, list of string or None (default=None)
        String[s] representing allowed sparse matrix formats, such as 'csc',
        'csr', etc.  None means that sparse matrix input will raise an error.
        If the input is sparse but not in the allowed format, it will be
        converted to the first listed format.
    dtype : string, type, list of types or None (default="numeric")
        Data type of result. If None, the dtype of the input is preserved.
        If "numeric", dtype is preserved unless array.dtype is object.
        If dtype is a list of types, conversion on the first type is only
        performed if the dtype of the input is not in the list.
    order : 'F', 'C' or None (default=None)
        Whether an array will be forced to be fortran or c-style.
    copy : boolean (default=False)
        Whether a forced copy will be triggered. If copy=False, a copy might
        be triggered by a conversion.
    force_all_finite : boolean (default=True)
        Whether to raise an error on np.inf and np.nan in X.
    ensure_2d : boolean (default=True)
        Whether to make X at least 2d.
    allow_nd : boolean (default=False)
        Whether to allow X.ndim > 2.
    ensure_min_samples : int (default=1)
        Make sure that the array has a minimum number of samples in its first
        axis (rows for a 2D array). Setting to 0 disables this check.
    ensure_min_features : int (default=1)
        Make sure that the 2D array has some minimum number of features
        (columns). The default value of 1 rejects empty datasets.
        This check is only enforced when the input data has effectively 2
        dimensions or is originally 1D and ``ensure_2d`` is True. Setting to 0
        disables this check.
    warn_on_dtype : boolean (default=False)
        Raise DataConversionWarning if the dtype of the input data structure
        does not match the requested dtype, causing a memory copy.
    estimator : str or estimator instance (default=None)
        If passed, include the name of the estimator in warning messages.
    Returns
    -------
    X_converted : object
        The converted and validated X.
     N/A N/A isinstance accept_sparse str N/A N/A accept_sparse N/A accept_sparse N/A dtype_numeric N/A dtype numeric N/A dtype_orig N/A getattr array dtype None N/A N/A N/A hasattr dtype_orig kind N/A N/A dtype_orig None N/A dtype_numeric N/A N/A N/A N/A dtype_orig None N/A N/A dtype_orig kind O N/A N/A dtype N/A np float64 N/A N/A dtype None N/A N/A isinstance dtype N/A list tuple N/A N/A N/A N/A dtype_orig None N/A dtype_orig dtype N/A N/A dtype None N/A N/A dtype N/A dtype N/A 0 N/A N/A N/A sp issparse array N/A N/A array N/A _ensure_sparse_format array accept_sparse dtype copy force_all_finite N/A N/A array N/A N/A np array array dtype dtype order order copy copy N/A ensure_2d N/A N/A N/A N/A array ndim 1 N/A N/A N/A ensure_min_samples 2 N/A N/A N/A ValueError N/A %s expects at least 2 samples provided in a 2 dimensional array-like input estimator_name N/A N/A N/A warnings warn Passing 1d arrays as data is deprecated in 0.17 and willraise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample. DeprecationWarning N/A array N/A N/A np atleast_2d array N/A array N/A N/A np array array dtype dtype order order copy copy N/A N/A dtype_numeric N/A N/A N/A array dtype kind O N/A N/A array N/A N/A array astype N/A np float64 N/A N/A N/A allow_nd N/A N/A array ndim 3 N/A N/A N/A ValueError N/A Found array with dim %d. expected <= 2. N/A array ndim N/A force_all_finite N/A N/A N/A _assert_all_finite array N/A shape_repr N/A _shape_repr N/A array shape N/A N/A ensure_min_samples 0 N/A N/A n_samples N/A _num_samples array N/A N/A n_samples ensure_min_samples N/A N/A N/A ValueError N/A Found array with %d sample(s) (shape=%s) while a minimum of %d is required. N/A n_samples shape_repr ensure_min_samples N/A N/A N/A ensure_min_features 0 N/A N/A array ndim 2 N/A N/A n_features N/A N/A array shape N/A 1 N/A N/A n_features ensure_min_features N/A N/A N/A ValueError N/A Found array with %d feature(s) (shape=%s) while a minimum of %d is required. N/A n_features shape_repr ensure_min_features N/A N/A warn_on_dtype N/A dtype_orig None N/A N/A array dtype dtype_orig N/A N/A msg N/A Data with input dtype %s was converted to %s. N/A dtype_orig N/A array dtype N/A N/A N/A warnings warn msg DataConversionWarning N/A array N/A