aws-samples / amazon-sagemaker-immersion-day

MIT No Attribution
277 stars 226 forks source link

Numbered cells of python code are useful for group training situations #26

Open Kumfert opened 3 years ago

Kumfert commented 3 years ago

bring-custom-script.ipynb has cell numbers, which are really useful to keep track of things and communicate "place" between instructor and student.

Can we just add them to all notebooks?

kmotohas commented 3 years ago

@Kumfert

Hi, I like this idea, but some cells are not working now, at least the cell below in xgboost_direct_marketing_sagemaker.ipynb.

# cell 01
conda update pandas

The comment (# cell 01) makes it assumed as a python cell so conda update pandas fails.

image

conda update pandas should be !conda update pandas -y now.

Kumfert commented 3 years ago

Good point @kmotohas . As far as I can tell, there's no automated acceptance tests for pull requests in this repo. Maybe that should be a separate issue?

vmehmeri commented 3 years ago

This is causing issues for magic commands that need to be the first statement in a cell, just as %%time. In the Model Monitoring notebook this is used in cell 01 and it is throwing an error. I suggest cell numbering be done as a separate markup line above the cells

Kumfert commented 2 years ago

Hello. I like your suggestion. But when I considered the implementation, I'm concerned that it makes too many changes in the *.ipynb files. (Consider the case where there is not a markdown block preceding the code block).

A simpler alternative, is to simply omit the explicit numbers in any code block leading with %%. (Though the counter would still increment)

Kumfert commented 2 years ago

@vmehmeri Here's a PR for your consideration https://github.com/aws-samples/amazon-sagemaker-immersion-day/pull/44