LogisticRegression.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:tinyml 作者: parasdahal 项目源码 文件源码
def plot_fit(self):
        """Plot the training data in X array along with decision boundary
        """
        from matplotlib import pyplot as plt
        x1 = np.linspace(self.table.min(), self.table.max(), 100)
        #reverse self.theta as it requires coeffs from highest degree to constant term
        x2 = np.polyval(np.poly1d(self.theta[::-1]),x1)
        plt.plot(x1, x2, color='r', label='decision boundary');
        plt.scatter(self.X[:, 1], self.X[:, 2], s=40, c=self.y, cmap=plt.cm.Spectral)
        plt.legend()
        plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号