bd2kccd / r-causal

R Wrapper for Tetrad Library
35 stars 19 forks source link

Tetradrunner's graph object contains the actually used parameters and good way to check in R #107

Closed yasu-sh closed 1 year ago

yasu-sh commented 2 years ago

Hi, developers,

For transparency of the result of the tetradrunner, can we use this method? I made experimental implementation and it looks working well.

I will made pull request on this matter. If somebody knows better methods or ideas for getting better format in R, let me know.

Place: String edu.cmu.tetrad.util.Parameters.toString()

    /**
     * Returns a list of the parameters whose values were actually used in the
     * course of the simulation.
     *
     * @return this list, in String form
     */
    @Override
    public String toString() {
        return usedParameters.stream()
                .map(e -> String.format("%s = %s", e, parameters.get(e)[0]))
                .collect(Collectors.joining(System.lineSeparator()));
    }