机器学习实战第5章 Logistic回归的weights

来源:互联网 发布:智能硬件编程 编辑:程序博客网 时间:2024/05/16 05:54

机器学习实战第5章Logistic(page80)有如下代码:

>>> from numpy import *

>>> reload(logRegres)

>>> logRegres.plotBestFit(weights.getA())

其中的wieghts显示没有定义,实现如下:

weights = grandAscent(dataArr, labelMat)

应该是原作者忘记了weights=.


其中getA() :返回自己,但是作为ndarray返回

关于Numpy中矩阵对象(matrix)

参考:http://blog.csdn.net/qq403977698/article/details/47254539


0 0