Closed davidrimshnick closed 6 years ago
The library does not provide any means to import CSV files nor any other arbitrary file formats.
To import the CSV file content, you’ll have to use vanilla python code and read the file content. Eg:
with open(“file.csv”, “r”) as f:
csv_content = f.read()
That's fine.. Maybe I am missing the documentation on how to convert these to "instances"? I don't see the documentation on how to create the instances other than hardcoding the data.
Really appreciate the library by the way!
On Mon, Apr 9, 2018 at 10:50 AM, wizzwizz4 notifications@github.com wrote:
Alternatively, you can make use of the csv https://docs.python.org/library/csv.html module.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jorgenkg/python-neural-network/issues/26#issuecomment-379779331, or mute the thread https://github.com/notifications/unsubscribe-auth/AELb3wCoPmWiOWr6BFgwVoGDANg_Lrwjks5tm3VBgaJpZM4TLREH .
Can this be modified to do what you want?
csv_data = [[[0, 0], [0]], [[1, 0], [1]], [[0, 1], [1]], [[1, 1], [0]]]
dataset = [Instance(inputs, outputs) for (inputs, outputs) in csv_data]
I will try that, thank you.
On Mon, Apr 9, 2018 at 11:00 AM, wizzwizz4 notifications@github.com wrote:
Can this be modified to do what you want?
csv_data = [[[0, 0], [0]], [[1, 0], [1]], [[0, 1], [1]], [[1, 1], [0]]] dataset = [Instance(inputs, outputs) for (inputs, outputs) in csv_data]
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jorgenkg/python-neural-network/issues/26#issuecomment-379782769, or mute the thread https://github.com/notifications/unsubscribe-auth/AELb343IQg5vpOrGz1HCErMTyLc6CrD5ks5tm3eFgaJpZM4TLREH .
Sorry I can't seem to find in the documentation...