Skip to content

JSON Configuration Files

Configuration files are meant to ease the use of our algorithms. It allows you to write all needed arguments inside a JSON formatted file and use it as input to any dimlpfidex algorithm. This will allow you to write shorter Python function calls and/or CLI commands, improving readability and reusability.

Example

Executing Fidex CLI command without configuration file:

./fidex --root_folder my/folder/ --train_data_file train_data.txt --train_pred_file train_predictions.out --train_class_file train_classes.txt --test_data_file test_data.txt --nb_attributes 16 --nb_classes 2 --weights_file weights.wts --rules_outfile output_rules.rls --stats_file output_stats.txt

Executing Fidex with this configuration file

./fidex --json_config_file my_conf.json

Executing Fidex Python command without configuration file:

from dimlpfidex.fidex import fidex

fidex(
"""--root_folder my/folder/ 
    --train_data_file train_data.txt 
    --train_pred_file train_predictions.out 
    --train_class_file train_classes.txt 
    --test_data_file test_data.txt 
    --nb_attributes 16 
    --nb_classes 2 
    --weights_file weights.wts 
    --rules_outfile output_rules.rls 
    --stats_file output_stats.txt"""
)

Executing Fidex with this configuration file

from dimlpfidex.fidex import fidex
fidex("""--json_config_file my_conf.json""")

If you are not used to JSON, you can:

Example

Here is a simple example of the content of a configuration file named my_conf.json, this one respects the comparison above.

{
    "root_folder": "my/folder/",
    "train_data_file": "train_data.txt",
    "train_pred_file": "train_predictions.out", 
    "train_class_file": "train_classes.txt ",
    "test_data_file": "test_data.txt ",
    "nb_attributes": 16,
    "nb_classes": 2,
    "weights_file": "weights.wts ",
    "rules_outfile": "output_rules.rls",
    "stats_file": "output_stats.txt"
}

Tip

You can find configuration file templates for every dimlpfidex algorithm here.