You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an error when trying to train a model with the main.py script.
It is working with a change line to this:
distance=np.sort(cdist(data.reshape(1, -1),PARAM[k]['Centre'],'euclidean'))[0]
However accuracy of the model is just 0.65.
Traceback (most recent call last):
File "/home/michal/Codes/xDNN/Projects/Python/1/main.py", line 103, in
Output2 = xDNN(Input2,Mode2)
File "/home/michal/Codes/xDNN/Projects/Python/1/Classes/xDNN_class.py", line 42, in xDNN
Test_Results = DecisionMaking(Params,datates)
File "/home/michal/Codes/xDNN/Projects/Python/1/Classes/xDNN_class.py", line 144, in DecisionMaking
distance=np.sort(cdist(data.reshape(1, -1),PARAM[k]['Centre'],'minkowski',6))[0]
TypeError: cdist() takes from 2 to 3 positional arguments but 4 were given
The text was updated successfully, but these errors were encountered:
The function only takes 2 parameters by default, 3 when you specify the distance metric that you want to use, when you use "Minkowski" distance you have to define the "p" parameter explicitly. You can do that with the following code line: distance=np.sort(cdist(data.reshape(1, -1),PARAM[k]['Centre'],'minkowski',p=6))[0]
Hello,
I am getting an error when trying to train a model with the main.py script.
It is working with a change line to this:
distance=np.sort(cdist(data.reshape(1, -1),PARAM[k]['Centre'],'euclidean'))[0]
However accuracy of the model is just 0.65.
Traceback (most recent call last):
File "/home/michal/Codes/xDNN/Projects/Python/1/main.py", line 103, in
Output2 = xDNN(Input2,Mode2)
File "/home/michal/Codes/xDNN/Projects/Python/1/Classes/xDNN_class.py", line 42, in xDNN
Test_Results = DecisionMaking(Params,datates)
File "/home/michal/Codes/xDNN/Projects/Python/1/Classes/xDNN_class.py", line 144, in DecisionMaking
distance=np.sort(cdist(data.reshape(1, -1),PARAM[k]['Centre'],'minkowski',6))[0]
TypeError: cdist() takes from 2 to 3 positional arguments but 4 were given
The text was updated successfully, but these errors were encountered: