In the train svm function, when i run it i am getting an error in the getpairvisedatasum

the error is - too many indices in the array, but i have done the same thing as the mentor.

def getDataPairForSVM(d1,d2):

l1,l2 = d1.shape[0],d2.shape[0]

samples = l1+l2
features = d1.shape[1]

data_pair = np.zeros((samples,features))
data_labels = np.zeros((samples,))

data_pair[:l1,:] = d1
data_pair[l1:,:] = d2

data_labels[:l1] = -1
data_labels[l1:] = +1

return data_pair,data_labels

Hi @sankalparora5,
To exactly pin-point the error, I need to look at the complete Jupyter Notebook (.ipynb) you have made. Request you to share the same through a drive link or any other file sharing method.

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.