Skip to content

Fix IndentationError in worked example and stratify reference in Lab 8.2#34

Open
Yassir-249 wants to merge 1 commit into
google-deepmind:mainfrom
Yassir-249:fix/lab-8-2-worked-example-indent-and-stratify
Open

Fix IndentationError in worked example and stratify reference in Lab 8.2#34
Yassir-249 wants to merge 1 commit into
google-deepmind:mainfrom
Yassir-249:fix/lab-8-2-worked-example-indent-and-stratify

Conversation

@Yassir-249

@Yassir-249 Yassir-249 commented Jun 5, 2026

Copy link
Copy Markdown

Fixes two bugs plus typos in course_8/gdm_lab_8_2_classification_part_1.ipynb.

Activity 4 worked example raises IndentationError when copied verbatim. In the "Worked example: Format the data" cell, the to_instruction_record docstring is indented 3 spaces while the function body is indented 4. Copying the template into the implementation cell (as the activity instructs) fails with IndentationError: unexpected indent. Re-indenting the docstring to 4 spaces lets the cell run and write the three JSONL splits.

Activity 3 task box stratifies on the wrong DataFrame. The alternative stratified-split snippet passes stratify=df['category'] when splitting df_val_test, which raises ValueError (inconsistent sample counts). Changed to stratify=df_val_test['category'], matching the worked example below it.

Typos: Disccover, excuted, funcion, processs, captstone, and a stray leading space on a code fence.

Ran the worked-example pipeline end-to-end to confirm the fixes.

upaq pushed a commit that referenced this pull request Jun 18, 2026
, #32, #33, #34, #35 and #36 by @Yassir-249.

PiperOrigin-RevId: 934537389
Change-Id: I5f6035aa2fb1ed3c291e26f9058e537ee5394996
@Yassir-249 Yassir-249 force-pushed the fix/lab-8-2-worked-example-indent-and-stratify branch from 53060ce to b1f7f49 Compare June 22, 2026 17:37
@Yassir-249

Copy link
Copy Markdown
Author

Rebased onto main. Both issues still reproduce on current main: the Activity 4 worked-example docstring is indented one space deeper than the function body (IndentationError), and the Activity 3 task-box second train_test_split stratifies by df while splitting df_val_test (ValueError). The diff is now just those two lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant