A Stochastic Gradient Descent (SGD) classifier

How can i fix it??

Please reply.

Hi Nirav,

Please share the entire sequence of code. It is impossible to debug your issues without knowing what steps you have taken when you got this error.

Just last line is not sufficient.

So, if you want quicker answer please detail out your problem statement. We expect the users themselves also to learn debugging the problems.

The main important part of learning computing is to learn to debug the issues.

Try these:

  • Break a large piece of code into steps
  • Try to understand the output at each step. Print the output/data type of a variable at each step.
  • Go thru the manual of the library or function to understand the errors. All of the technology libraries taught at CloudxLab are open source and free. The manual of each function is available online. Also, try using help(myvar) or put ‘?’ at the end of the function to get help. There is a function dir in python that lists the functions of an object.
  • Or just search on the internet the error to get a context of what is wrong.

It looks like the y_train which is an array of labels only has one value.

This is only possible if you sorted the data based on the label and then did the split.

How can i fix it??
please reply.

How can i sort the data based on label??

I do not know the code

Please tell me.

How can i fix it??
Please reply.

I did but i am not sure.

please reply.

As per this line in your code:

X_train and X_test are same both contain data from beginning till 60000 records.
Similarly, y_train and y_test are same.

I created labels and then sorted the data.
i did split.

i want to fix the error i am getting

how can i fix that error??

Please tell

in your git hub you did not sort the data.

How can i fix this error??

tell me the code please