Giter Club home page Giter Club logo

time-series-classification-and-clustering's Introduction

Time Series Classification and Clustering

The work of Dr. Eamonn Keogh at University of California Riverside has shown that a good way to classify time series is with a k-NN algorithm using a dynamic time warping similarity measure.

This repo is meant to implement this time series classification method in Python. The same techniques are also extended to clustering time series.

I have also written a tutorial on this subject.

time-series-classification-and-clustering's People

Contributors

66ly avatar alexminnaar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

time-series-classification-and-clustering's Issues

Error while recalculate centroids of clusters(int is not iterable)

    #recalculate centroids of clusters
        for key in self.assignments:
            clust_sum=0
            for k in self.assignments[key]:
                clust_sum=clust_sum+data[k]
            self.centroids[key]=[m/len(self.assignments[key]) for m in clust_sum]-- error in this line,int is not iterable. 

change clust_sum declaration to np.zeros(len(data[0]))
change clust_sum=clust_sum+data[k] to clust_sum=np.add(clust_sum,data[k])

change it to following code

#recalculate centroids of clusters
for key in self.assignments:
clust_sum=np.zeros(len(data[0]))
for k in self.assignments[key]:
clust_sum=np.add(clust_sum,data[k])
self.centroids[key]=[m/len(self.assignments[key]) for m in clust_sum]

the k_means_clust function has a error

if closest_clust in assignments:
    assignments[closest_clust].append(ind)
else:
    assignments[closest_clust]=[]

this code is error! when the element match the clus , the element will not append to the clust ,it make the result error!the right code like this:

assignments.setdefault(closest_clust,[])
assignments[closest_clust].append(ind)

Description of a Data

Hi Alex, Can you please tell about/ describe a bit of data. What number or the row suggest what.?

How to return cluster labels for data sampled.

I see that tslearn.clustering natively supports dynamic time warping via TimeSeriesKMeans.

However, TimeSeriesKMeans is quite slow. I would like to use this implementation which from the code looks like it has more optimization via locality constraints. I'm not sure it's actually faster but I have my fingers crossed it is.

Can someone point me to how I can use @alexminnaar's implementation to output cluster labels per series?

I can see that this implementation robustly outputs the average cluster curves but I don't see it outputting the labels for the entire time series data.

I suspect it is in this block, but I'm having trouble parsing it.
if closest_clust in assignments: assignments[closest_clust].append(ind) else: assignments[closest_clust]=[]

Any pointers would be appreciated.

have a doubt

Thanks for the excellent ipython notebook.
I have a doubt, can you please clarify.
Using k-means clustering, what is the conclusion? there are no clusters as such.
How can we predict cluster number for a new input, based on such results?

Please revert back.

"TypeError: 'NoneType' object is not iterable" ERROR in Clustering

I've followed the exact method (for Kmean Clustering) you've written in the tutorial.
But it generates following error:

100
iteration 1
100
iteration 2
69
iteration 3
48
iteration 4
38
Traceback (most recent call last):
  File "spatio-time cluster.py", line 177, in <module>
    for i in centroids:
TypeError: 'NoneType' object is not iterable

The datasets are same as your Github repo. I am also attaching the code. Please let me know, where I am doing wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.