I’m porting ipynb lab notebooks to python scripts in mycharm IDE.
Course 1 week3 notebook examples use plotting tools in C:\Users..\plt_one_addpt_onclick.py
which give me error:
File “C:\Users\shonc\PycharmProjects\ML_supervised\plt_one_addpt_onclick.py”, line 66, in init
self.resize_sq(self.bthresh)
File “C:\Users\shonc\PycharmProjects\ML_supervised\plt_one_addpt_onclick.py”, line 179, in resize_sq
h = bcid.rectangles[0].get_height()
^^^^^^^^^^^^^^^
AttributeError: ‘CheckButtons’ object has no attribute ‘rectangles’
I’m also not a mentor for MLS, but as Balaji says the issue is probably “versionitis”. The APIs in the python/ML space are not that stable over time. These courses were published several years ago using the versions that were current at that time. You can’t just port the notebooks to your local environment with whatever current versions you happen to have and assume everything will “just work”.
You have a fundamental choice of two approaches to this kind of issue:
Just debug each instance you run into.
Set up an environment that allows you to duplicate the particular versions to match a given notebook.
Approach 2) is a lot more work, but once you have that understanding then it’s a general tool that you can use a lot over time. Using approach 1) is less work in any given case, but it’s not predictable how many such issues you have to fight your way through each time you try to port something.
Here’s a thread which will get you started on the process of figuring out option 2), but it is beyond the scope of these courses.
Thank you for the 2nd approach and the linked conversation about it. I’ll work through this and maybe try to build a docker image that mimics the course environment