<commit_before>package de.lmu.ifi.dbs.data.synthetic;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.regex.Pattern;

import de.lmu.ifi.dbs.logging.LoggingConfiguration;
import de.lmu.ifi.dbs.utilities.Progress;
import de.lmu.ifi.dbs.utilities.UnableToComplyException;
import de.lmu.ifi.dbs.utilities.Util;
import de.lmu.ifi.dbs.utilities.optionhandling.AttributeSettings;
import de.lmu.ifi.dbs.utilities.optionhandling.Parameter;
import de.lmu.ifi.dbs.utilities.optionhandling.ParameterException;
import de.lmu.ifi.dbs.utilities.optionhandling.WrongParameterValueException;
import de.lmu.ifi.dbs.wrapper.StandAloneWrapper;

/**
 * Provides automatic generation of axes parallel hyperplanes
 * of arbitrary correlation dimensionalities, where the the dependent
 * and independent variables can be specified.
 *
 * @author <NAME> (<a href="mailto:<EMAIL>"><EMAIL></a>)
 */
public class AxesParallelCorrelationGenerator extends StandAloneWrapper {
 

  static {
    OUTPUT_D = "<filename>the file to write the generated correlation hyperplane in, " +
               "if the file already exists, the generated points will be appended to this file.";
  }

  public final static String LINE_SEPARATOR = System.getProperty("line.separator");

  /**
   * A pattern defining a comma.
   */
  public static final Pattern COMMA_SPLIT = Pattern.compile(",");

  /**
   * A pattern defining a |.
   */
  public static final Pattern VECTOR_SPLIT = Pattern.compile(":");

  /**
   * Parameter for dimensionality.
   */
  public static final String DIM_P = "dim";

  /**
   * Description for parameter dim.
   */
  public static final String DIM_D = "the dimensionality of the feature space.";

  /**
   * Parameter for correlation dimensionality.
   */
  public static final String CORRDIM_P = "corrdim";

  /**
   * Description for parameter corrdim.
   */
  public static final String CORRDIM_D = "the correlation dimensionality of the correlation hyperplane.";

  /**
   * Parameter for dep.
   */
  public static final String DEPENDENT_VALUES_P = "dep";

  /**
   * Description for parameter pref.
   */
  public static final String DEPENDENT_VALUES_D = "<p_1,...,p_d>a vector specifying " +
                                                  "the dependent and independent variables of the correlation hyperplane, " +
                                                  "where d denotes the dimensionality of the feature space. " +
                                                  "p_i = 0 specifies an independent variable, any other value of p_i " +
                                                  "specifies the value of the dependent variable. " +
                                                  "The number of zero values has to " +
                                                  "correspond with the specified correlation dimensionality. The values of the " +
                                                  "dependent variables have to correspond with the specified main and max values. " +
                                                  "If no preference vector is specified, the " +
                                                  "the first dataDim - corrDim variables are the dependent variables " +
                                                  "(the values will be randomized), " +
                                                  "the last corrDim variables are the independent variables.";

  /**
   * Parameter for number of points.
   */
  public static final String NUMBER_P = "number";

  /**
   * Description for parameter number.
   */
  public static final String NUMBER_D = "the (positive) number of points in the correlation hyperplane.";

  /**
   * Parameter for label.
   */
  public static final String LABEL_P = "label";

  /**
   * Description for parameter label.
   */
  public static final String LABEL_D = "a label specifiying the correlation hyperplane, " +
                                       "default is no label.";

  /**
   * Parameter for minimum value.
   */
  public static final String MIN_P = "minima";

  /**
   * The default value for min.
   */
  public static final double MIN_DEFAULT = 0;

  /**
   * Description for parameter min.
   */
  public static final String MIN_D = "<min_1,...,min_d>a comma seperated list of the coordinates of the minimum " +
                                     "value in each dimension, default is " + MIN_DEFAULT + " in each dimension";

  /**
   * Parameter for maximum value.
   */
  public static final String MAX_P = "maxima";

  /**
   * The default value for max.
   */
  public static final double MAX_DEFAULT = 1;

  /**
   * Description for parameter max.
   */
  public static final String MAX_D = "<max_1,...,max_d>a comma seperated list of the coordinates of the maximum " +
                                     "value in each dimension, default is " + MAX_DEFAULT + " in each dimension";

  /**
   * Parameter for jitter.
   */
  public static final String JITTER_P = "jitter";

  /**
   * The default value for jitter.
   */
  public static final double JITTER_DEFAULT = 0;

