CVXOPT QP Solver: TypeError: 'A' must be a 'd' matrix with 1000 columns

后端 未结 3 1690
深忆病人
深忆病人 2021-01-17 20:20

I\'m trying to use the CVXOPT qp solver to compute the Lagrange Multipliers for a Support Vector Machine

def svm(X, Y, c):
      m = len(X)
      P = matrix(         


        
3条回答
  •  醉酒成梦
    2021-01-17 21:02

    Your matrix elements have to be of the floating-point type as well. So the error is removed by using A = A.astype('float') to cast it.

提交回复
热议问题