I need some assistance with the code block 1C. I attempted to run this code but it said the name "df" is not defined. What did I do wrong and can you explain it in simple words?
Thank you!!!
Predicting Thyroid Cancer Recurrence with Machine Learning Project
Moderators: AmyCowen, kgudger, MadelineB, Moderators
-
hshshsjdhe9ncd
- Posts: 1
- Joined: Thu Oct 17, 2024 11:38 am
- Occupation: Student
-
amyCC
- Site Admin
- Posts: 398
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Predicting Thyroid Cancer Recurrence with Machine Learning Project
You need to look at the directions and do the TODO section in the code. In the project, the directions tell you:
"(Code Block 1C) In this code block, you will specify the column names (features) from your .csv file that have “Yes” or “No” values: ‘Smoking,’ ‘Hx Smoking,’ ‘Hx Radiotherapy,’ and ‘Recurred.’ Inside the blue brackets under the comment #TODO, type in these column names. We have included the first column name for you. Be sure to use quotes around each column name and separate them using commas. Run the code and then check the output to see how the yes/no values were replaced with 1/0.
Note: By common coding conventions, 0 typically means ‘No’ and 1 typically means ‘Yes.’
If you get an error when you run the code block, double-check that you don’t have any typos and have used commas and quotes correctly.
Here is an example of how the code should look."
You need to follow those directions (and an example is shown in Figure 1) to change your code before you run the cell.
If you still have trouble about typing in what you need to enter, post a screenshot and someone can take a look.
All of the directions follow this format, so it is important to carefully look at what you are being asked to do. You can't just press the run arrows.
Project: https://www.sciencebuddies.org/science- ... oid_cancer
Amy
Science Buddies
"(Code Block 1C) In this code block, you will specify the column names (features) from your .csv file that have “Yes” or “No” values: ‘Smoking,’ ‘Hx Smoking,’ ‘Hx Radiotherapy,’ and ‘Recurred.’ Inside the blue brackets under the comment #TODO, type in these column names. We have included the first column name for you. Be sure to use quotes around each column name and separate them using commas. Run the code and then check the output to see how the yes/no values were replaced with 1/0.
Note: By common coding conventions, 0 typically means ‘No’ and 1 typically means ‘Yes.’
If you get an error when you run the code block, double-check that you don’t have any typos and have used commas and quotes correctly.
Here is an example of how the code should look."
You need to follow those directions (and an example is shown in Figure 1) to change your code before you run the cell.
If you still have trouble about typing in what you need to enter, post a screenshot and someone can take a look.
All of the directions follow this format, so it is important to carefully look at what you are being asked to do. You can't just press the run arrows.
Project: https://www.sciencebuddies.org/science- ... oid_cancer
Amy
Science Buddies

