arlin.analysis.cluster_analysis

Module Contents

Classes

ClusterAnalyzer

Class to analyze latent clusters and generate data to visualize.

class arlin.analysis.cluster_analysis.ClusterAnalyzer(dataset, clusters)

Class to analyze latent clusters and generate data to visualize.

Initialize an instance of a ClusterAnalyzer.

Parameters:
  • dataset (XRLDataset) – XRLDataset created from an RL policy

  • clusters (np.ndarray) – Generated clusters

Raises:

ValueError – A cluster has both initial and terminal states within it

cluster_state_analysis(cluster_id, env, save_dir_path, num_img_samples=10)

Generate state analytics from a given cluster including renders and metrics.

Parameters:
  • cluster_id (int) – Cluster to analyze the states of

  • env (gym.Env) – Environment this policy was trained in.

  • save_dir_path (str) – Directory to save data to.

  • num_img_samples (int, optional) – Number of renders to save. Defaults to 10.

Return type:

None

cluster_confidence()

Get data of the average confidence of each cluster.

Returns:

Data to visualize

Return type:

GraphData

cluster_rewards()

Get data of the average reward of each cluster.

Returns:

Data to visualize

Return type:

GraphData

cluster_values()

Get data of the average value of each cluster.

Returns:

Data to visualize

Return type:

GraphData