agentlib_mpc.machine_learning_plugins.physXAI package
Submodules
agentlib_mpc.machine_learning_plugins.physXAI.model_config_creation module
- agentlib_mpc.machine_learning_plugins.physXAI.model_config_creation.model_path_generation(run_id: str, output_name: str) str[source]
Generates the relative model path based on run_id and output_name. :param run_id: The unique identifier for the mpc run. :type run_id: str :param output_name: The name of the output feature. :type output_name: str
- Returns:
The relative path to the model file.
- Return type:
str
- agentlib_mpc.machine_learning_plugins.physXAI.model_config_creation.physXAI_2_agentlib_json(run_id: str, preprocessing_dict: dict, model_dict: dict = None, training_dict: dict = None, model_type: str = 'ANN') dict[source]
Converts physXAI model configurations to an AgentLib-MPC compatible JSON format. :param run_id: The unique identifier for the mpc run. :type run_id: str :param preprocessing_dict: The preprocessing configuration from physXAI. :type preprocessing_dict: dict :param model_dict: The model configuration from physXAI. Defaults to None. :type model_dict: dict, optional :param training_dict: The training configuration from physXAI. Defaults to None. :type training_dict: dict, optional :param model_type: The type of model (‘ANN’ or ‘LinReg’). Defaults to ‘ANN’. :type model_type: str, optional
- Returns:
The converted configuration in AgentLib-MPC JSON format.
- Return type:
dict
agentlib_mpc.machine_learning_plugins.physXAI.model_generation module
- agentlib_mpc.machine_learning_plugins.physXAI.model_generation.generate_physxai_model(models: list[str] | dict[str, str] | str, physXAI_scripts_path: str, training_data_path: str, run_id: str, time_step: int = 900) list[str][source]
Generate physXAI models
- Parameters:
models (Union[list[str], dict[str, str], str]) – Define Models to be generated by physXAI. If a single string is given, it is assumed to be an id to an existing model folder. In this case, the existing models are copied to a new folder with the given new run_id. If a list of strings is given, each string is assumed to be a physXAI script filename (with or without .py ending) to be executed for model training. The output model names will be determined by the physXAI scripts. If a dict is given, each key is the desired output model name, and each value is the physXAI script filename (with or without .py ending) to be executed for model training.
physXAI_scripts_path (str) – Base path to physXAI scripts
training_data_path (str) – Path to training data csv file
run_id (str) – Run identifier
time_step (int, optional) – Time step for training. Defaults to 900.
- Returns:
List of generated model file paths
- Return type:
List[str]
- agentlib_mpc.machine_learning_plugins.physXAI.model_generation.use_existing_models(old_id: str, new_id: str, model_save_path: str) list[str][source]
Use existing physXAI models by copying them to a new folder with a new run_id.
- Parameters:
old_id (str) – Existing model run identifier
new_id (str) – New model run identifier
model_save_path (str) – Path where models are saved
- Returns:
List of generated model file paths
- Return type:
List[str]