11 ms·
From my experience in the fields of DSP / Data / AI during the last 10 years, issues arise when product teams are segregated into jobs (one guy for initial prot
by rmnclmnt 4y ago
From my experience in the fields of DSP / Data / AI during the last 10 years, issues arise when product teams are segregated into jobs (one guy for initial prototype, then one guy to prep the integration, then one guy for the ops side of things, etc.): people need to be interested and involved in the product they are building end-to-end! Yes this is more demanding, yes this requires perpetual training, but gosh it is rewarding!
My take (non-exhaustive) with the current ecosystem is to apply Agile and DevOps methodologies:
- Use Git everywhere all the time, always
- Use Jupyter early one: great for quick prototypes & demos, keynotes, training material, articles
- Once the initial prototype is approved, archive Jupyter notebooks as snapshots
- Write functional tests (ideally in a TDD fashion)
- Build and/or integrate the work into a real software product, be it in Python, C++, Java, etc.
- Use tools for deterministic behavior (package manager, Docker, etc.)
- Use CI/CD and GitOps methodologies
- Deliver iteratively, fast and reliably
And by "MATLAB to C++" was a reference to a time (2010's) when corporation were deeply involved with MATLAB licenses, could not afford to switch easily to Python and lots of SWE with applied math background had to deal with MATLAB code written by pure math guys without any consideration for SWE best practices and target product constraints. Nowadays, if the target product is also in Python, there is way less friction, hopefully :)
- gusgordon 4y agoWhat’s your recommendation in terms of tooling for cases where it’s not just prototype -> production, but an iterative process? I love notebooks for prototyping, but I find it’s a lot of work to make sure notebook code and prod code are in sync. Maybe just debugging with IPython?
- rmnclmnt 4y agoWhen you've "productionized" a part of your notebook into a Python module, refactor your notebook to use the module instead. Usually, the notebook code will shrink by 80% and will switch to model documentation and demo.
- gusgordon 4y agoYeah, that’s basically what I do, but I often find I need to play around with intermediary data within functions.
- rmnclmnt 4y agoThis is a blind guess here, but if you need to inspect the inner data of your function after writing it, it might mean the scope is too broad and your function could be split? This is where standard SWE guidelines could be of help (function interfaces, contracts definition, etc)
- apwheele 4y agoI create my own classes for this. (Essentially to do the same thing as sklearn pipelines, but I like creating my own classes just for this debugging/slowly expand functionality reason.) Something like: class mymodel(): ... def feature_engineering(self): ... def impute_missing(self): ... def fit(self) ... def predict_proba(self) ... Then it is pretty trivial to test with new data. And you can parameterize the things you want, e.g. init fit method as random forest or xgboost, or stack on different feature engineering, etc. And for debugging you can extract/step through the individual methods.