I'm training a neural network to predict the number of views on a question based on number of answers, comments, and days passed. My data in csv file looks like that:
answers, comments, days_passed, Views
2, 5, 20, 300
From above data, I'm using first 3 columns as features and last column as label.And my file contains 3000 entries.I've modified this code to train my neural network: here
but I'm getting an error while cross-validation.That's how my code looks like:
filename_queue = tf.train.string_input_producer(["file0.csv"])
reader = tf.TextLineReader()
key, value = reader.read(filename_queue)
# Default values, in case of empty columns. Also specifies the type of the
# decoded result.
record_defaults = [[1], [1], [1], [1]]
col1, col2, col3, col4 = tf.decode_csv(value, record_defaults=record_defaults)
features = tf.stack([col1, col2, col3])
with tf.Session() as sess:
# Start populating the filename queue.
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
for i in range(3000):
# Retrieve a single instance:
x, y = sess.run([features, col4])
coord.request_stop()
coord.join(threads)
X_train, X_test, Y_train, Y_test = cross_validation.train_test_split(x, y, test_size=0.2, random_state=42)
I'm getting following error on the last line(cross_validation.train_test_split):