Package org.apache.mahout.ga.watchmaker.cd.tool.DescriptionUtils

Examples of org.apache.mahout.ga.watchmaker.cd.tool.DescriptionUtils.Range


  }
 
  public void testExtractNumericalRange() {
    String description = "-2.06,12.32";
   
    Range range = DescriptionUtils.extractNumericalRange(description);
   
    assertEquals(-2.06, range.min);
    assertEquals(12.32, range.max);
  }
View Full Code Here


        if (descriptors.isNumerical(index)) {
          // numerical attribute
          double min = (Double) descriptions[index][0];
          double max = (Double) descriptions[index][1];
          Range range = DescriptionUtils.extractNumericalRange(description);

          assertTrue("bad min value for attribute (" + index + ')',
                  min <= range.min);
          assertTrue("bad max value for attribute (" + index + ')',
                  max >= range.max);
View Full Code Here

  static String numericDescription(Iterator<Text> values) {
    double min = Double.POSITIVE_INFINITY;
    double max = Double.NEGATIVE_INFINITY;
   
    while (values.hasNext()) {
      Range range = DescriptionUtils.extractNumericalRange(values.next().toString());
      min = Math.min(min, range.min);
      max = Math.max(max, range.max);
    }
   
    return DescriptionUtils.createNumericalDescription(min, max);
View Full Code Here

  }
 
  public void testExtractNumericalRange() {
    String description = "-2.06,12.32";
   
    Range range = DescriptionUtils.extractNumericalRange(description);
   
    assertEquals(-2.06, range.min);
    assertEquals(12.32, range.max);
  }
View Full Code Here

      if (descriptors.isNumerical(index)) {
        // numerical attribute
        double min = (Double) descriptions[index][0];
        double max = (Double) descriptions[index][1];
        Range range = DescriptionUtils.extractNumericalRange(description);

        assertTrue("bad min value for attribute (" + index + ")",
            min <= range.min);
        assertTrue("bad max value for attribute (" + index + ")",
            max >= range.max);
View Full Code Here

  static String numericDescription(Iterator<Text> values) {
    double min = Double.POSITIVE_INFINITY;
    double max = Double.NEGATIVE_INFINITY;

    while (values.hasNext()) {
      Range range = DescriptionUtils.extractNumericalRange(values.next().toString());
      min = Math.min(min, range.min);
      max = Math.max(max, range.max);
    }

    return DescriptionUtils.createNumericalDescription(min, max);
View Full Code Here

        if (descriptors.isNumerical(index)) {
          // numerical attribute
          double min = (Double) descriptions[index][0];
          double max = (Double) descriptions[index][1];
          Range range = DescriptionUtils.extractNumericalRange(description);

          assertTrue("bad min value for attribute (" + index + ')',
                  min <= range.min);
          assertTrue("bad max value for attribute (" + index + ')',
                  max >= range.max);
View Full Code Here

  static String numericDescription(Iterator<Text> values) {
    double min = Double.POSITIVE_INFINITY;
    double max = Double.NEGATIVE_INFINITY;

    while (values.hasNext()) {
      Range range = DescriptionUtils.extractNumericalRange(values.next().toString());
      min = Math.min(min, range.min);
      max = Math.max(max, range.max);
    }

    return DescriptionUtils.createNumericalDescription(min, max);
View Full Code Here

TOP

Related Classes of org.apache.mahout.ga.watchmaker.cd.tool.DescriptionUtils.Range

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.