Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature on TimeSeriesKmean: DTW_BaryCenterAverage #268
Comments
|
Not sure if I understand the question completely, but there is a |
|
@GillesVandewiele I think we do have such a parameter for This should not be too difficult to implement since
Hence I tag this one as a good first issue: anyone willing to work on this should feel free to open a PR. |
|
Thanks for the response. I took a look at the argument sample_weights for KernelKmeans fit method. According to my understanding, it seems it only accepts a pre-defined vector for weight. However, in my case, the weights are changing. In other words, the weights of points in a cluster (to calculate its DBA) are calculated as a function of those points in that cluster and return an array with a length equal to its cluster size. So, it would be nice if it can accept a function as well. |
|
I understand your point, yet:
|
In the end, you are the expert here. So, you definitely know better than me. My field is in electrical engineering (power system) and I am a newbie in this area. Thanks again for your responses. |
I agree! Although it should be noted that there are some exceptions to this, e.g. the KNN can accept a string for the |
|
But for knn, weights are just used at predict time, they are not involved in any fit time optimization. Once again I feel that this could definitely break convergence which is not a desirable behavior. |


Hi,
I opened an issue before but closed it later and decided to say it here in "Feature Request."
I was wondering if you could modify the TimeSeriesKmean function such that it can accept weight (as a callable function) in its metric_params for calculating the dtw_barycenteraveraging.
So:
metric_params = {'weights: ', my_function(data_points)}
So, it is a function that gets a set of data points (observations) and based on that calculates a weight vector and returns it. It gives the flexibility to the user to define a weight function and apply it throughout the clustering process.
(In my problem, for instance, I modified the centroid of the FINAL RESULT and see that it works better for me. However, if such modification can be applied throughout the whole clustering process (and just the final result), it might better enhance the final clusters and result.)
Best,
Nima