Class UnmixSpec
java.lang.Object
edu.cmu.tetrad.data.UnmixSpec
- All Implemented Interfaces:
Serializable
Minimal, UI-friendly spec for the unmixer. No search/PC/BOSS classes referenced here; we keep it decoupled and
translate elsewhere.
- Author:
- josephramsey
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe ColliderStyle enum represents different styles for handling colliders during graph learning processes.static enumThe CovarianceMode enum represents different modes for handling covariance calculations during graph learning processes.static enumThe GraphLearner enum represents different algorithms or strategies used for graph learning processes within a system.static enumThe SupersetScore enum represents statistical ranking correlation coefficients that can be used to assess the relationship between two rankings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleRetrieves the starting temperature for annealing.intRetrieves the number of annealing steps.doubleRetrieves the BOSS penalty discount value.Retrieves the covariance mode.intRetrieves the maximum number of iterations for the EM algorithm.intRetrieves the full sigma safety margin.Retrieves the graph learning method currently set for this instance.intgetK()Retrieves the current value of K.intgetKmax()Retrieves the maximum allowed value of K (Kmax).intRetrieves the number of k-means restarts.intgetKmin()Retrieves the minimum allowed value of K.doubleRetrieves the alpha value used in the PC algorithm for statistical testing.Retrieves the collider style used in the PC algorithm for handling colliders during causal discovery.doublegetRidge()Retrieves the ridge parameter.doubleRetrieves the shrinkage parameter.Retrieves the score used for parent superset feature.intRetrieves the top M value for the parent superset feature.booleanRetrieves the current value of K.booleanDetermines if intermediate logging is enabled.booleanIndicates whether robust scaling of residuals is enabled.booleanRetrieves whether to save diagnostics.booleanIndicates whether the parent superset feature is enabled or disabled.setAnnealStartT(double t) Sets the starting temperature for annealing.setAnnealSteps(int s) Sets the number of annealing steps.setAutoSelectK(boolean v) Sets whether to enable or disable the automatic selection of the best value of K.setBossPenaltyDiscount(double d) Sets the BOSS penalty discount value for this instance of UnmixSpec.Sets the covariance mode.setEmMaxIters(int it) Sets the maximum number of iterations for the EM algorithm.setFullSigmaSafetyMargin(int m) Sets the full sigma safety margin.Sets the graph learning method for this instance of UnmixSpec.setK(int k) Sets the value of K for the current instance of UnmixSpec.setKmax(int kmax) Sets the maximum allowed value of K (Kmax) for the current instance of UnmixSpec.setKmeansRestarts(int r) Sets the number of k-means restarts.setKmin(int kmin) Sets the minimum allowed value of K.voidsetLogIntermediate(boolean logIntermediate) Sets the logging state for intermediate steps in a process.setPcAlpha(double a) Sets the alpha value for the PC algorithm.Sets the collider style to be used in the PC algorithm for identifying colliders during causal graph discovery.setRidge(double r) Sets the ridge parameter.setRobustScaleResiduals(boolean v) Sets whether robust scaling of residuals is enabled.setSaveDiagnostics(boolean v) Sets whether to save diagnostics.setShrinkage(double s) Sets the shrinkage parameter.Sets the score used for parent superset feature.setSupersetTopM(int m) Sets the top M value for the parent superset feature.setUseParentSuperset(boolean v) Sets the parent superset feature to enabled or disabled.
-
Constructor Details
-
UnmixSpec
public UnmixSpec()Constructor for the UnmixSpec class. This constructor initializes an instance of the UnmixSpec class.
-
-
Method Details
-
isLogIntermediate
public boolean isLogIntermediate()Determines if intermediate logging is enabled.- Returns:
- true if intermediate logging is enabled, false otherwise
-
setLogIntermediate
public void setLogIntermediate(boolean logIntermediate) Sets the logging state for intermediate steps in a process.- Parameters:
logIntermediate- a boolean indicating whether intermediate steps should be logged (true) or not (false)
-
isAutoSelectK
public boolean isAutoSelectK()Retrieves the current value of K.- Returns:
- the value of K.
-
setAutoSelectK
Sets whether to enable or disable the automatic selection of the best value of K.- Parameters:
v- a boolean value indicating whether to enable (true) or disable (false) the automatic selection of K.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getK
public int getK()Retrieves the current value of K.- Returns:
- the value of K.
-
setK
Sets the value of K for the current instance of UnmixSpec. K must be greater than or equal to 1.- Parameters:
k- the value to set for K; must be a positive integer >= 1.- Returns:
- the current instance of UnmixSpec for method chaining.
- Throws:
IllegalArgumentException- if the provided k is less than 1.
-
getKmin
public int getKmin()Retrieves the minimum allowed value of K.- Returns:
- the minimum value of K (Kmin).
-
setKmin
Sets the minimum allowed value of K. Ensures that the value of Kmin is at least 1.- Parameters:
kmin- the proposed minimum value for K; must be an integer.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getKmax
public int getKmax()Retrieves the maximum allowed value of K (Kmax).- Returns:
- the maximum value of K (Kmax).
-
setKmax
Sets the maximum allowed value of K (Kmax) for the current instance of UnmixSpec. Ensures that the value of Kmax is at least 1.- Parameters:
kmax- the proposed maximum value for K; must be an integer.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getGraphLearner
Retrieves the graph learning method currently set for this instance.- Returns:
- the currently configured GraphLearner, which determines the method used for graph learning (e.g., BOSS or PC_MAX).
-
setGraphLearner
Sets the graph learning method for this instance of UnmixSpec. The provided GraphLearner determines the algorithm to be used for graph learning (e.g., BOSS or PC_MAX).- Parameters:
g- the GraphLearner to set; must be a valid enumeration value.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getPcAlpha
public double getPcAlpha()Retrieves the alpha value used in the PC algorithm for statistical testing.- Returns:
- the alpha value for the PC algorithm, which is typically used as a threshold for significance in tests.
-
setPcAlpha
Sets the alpha value for the PC algorithm. This value is typically used as a significance threshold in statistical testing within the PC algorithm.- Parameters:
a- the alpha value to set for the PC algorithm; must be a non-negative double representing the significance level.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getPcColliderStyle
Retrieves the collider style used in the PC algorithm for handling colliders during causal discovery. The collider style determines the specific method or approach used to identify colliders in the causal graph.- Returns:
- the configured
UnmixSpec.ColliderStylefor the PC algorithm, which may be one of SEPSETS, CONSERVATIVE, or MAX_P.
-
setPcColliderStyle
Sets the collider style to be used in the PC algorithm for identifying colliders during causal graph discovery. The collider style determines the approach applied for handling colliders (e.g., SEPSETS, CONSERVATIVE, or MAX_P).- Parameters:
s- theUnmixSpec.ColliderStyleto set; must be a valid enumeration value.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getBossPenaltyDiscount
public double getBossPenaltyDiscount()Retrieves the BOSS penalty discount value. The BOSS penalty discount is used as a parameter in graph learning algorithms to adjust or scale penalties during the learning process.- Returns:
- the current BOSS penalty discount value as a double.
-
setBossPenaltyDiscount
Sets the BOSS penalty discount value for this instance of UnmixSpec. The BOSS penalty discount is a parameter used in graph learning algorithms to adjust or scale penalties during the learning process.- Parameters:
d- the BOSS penalty discount value to set; must be a double.- Returns:
- the current instance of UnmixSpec for method chaining.
-
isUseParentSuperset
public boolean isUseParentSuperset()Indicates whether the parent superset feature is enabled or disabled.- Returns:
trueif the parent superset feature is enabled;falseotherwise.
-
setUseParentSuperset
Sets the parent superset feature to enabled or disabled.- Parameters:
v-trueto enable the parent superset feature;falseto disable.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getSupersetTopM
public int getSupersetTopM()Retrieves the top M value for the parent superset feature.- Returns:
- the top M value for the parent superset feature.
-
setSupersetTopM
Sets the top M value for the parent superset feature.- Parameters:
m- the top M value to set; must be greater than or equal to 1.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getSupersetScore
Retrieves the score used for parent superset feature.- Returns:
- the score used for parent superset feature.
-
setSupersetScore
Sets the score used for parent superset feature.- Parameters:
s- the score to set; must not be null.- Returns:
- the current instance of UnmixSpec for method chaining.
-
isRobustScaleResiduals
public boolean isRobustScaleResiduals()Indicates whether robust scaling of residuals is enabled.- Returns:
trueif robust scaling of residuals is enabled;falseotherwise.
-
setRobustScaleResiduals
Sets whether robust scaling of residuals is enabled.- Parameters:
v-trueto enable robust scaling of residuals;falseto disable.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getCovarianceMode
Retrieves the covariance mode.- Returns:
- the covariance mode.
-
setCovarianceMode
Sets the covariance mode.- Parameters:
m- the covariance mode to set; must not be null.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getFullSigmaSafetyMargin
public int getFullSigmaSafetyMargin()Retrieves the full sigma safety margin.- Returns:
- the full sigma safety margin.
-
setFullSigmaSafetyMargin
Sets the full sigma safety margin.- Parameters:
m- the full sigma safety margin to set; must be non-negative.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getKmeansRestarts
public int getKmeansRestarts()Retrieves the number of k-means restarts.- Returns:
- the number of k-means restarts.
-
setKmeansRestarts
Sets the number of k-means restarts.- Parameters:
r- the number of k-means restarts to set; must be positive.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getEmMaxIters
public int getEmMaxIters()Retrieves the maximum number of iterations for the EM algorithm.- Returns:
- the maximum number of iterations for the EM algorithm.
-
setEmMaxIters
Sets the maximum number of iterations for the EM algorithm.- Parameters:
it- the maximum number of iterations to set; must be positive.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getRidge
public double getRidge()Retrieves the ridge parameter.- Returns:
- the ridge parameter.
-
setRidge
Sets the ridge parameter.- Parameters:
r- the ridge parameter to set; must be non-negative.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getShrinkage
public double getShrinkage()Retrieves the shrinkage parameter.- Returns:
- the shrinkage parameter.
-
setShrinkage
Sets the shrinkage parameter.- Parameters:
s- the shrinkage parameter to set; must be between 0 and 1 inclusive.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getAnnealSteps
public int getAnnealSteps()Retrieves the number of annealing steps.- Returns:
- the number of annealing steps.
-
setAnnealSteps
Sets the number of annealing steps.- Parameters:
s- the number of annealing steps to set; must be non-negative.- Returns:
- the current instance of UnmixSpec for method chaining.
-
getAnnealStartT
public double getAnnealStartT()Retrieves the starting temperature for annealing.- Returns:
- the starting temperature for annealing.
-
setAnnealStartT
Sets the starting temperature for annealing.- Parameters:
t- the starting temperature to set; must be non-negative.- Returns:
- the current instance of UnmixSpec for method chaining.
-
isSaveDiagnostics
public boolean isSaveDiagnostics()Retrieves whether to save diagnostics.- Returns:
- true if diagnostics are saved, false otherwise.
-
setSaveDiagnostics
Sets whether to save diagnostics.- Parameters:
v- true to save diagnostics, false otherwise.- Returns:
- the current instance of UnmixSpec for method chaining.
-