Do you have duplicate features or exactly duplicate training cases? Often these sorts of things crop up when there is a rank deficiency in the data. If that's the case, adding a small amount of random noise before computing adjacencies might fix things.
On 2011-12-07, at 20:48, Timmy Wilson <[email protected]> wrote: > I get the following error when running Hessian-based LLE:: > > > /home/timmyt/projects/smarttypes/smarttypes/scripts/reduce_twitter_graph.py > in <module>() > 32 print "Passed our little test: following %s users!" % > len(tmp_followies) > 33 > ---> 34 results = reduce_graph(adjacency_matrix, follower_ids, > out_dim=2, n_neighbors=30, method='hessian') > 35 > 36 > > /home/timmyt/projects/graphreduce/graphreduce.py in > reduce_graph(input_graph, sample_ids, out_dim, n_neighbors, method) > 7 def reduce_graph(input_graph, sample_ids, out_dim=2, > n_neighbors=30, method='modified'): > 8 clf = manifold.LocallyLinearEmbedding(n_neighbors, > out_dim=out_dim, method=method) > ----> 9 results = clf.fit_transform(input_graph) > 10 print "Done. Reconstruction error: %g" % clf.reconstruction_error_ > 11 return results > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/manifold/locally_linear.pyc > in fit_transform(self, X, y) > 573 X_new: array-like, shape (n_samples, out_dim) > 574 """ > --> 575 self._fit_transform(X) > 576 return self.embedding_ > 577 > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/manifold/locally_linear.pyc > in _fit_transform(self, X) > 544 eigen_solver=self.eigen_solver, tol=self.tol, > 545 max_iter=self.max_iter, method=self.method, > --> 546 hessian_tol=self.hessian_tol, > modified_tol=self.modified_tol) > 547 > 548 def fit(self, X, y=None): > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/manifold/locally_linear.pyc > in locally_linear_embedding(X, n_neighbors, out_dim, reg, > eigen_solver, tol, max_iter, method, hessian_tol, modified_tol) > 457 > 458 return null_space(M, out_dim, k_skip=1, eigen_solver=eigen_solver, > --> 459 tol=tol, max_iter=max_iter) > 460 > 461 > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/manifold/locally_linear.pyc > in null_space(M, k, k_skip, eigen_solver, tol, max_iter) > 139 if eigen_solver == 'arpack': > 140 eigen_values, eigen_vectors = eigsh(M, k + k_skip, sigma=0.0, > --> 141 tol=tol, maxiter=max_iter) > 142 > 143 return eigen_vectors[:, k_skip:], np.sum(eigen_values[k_skip:]) > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/utils/arpack.pyc > in eigsh(A, k, M, sigma, which, v0, ncv, maxiter, tol, > return_eigenvectors, Minv, OPinv, mode) > 1486 if OPinv is None: > 1487 Minv_matvec = get_OPinv_matvec(A, M, sigma, > -> 1488 symmetric=True, > tol=tol) > 1489 else: > 1490 OPinv = _aslinearoperator_with_dtype(OPinv) > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/utils/arpack.pyc > in get_OPinv_matvec(A, M, sigma, symmetric, tol) > 1008 def get_OPinv_matvec(A, M, sigma, symmetric=False, tol=0): > 1009 if sigma == 0: > -> 1010 return get_inv_matvec(A, symmetric=symmetric, tol=tol) > 1011 > 1012 if M is None: > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/utils/arpack.pyc > in get_inv_matvec(M, symmetric, tol) > 1001 if isspmatrix_csr(M) and symmetric: > 1002 M = M.T > -> 1003 return SpLuInv(M).matvec > 1004 else: > 1005 return IterInv(M, tol=tol).matvec > > /home/timmyt/.virtualenvs/smarttypes/lib/python2.6/site-packages/sklearn/utils/arpack.pyc > in __init__(self, M) > 894 """ > 895 def __init__(self, M): > --> 896 self.M_lu = splu(M) > 897 LinearOperator.__init__(self, M.shape, self._matvec, > dtype=M.dtype) > 898 self.isreal = not np.issubdtype(self.dtype, np.complexfloating) > > /usr/lib/python2.6/dist-packages/scipy/sparse/linalg/dsolve/linsolve.pyc > in splu(A, permc_spec, diag_pivot_thresh, drop_tol, relax, panel_size, > options) > 171 _options.update(options) > 172 return _superlu.gstrf(N, A.nnz, A.data, A.indices, A.indptr, > --> 173 ilu=False, options=_options) > 174 > 175 def spilu(A, drop_tol=None, fill_factor=None, drop_rule=None, > permc_spec=None, > > RuntimeError: Factor is exactly singular > > ------------------------------------------------------------------------------ > Cloud Services Checklist: Pricing and Packaging Optimization > This white paper is intended to serve as a reference, checklist and point of > discussion for anyone considering optimizing the pricing and packaging model > of a cloud services business. Read Now! > http://www.accelacomm.com/jaw/sfnl/114/51491232/ > _______________________________________________ > Scikit-learn-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
