Reputation: 748
I got multiple curves from different sensor but all attached in the same moving object.
Now I want to extract features from it , let's say I have cut 0-10 as window1 , so in window1 I got 5 graphs ,each graph represents one sensor in a particular position, each sensor generates 3 curves , x(red) ,y(green),and z(blue), as shown below:
**Entire graph is a single window
Since all sensors are attached in a same moving object ,I thought these graphs and curves should have some relations I could use as features to use in machine learning algorithms(especially SVM) . But they are too many, I am kind of lost.
How many reasonable features I could generate from this single window?
I am so appreciated for any advices .. Thanks!
Upvotes: 4
Views: 956
Reputation: 4666
You can transform the different time series to live in the same coordinate system by solving the orthogonal Procrustes problem.
Here are the five arrays of Euler angles that you gave me (they are stored in arr[0]
through arr[4]
as 169x3 numpy arrays):
Now we solve the orthogonal Procrustes problem by the following Python routine, which allows us to rotate one of the arrays to match another one as closely as possible:
def rotate_into(arr0, arr1):
"""Solve orthogonal Procrustes problem"""
M = dot(arr0.T, arr1)
(U,S,V) = svd(M)
Q = dot(U, V) # the rotation matrix which transforms arr0 into arr1
return arr0.dot(Q)
svd
is the singular value decomposition and lives in numpy.linalg.svd
. Now we can apply this routine to each array and transform it to be as close as possible to the reference array, here the first one:
reference = 0
for i in range(0,5):
subplot(2,3, i+1)
plot(rotate_into(arr[i], arr[reference]))
Now all the series are comparable, and you can easily compute features from them by taking the mean, the standard deviation, and so on.
Upvotes: 2