Class ClusterUtils

java.lang.Object
edu.cmu.tetrad.search.utils.ClusterUtils

public class ClusterUtils extends Object
Provides some general utilities for dealing with clustering input and output.

The method of this class are used only internally and so are not documented for public use.

Version:
$Id: $Id
Author:
josephramsey
  • Field Details

  • Method Details

    • convertListToInt

      public static List<int[]> convertListToInt(List<List<Node>> partition, List<Node> nodes)
      Converts a list of indices into a list of Nodes representing a cluster.
      Parameters:
      partition - The indices of the variables.
      nodes - The variables.
      Returns:
      The extracted node list.
    • clustersToPartition

      public static List<List<Node>> clustersToPartition(Clusters clusters, List<Node> variables)
      Converts a list of indices into a list of Nodes representing a cluster.
      Parameters:
      clusters - The indices of the variables.
      variables - The variables.
      Returns:
      The extracted node list.
    • partitionToClusters

      public static Clusters partitionToClusters(List<List<Node>> partition)
      Converts a list of indices into a list of Nodes representing a cluster.
      Parameters:
      partition - The indices of the variables.
      Returns:
      The extracted node list.
    • convertSearchGraph

      public static Graph convertSearchGraph(List<int[]> clusters, String[] varNames)
      Converts a list of indices into a list of Nodes representing a cluster.
      Parameters:
      clusters - The indices of the variables.
      varNames - The variables.
      Returns:
      The extracted node list.
    • mimClusters

      public static Clusters mimClusters(Graph mim)
      Converts a list of indices into a list of Nodes representing a cluster.
      Parameters:
      mim - The graph to convert.
      Returns:
      The extracted node list.
    • logClusters

      public static void logClusters(Set<Set<Integer>> clusters, List<Node> variables)
      Logs the clusters.
      Parameters:
      clusters - The clusters.
      variables - The variables.
    • generateLatentNames

      public static List<String> generateLatentNames(int total)
      Generates a list of latent variable names.
      Parameters:
      total - The number of latent variables to generate.
      Returns:
      The list of latent variable names.