Recently I've been working on the breast cancer and AI project that uses a KNN algorithm. However, the code does not seem to work once I get past the PAC graphing stage. Unfortunately, I can't upload any of the pictures of the code but I am getting name errors for the PAC variable then in the next section I'm getting name errors for the neighbors variable. The code I'm using is the same original one in the breastcancer.ipynb file that is uploaded to Google Collab.
Moderator note: Project: https://www.sciencebuddies.org/science- ... ast-cancer
Breast Cancer and AI Project
Moderators: kgudger, bfinio, Moderators
-
- Posts: 3
- Joined: Tue Dec 05, 2023 1:01 pm
- Occupation: Parent
-
- Site Admin
- Posts: 92
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Breast Cancer and AI Project
So that a member of our team can help, can you email your images to scibuddy@sciencebuddies.org. I can attach them to this thread. (You should be able to use the attachment option to add the inline images to your post, but if that didn't work, email them, and I'll add them.)
Amy
Science Buddies
Amy
Science Buddies
-
- Posts: 3
- Joined: Tue Dec 05, 2023 1:01 pm
- Occupation: Parent
Re: Breast Cancer and AI Project
Just emailed them
-
- Site Admin
- Posts: 92
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Breast Cancer and AI Project
Attaching images here.
Image 1 Image 2 Image 3 Image 4 Image 5 Image 6
Image 1 Image 2 Image 3 Image 4 Image 5 Image 6
-
- Site Admin
- Posts: 92
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Breast Cancer and AI Project
Can you make sure that, starting at the top, you have "run" each of the code blocks, starting with the "Importing libraries" section? Once you run that one successfully, it will give you a green checkmark. Then move on to the next one. Run it and ensure you get a checkmark.
Running these loads certain elements that you need to run the parts where you are getting errors.
Amy
Science Buddies
Running these loads certain elements that you need to run the parts where you are getting errors.
Amy
Science Buddies
-
- Site Admin
- Posts: 92
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Breast Cancer and AI Project
This is an example -- the green checkmark after running this block of code.
If you go through and run all blocks, in sequence, I don't think you will see the errors you saw.
Amy
Science Buddies
If you go through and run all blocks, in sequence, I don't think you will see the errors you saw.
Amy
Science Buddies
-
- Site Admin
- Posts: 92
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Breast Cancer and AI Project
Hi Claudia - Alternatively, you can use Runtime / Run All from the menu at the top.
Please note that every time the notebook is opened, especially if you get a warning that says "Runtime disconnected," you will need to run all the blocks again.
I hope this helps. Please let us know if you run into additional questions.
Amy
Science Buddies
Please note that every time the notebook is opened, especially if you get a warning that says "Runtime disconnected," you will need to run all the blocks again.
I hope this helps. Please let us know if you run into additional questions.
Amy
Science Buddies
-
- Posts: 3
- Joined: Tue Dec 05, 2023 1:01 pm
- Occupation: Parent
Re: Breast Cancer and AI Project
I've run all of them in sequence and I've also tried "Run all". However, my runtime always crashes as soon as I get to the PAC part and I've tried running everything again. I also have Collab Pro and I'm using high RAM but it keeps telling me that I don't have enough RAM so that may be the problem
-
- Site Admin
- Posts: 92
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Breast Cancer and AI Project
Claudia - I am sorry to hear you are still having problems running the code. I talked with our team about what you are experiencing. This does seem to be a resource-intensive one to run. Because this problem suggests the CPU is maxing out, here are some suggestions:
Amy
Science Buddies
- Try closing other browser tabs or programs.
- Open 'Task Manager' on your computer and force-quit some programs.
- Switch the Runtime to GPU instead of CPU by clicking on 'Runtime' -> 'Change Runtime type' -> 'T4 GPU'
Amy
Science Buddies