Creating a Custom Processing Block: Features and Labels

I want to add statistical metrics a Features. Features[] and Labels[] need to be the same length.
So I need to Label all the Processed Data and then I will add in my metrics.

In dsp.py we can add Features and Labels like this:

for f in fx:
   features.append(f)
   labels.append("PD") ← Should this change for each Feature (PD01, PD02,…PDnn) or should it stay constant such as “PD”?
   ...
   features.append(float(skew(fx)))
   labels.append('Skewness')

Hi @MMarcial The label should be unique for each feature. However, if you don’t have named features (so you’re just using increments like PD01, PD02 in your example) you can omit the labels and we’ll generate them for you.

@janjongboom

For clarification:

In generate_features() one can code something like this:


   for f in fx:
      features.append(f)

   features.append(float(skew(fx)))
   labels.append('Skewness')
   features.append(float(calculateKurtosis(fx)))
   labels.append('Kurtosis')
   features.append(float(np.mean(fx)))
   labels.append('Mean')
   features.append(float(np.median(fx)))
   labels.append('Median')
   features.append(float(np.std(fx)))
   labels.append('StDev')
   features.append(float(np.std(fx)))
   labels.append('StDev'')


Then the Edge Impulse Labeler will see features[] and labels[] do not have the same length and will label the rest, correct?