in Education by
I have worked all the tutorials and searched for "load csv tensorflow" but just can't get the logic of it all. I'm not a total beginner, but I don't have much time to complete this, and I've been suddenly thrown into Tensorflow, which is unexpectedly difficult. Let me lay it out: A very simple CSV file of 184 columns that are all float numbers. A row is simply today's price, three buy signals, and the previous 180 days prices close = tf.placeholder(float, name='close') signals = tf.placeholder(bool, shape=[3], name='signals') previous = tf.placeholder(float, shape=[180], name = 'previous') This article: https://www.tensorflow.org/guide/datasets It covers how to load pretty well. It even has a section on changing to numpy arrays, which is what I need to train and test the 'net. However, as the author says in the article leading to this Web page, it is pretty complex. It seems like everything is geared toward doing data manipulation, where we have already normalized our data (nothing has really changed in AI since 1983 in terms of inputs, outputs, and layers). Here is a way to load it, but not into Numpy and no example of not manipulating the data. with tf.Session as sess: sess.run( tf.global variables initializer()) with open('/BTC1.csv') as csv_file: csv_reader = csv.reader(csv_file, delimiter =',') line_count = 0 for row in csv_reader: ????????? line_count += 1 I need to know how to get the CSV file into the close = tf.placeholder(float, name='close') signals = tf.placeholder(bool, shape=[3], name='signals') previous = tf.placeholder(float, shape=[180], name = 'previous') so that I can follow the tutorials to train and test the net. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
For loading the CSV with tf.data you can refer the following link: https://www.tensorflow.org/beta/tutorials/load_data/csv In order to utilize a Dataset we need three steps: First, we have to import the data. Create a Dataset instance from some data Then we will create an iterator. By using the imported dataset to make an Iterator instance to iterate through the dataset At last, we will consume the data. By using the above-created iterator we can get the elements from the dataset to feed the model. You can refer the following link for better understanding: https://towardsdatascience.com/how-to-use-dataset-in-tensorflow-c758ef9e4428 If you wish to know more about TensorFlow then visit this TensorFlow Tutorial.

Related questions

0 votes
    Suppose I have a Tensorflow tensor. How do I get the dimensions (shape) of the tensor as integer values? I ... 'Dimension' instead. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am new to TensorFlow. While I am reading the existing documentation, I found the term tensor really confusing. ... types of tensors? Select the correct answer from above options...
asked Jan 29, 2022 in Education by JackTerrance
0 votes
    I am trying to decompose a 3D matrix using python library scikit-tensor. I managed to decompose my Tensor ... the decomposed matrices? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I'm wondering how to calculate precision and recall measures for multiclass multilabel classification, i.e. classification ... labels? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I'm creating a very basic AI with Tensorflow, and am using the code from the official docs/tutorial. Here's my ... Tensorflow 1.13.1. Select the correct answer from above options...
asked Jan 28, 2022 in Education by JackTerrance
0 votes
    I have a Python dictionary like the following: {u'2012-06-08': 388, u'2012-06-09': 388, u'2012-06-10 ... (my_dict,index=my_dict.keys()) Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
0 votes
    The classifiers in machine learning packages like liblinear and nltk offer a method show_most_informative_features(), which ... lot! Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I read a few books and articles about Convolutional neural network, it seems I understand the concept but I don ... please help thanks. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have trained a binary classification model with CNN, and here is my code model = Sequential() model.add(Convolution2D ... I do that? Select the correct answer from above options...
asked Jan 26, 2022 in Education by JackTerrance
0 votes
    I started Tensorflow some days back and I understand that it is a visualization tool but is there any way to ... remote Ubuntu machine? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    I am trying to understand the role of the Flatten function in Keras. Below is my code, which is a simple two ... flatten it? Thanks! Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I was looking at the docs of TensorFlow about tf.nn.conv2d here. But I can't understand what it does or ... it raised the question. Select the correct answer from above options...
asked Jan 27, 2022 in Education by JackTerrance
0 votes
    What is the role of Flatten in Keras. I am executing the code below and it's a two layered network. The ... output is already flat? Select the correct answer from above options...
asked Jan 25, 2022 in Education by JackTerrance
0 votes
    Is Tensorflow similar to scikit learn's one hot encoder for processing of categorical data? Does using placeholder of ... very easy. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Currently, I have Keras with TensorFlow and CUDA at the backend. But, I want to force Keras to use the ... are accessible via Keras. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
...