Пример #1
0
def main():
    w = np.matrix([0., 0.])
    index = 0
    while True:
      if (w.dot(paitentData[index].T) > 0) != ( hasCancerData[index] > 0):
        w += paitentData[index] * hasCancerData[index]
        index = 0
        continue
      index += 1
      if index >= len(hasCancerData):
        break
    print w.tolist()[0]



    #### Do the training here ###


    mlt.plot_prec(paitentData.tolist(), hasCancerData, w.tolist()[0])
Пример #2
0
def main():
    nn = NeuNet.NeuralNetwork([2, 10, 1])
    nn.fit(xor_data, xor_expected)
    mlt.plot_nn(xor_data, xor_expected, nn)
Пример #3
0
def main():
    nn = NeuNet.NeuralNetwork([2, 10, 1])
    nn.fit(xor_data, xor_expected)
    mlt.plot_nn(xor_data, xor_expected, nn)