所以我对R有点陌生,我需要画一些函数。我在R中对curve的理解是,它需要一个以x作为其单一输入的函数。因为我的函数都是同一个主函数的不同表示,所以我首先想创建主函数,然后分别定义每个特定的函数。(30,k) * (theta^k) * ((1-theta)^(30-k)))}
# The specific functions I need to draw on the same plot在其他选择<em
我试图绘制关于时期的梯度下降cost_list,但当我试图这样做时,我迷失了基本的python函数结构。我将我的代码结构附加到我想做的事情上。def gradientDescent(x, y, theta, alpha, m, numIterations):cost_list=[] hypothesis = np.dot(x, theta) c