refine_plan.learning.option_learning

Functions for processing datsets and learning DBNs.

Author: Charlie Street Owner: Charlie Street

Module Contents

Functions

mongodb_to_yaml(connection_str, db_name, ...)

Processes a mongodb collection into a yaml dataset for DBN learning.

learn_dbns(dataset_path, output_dir, sf_list)

Learn a set of DBNs representing options.

refine_plan.learning.option_learning.mongodb_to_yaml(connection_str, db_name, collection_name, sf_list, out_file)

Processes a mongodb collection into a yaml dataset for DBN learning.

Parameters:
  • connection_str – The mongodb connection string

  • db_name – The Mongo database name

  • collection_name – The collection within the database

  • sf_list – The list of state factors to expect in the MongoDB

  • out_file – The path for the yaml file

refine_plan.learning.option_learning.learn_dbns(dataset_path, output_dir, sf_list)

Learn a set of DBNs representing options.

The dataset should be a dictionary from options to a dictionary with two keys: ‘transition’ and ‘reward’. In ‘transition’ there should be a dictionary with keys sf0 and sft for each state factor sf. At each of these keys is a list of data. In ‘reward’ there should be a dictionary with keys sf for each state factor sf, and ‘r’ to represent the reward. At each of these keys is a list of data

Parameters:
  • dataset_path – A yaml file containing the dataset.

  • output_dir – The output directory for the DBNs.

  • sf_list – The list of state factors we expect to see in the dataset