Generating features on your own

Hi!
Is there any way to generate features on your own?
I don’t want to copy the features from the website every time I want to run an impulse on my pc.
I’m using node.js
Thanks.

@Orzech do you like to obtain the processed features?

This can be done by the EI API and by writing some node.js code.

If I am correct you can obtain the processed features by feature for sample.
The Sample ID you can obtain by list samples, DSP Block ID by get impulse

@Orzech so usually you’d collect sensor data and feed that into the classifier. What type of data are you collecting? The Node.js SDK for Linux has examples for classifying data from cameras, microphones, and custom sensors: https://github.com/edgeimpulse/edge-impulse-linux-cli (runs on MacOS and most Linux’es).

First of all, thank you very much for your response.

This is a helpful answer, but what about the sample that I did not upload?

Once again, thanks.

First of all, thank you very much for your response.

I’m collecting data from a 3-axis accelerometer, 3-axis gyroscope, and four quaternions that are calculated on the microcontroller. I’m not using the ‘Spectral Features’ block, I’m using ‘Raw Data’ - since I find it works better.
Right now I’m working on my personal Windows laptop, but next week I’ll be getting a MacOS laptop and will be able to test the linux-cli.

@Orzech

In node.js you need to perform some data wrangling.

Maybe I can help with an example (Python).

Currently, I am working on a project using a 3-axis accelerometer and a 3-axis gyroscope. Data is stored in a CSV file as follows Ax, Ay, Az, Gx, Gy, Gz, according to the format described in Importing CSV data. I assume your data is in a similar format?

I have uploaded this data using the EI API.

Below I show one sample.

In Jupyter Notebook, below, I take only the first 3 lines from the CSV file.

The steps:

  • Read CSV file using pandas.
  • Convert data frame to numpy array (shape is 3 x 6).
  • Reshape the array by using np.reshape(sensor_data, 3*6) (compare this outcome with Raw features shown in the screenshot)
  • Apply scaling and you obtain the processed features (compare this outcome with Processed features shown in the screenshot)

I am not a node.js expert but take a look at math.js

I hope this example is a starting for your implementation.

@janjongboom I assume EI use tf.reshape.

2 Likes

Thank you so much @Joeri.
I didn’t try it yet, but I’m pretty sure this is the answer I’ve been looking for.
I’ll definitely test this tomorrow and let you know.
Once again, thank you very much.