Package edu.cmu.tetrad.search.utils
Class ClusterUtils
java.lang.Object
edu.cmu.tetrad.search.utils.ClusterUtils
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionclustersToPartition
(Clusters clusters, List<Node> variables) Converts a list of indices into a list of Nodes representing a cluster.static List<int[]>
Converts a list of indices into a list of Nodes representing a cluster.static Graph
convertSearchGraph
(List<int[]> clusters, String[] varNames) Converts a list of indices into a list of Nodes representing a cluster.generateLatentNames
(int total) Generates a list of latent variable names.static void
Logs the clusters.static Clusters
mimClusters
(Graph mim) Converts a list of indices into a list of Nodes representing a cluster.static Clusters
partitionToClusters
(List<List<Node>> partition) Converts a list of indices into a list of Nodes representing a cluster.
-
Field Details
-
LATENT_PREFIX
The prefix for latent variables.- See Also:
-
-
Method Details
-
convertListToInt
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
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
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
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
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
Logs the clusters.- Parameters:
clusters
- The clusters.variables
- The variables.
-
generateLatentNames
Generates a list of latent variable names.- Parameters:
total
- The number of latent variables to generate.- Returns:
- The list of latent variable names.
-