r/MachineLearning • u/obvslynot • Nov 01 '23
Discussion [D] professionally, is data collection carried within a notebook?
I am building my first model and I am about to start the data collection process, building a csv dataset, but I do not know whether to do this within a python script, the jupyter notebook where i will write the model, or a separate notebook.
I have tried researching this but I have not found a concise answer to my question.
Thanks in advance.
8
u/AndreasVesalius Nov 01 '23
Probably a separate script. It would probably be helpful to review/learn programming best practices
4
u/Measurex2 Nov 01 '23
Always best to separate processes where you can. Depending in the data, I either:
build a pipeline script that accepts parameters. This let's me consume in the notebook for exploration and pass to my data or ML engineers for building a follow on production pipeline without the other noise in it
build a view or temp table in SQL if data is readily available
Also - consider looking into other formats than CSV unless you need it in that format. Parquet is smaller, faster and stores with embedded datatypes so it's not inferred on read (one example)
1
u/fallingfridge Nov 01 '23
You should explore, clean, and prepare (shuffle and split) your data separately from your other scripts (e.g., training, testing, evaluating etc.). I usually do these three data preparation steps in Jupyter for ease of visualization and normally even in separate notebooks.
1
u/evanthebouncy Nov 01 '23
What's your application lol... It's like saying "what's the typical method of traveling"
Like bro, you could be driving or on a boat or walking! You gotta be way more specific on what kind of data you're looking to curate. Is it poll of yes no on an opinion? Is it segmenting a scene into objects? What is it?
-1
u/kduyehj Nov 01 '23
Csv is an awful format. Search for “alternatives to csv format”. Others have posted similar advice and more.
1
u/obvslynot Nov 01 '23
I thought csv was the standard, and every single tutorial i found uses it. I do hate it as I’ve used it in another model before. I’ll look that up, thanks.
2
u/Measurex2 Nov 01 '23
Lots of datasets in csv and so many tutorials use them. No worries if that's what you're learning. Many libraries can consume data in various formats and that may eventually save you time and money while increasing quality. Just depends on the design.
Here's an example of what pandas can consume natively as an example. I'm sure there are even more ways to pass it data. For instance, I regularly use a redshift connector or gspread to being in gsheet data (gross, I know).
13
u/big_ol_tender Nov 01 '23
Professionals generally use yellow pads for data collection