Want to clarify the x and y working

i want to understand how sir is taking the value of x and y I understood the y value but did not understood the x value if anyone can help me to understand the value

6.22 se anyone can watch what sir is saying i am not understanding please make me understand

Hey @anindo.kmr

Our dataset is 2-Dimensional table where each row is a training sample and each column is a feature. The table also contains the class/label/prediction for each data sample too. We want to separate the training features and the label into X and y respectively.

To do that, we will use the slicing operation. For a numpy array, data[r1:r2, c1:c2] denotes rows r1 to r2 (excluding r2) and columns c1 to c2 (excluding c2). Leaving these blank implies all rows or columns. So, we extract the first column using data[:, 0] to get the labels, and assign the remaining training data to X using the slice data[:, 1:].

Hope this helps!

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.