X, y = make_blobs(n_features=2, centers=1)
(x[:,0],x[:,1],c=y)
- What is simplest meaning of these lines
2.What is the use of these statements - What does “n_features” and “centers” parameters mean in make_blobs in SciKit?
X, y = make_blobs(n_features=2, centers=1)
(x[:,0],x[:,1],c=y)
Hey @sawi.1899, these lines are basically used to generate data points for training and testing any algorithm. And the parameters specify the way in which those random data points are generated and what relationship exist between all the points. So this statement is just used to generate a dataset to find the best fit line. n_features
are the number of features you want to keep in your dataset. So if n_features is 2 then you will get a dataset of shape (m,2) where m are the number of samples you want. centers
are the fixed center locations you want in your dataset. All the other data points are located around these centers only. You will be able to see this in the video clearly.
For best info, please refer to this as well.
I hope this resolves your doubt !
Please mark the doubt as resolved in your doubts section !
Happy Learning !
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.