Class TrainAndResimulate

java.lang.Object
edu.cmu.tetrad.sem.TrainAndResimulate

public final class TrainAndResimulate extends Object
Simple driver: args[0] = input data path (tab-delimited with header) args[1] = input DAG path (one directed edge per line, like "A -> B" or "A-->B" or "A->B") args[2] = output data path (tab-delimited) args[3] = output DAG path (edge list) args[4] = (optional) nSamples (default = input N)

Run example (from any directory, assuming your launch jar is on the classpath): java -cp tetrad-launch.jar:. edu.cmu.tetrad.sem.TrainAndResimulate in.tsv dag.txt out.tsv out_dag.txt 2000

  • Method Details

    • main

      public static void main(String[] args) throws Exception
      The entry point for the application. This method reads input data and a DAG structure, trains a simulator based on the input data and DAG, performs simulations, and writes the output dataset and DAG structure to specified files.
      Parameters:
      args - Command-line arguments: args[0] - Path to the input dataset file (tab-separated values, .tsv file). args[1] - Path to the input DAG structure file (text file, .txt file). args[2] - Path to the output dataset file to be generated (tab-separated values, .tsv file). args[3] - Path to the output DAG structure file to be generated (text file, .txt file). args[4] (optional) - Number of samples to simulate. If not provided, defaults to the number of rows in the input dataset.
      Throws:
      Exception - If an error occurs during file I/O or processing.