On 11 December 2013 23:30, José Pablo González <[email protected]> wrote:
> Hello,
>
> I am new in sklearn, but so far I'm impressed.  I think it is a great
> library!
>
> I think I found a little bug in the Multidimensional Scaling Function. It
> expects "perfect" similarity matrices, which it's often not possible with
> real data.  Moreover, sklearn's functions are unable to get the expected
> precision.
>
> For example if I use sklearn to computea similarity matrix of euclidean
> distances:
>
> similarities = euclidean_distances(data)
> print np.abs(similarities - similarities.T).max()
> # this outputs 5.26835606386e-09, which I'd it's precise enough
>
>
> Unfortunately, when I try to calculate MDS:
> mds = manifold.MDS(n_components=2, dissimilarity="precomputed", n_jobs=1)
> pos = mds.fit(similarities)
>
> I get a precision error.  I have already tried casting to float64 as
> suggested here, but it doesn't work either.  There's no way to change the
> precision of this, only the convergence precision.
>
> Am I overlooking at something?

Nope, this is indeed a problem from the MDS code. You can provide a
fix for this by raising the precision required.
Also, depending on the algorithm used to solve the MDS, a symmetric
matrix should or shouldn't be required. I think in the case of the
SMACOF algorithm (currently used in sklearn), it isn't even required.
Someone should have a look at the litterature to check this (I should
be able to in a couple of weeks).

Cheers,
N

>
> Thanks,
> Jose
>
>
> --
> José P. González-Brenes, Ph.D.
> www.josepablogonzalez.com
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to