Class StARS

java.lang.Object
edu.cmu.tetrad.algcomparison.algorithm.StARS
All Implemented Interfaces:
Algorithm, HasParameters, TetradSerializable, Serializable

public class StARS extends Object implements Algorithm
StARS (Stability Approach to Regularization Selection): selects a value for one numeric parameter of a wrapped algorithm by sweeping the parameter over [low, high] in steps of 0.5, measuring the StARS adjacency instability of the algorithm's output over a fixed set of resamples at each value, choosing the value with the largest instability strictly below the cutoff (Params "StARS.cutoff"), and then running the wrapped algorithm on the full data at the chosen value. The resamples are drawn once and shared across values, so instability comparisons are paired.

The sweep and instability machinery is delegated to ParameterSweep; this class is a thin selector over the resulting SweepReport, whose full evidence (per-value instabilities, point graphs, edge-probability graphs) can be obtained programmatically by running the harness directly.

Parameters read from the Parameters object: "percentSubsampleSize" (fraction of the sample per resample), "numSubsamples", "StARS.cutoff" (the instability cutoff beta), "logScale" (if true, evaluated values are 10^lambda for lambda in [low, high]), and optionally Params.SEED for reproducible resampling.

Changes from the pre-2026 implementation, preserved semantics aside: (1) with "logScale" set, the parameter is now evaluated at the transformed value 10^lambda during the sweep, where previously the sweep evaluated the raw lambda but the final search used 10^lambda; (2) if no value's instability falls below the cutoff, the most stable value is used (with a log message), where previously the parameter was set to NaN; (3) resampling is seed-controlled via Params.SEED; (4) a concurrency hazard in the resample collection was removed.

Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • StARS

      public StARS(Algorithm algorithm, String parameter, double low, double high)

      Constructor for StARS.

      Parameters:
      algorithm - a Algorithm object
      parameter - a String object
      low - a double
      high - a double
  • Method Details

    • search

      public Graph search(DataModel dataSet, Parameters parameters) throws InterruptedException
      Runs the search.
      Specified by:
      search in interface Algorithm
      Parameters:
      dataSet - The data set to run to the search on.
      parameters - The paramters of the search.
      Returns:
      The result graph.
      Throws:
      InterruptedException - if any
    • getComparisonGraph

      public Graph getComparisonGraph(Graph graph)
      Returns that graph that the result should be compared to.
      Specified by:
      getComparisonGraph in interface Algorithm
      Parameters:
      graph - The true directed graph, if there is one.
      Returns:
      The comparison graph.
    • getDescription

      public String getDescription()
      Returns a short, one-line description of this algorithm. This will be printed in the report.
      Specified by:
      getDescription in interface Algorithm
      Returns:
      This description.
    • getDataType

      public DataType getDataType()
      Returns the data type that the search requires, whether continuous, discrete, or mixed.
      Specified by:
      getDataType in interface Algorithm
      Returns:
      This type.
    • getParameters

      public List<String> getParameters()
      Returns the list of parameter names that are used. These are looked up in ParamMap, so if they're not
      Specified by:
      getParameters in interface HasParameters
      Returns:
      Returns the list of parameter names that are used. These are looked up in ParamMap, so if they're not already defined they'll need to be defined there.