in the Logistic regression method:
weights.getA(): a method in numpy
website:
https://docs.scipy.org/doc/numpy/reference/generated/numpy.matrix.getA.html
numpy.matrix.getA
matrix.getA()[source] Return self as an ndarray object.
Equivalent to np.asarray(self).
Parameters: None Returns: ret : ndarray self as an ndarray
作用是把矩阵转成一个ndarray.
如果不转,矩阵的每个元素将无法取出,会造成越界的问题。