Preparing for an in-person lab day: laptop, data and questions
In this article (6 sections)
Related programme: the Data Science course (6 months; ₹1,30,000 (inclusive of GST) · EMI from ₹5,000/month).
Before an in-person data science lab day, prepare three things. Your laptop should be able to run the notebook offline. You need a local copy of the dataset that you can prove is the right version. And you should have written down the errors you want help with. Run the check script below the night before and you will spend the lab day on modelling, not installing packages.
Why lab time slips away
Lab days at the Noida centre are optional and most of the programme is live online, so a day on site is expensive for you, especially if you have travelled far. The usual way to waste it is with problems that have nothing to do with the topic. The Wi-Fi password takes a while to reach you. A package fails to install. The notebook points to C:\Users\someone-else\.... The dataset is the version from three weeks ago. Every one of these can be caught the night before.
The night-before script
Save this as lab_check.py in your project folder and run it with the same Python you use for class. It uses only the standard library, so it runs even if your environment is half-broken. That is exactly when you need it. The expected hash and file name are placeholders. Your mentor will share the real values, or you can record the hash of the file you know is correct.
import hashlib
import importlib.util
import os
import shutil
import sys
import tempfile
REQUIRED_PACKAGES = ["pandas", "numpy", "sklearn", "matplotlib"]
DATA_FILE = "data/churn_sample.csv" # placeholder path
EXPECTED_SHA256 = None # paste the value your mentor shares
MIN_FREE_GB = 5
problems = []
if sys.version_info < (3, 10):
problems.append(f"Python {sys.version.split()[0]} is older than 3.10")
for name in REQUIRED_PACKAGES:
if importlib.util.find_spec(name) is None:
problems.append(f"package missing: {name}")
free_gb = shutil.disk_usage(os.getcwd()).free / 1e9
if free_gb < MIN_FREE_GB:
problems.append(f"only {free_gb:.1f} GB free on this drive")
if os.path.exists(DATA_FILE):
with open(DATA_FILE, "rb") as fh:
digest = hashlib.sha256(fh.read()).hexdigest()
print("dataset sha256:", digest)
if EXPECTED_SHA256 and digest != EXPECTED_SHA256:
problems.append("dataset differs from the shared version")
else:
problems.append(f"dataset not found at {DATA_FILE}")
try:
with tempfile.NamedTemporaryFile(dir=os.getcwd()):
pass
except OSError:
problems.append("cannot write to the project folder")
print("\n".join(problems) if problems else "All checks passed.")Run it while you still have home internet. Anything it reports can be fixed that night by reinstalling a package or downloading the right file. On the lab day the same fix may be slowed down by a shared connection.
Two points explain why the checks are what they are. The hash check exists because many "my model gives different results from yours" conversations turn out to be two different CSV files with the same name. The write-permission check catches projects stored inside a synced or protected folder, where saving fails without any error message.
Remove paths that only work on your machine
Open each notebook you will use and search for a drive letter or your username. Replace absolute paths with ones relative to the project folder:
from pathlib import Path
PROJECT = Path.cwd()
data_path = PROJECT / "data" / "churn_sample.csv"
print(data_path.relative_to(PROJECT))If you move the folder to a pen drive or share it with a mentor, relative paths still work. Absolute paths do not.
The bag list
- Laptop and its charger. A three-hour lab uses more battery than you expect once a model starts training.
- A pen drive or external disk with the project folder and dataset, in case the network is slow.
- A notebook and pen for the question list and whatever the mentor draws on the board.
- Your phone with the admissions number saved, in case you are running late.
- Water. Whether food is available on site is something to ask before you travel.
Write your questions as reproducible cases
Mentors can help fastest when a question comes with evidence. For each problem you bring, write three lines:
| Line | Example |
|---|---|
| What I ran | model.fit(X_train, y_train) in cell 14 of 02_model.ipynb |
| What I expected | Training to finish and accuracy printed |
| What happened | ValueError: could not convert string to float: 'Noida' |
That example is a common one: a text column, a city name, went into the model without being encoded. With the three lines in front of them, a mentor can spot it in seconds. A question like "my model isn't working" can take ten minutes just to reproduce.
Rank your list. Put the question that blocks your project first and the ones you are merely curious about last, because lab time runs out before questions do.
After the lab, the same evening
- Commit or back up everything you changed during the day, with a note saying what the mentor suggested.
- Turn each answered question into one sentence in your project's README. You will need those sentences in interviews.
- Move any unanswered questions to the cohort channel while they are fresh.
If this will be your first visit, getting to our Noida Sector 4 centre covers the route. The Data Science programme page shows which modules are coming up, so you can match your questions to the lab's topic. If you are unsure your fundamentals are ready for a modelling lab, the free skill check is a quick way to see where you stand.
Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.
This article is part of our Data Science programme — 6 months. From data foundations to machine learning, deep learning and deployment.
Explore Data Science