markdregan / k-nearest-neighbors-with-dynamic-time-warping Goto Github PK
View Code? Open in Web Editor NEWPython implementation of KNN and DTW classification algorithm
Python implementation of KNN and DTW classification algorithm
I am new to Dynamic Time Warping and your note helps quite a lot. Thank you for your sharing. My input
data is 3-D, having shape of (n_samples, n_timesteps,n_features). I am not sure how to transfer it into using the model. Thank you so much!
Hi, is there any change in the code that you might recommend to speed up the execution of the algorithm?
np.shape & scipy.spatial.distance are being used w/o previous import of those modules.
Hi Mark,
Glad to know you...am NOT a proficient python user however I'm quite familiar in writing and running few scripts in Ipython Notebook. I came across your k-NN+DTW classifier source code which is quite self-explanatory and well written on your Github page - appreciate that.
However, I seek your help in getting started running your demo script with HAR dataset first to gain understanding about implementation of some of your routines.
I encounter an error when reading the datasets at the following lines...
for x in x_train_file:
x_train.append([float(ts) for ts in x.split()])
Attached is the snapshot of my error in IPython terminal
Could you pls help me rectify & rerun this without error?
Thanks,
Bala
will it work for multivariate time series classification for example mixture of categorical and continues data?
for example at time t1 we have observation: red, 2.4 , 5, 12.456 and time t2: green, 3.5, 2, 45.78; time t3: black, 5.6, 7, 23.56; t4: red, 2.1, 5, 12.6 ?
This is the error i am getting while trying to execute the code posted here. Please help me resolve that asap
First of all, thanks for this wonderful example. I have downloaded it and tried to run under python 3.6. It shows an unresolved error in the following line:
dm = squareform(dm)
May I know how to resolve this?
Hi,
Perhaps I'm not understanding your code properly, but I was hoping you could clear some things up. When performing DTW on the dataset you read in data/UCI-HAR-Dataset/train/X_train.txt
- This is the feature-engineered dataset, I believe. It contains 561 columns instead of 128, which the README of the data indicates is the number of observations per window.
The part I don't understand is that the features are all dependent on the same observation window. (I checked this by adding an assertion in KnnDtw._dtw_distance()
) In that case how can you perform DTW on them when there isn't a time-scale to warp? Or - more likely - am I misunderstanding DTW?
hey, thanks for the wonderful tutorial, I am wondering how to save once the model is trained, I tried using joblib (sklearn), after saving whenever I am loading the model it starts training again. can you please help me with that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.