开发者

Pattern recognition with double vectors

开发者 https://www.devze.com 2023-02-16 01:31 出处:网络
I have a set of vectors which contain the same amount of entries. I have been googling for a while but i haven\'t found anything useful:

I have a set of vectors which contain the same amount of entries. I have been googling for a while but i haven't found anything useful:

Is there a way to detect a patte开发者_Go百科rn in these numbers?

The vectors look like this:

{840.2, 842.1,....,} {840.3, 843.1,....,} ....


To analyze your data, I suggest writing a program that puts the data into a Comma Separated Values formatted file, then input the file into a spreadsheet. Spreadsheets already have great functions for analyzing data.

A good project would be to use (implement) a neural network for analyzing the data. Search the Web for "Neural Network C++".


Based on your comment above, I think you'll be interested in cross-correlation.

The basic idea is that you have two vectors (one of length m and one of length n, where n is usually much smaller than m) and you create a third vector (of length m - n) whose values represent how well the smaller vector matches a portion of the larger at particular points.

The basic algorithm is something like:

for i = 0 to m - n
    output[i] = 0
    for j = 0 to n
        output[i] = output[i] + (v0[i + j] * v1[j])^2 

The index of the maximum value in the output vector is where the smaller input vector best matches the larger.

This naive implementation is quite slow, but in the Properties section of the above link, we see that we can use FFTs to calculate the cross-correlation much faster in general.


You could also use metrics like the cosine similarity in order to determine how similar two vectors are. If all of the vectors follow a similar trend, then their cosine similarities should also be similar.

0

精彩评论

暂无评论...
验证码 换一张
取 消