我正在尝试从头开始创建最基本的神经网络来预测苹果的股票。以下代码是我迄今为止在查看数据科学教程的帮助下得到的代码。然而,我正在实际输入数据并确保其正确。我会输入股票交易的 pandas 数据框架。这是我对NN的看法。
然后该过程是使用反向传播技术向后移动。
import pandas as pd
import pandas_datareader as web
import matplotlib.pyplot as plt
import numpy as np
def sigmoid(x):
return 1.0/(1+ np.exp(-x))
def sigmoid_derivative(x):
return x * (1.0 - x)
class NeuralNetwork:
def __init__(self, x, y):
self.input = x
self.weights1 = #will work out when i get the correct input
self.weights2 = #will work out when i get the correct input
self.y = …
Run Code Online (Sandbox Code Playgroud) python machine-learning neural-network dataframe data-science