  /**
   * Description for parameter jitter.<commit_msg>comments<commit_after>package de.lmu.ifi.dbs.data.synthetic;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.regex.Pattern;

import de.lmu.ifi.dbs.logging.LoggingConfiguration;
import de.lmu.ifi.dbs.utilities.Progress;
import de.lmu.ifi.dbs.utilities.UnableToComplyException;
import de.lmu.ifi.dbs.utilities.Util;
import de.lmu.ifi.dbs.utilities.optionhandling.AttributeSettings;
import de.lmu.ifi.dbs.utilities.optionhandling.Parameter;
import de.lmu.ifi.dbs.utilities.optionhandling.ParameterException;
import de.lmu.ifi.dbs.utilities.optionhandling.WrongParameterValueException;
import de.lmu.ifi.dbs.wrapper.StandAloneWrapper;

/**
 * Provides automatic generation of axes parallel hyperplanes
 * of arbitrary correlation dimensionalities, where the the dependent
 * and independent variables can be specified.
 *
 * @author <NAME> (<a href="mailto:<EMAIL>"><EMAIL></a>)
 */
public class AxesParallelCorrelationGenerator extends StandAloneWrapper {


  static {
    OUTPUT_D = "<filename>the file to write the generated correlation hyperplane in, " +
               "if the file already exists, the generated points will be appended to this file.";
  }

  public final static String LINE_SEPARATOR = System.getProperty("line.separator");

  /**
   * A pattern defining a comma.
   */
  public static final Pattern COMMA_SPLIT = Pattern.compile(",");

  /**
   * A pattern defining a |.
   */
  public static final Pattern VECTOR_SPLIT = Pattern.compile(":");

  /**
   * Parameter for dimensionality.
   */
  public static final String DIM_P = "dim";

  /**
   * Description for parameter dim.
   */
  public static final String DIM_D = "the dimensionality of the feature space.";

  /**
   * Parameter for correlation dimensionality.
   */
  public static final String CORRDIM_P = "corrdim";

  /**
   * Description for parameter corrdim.
   */
  public static final String CORRDIM_D = "the correlation dimensionality of the correlation hyperplane.";

  /**
   * Parameter for dep.
   */
  public static final String DEPENDENT_VALUES_P = "dep";

  /**
   * Description for parameter pref.
   */
  public static final String DEPENDENT_VALUES_D = "<p_1,...,p_d>a vector specifying " +
                                                  "the dependent and independent variables of the correlation hyperplane, " +
                                                  "where d denotes the dimensionality of the feature space. " +
                                                  "p_i = 0 specifies an independent variable, any other value of p_i " +
                                                  "specifies the value of the dependent variable. " +
                                                  "The number of zero values has to " +
                                                  "correspond with the specified correlation dimensionality. The values of the " +
                                                  "dependent variables have to correspond with the specified main and max values. " +
                                                  "If no preference vector is specified, the " +
                                                  "the first dataDim - corrDim variables are the dependent variables " +
                                                  "(the values will be randomized), " +
                                                  "the last corrDim variables are the independent variables.";

  /**
   * Parameter for number of points.
   */
  public static final String NUMBER_P = "number";

  /**
   * Description for parameter number.
   */
  public static final String NUMBER_D = "the (positive) number of points in the correlation hyperplane.";

  /**
   * Parameter for label.
   */
  public static final String LABEL_P = "label";

  /**
   * Description for parameter label.
   */
  public static final String LABEL_D = "a label specifiying the correlation hyperplane, " +
                                       "default is no label.";

  /**
   * Parameter for minimum value.
   */
  public static final String MIN_P = "minima";

  /**
   * The default value for min.
   */
  public static final double MIN_DEFAULT = 0;

  /**
   * Description for parameter min.
   */
  public static final String MIN_D = "<min_1,...,min_d>a comma separated list of the coordinates of the minimum " +
                                     "value in each dimension, default is " + MIN_DEFAULT + " in each dimension";

  /**
   * Parameter for maximum value.
   */
  public static final String MAX_P = "maxima";

  /**
   * The default value for max.
   */
  public static final double MAX_DEFAULT = 1;

  /**
   * Description for parameter max.
   */
  public static final String MAX_D = "<max_1,...,max_d>a comma separated list of the coordinates of the maximum " +
                                     "value in each dimension, default is " + MAX_DEFAULT + " in each dimension";

  /**
   * Parameter for jitter.
   */
  public static final String JITTER_P = "jitter";

  /**
   * The default value for jitter.
   */
  public static final double JITTER_DEFAULT = 0;

  /**
   * Description for parameter jitter.
{'fraction_non_alphanumeric': 0.08807511737089202, 'fraction_numerical': 0.0013145539906103286, 'mean_word_length': 2.1511834319526626, 'pattern_counts': {'":': 2, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 50, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7322524', 'n_tokens_mistral': 2771, 'n_tokens_neox': 2662, 'n_words': 931}