Last answered:

07 May 2023

Posted on:

28 Jun 2022

0

Why is my code not running?

Defining the inputs and the target. Creating the train-test split. This whole category does not work and all the code keeps running into errors quoting the errors in the attachment. If someone can help I will be very grateful.Proof

3 answers ( 0 marked as helpful)
Instructor
Posted on:

29 Jun 2022

0

Hey Emmanuel,

Thank you for reaching out!

Sometimes, if the code is not run successively, this could affect the upcoming cells. Could you therefore try restarting the kernel and then running all cells anew? This is done as follows.
1. Go to Kernel -> Restart. Then press Restart
image.png
image.png
2. Wait until you see message "Kernel ready" on the top right corner (it disappears fast).

3. Click on the cell below the one which gives the error message, namely

y_train.value_counts()

4. Go to Cell -> Run All Above. This will run all cells above the cell you're currently on
image.png
Do you still get the error? If yes, then could you please take a screenshot of the whole error message?

Thank you!

Kind regards,
365 Hristina

Posted on:

29 Jun 2022

0

Hi Hristina I ran the code with just the code no comments (even though I like the comments as they are very thorough) for all people that run into the error reading this the MultinomialNB_YouTube-with-code works better than MultinomialNB_YouTube-with-code-and-comments. Thanks again

Posted on:

07 May 2023

0

     Dude, you are just misspelling the variable which is the input 

during the initial defining of the variable you named it 'inputs' but when used you entered 'input' where 's' is missing

hopefully, that solved your issue although its a long time passed since you raised this issue

Submit an answer