擅长:python、mysql、java
<blockquote>
<p>Is there any relation between the dimension of data points or the number of samples and the number of neighbors (<code>n_neighbors</code>) and number of components (<code>n_components</code>)?</p>
</blockquote>
<p>一般来说,没有关系。<code>n_neighbors</code>通常由样本之间的距离决定。尤其是,如果您知道样本的类,那么最好将<code>n_neighbors</code>设置为比每个类中的样本数稍大一点。而<code>n_components</code>,即降维大小,是由原始维中数据的冗余度决定的。根据具体的数据分布和您自己的需求,您可以选择合适的空间维度进行投影。在</p>
<p><code>n_components=2</code>是将原始高维空间映射到二维空间。实际上,这是一个特例。在</p>
<blockquote>
<p>Is there any other parameter that is critical to tune, or I should use the default setting for the rest of parameters?</p>
</blockquote>
<p>这里还有几个你应该注意的参数。在</p>
<ul>
<li><code>reg</code>用于权重正则化,它在<a href="http://www.robots.ox.ac.uk/~az/lectures/ml/lle.pdf" rel="nofollow noreferrer">the original LLE paper</a>中没有使用。如果你不想使用它,只需将它设置为零。但是,<code>reg</code>的默认值是<code>1e-3</code>,这个值非常小。在</li>
<li><code>eigen_solver</code>。如果您的数据量很小,建议使用<code>dense</code>以保证准确性。你可以做更多的研究。在</li>
<li><code>max_iter</code>。<code>max_iter</code>的默认值只有100,<strong>,这通常会导致结果不收敛</strong>。如果结果不稳定,请选择较大的整数。在</li>
</ul>