Can someone help me with TensorFlow?

Google just opened TensorFlow as an open source. I read this a bit, but it looks like you can only train it with MNIST data.

I am looking for an example code where I can train with my own data and output the results for my test file.

where I have a .csv file (for example, a sample in a row) as training data (with identifier, output, + 72 columns)

and have another CSV file for test data, where I could predict the output (1 or 0).

Does anyone understand that TensorFlow is enough to give me some sample code?

+5
source share
3 answers

The best solution I found:

https://github.com/google/skflow

Charles

+6
source

You can look at these examples (e.g. linear regression): https://github.com/aymericdamien/TensorFlow-Examples

But for examples using mnist, you just need to replace the inputs (train and test data from your own datasets).

0
source

Ok, here is a sample code from the site for csv. You need to use TextLineReader to handle the csv format if this is what interests you and it looks like what you are. For all your options for reading files, link here

filename_queue = tf.train.string_input_producer(["file0.csv", "file1.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], [1]] col1, col2, col3, col4, col5 = tf.decode_csv( value, record_defaults=record_defaults) features = tf.concat(0, [col1, col2, col3, col4]) 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(1200): # Retrieve a single instance: example, label = sess.run([features, col5]) coord.request_stop() coord.join(threads) 
0
source

Source: https://habr.com/ru/post/1235647/


All Articles