Matlab 中时间序列之间的相似性搜索。可能的 ?我在 matlab 中找不到 R 树实现

发布于 2024-09-11 10:09:20 字数 407 浏览 2 评论 0原文

我想在matlab中实现相似性搜索。我想知道这可能吗?

我的计划是使用两种流行的相似性测量,即欧几里德距离和动态时间扭曲。这两者都将应用于时间序列数据集。我现在的问题是如何评估这两种测量性能和准确性?我看到一些文献说我应该使用K-NN算法。

然后,我计划对时间序列数据集应用降维。降低数据集的维度后。我需要使用 R 树或任何可用的索引技术来索引数据集。

然而我的问题是,要做到这一点,我需要 R-tree matlab 代码,我在互联网上几乎找不到任何代码......

我确实意识到相似性搜索的大多数实现都是用 C++、C 和 Java 编写的......但我对那些不熟悉。我希望我可以在 Matlab 中实现这些......任何大师可以帮助我吗?

另外我可以进行什么样的评估来评估每种算法的性能。

谢谢

I would like to implement similarity search in matlab. I wanna to know is it possible ?

My plan is to do use 2 popular similarity measurement which are Euclidean Distance and Dynamic Time Warping. Both of these will be applied on time series dataset. My question at this point is how can I evaluate both of these two measurement performance and accuracy ? I seen some literature saying i should use K-NN algorithm.

Then, I plan to apply dimensionality reduction on the time series dataset. After reducued the dimensionality of the dataset. I will need to index the dataset using R-tree or any indexing techniques available.

However my problem is that to do this, I need R-tree matlab code which I hardly able to find any in the internet ...

I do realised that most of the implementation for similarity search are in C++, C and Java ... But im not familiar with those. Im hoping I could implement these in Matlab ... Any Guru could help me with this ?

Also what kind of evaluation can I make to evaluate the performance for each algorithm.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小嗷兮 2024-09-18 10:09:20

最近(我相信是 R2010a),MATLAB 为 k-最近邻 (kNN) 使用 KD-tree 进行搜索(a 空间索引方法类似于 R 树)到统计工具箱。示例:

load fisheriris                            % Iris dataset
Q = [6 3 4 1 ; 5 4 3 2];                   % query points

% build kd-tree
knnObj = createns(meas, 'NSMethod','kdtree', 'Distance','euclidean');

% find k=5 Nearest Neighbors to Q
[idx Dist] = knnsearch(knnObj, Q, 'K',5);

请参阅此页面了解详细说明。

另外,如果您有图像处理工具箱,它包含(很长一段时间以来)kd 树和 kNN 搜索的实现。不过,它们是私有函数:

[matlabroot '\images\images\private\kdtree.m']
[matlabroot '\images\images\private\nnsearch.m']

比较您的两种方法(动态时间扭曲欧几里得距离),可以设计一个经典的分类问题;给定一组带标签的训练/测试时间序列,任务是通过使用 kNN 查找最相似的序列来预测每个测试序列的标签,然后预测多数类。要评估性能,请使用任何标准的分类度量,例如准确性/错误等。

Recently (R2010a I believe), MATLAB added new functions for k-Nearest Neighbor (kNN) searching using KD-tree (a spatial indexing method similar to R-tree) to the Statistics Toolbox. Example:

load fisheriris                            % Iris dataset
Q = [6 3 4 1 ; 5 4 3 2];                   % query points

% build kd-tree
knnObj = createns(meas, 'NSMethod','kdtree', 'Distance','euclidean');

% find k=5 Nearest Neighbors to Q
[idx Dist] = knnsearch(knnObj, Q, 'K',5);

Refer to this page for nice description.

Also if you have the Image Processing Toolbox, it contains (for a long time now) an implementation of the kd-tree and kNN searching. They are private functions though:

[matlabroot '\images\images\private\kdtree.m']
[matlabroot '\images\images\private\nnsearch.m']

To compare your two approaches (Dynamic Time Warping and Euclidean distance), you can design a classic problem of classification; given a set of labeled training/testing time series, the task is to predict the label of each test sequenceby finding the most similar ones using kNN then predict the majority class. To evaluate performance, use any of the standard measures of classification like accuracy/error, etc..

心舞飞扬 2024-09-18 10:09:20

事实证明,对于 ED 和 DTW,使用 UCR 套件进行顺序扫描要快得多。

看这个视频
https://www.youtube.com/watch?v=d_qLzMMuVQg

或此

https://www.youtube.com/watch?v=c7xz9pVr05Q

代码是免费的http://www.cs.ucr.edu/~eamonn/UCRsuite.html

It turns out that it is MUCH faster, for both ED and DTW, to do a sequential scan, using the UCR suite.

See this video
https://www.youtube.com/watch?v=d_qLzMMuVQg

or this

https://www.youtube.com/watch?v=c7xz9pVr05Q

the code is free http://www.cs.ucr.edu/~eamonn/UCRsuite.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文