python.matrix.getA()

来源:互联网 发布:记事本软件的英文名 编辑:程序博客网 时间:2024/06/03 20:29

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.
如果不转,矩阵的每个元素将无法取出,会造成越界的问题。