kstaats / karoo_gp

A Genetic Programming platform for Python with TensorFlow for wicked-fast CPU and GPU support.
Other
159 stars 61 forks source link

Add a machine-parsable `log_test.json` #62

Closed ezio-melotti closed 2 years ago

ezio-melotti commented 2 years ago

Currently the results of the runs are saved into a log_test.txt file. If you want to access these values programmatically, you have to manually parse the file.

In addition to the human-parsable log_test.txt, we could add a machine-parsable log_test.json. This will be useful for both users that want to access the result, and for us during testing.

To match closely log_test.txt, the file could include the following fields:

launched: datetime (str)
dataset: path (str)
outcome: SUCCESS/FAILURE (or EXTINCTION) (str)
results: only in case of SUCCESS (object)
    fittest_tree: tree number (int)
    expression: sympified expression (str)
    fitness_score: c/r/m fitness score (float)
    # only for classification kernel
    precision_recall_report: (object)
    confusion_matrix: (array of arrays)
    # only for regression kernel
    mean_squared_error: (float)

We can also add more fields, including:

We could also make the creation of this report optional, and triggered with a command line argument (e.g. something like --output-format json/txt/json,txt). This can be added later though -- for now it's easier to just produce both reports.

granawkins commented 2 years ago

This can be closed right?