예제 #1
0
  private CaseExpanderWrapper(DataWrapper wrapper) {
    DataFilter filter = new CaseExpander();
    DataSet columnDataModel = (DataSet) wrapper.getSelectedDataModel();
    setDataModel(filter.filter(columnDataModel));
    setSourceGraph(wrapper.getSourceGraph());

    LogDataUtils.logDataModelList(
        "Data in which case multipliers of parent node data have been multiplied out.",
        getDataModelList());
  }
예제 #2
0
  /**
   * Constructs the wrapper given some data and the params.
   *
   * @param data
   * @param params
   */
  public SplitCasesWrapper(DataWrapper data, SplitCasesParams params) {
    if (data == null) {
      throw new NullPointerException("The given data must not be null");
    }
    if (params == null) {
      throw new NullPointerException("The given parameters must not be null");
    }
    DataSet originalData = (DataSet) data.getSelectedDataModel();
    DataModel model = createSplits(originalData, params);
    this.setDataModel(model);
    this.setSourceGraph(data.getSourceGraph());

    LogDataUtils.logDataModelList("One split of the parent data.", getDataModelList());
  }
  public RegressionInterpolatorWrapper(DataWrapper data) {
    if (data == null) {
      throw new NullPointerException("The givan data must not be null");
    }
    DataModel model = data.getSelectedDataModel();
    if ((!(model instanceof DataSet))) {
      throw new IllegalArgumentException("Data must be tabular");
    }
    DataFilter interpolator = new RegressionInterpolator();
    this.setDataModel(interpolator.filter((DataSet) model));
    this.setSourceGraph(data.getSourceGraph());

    LogDataUtils.logDataModelList(
        "Parent data in which missing values have been replaced by regression predictions.",
        getDataModelList());
  }
예제 #4
0
  public CopyAllDatasetsWrapper(DataWrapper wrapper) {
    LogDataUtils.logDataModelList(
        "Parent data in which constant columns have been removed.", getDataModelList());

    DataModelList inList = wrapper.getDataModelList();
    DataModelList outList = new DataModelList();

    for (DataModel model : inList) {
      if (!(model instanceof DataSet)) {
        throw new IllegalArgumentException("Not a data set: " + model.getName());
      }

      this.setDataModel(model);
      outList.add(model);
    }

    setDataModel(outList);
    setSourceGraph(wrapper.getSourceGraph());
  }
  public ImpliedCovarianceDataAllWrapper(SemEstimatorWrapper wrapper) {
    //        int sampleSize = params.getSampleSize();
    //        boolean latentDataSaved = params.isIncludeLatents();
    SemEstimator semEstimator = wrapper.getSemEstimator();
    SemIm semIm1 = semEstimator.getEstimatedSem();

    if (semIm1 != null) {

      TetradMatrix matrix2D = semIm1.getImplCovar(true);
      int sampleSize = semIm1.getSampleSize();
      List<Node> variables =
          wrapper.getSemEstimator().getEstimatedSem().getSemPm().getVariableNodes();
      CovarianceMatrix cov = new CovarianceMatrix(variables, matrix2D, sampleSize);
      setDataModel(cov);
      setSourceGraph(wrapper.getSemEstimator().getEstimatedSem().getSemPm().getGraph());
      this.semIm = wrapper.getEstimatedSemIm();
    }

    LogDataUtils.logDataModelList(
        "Data simulated from a linear structural equation model.", getDataModelList());
  }
예제 #6
0
  /**
   * Splits the given data set by collinear columns.
   *
   * @param wrapper
   */
  public SimulateFromCovWrapper(DataWrapper wrapper) {
    if (wrapper == null) {
      throw new NullPointerException("The given data must not be null");
    }

    DataModel model = wrapper.getSelectedDataModel();

    if (model instanceof ICovarianceMatrix) {
      CovarianceMatrix covarianceMatrix = new CovarianceMatrix((CovarianceMatrix) model);

      DataSet dataSet = DataUtils.choleskySimulation(covarianceMatrix);

      setDataModel(dataSet);
      setSourceGraph(wrapper.getSourceGraph());
    } else {
      throw new IllegalArgumentException("Must be a dataset or a covariance  matrix");
    }

    LogDataUtils.logDataModelList(
        "Conversion of data to covariance matrix form.", getDataModelList());
  }