On 7/8/2013 12:53 PM, Lars Buitinck wrote: > cost = np.sum(np.einsum('ij,ji->i', diff, diff.T)) / (2 * n_samples) Thanks for all the remarks!
I found out that the `einsum` can be replaced simply by 'cost = np.sum(diff**2)/ (2 * n_samples)' which is faster and more readable. ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Scikit-learn-general mailing list Scikit-learn-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scikit-learn-general