我使用以下假设运行以下简单代码:
A值和B值彼此相似,通过组合多个变量使B值等于A值。
所以我的假设是这样的
a=w1(重量)*b+w2(重量)c(变异数)+
这是我的代码
hypothesis = tf.sigmoid(tf.matmul(X1, W1)+tf.matmul(X2, W2)+tf.matmul(X3, W3)+tf.matmul(X4, W4) + tf.matmul(X5, W5) + b1)
cost = -tf.reduce_mean(Y * tf.log(hypothesis) + (1 - Y) * tf.log(1 - hypothesis))
train = tf.train.GradientDescentOptimizer(learning_rate=0.000000000000000001).minimize(cost)
predicted = tf.cast(hypothesis > 0.5, dtype=tf.float32)
accuracy = tf.reduce_mean(tf.cast(tf.equal(predicted, Y), dtype=tf.float32))
with tf.Session() as sess:
# Initialize TensorFlow variables
sess.run(tf.global_variables_initializer())
for step in range(5000):
sess.run(y, feed_dict={X1:ct, X2: temperature, X3:humidity, X4: windspeed, X5:tideheight, Y:sst})
但是,当我验证了这段代码的值时,我发现了一个根本不适合的值。
当我查看数据集时,它似乎不是线性的。
如果你能给我举个例子,我将不胜感激。
我的数据集:
A B C D E F
25.6 27.29999 24.4752741667 71.5801495 6.468 97.1
25.6 27.5 24.3449186667 71.1314193333 5.39 288.3
25.4 27.60001 24.4019961667 71.8209758333 6.076 103.7
25.5 27.5 24.3473485 71.3570816667 6.762 95.3
25.5 27.5 24.3420308333 71.9577738333 5.978 103.7
25.6 27.29999 24.464413 71.993804 6.37 105.8
25.6 27.29999 24.3999401667 71.5558695 6.664 100.2
...