harislulic / ZeMA-machine-learning-tutorials

Machine Learning tutorials oriented at begginers in data science. Methods are applied on ZeMA-s testbed data (Zentrum für Mechatronik und Automatisierungstechnik gGmbH).
1 stars 5 forks source link

NameError in 2_Features_extraction_and_selection.ipynb #33

Open BjoernLudwigPTB opened 4 years ago

BjoernLudwigPTB commented 4 years ago

I receive a

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-18-e491d44dd19f> in <module>
      8 for i in range((len(sensor_train))):
      9 
---> 10     sensor_train[i]=((sensor_train[i]*gain[sensor_num])+offset[sensor_num])*b[sensor_num]*k[sensor_num]

NameError: name 'sensor_num' is not defined

on execution of

#if you did not convert the signal to SI units, convert here
offset=[0, 0, 0, 0, 0.00488591, 0.00488591, 0.00488591,  0.00488591, 1.36e-2, 1.5e-2, 1.09e-2]
gain=[5.36e-9, 5.36e-9, 5.36e-9, 5.36e-9, 3.29e-4, 3.29e-4, 3.29e-4, 3.29e-4, 8.76e-5, 8.68e-5, 8.65e-5]
b=[1, 1, 1, 1, 1, 1, 1, 1, 5.299641744, 5.299641744, 5.299641744]
k=[250, 1, 10, 10, 1.25, 1, 30, 0.5, 2, 2, 2]
units=['[Pa]', '[g]', '[g]', '[g]', '[kN]', '[bar]', '[mm/s]', '[A]', '[A]', '[A]', '[A]']

for i in range((len(sensor_train))):

    sensor_train[i]=((sensor_train[i]*gain[sensor_num])+offset[sensor_num])*b[sensor_num]*k[sensor_num]

in _2_Features_extraction_andselection.ipynb. Could you please have a look at the lines and fix this issue?