Breast Cancer and AI Project

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: kgudger, bfinio, Moderators

Post Reply
claudiacordero
Posts: 3
Joined: Tue Dec 05, 2023 1:01 pm
Occupation: Parent

Breast Cancer and AI Project

Post by claudiacordero »

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
amyCC
Site Admin
Posts: 90
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

Post by amyCC »

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
claudiacordero
Posts: 3
Joined: Tue Dec 05, 2023 1:01 pm
Occupation: Parent

Re: Breast Cancer and AI Project

Post by claudiacordero »

Just emailed them
amyCC
Site Admin
Posts: 90
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

Post by amyCC »

Attaching images here.
Image 1
Ia7qgzOiK1P5dkmzyLP7UQz6O_go9h-I_Q.jpg
Ia7qgzOiK1P5dkmzyLP7UQz6O_go9h-I_Q.jpg (69.78 KiB) Viewed 10374 times
Image 2
-ucwj_NJJUaembpueUKq_Db-8_CdvX0_5Q.jpg
-ucwj_NJJUaembpueUKq_Db-8_CdvX0_5Q.jpg (25.8 KiB) Viewed 10374 times
Image 3
YMfLRgasU7y4kE6cjGpLHGKikZybHw4qdA.jpg
YMfLRgasU7y4kE6cjGpLHGKikZybHw4qdA.jpg (67.87 KiB) Viewed 10374 times
Image 4
qpeRQx9zHzXfBF5ZYF0b0wwX3s0_DFg7HA.jpg
qpeRQx9zHzXfBF5ZYF0b0wwX3s0_DFg7HA.jpg (26.92 KiB) Viewed 10374 times
Image 5
OKMPeIrBpeVeQnSxSVnMFLKK2fBG2PW1Xw.jpg
OKMPeIrBpeVeQnSxSVnMFLKK2fBG2PW1Xw.jpg (93.94 KiB) Viewed 10374 times
Image 6
pmFgao8B9sWmedcYoryJGLZ99DlVicevtA.jpg
pmFgao8B9sWmedcYoryJGLZ99DlVicevtA.jpg (26.36 KiB) Viewed 10374 times
amyCC
Site Admin
Posts: 90
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

Post by amyCC »

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
amyCC
Site Admin
Posts: 90
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

Post by amyCC »

This is an example -- the green checkmark after running this block of code.
sample-colab.png
sample-colab.png (69.1 KiB) Viewed 10369 times

If you go through and run all blocks, in sequence, I don't think you will see the errors you saw.

Amy
Science Buddies
amyCC
Site Admin
Posts: 90
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

Post by amyCC »

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
claudiacordero
Posts: 3
Joined: Tue Dec 05, 2023 1:01 pm
Occupation: Parent

Re: Breast Cancer and AI Project

Post by claudiacordero »

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
amyCC
Site Admin
Posts: 90
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

Post by amyCC »

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:
  • 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'
I hope these suggestions help.

Amy
Science Buddies
Post Reply

Return to “Grades 9-12: Math and Computer Science”