On 04/02/2013 10:26 PM, Pieraut, Francis wrote:
Hi Andy & Ken,
Thanks Ken for the alternative but I am using a cosine distance.
Andy, concerning the computation of the mean, the function has to be
configurable too but the default function mean is also good for cosine
& bregman divergence
(http://www-users.cs.umn.edu/~kumar/dmbook/ch8.pdf see table 8.2 page
501). Yes I could implement easily k-means but I will lose lot of
benefits from sklearn frameworks such as the ability to compare easily
several unsupervised algorithms. I was simply expected the distance
function to be configurable as it is with many other sklearn functions.
You can implement it and inherit from BaseEstimator (and optionally
cluster mixin)
There is no magic to making a sklearn estimator, you just have to define
"fit" and "predict".
Actually there are not many place in sklearn where you can pass
callables to customize an algorithm.
The thing is that you would need to provide a pairwise distance measure
and a function to compute the center and these should be compatible.
If they are not, the algorithm might not stop (afaik). So does the
algorithm check for endless loops? Does it check whether computing the
center
does the right thing? Or does it check for infinite loops?
On the other hand, do you know why
metrics.cluster.unsupervised.silhouette_score required the labels? I
understand that we can compute the supervised version of the
silhouette score but was looking for the unsupervised version. Even
the help doesn't mention anywhere the labels.
The labels here are the cluster assignments you want to evaluate. Just
passing X is no good, is it ;)
Cheers,
Andy
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general