sklearn.manifold.locally_linear_embedding?
sklearn.manifold.locally_linear_embedding(X, *, n_neighbors, n_components, reg=0.001, eigen_solver='auto', tol=1e-06, max_iter=100, method='standard', hessian_tol=0.0001, modified_tol=1e-12, random_state=None, n_jobs=None)
[源碼]
對數據執行局部線性嵌入分析。
在用戶指南中閱讀更多內容。
參數 | 說明 |
---|---|
X | {array-like, NearestNeighbors} 以numpy數組或NearestNeighbors對象形式的樣本數據shape = (n_samples, n_features) |
n_neighbors | integer 每個點要考慮的鄰居數量。 |
n_components | integer 流形的坐標數。 |
reg | float 正則化常數,乘以距離的局部協方差矩陣的軌跡。 |
eigen_solver | string, {‘auto’, ‘arpack’, ‘dense’} ‘auto’:算法將嘗試為輸入數據選擇最佳方法 |
arpack | use arnoldi iteration in shift-invert mode. 對于此方法,M可以是稠密矩陣,稀疏矩陣或一般線性式子。警告:由于某些問題,ARPACK可能不穩定。最好嘗試幾個隨機種子以檢查結果。 |
dense | use standard dense matrix operations for the eigenvalue 分解。對于此方法,M必須為數組或矩陣類型。對于大問題應避免使用此方法。 |
tol | float, optional 'arpack'方法的公差,如果eigen_solver =='dense'不使用。 |
max_iter | integer arpack求解器的最大迭代次數。 |
method | {‘standard’, ‘hessian’, ‘modified’, ‘ltsa’} |
standard | use the standard locally linear embedding algorithm. 參見參考文獻[1] |
hessian | use the Hessian eigenmap method. This method requires n_neighbors> n_components *(1 +(n_components +1)/2。請參見參考文獻[2] |
modified | use the modified locally linear embedding algorithm. 參見參考文獻[3] |
ltsa | use local tangent space alignment algorithm 參見參考文獻[4] |
hessian_tol | float, optional Hessian特征映射方法的公差。僅在method=='hessian'時使用 |
modified_tol | float, optional 修正的LLE方法的公差。僅在method=='modified'時使用 |
random_state | int, RandomState instance, default=None 當 solver =='arpack' 時確定隨機數生成器。在多個函數調用之間傳遞int以獲得可重復的結果。請參閱:term: Glossary <random_state> |
n_jobs | int or None, optional (default=None) 為鄰居搜索運行的并行作業數。 None 除非在joblib.parallel_backend 環境中,否則表示1 。 undefined表示使用所有處理器。有關更多詳細信息,請參見詞匯表。 |
返回值 | 說明 |
---|---|
Y | array-like, shape [n_samples, n_components] 嵌入向量。 |
squared_error | float 嵌入向量的重建誤差。相當于 norm(Y - W Y, 'fro')**2 , 其中W是重建權重。 |
參考文獻
[1] Roweis, S. & Saul, L. Nonlinear dimensionality reduction by locally linear embedding. Science 290:2323 (2000).
[2] Donoho, D. & Grimes, C. Hessian eigenmaps: Locally linear embedding techniques for high-dimensional data. Proc Natl Acad Sci U S A. 100:5591 (2003).
[3] Zhang, Z. & Wang, J. MLLE: Modified Locally Linear Embedding Using Multiple Weights. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.70.382
[4] Zhang, Z. & Zha, H. Principal manifolds and nonlinear dimensionality reduction via tangent space alignment. Journal of Shanghai Univ. 8:406 (2004)