Module Expr Str Import alias Import alias identifier Import alias identifier ImportFrom alias alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index CompareEq NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore BinOpSub SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt NameLoad Num body Assign NameStore BinOpMult NameLoad NameLoad orelse Assign NameStore NameLoad AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Slice BinOpAdd NameLoad Num NameLoad Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpDiv NameLoad Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num Str Num NameLoad body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call NameLoad NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index Num keyword BinOpAdd NameLoad Num If CompareNotEq NameLoad Str body Assign NameStore BinOpSub Call NameLoad keyword AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad BinOpMult AttributeLoad NameLoad attr NameLoad attr orelse Assign NameStore Call AttributeLoad BinOpSub BinOpSub BinOpMult AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad attr AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Slice BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num Num Num Return Call NameLoad NameLoad NameLoad keyword Num keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad NameLoad Str NameLoad Num Num Num body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list
N/A N/A Locally Linear Embedding N/A warnings N/A numpy np N/A scipy.sparse sparse scipy.linalg eigh svd qr solve scipy.sparse eye csr_matrix embedding.base BaseEmbedding utils.validation check_array check_random_state utils.eigendecomp null_space check_eigen_solver barycenter_graph N/A N/A distance_matrix X reg N/A 0.001 N/A N/A 
    Computes the barycenter weighted graph for points in X

    Parameters
    ----------
    distance_matrix: sparse Ndarray, (N_obs, N_obs) pairwise distance matrix.
    X : Ndarray (N_obs, N_dim) observed data matrix.
    reg : float, optional
        Amount of regularization when solving the least-squares
        problem. Only relevant if mode='barycenter'. If None, use the
        default.

    Returns
    -------
    W : sparse matrix in CSR format, shape = [n_samples, n_samples]
        W[i, j] is assigned the weight of edge that connects i to j.
     N/A N/A N d_in N/A X shape N/A N/A rows cols N/A N/A distance_matrix nonzero N/A W N/A N/A sparse lil_matrix N/A N N N/A i N/A range N N/A N/A nbrs_i N/A cols N/A N/A rows i N/A n_neighbors_i N/A len nbrs_i N/A v N/A N/A np ones n_neighbors_i dtype N/A X dtype N/A C N/A N/A X N/A nbrs_i N/A X N/A i N/A G N/A N/A np dot C N/A C T N/A trace N/A N/A np trace G N/A N/A trace 0 N/A N/A R N/A reg trace N/A N/A R reg N/A N/A N/A G flat N/A N/A n_neighbors_i 1 R N/A w N/A solve G v sym_pos True N/A N/A W N/A N/A i nbrs_i N/A w N/A N/A np sum w N/A W N/A locally_linear_embedding N/A N/A geom n_components reg max_iter eigen_solver tol random_state N/A 0.001 100 auto 1e-06 None N/A N/A 
    Perform a Locally Linear Embedding analysis on the data.

    Parameters
    ----------
    geom : a Geometry object from megaman.geometry.geometry
    n_components : integer
        number of coordinates for the manifold.
    reg : float
        regularization constant, multiplies the trace of the local covariance
        matrix of the distances.
    eigen_solver : {'auto', 'dense', 'arpack', 'lobpcg', or 'amg'}
        'auto' :
            algorithm will attempt to choose the best method for input data
        'dense' :
            use standard dense matrix operations for the eigenvalue decomposition.
            For this method, M must be an array or matrix type.  This method should be avoided for large problems.
        'arpack' :
            use arnoldi iteration in shift-invert mode. For this method,
            M may be a dense matrix, sparse matrix, or general linear operator.
            Warning: ARPACK can be unstable for some problems.  It is best to
            try several random seeds in order to check results.
        'lobpcg' :
            Locally Optimal Block Preconditioned Conjugate Gradient Method.
            A preconditioned eigensolver for large symmetric positive definite
            (SPD) generalized eigenproblems.
        'amg' :
            AMG requires pyamg to be installed. It can be faster on very large,
            sparse problems, but may also lead to instabilities.
    tol : float, optional
        Tolerance for 'arpack' method
        Not used if eigen_solver=='dense'.
    max_iter : integer
        maximum number of iterations for the arpack solver.
    random_state : numpy.RandomState or int, optional
        The generator or seed used to determine the starting vector for arpack
        iterations.  Defaults to numpy.random.

    Returns
    -------
    Y : array-like, shape [n_samples, n_components]
        Embedding vectors.
    squared_error : float
        Reconstruction error for the embedding vectors. Equivalent to
        ``norm(Y - W Y, 'fro')**2``, where W are the reconstruction weights.

    References
    ----------

    .. [1] Roweis, S. & Saul, L. Nonlinear dimensionality reduction
        by locally linear embedding.  Science 290:2323 (2000).
     N/A N/A N/A geom X None N/A N/A N/A ValueError Must pass data matrix X to Geometry N/A N/A N/A geom adjacency_matrix None N/A N/A N/A N/A geom compute_adjacency_matrix N/A W N/A barycenter_graph N/A geom adjacency_matrix N/A geom X reg reg N/A eigen_solver N/A check_eigen_solver eigen_solver size N/A N/A W shape N/A 0 nvec N/A n_components 1 N/A N/A eigen_solver dense N/A N/A M N/A N/A eye format N/A W format N/A W shape W N/A M N/A N/A N/A N/A M T M tocsr N/A N/A M N/A N/A N/A N/A N/A N/A W T W N/A W T W toarray N/A N/A N/A M flat N/A N/A N/A N/A M shape N/A 0 1 1 N/A N/A null_space M n_components k_skip 1 eigen_solver eigen_solver tol tol max_iter max_iter random_state random_state N/A LocallyLinearEmbedding N/A BaseEmbedding N/A N/A 
    Locally Linear Embedding

    Parameters
    ----------

    n_components : integer
        number of coordinates for the manifold.
    radius : float (optional)
        radius for adjacency and affinity calculations. Will be overridden if
        either is set in `geom`
    geom : dict or megaman.geometry.Geometry object
        specification of geometry parameters: keys are
        ["adjacency_method", "adjacency_kwds", "affinity_method",
         "affinity_kwds", "laplacian_method", "laplacian_kwds"]
    eigen_solver : {'auto', 'dense', 'arpack', 'lobpcg', or 'amg'}
        'auto' :
            algorithm will attempt to choose the best method for input data
        'dense' :
            use standard dense matrix operations for the eigenvalue
            decomposition. Uses a dense data array, and thus should be avoided
            for large problems.
        'arpack' :
            use arnoldi iteration in shift-invert mode. For this method,
            M may be a dense matrix, sparse matrix, or general linear operator.
            Warning: ARPACK can be unstable for some problems.  It is best to
            try several random seeds in order to check results.
        'lobpcg' :
            Locally Optimal Block Preconditioned Conjugate Gradient Method.
            A preconditioned eigensolver for large symmetric positive definite
            (SPD) generalized eigenproblems.
        'amg' :
            AMG requires pyamg to be installed. It can be faster on very large,
            sparse problems, but may also lead to instabilities.
    random_state : numpy.RandomState or int, optional
        The generator or seed used to determine the starting vector for arpack
        iterations.  Defaults to numpy.random.RandomState
    tol : float, optional
        Tolerance for 'arpack' method
        Not used if eigen_solver=='dense'.
    max_iter : integer, optional
        maximum number of iterations for the arpack solver.
    reg : float, optional
        regularization constant, multiplies the trace of the local covariance
        matrix of the distances.

    References
    ----------
    .. [1] Roweis, S. & Saul, L. Nonlinear dimensionality reduction
        by locally linear embedding.  Science 290:2323 (2000).
     __init__ N/A N/A self n_components radius geom eigen_solver random_state tol max_iter reg N/A 2 None None auto None 1e-06 100 1000.0 N/A N/A N/A self n_components n_components N/A N/A self radius radius N/A N/A self geom geom N/A N/A self eigen_solver eigen_solver N/A N/A self random_state random_state N/A N/A self tol tol N/A N/A self max_iter max_iter N/A N/A self reg reg N/A fit N/A N/A self X y input_type N/A None data N/A N/A Fit the model from data in X.

        Parameters
        ----------
        input_type : string, one of: 'data', 'distance'.
            The values of input data X. (default = 'data')
        X : array-like, shape (n_samples, n_features)
            Training vector, where n_samples in the number of samples
            and n_features is the number of features.

        If self.input_type is 'distance':

        X : array-like, shape (n_samples, n_samples),
            Interpret X as precomputed distance or adjacency graph
            computed from samples.

        Returns
        -------
        self : object
            Returns the instance itself.
         N/A X N/A N/A self _validate_input X input_type N/A N/A N/A self fit_geometry X input_type N/A random_state N/A check_random_state N/A self random_state N/A N/A N/A self embedding_ N/A self error_ N/A locally_linear_embedding N/A self geom_ n_components N/A self n_components eigen_solver N/A self eigen_solver tol N/A self tol random_state N/A self random_state reg N/A self reg max_iter N/A self max_iter N/A self N/A N/A