Reading a csv file directly from the C++ implementation

User 334 | 11/25/2014, 1:36:15 AM

Hi guys,

I hope you can help me with this question.... In the Python API of the GraphLab we can use SFrames and read csv files. How can we read from csv files using the C++ implementation of the GraphLab? I am sorry if the answer for this question is somewhere else, I was not able to find it.

Best wishes, Breno

Comments

User 6 | 11/25/2014, 5:56:02 AM

Hi Breno, We would like to understand your use case better. Currently, read_csv has an efficient c++ implementation. It is wrapped by a thin python layer but the execution is done in parallel (using several threads) in c++. Why do you need to access to c++ layer directly? We are working on open sourcing this part of the code, so in the future it will be possible to access this code also from c++.

Thanks,


User 334 | 11/25/2014, 8:55:55 AM

Hi Danny,

I am trying to implement Bayesian Networks learning using GraphLab. In order to do that I am using the factor graphs implementation that Scott wrote, with some modifications (I turned some private methods into public). Currently I can perform evidence and inference, but I want to implement both parameter learning (for the complete data and incomplete data scenarios) and structure learning (also for complete and incomplete data).

In order to implement those learning tasks I need to be able to read data from a table. For the parameter learning I assume I already have a structure for the network and that each line of the table represents a particular assignment for the variables in the network.

I don't know if there is an easier way than the one I explained, but I believe I need, some how, to read this data from a table so I can propagate the information through the graph and do the learning.

Finally, once I finish this implementations and test it in some common test cases I am going to send it to you guys in case you want to incorporate those algorithms to the GraphLab source code.

Thank you for your time helping me :smiley:


User 6 | 11/26/2014, 7:17:27 AM

We are going to release the open source code of GraphLab Create in a few months - we would love code contributions of new algorithms. In PowerGraph, you will unfortunately need to write your own parser.