Hi,
I am working on time-series data to build classic ML models for classification problem. I used a Python Library, tsfresh, to extract (calculate) all possible features on the data, and the library can filter significant features. Overall the library is very cool because it enables me to train the model with very high accuracy (0.95). However, I can’t use this preprocessing data on my company’s edge directly. It requires a python source code that can be converted to C++. I found on Edge Impulse has the custom processing block, which enable to export to C++. Can I paste the extract-feature functions from the tsfresh library into the dsp.py file in the custom processing block so that it can export as C++? If yes, How can I do that?
Remember, your extract_custom_block_features function can be anything, not just a simple function. If you know how, you can even call external applications, and network services or call Python libraries directly using pybind11 or Python embeddings
Just in case Mat wasn’t clear, custom DSP block won’t export this code as CPP for you. You will need to manually port that py file.
As an alternative, many of the feature engineering offerings in tsfresh are present in our Flatten and Spectral Analysis blocks. Before converting tsfresh to cpp, you should try training your model with our blocks (you can use both as input to a model), and see if you can also get to 95% with our turnkey blocks. Those WILL automatically export to cpp
Thank you so much. I initially thought the custom DSP block can export my code to CPP. I will try those two blocks. Also, to convert those built-in processing blocks to C++, will have need to do on edge impulse interface or on my local computer?
When you’ve trained your model on our website and ready to run, refer to these tutorials and documents for how to deploy to test and run inference. Keeping coming back here if you get stuck or need any help with running the C++ inference library!