Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the format of config? #5

Closed
PJthunder opened this issue Aug 7, 2019 · 11 comments
Closed

What's the format of config? #5

PJthunder opened this issue Aug 7, 2019 · 11 comments
Labels
documentation Improvements or additions to documentation

Comments

@PJthunder
Copy link

Looks like users should run through the config file (yaml file) for training/evaluation. But I have no idea what's the format it should be. Could you add some simple examples in the readme file? Maybe just run LINE on karate club network (adjacent matrix/edgelist)?

In addition, it is not very clear what will be included in the output pickle file. Could you please add some simple explanation about that?

@KiddoZhu
Copy link
Collaborator

KiddoZhu commented Aug 7, 2019

For the yaml format, please refer to the document page.

The pickled object is a dict that contains all embeddings, and their index mappings to the original node names. The following lines may help you understand what is in the pickled object.

with open("line_blogcatalog.pkl", "rb") as fin:
    blogcatalog = pickle.load(fin)
print(blogcatalog.keys())

names = blogcatalog.id2name
embeddings = blogcatalog.vertex_embeddings
print(names[1024], embddings[1024])

@KiddoZhu KiddoZhu closed this as completed Aug 7, 2019
@PJthunder
Copy link
Author

Thank you for your prompt reply. The document is helpful but a little bit confusing to me. So if I want to specify a edge_link file to run. I need to create a single yaml file and change the global yaml file to indicate the dataset path? Also, I am not pretty sure which data format is acceptable for your project.

This information may be stored somewhere in the document. An easy start point in the readme file may still be very helpful for people who only want to calculate the embedding in a short run.

@KiddoZhu
Copy link
Collaborator

KiddoZhu commented Aug 8, 2019

The dataset path in the global yaml file is for downloading/caching standard datasets. You don't necessarily need to modify it in most cases.

To run your own dataset,

  • Fork an existing yaml.
  • Change dataset paths in graph, evaluation. It's better to use absolute paths.
  • Change hyperparameters if necessary.

For all applications, the dataset format is strings separated by delimiters. There can be some comment at the end of each line. By default, delimiters are any blank characters, and comment prefix is "#". For node embeddings, the following examples are valid.

  • # this is a comment line
  • xxx yyy 1.5 # some comment
  • xxx yyy # some comment

The edge weight is optional.

If you're using Python, you can also pass list of (string, string, float) to the interface.

Sorry for not clarifying the data formats. We will add documentation of dataset format.

@KiddoZhu KiddoZhu reopened this Aug 8, 2019
@KiddoZhu KiddoZhu added the documentation Improvements or additions to documentation label Aug 8, 2019
@PJthunder
Copy link
Author

Thanks for your explanation!
Looks like I just need to provide a common edge list to it.
I have opened another issue about the evaluation file format. I hope it will be easy for you to add a simple documents for that one as well.

@kalufinnle
Copy link

I also found it a bit confusing of what the desired dataset format should be. Could you add some simple examples in the readme file. Or maybe tutorials on how we can run the codes on our own data? Thank you

@PJthunder
Copy link
Author

sorry to brother you again. But I don't know what's the input format for LargeViz? I know it should be vectors for nodes, but do not know exactly how the vector should be formatted.

@KiddoZhu
Copy link
Collaborator

KiddoZhu commented Aug 13, 2019

That's good. I will add it to the document.

If you call LargeVis from yaml, there are two formats, depending on the task. For graph visualization, it's an edge list. For vector visualization, it's an n*d text matrix, i.e. n lines of d-dimensional samples.

The command line graphvite visualize is only designed for vector visualization, but you can also pass a numpy dump of n*d matrix as input, with .npy suffix.

@PJthunder
Copy link
Author

Thank you for the quick reply!

@PJthunder
Copy link
Author

Want to double check. The label file for largevis is just an array (length = n) of string or integer right?

@KiddoZhu
Copy link
Collaborator

KiddoZhu commented Aug 20, 2019

Yes. It can be either n lines of strings (*.txt) or a 1d numpy array (*.npy).

@KiddoZhu
Copy link
Collaborator

Added in v0.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants