analyze module

Analyze a dataset by a method.

This command takes two mandatory arguments, dataset and method, in this order.

If you choose file as the dataset, you can give a file path for the dataset via –dataset-param flag with file key. The –dataset-param flag takes key and value within the format KEY=VALUE, i.e. if the path of your dataset is ~/path/to/dataset.json, give –dataset-param file=~/path/to/dataset.json.

If your chosen dataset supports other options, you can also give them via –dataset-param flags.

Most of methods also take options. You can give those options via –method-param flag. The flag takes key and value as same format as –dataset-param, i.e. to set alpha = 1, give –dataset-param alpha=1.

analyze.analyze(graph, output=<open file '<stdout>', mode 'w'>, loop=20, threshold=1e-05)[source]

Execute iteration.

The iteration ends if the number of iteration reaches the given maximum number of iteration, loop, or the update becomes smaller than or equal to the given threshold.

After each iteration ends, the current status of the graph will be outputted using dataset_io:dataset_io.helper.print_state().

Parameters:
  • graph – Review graph object.
  • output – Writable object to write outputs.
  • loop – Maximum number of iteration (default: 20).
  • threshold – Threshold of the update (default: 10^5).
analyze.main()[source]

Main function.

analyze.run(method, method_param, dataset, dataset_param, **kwargs)[source]

Prepare a review graph, load a dataset to it, and execute analyze.

Parameters:
  • method – name of the method to be run.
  • method_param – list of strings representing key-value pairs.
  • dataset – name of the dataset to be loaded.
  • dataset_param – list of strings representing key-value pairs.