Java 类weka.core.AdditionalMeasureProducer 实例源码

项目:repo.kmeanspp.silhouette_score    文件:AttributeSelectedClassifier.java   
/**
  * Returns the value of the named measure
  * @param additionalMeasureName the name of the measure to query for its value
  * @return the value of the named measure
  * @throws IllegalArgumentException if the named measure is not supported
  */
 public double getMeasure(String additionalMeasureName) {
   if (additionalMeasureName.compareToIgnoreCase("measureNumAttributesSelected") == 0) {
     return measureNumAttributesSelected();
   } else if (additionalMeasureName.compareToIgnoreCase("measureSelectionTime") == 0) {
     return measureSelectionTime();
   } else if (additionalMeasureName.compareToIgnoreCase("measureTime") == 0) {
     return measureTime();
   } else if (m_Classifier instanceof AdditionalMeasureProducer) {
     return ((AdditionalMeasureProducer)m_Classifier).
getMeasure(additionalMeasureName);
   } else {
     throw new IllegalArgumentException(additionalMeasureName 
          + " not supported (AttributeSelectedClassifier)");
   }
 }
项目:repo.kmeanspp.silhouette_score    文件:ClassifierSplitEvaluator.java   
/**
 * Returns the value of the named measure
 *
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Template instanceof AdditionalMeasureProducer) {
    if (m_Classifier == null) {
      throw new IllegalArgumentException("ClassifierSplitEvaluator: "
        + "Can't return result for measure, "
        + "classifier has not been built yet.");
    }
    return ((AdditionalMeasureProducer) m_Classifier)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ClassifierSplitEvaluator: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_Template.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:RegressionSplitEvaluator.java   
/**
 * Set a list of method names for additional measures to look for in
 * Classifiers. This could contain many measures (of which only a subset may
 * be produceable by the current Classifier) if an experiment is the type that
 * iterates over a set of properties.
 *
 * @param additionalMeasures an array of method names.
 */
@Override
public void setAdditionalMeasures(String[] additionalMeasures) {
  m_AdditionalMeasures = additionalMeasures;

  // determine which (if any) of the additional measures this classifier
  // can produce
  if (m_AdditionalMeasures != null && m_AdditionalMeasures.length > 0) {
    m_doesProduce = new boolean[m_AdditionalMeasures.length];

    if (m_Template instanceof AdditionalMeasureProducer) {
      Enumeration<String> en = ((AdditionalMeasureProducer) m_Template)
        .enumerateMeasures();
      while (en.hasMoreElements()) {
        String mname = en.nextElement();
        for (int j = 0; j < m_AdditionalMeasures.length; j++) {
          if (mname.compareToIgnoreCase(m_AdditionalMeasures[j]) == 0) {
            m_doesProduce[j] = true;
          }
        }
      }
    }
  } else {
    m_doesProduce = null;
  }
}
项目:repo.kmeanspp.silhouette_score    文件:RegressionSplitEvaluator.java   
/**
 * Returns the value of the named measure
 *
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Template instanceof AdditionalMeasureProducer) {
    if (m_Classifier == null) {
      throw new IllegalArgumentException("ClassifierSplitEvaluator: "
        + "Can't return result for measure, "
        + "classifier has not been built yet.");
    }
    return ((AdditionalMeasureProducer) m_Classifier)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ClassifierSplitEvaluator: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_Template.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:autoweka    文件:AttributeSelectedClassifier.java   
/**
  * Returns an enumeration of the additional measure names
  * @return an enumeration of the measure names
  */
 public Enumeration enumerateMeasures() {
   Vector newVector = new Vector(3);
   newVector.addElement("measureNumAttributesSelected");
   newVector.addElement("measureSelectionTime");
   newVector.addElement("measureTime");
   if (m_Classifier instanceof AdditionalMeasureProducer) {
     Enumeration en = ((AdditionalMeasureProducer)m_Classifier).
enumerateMeasures();
     while (en.hasMoreElements()) {
String mname = (String)en.nextElement();
newVector.addElement(mname);
     }
   }
   return newVector.elements();
 }
项目:autoweka    文件:AttributeSelectedClassifier.java   
/**
  * Returns the value of the named measure
  * @param additionalMeasureName the name of the measure to query for its value
  * @return the value of the named measure
  * @throws IllegalArgumentException if the named measure is not supported
  */
 public double getMeasure(String additionalMeasureName) {
   if (additionalMeasureName.compareToIgnoreCase("measureNumAttributesSelected") == 0) {
     return measureNumAttributesSelected();
   } else if (additionalMeasureName.compareToIgnoreCase("measureSelectionTime") == 0) {
     return measureSelectionTime();
   } else if (additionalMeasureName.compareToIgnoreCase("measureTime") == 0) {
     return measureTime();
   } else if (m_Classifier instanceof AdditionalMeasureProducer) {
     return ((AdditionalMeasureProducer)m_Classifier).
getMeasure(additionalMeasureName);
   } else {
     throw new IllegalArgumentException(additionalMeasureName 
          + " not supported (AttributeSelectedClassifier)");
   }
 }
项目:autoweka    文件:ClassifierSplitEvaluator.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Template instanceof AdditionalMeasureProducer) {
    if (m_Classifier == null) {
      throw new IllegalArgumentException("ClassifierSplitEvaluator: "
          + "Can't return result for measure, "
          + "classifier has not been built yet.");
    }
    return ((AdditionalMeasureProducer) m_Classifier)
        .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ClassifierSplitEvaluator: "
        + "Can't return value for : " + additionalMeasureName + ". "
        + m_Template.getClass().getName() + " "
        + "is not an AdditionalMeasureProducer");
  }
}
项目:autoweka    文件:DensityBasedClustererSplitEvaluator.java   
/**
  * Set a list of method names for additional measures to look for
  * in Classifiers. This could contain many measures (of which only a
  * subset may be produceable by the current Classifier) if an experiment
  * is the type that iterates over a set of properties.
  * @param additionalMeasures a list of method names
  */
 public void setAdditionalMeasures(String [] additionalMeasures) {
   // System.err.println("ClassifierSplitEvaluator: setting additional measures");
   m_additionalMeasures = additionalMeasures;

   // determine which (if any) of the additional measures this clusterer
   // can produce
   if (m_additionalMeasures != null && m_additionalMeasures.length > 0) {
     m_doesProduce = new boolean [m_additionalMeasures.length];

     if (m_clusterer instanceof AdditionalMeasureProducer) {
Enumeration en = ((AdditionalMeasureProducer)m_clusterer).
  enumerateMeasures();
while (en.hasMoreElements()) {
  String mname = (String)en.nextElement();
  for (int j=0;j<m_additionalMeasures.length;j++) {
    if (mname.compareToIgnoreCase(m_additionalMeasures[j]) == 0) {
      m_doesProduce[j] = true;
    }
  }
}
     }
   } else {
     m_doesProduce = null;
   }
 }
项目:autoweka    文件:RegressionSplitEvaluator.java   
/**
  * Set a list of method names for additional measures to look for
  * in Classifiers. This could contain many measures (of which only a
  * subset may be produceable by the current Classifier) if an experiment
  * is the type that iterates over a set of properties.
  * @param additionalMeasures an array of method names.
  */
 public void setAdditionalMeasures(String [] additionalMeasures) {
   m_AdditionalMeasures = additionalMeasures;

   // determine which (if any) of the additional measures this classifier
   // can produce
   if (m_AdditionalMeasures != null && m_AdditionalMeasures.length > 0) {
     m_doesProduce = new boolean [m_AdditionalMeasures.length];

     if (m_Template instanceof AdditionalMeasureProducer) {
Enumeration en = ((AdditionalMeasureProducer)m_Template).
  enumerateMeasures();
while (en.hasMoreElements()) {
  String mname = (String)en.nextElement();
  for (int j=0;j<m_AdditionalMeasures.length;j++) {
    if (mname.compareToIgnoreCase(m_AdditionalMeasures[j]) == 0) {
      m_doesProduce[j] = true;
    }
  }
}
     }
   } else {
     m_doesProduce = null;
   }
 }
项目:autoweka    文件:RegressionSplitEvaluator.java   
/**
  * Returns the value of the named measure
  * @param additionalMeasureName the name of the measure to query for its value
  * @return the value of the named measure
  * @throws IllegalArgumentException if the named measure is not supported
  */
 public double getMeasure(String additionalMeasureName) {
   if (m_Template instanceof AdditionalMeasureProducer) {
     if (m_Classifier == null) {
throw new IllegalArgumentException("ClassifierSplitEvaluator: " +
                   "Can't return result for measure, " +
                   "classifier has not been built yet.");
     }
     return ((AdditionalMeasureProducer)m_Classifier).
getMeasure(additionalMeasureName);
   } else {
     throw new IllegalArgumentException("ClassifierSplitEvaluator: "
          +"Can't return value for : "+additionalMeasureName
          +". "+m_Template.getClass().getName()+" "
          +"is not an AdditionalMeasureProducer");
   }
 }
项目:umple    文件:AttributeSelectedClassifier.java   
/**
  * Returns the value of the named measure
  * @param additionalMeasureName the name of the measure to query for its value
  * @return the value of the named measure
  * @throws IllegalArgumentException if the named measure is not supported
  */
 public double getMeasure(String additionalMeasureName) {
   if (additionalMeasureName.compareToIgnoreCase("measureNumAttributesSelected") == 0) {
     return measureNumAttributesSelected();
   } else if (additionalMeasureName.compareToIgnoreCase("measureSelectionTime") == 0) {
     return measureSelectionTime();
   } else if (additionalMeasureName.compareToIgnoreCase("measureTime") == 0) {
     return measureTime();
   } else if (m_Classifier instanceof AdditionalMeasureProducer) {
     return ((AdditionalMeasureProducer)m_Classifier).
getMeasure(additionalMeasureName);
   } else {
     throw new IllegalArgumentException(additionalMeasureName 
          + " not supported (AttributeSelectedClassifier)");
   }
 }
项目:umple    文件:ClassifierSplitEvaluator.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Template instanceof AdditionalMeasureProducer) {
    if (m_Classifier == null) {
      throw new IllegalArgumentException("ClassifierSplitEvaluator: "
        + "Can't return result for measure, "
        + "classifier has not been built yet.");
    }
    return ((AdditionalMeasureProducer) m_Classifier)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ClassifierSplitEvaluator: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_Template.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:umple    文件:RegressionSplitEvaluator.java   
/**
 * Set a list of method names for additional measures to look for in
 * Classifiers. This could contain many measures (of which only a subset may
 * be produceable by the current Classifier) if an experiment is the type that
 * iterates over a set of properties.
 * 
 * @param additionalMeasures an array of method names.
 */
@Override
public void setAdditionalMeasures(String[] additionalMeasures) {
  m_AdditionalMeasures = additionalMeasures;

  // determine which (if any) of the additional measures this classifier
  // can produce
  if (m_AdditionalMeasures != null && m_AdditionalMeasures.length > 0) {
    m_doesProduce = new boolean[m_AdditionalMeasures.length];

    if (m_Template instanceof AdditionalMeasureProducer) {
      Enumeration<String> en = ((AdditionalMeasureProducer) m_Template)
        .enumerateMeasures();
      while (en.hasMoreElements()) {
        String mname = en.nextElement();
        for (int j = 0; j < m_AdditionalMeasures.length; j++) {
          if (mname.compareToIgnoreCase(m_AdditionalMeasures[j]) == 0) {
            m_doesProduce[j] = true;
          }
        }
      }
    }
  } else {
    m_doesProduce = null;
  }
}
项目:umple    文件:RegressionSplitEvaluator.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Template instanceof AdditionalMeasureProducer) {
    if (m_Classifier == null) {
      throw new IllegalArgumentException("ClassifierSplitEvaluator: "
        + "Can't return result for measure, "
        + "classifier has not been built yet.");
    }
    return ((AdditionalMeasureProducer) m_Classifier)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ClassifierSplitEvaluator: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_Template.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:jbossBA    文件:AttributeSelectedClassifier.java   
/**
  * Returns an enumeration of the additional measure names
  * @return an enumeration of the measure names
  */
 public Enumeration enumerateMeasures() {
   Vector newVector = new Vector(3);
   newVector.addElement("measureNumAttributesSelected");
   newVector.addElement("measureSelectionTime");
   newVector.addElement("measureTime");
   if (m_Classifier instanceof AdditionalMeasureProducer) {
     Enumeration en = ((AdditionalMeasureProducer)m_Classifier).
enumerateMeasures();
     while (en.hasMoreElements()) {
String mname = (String)en.nextElement();
newVector.addElement(mname);
     }
   }
   return newVector.elements();
 }
项目:jbossBA    文件:AttributeSelectedClassifier.java   
/**
  * Returns the value of the named measure
  * @param additionalMeasureName the name of the measure to query for its value
  * @return the value of the named measure
  * @throws IllegalArgumentException if the named measure is not supported
  */
 public double getMeasure(String additionalMeasureName) {
   if (additionalMeasureName.compareToIgnoreCase("measureNumAttributesSelected") == 0) {
     return measureNumAttributesSelected();
   } else if (additionalMeasureName.compareToIgnoreCase("measureSelectionTime") == 0) {
     return measureSelectionTime();
   } else if (additionalMeasureName.compareToIgnoreCase("measureTime") == 0) {
     return measureTime();
   } else if (m_Classifier instanceof AdditionalMeasureProducer) {
     return ((AdditionalMeasureProducer)m_Classifier).
getMeasure(additionalMeasureName);
   } else {
     throw new IllegalArgumentException(additionalMeasureName 
          + " not supported (AttributeSelectedClassifier)");
   }
 }
项目:jbossBA    文件:ClassifierSplitEvaluator.java   
/**
  * Set a list of method names for additional measures to look for
  * in Classifiers. This could contain many measures (of which only a
  * subset may be produceable by the current Classifier) if an experiment
  * is the type that iterates over a set of properties.
  * @param additionalMeasures a list of method names
  */
 public void setAdditionalMeasures(String [] additionalMeasures) {
   // System.err.println("ClassifierSplitEvaluator: setting additional measures");
   m_AdditionalMeasures = additionalMeasures;

   // determine which (if any) of the additional measures this classifier
   // can produce
   if (m_AdditionalMeasures != null && m_AdditionalMeasures.length > 0) {
     m_doesProduce = new boolean [m_AdditionalMeasures.length];

     if (m_Template instanceof AdditionalMeasureProducer) {
Enumeration en = ((AdditionalMeasureProducer)m_Template).
  enumerateMeasures();
while (en.hasMoreElements()) {
  String mname = (String)en.nextElement();
  for (int j=0;j<m_AdditionalMeasures.length;j++) {
    if (mname.compareToIgnoreCase(m_AdditionalMeasures[j]) == 0) {
      m_doesProduce[j] = true;
    }
  }
}
     }
   } else {
     m_doesProduce = null;
   }
 }
项目:jbossBA    文件:ClassifierSplitEvaluator.java   
/**
  * Returns the value of the named measure
  * @param additionalMeasureName the name of the measure to query for its value
  * @return the value of the named measure
  * @throws IllegalArgumentException if the named measure is not supported
  */
 public double getMeasure(String additionalMeasureName) {
   if (m_Template instanceof AdditionalMeasureProducer) {
     if (m_Classifier == null) {
throw new IllegalArgumentException("ClassifierSplitEvaluator: " +
                   "Can't return result for measure, " +
                   "classifier has not been built yet.");
     }
     return ((AdditionalMeasureProducer)m_Classifier).
getMeasure(additionalMeasureName);
   } else {
     throw new IllegalArgumentException("ClassifierSplitEvaluator: "
          +"Can't return value for : "+additionalMeasureName
          +". "+m_Template.getClass().getName()+" "
          +"is not an AdditionalMeasureProducer");
   }
 }
项目:jbossBA    文件:DensityBasedClustererSplitEvaluator.java   
/**
  * Set a list of method names for additional measures to look for
  * in Classifiers. This could contain many measures (of which only a
  * subset may be produceable by the current Classifier) if an experiment
  * is the type that iterates over a set of properties.
  * @param additionalMeasures a list of method names
  */
 public void setAdditionalMeasures(String [] additionalMeasures) {
   // System.err.println("ClassifierSplitEvaluator: setting additional measures");
   m_additionalMeasures = additionalMeasures;

   // determine which (if any) of the additional measures this clusterer
   // can produce
   if (m_additionalMeasures != null && m_additionalMeasures.length > 0) {
     m_doesProduce = new boolean [m_additionalMeasures.length];

     if (m_clusterer instanceof AdditionalMeasureProducer) {
Enumeration en = ((AdditionalMeasureProducer)m_clusterer).
  enumerateMeasures();
while (en.hasMoreElements()) {
  String mname = (String)en.nextElement();
  for (int j=0;j<m_additionalMeasures.length;j++) {
    if (mname.compareToIgnoreCase(m_additionalMeasures[j]) == 0) {
      m_doesProduce[j] = true;
    }
  }
}
     }
   } else {
     m_doesProduce = null;
   }
 }
项目:jbossBA    文件:RegressionSplitEvaluator.java   
/**
 * Set a list of method names for additional measures to look for in
 * Classifiers. This could contain many measures (of which only a subset may
 * be produceable by the current Classifier) if an experiment is the type that
 * iterates over a set of properties.
 * 
 * @param additionalMeasures an array of method names.
 */
@Override
public void setAdditionalMeasures(String[] additionalMeasures) {
  m_AdditionalMeasures = additionalMeasures;

  // determine which (if any) of the additional measures this classifier
  // can produce
  if (m_AdditionalMeasures != null && m_AdditionalMeasures.length > 0) {
    m_doesProduce = new boolean[m_AdditionalMeasures.length];

    if (m_Template instanceof AdditionalMeasureProducer) {
      Enumeration en = ((AdditionalMeasureProducer) m_Template)
        .enumerateMeasures();
      while (en.hasMoreElements()) {
        String mname = (String) en.nextElement();
        for (int j = 0; j < m_AdditionalMeasures.length; j++) {
          if (mname.compareToIgnoreCase(m_AdditionalMeasures[j]) == 0) {
            m_doesProduce[j] = true;
          }
        }
      }
    }
  } else {
    m_doesProduce = null;
  }
}
项目:jbossBA    文件:RegressionSplitEvaluator.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Template instanceof AdditionalMeasureProducer) {
    if (m_Classifier == null) {
      throw new IllegalArgumentException("ClassifierSplitEvaluator: "
        + "Can't return result for measure, "
        + "classifier has not been built yet.");
    }
    return ((AdditionalMeasureProducer) m_Classifier)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ClassifierSplitEvaluator: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_Template.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:AttributeSelectedClassifier.java   
/**
  * Returns an enumeration of the additional measure names
  * @return an enumeration of the measure names
  */
 public Enumeration<String> enumerateMeasures() {
   Vector<String> newVector = new Vector<String>(3);
   newVector.addElement("measureNumAttributesSelected");
   newVector.addElement("measureSelectionTime");
   newVector.addElement("measureTime");
   if (m_Classifier instanceof AdditionalMeasureProducer) {
     newVector.addAll(Collections.list(((AdditionalMeasureProducer)m_Classifier).
enumerateMeasures()));
   }
   return newVector.elements();
 }
项目:repo.kmeanspp.silhouette_score    文件:InputMappedClassifier.java   
/**
 * Returns an enumeration of the additional measure names
 * 
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();

  if (m_Classifier instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_Classifier)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.addElement(mname);
    }
  }
  return newVector.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:InputMappedClassifier.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_Classifier instanceof AdditionalMeasureProducer) {
    return ((AdditionalMeasureProducer) m_Classifier)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException(additionalMeasureName
      + " not supported (InputMappedClassifier)");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:LearningRateResultProducer.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * result producer
 * 
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();
  if (m_ResultProducer instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_ResultProducer)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.add(mname);
    }
  }
  return newVector.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:LearningRateResultProducer.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_ResultProducer instanceof AdditionalMeasureProducer) {
    return ((AdditionalMeasureProducer) m_ResultProducer)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("LearningRateResultProducer: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_ResultProducer.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:DatabaseResultProducer.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * result producer
 * 
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();
  if (m_ResultProducer instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_ResultProducer)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.addElement(mname);
    }
  }
  return newVector.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:DatabaseResultProducer.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_ResultProducer instanceof AdditionalMeasureProducer) {
    return ((AdditionalMeasureProducer) m_ResultProducer)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("DatabaseResultProducer: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_ResultProducer.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:ClassifierSplitEvaluator.java   
/**
 * Set a list of method names for additional measures to look for in
 * Classifiers. This could contain many measures (of which only a subset may
 * be produceable by the current Classifier) if an experiment is the type that
 * iterates over a set of properties.
 *
 * @param additionalMeasures a list of method names
 */
@Override
public void setAdditionalMeasures(String[] additionalMeasures) {
  // System.err.println("ClassifierSplitEvaluator: setting additional measures");
  m_AdditionalMeasures = additionalMeasures;

  // determine which (if any) of the additional measures this classifier
  // can produce
  if (m_AdditionalMeasures != null && m_AdditionalMeasures.length > 0) {
    m_doesProduce = new boolean[m_AdditionalMeasures.length];

    if (m_Template instanceof AdditionalMeasureProducer) {
      Enumeration<String> en = ((AdditionalMeasureProducer) m_Template)
        .enumerateMeasures();
      while (en.hasMoreElements()) {
        String mname = en.nextElement();
        for (int j = 0; j < m_AdditionalMeasures.length; j++) {
          if (mname.compareToIgnoreCase(m_AdditionalMeasures[j]) == 0) {
            m_doesProduce[j] = true;
          }
        }
      }
    }
  } else {
    m_doesProduce = null;
  }
}
项目:repo.kmeanspp.silhouette_score    文件:ClassifierSplitEvaluator.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * classifier
 *
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();
  if (m_Template instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_Template)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.add(mname);
    }
  }
  return newVector.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:ClassifierSplitEvaluator.java   
/**
 * Gets the raw output from the classifier
 *
 * @return the raw output from th,0e classifier
 */
@Override
public String getRawResultOutput() {
  StringBuffer result = new StringBuffer();

  if (m_Classifier == null) {
    return "<null> classifier";
  }
  result.append(toString());
  result.append("Classifier model: \n" + m_Classifier.toString() + '\n');

  // append the performance statistics
  if (m_result != null) {
    result.append(m_result);

    if (m_doesProduce != null) {
      for (int i = 0; i < m_doesProduce.length; i++) {
        if (m_doesProduce[i]) {
          try {
            double dv = ((AdditionalMeasureProducer) m_Classifier)
              .getMeasure(m_AdditionalMeasures[i]);
            if (!Utils.isMissingValue(dv)) {
              Double value = new Double(dv);
              result.append(m_AdditionalMeasures[i] + " : " + value + '\n');
            } else {
              result.append(m_AdditionalMeasures[i] + " : " + '?' + '\n');
            }
          } catch (Exception ex) {
            System.err.println(ex);
          }
        }
      }
    }
  }
  return result.toString();
}
项目:repo.kmeanspp.silhouette_score    文件:DensityBasedClustererSplitEvaluator.java   
/**
 * Set a list of method names for additional measures to look for in
 * Classifiers. This could contain many measures (of which only a subset may
 * be produceable by the current Classifier) if an experiment is the type that
 * iterates over a set of properties.
 *
 * @param additionalMeasures a list of method names
 */
@Override
public void setAdditionalMeasures(String[] additionalMeasures) {
  // System.err.println("ClassifierSplitEvaluator: setting additional measures");
  m_additionalMeasures = additionalMeasures;

  // determine which (if any) of the additional measures this clusterer
  // can produce
  if (m_additionalMeasures != null && m_additionalMeasures.length > 0) {
    m_doesProduce = new boolean[m_additionalMeasures.length];

    if (m_clusterer instanceof AdditionalMeasureProducer) {
      Enumeration<String> en = ((AdditionalMeasureProducer) m_clusterer)
        .enumerateMeasures();
      while (en.hasMoreElements()) {
        String mname = en.nextElement();
        for (int j = 0; j < m_additionalMeasures.length; j++) {
          if (mname.compareToIgnoreCase(m_additionalMeasures[j]) == 0) {
            m_doesProduce[j] = true;
          }
        }
      }
    }
  } else {
    m_doesProduce = null;
  }
}
项目:repo.kmeanspp.silhouette_score    文件:DensityBasedClustererSplitEvaluator.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * classifier
 *
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();
  if (m_clusterer instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_clusterer)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.addElement(mname);
    }
  }
  return newVector.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:DensityBasedClustererSplitEvaluator.java   
/**
 * Returns the value of the named measure
 *
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @exception IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_clusterer instanceof AdditionalMeasureProducer) {
    return ((AdditionalMeasureProducer) m_clusterer)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException(
      "DensityBasedClustererSplitEvaluator: " + "Can't return value for : "
        + additionalMeasureName + ". " + m_clusterer.getClass().getName()
        + " " + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:DensityBasedClustererSplitEvaluator.java   
/**
 * Gets the raw output from the classifier
 *
 * @return the raw output from the classifier
 */
@Override
public String getRawResultOutput() {
  StringBuffer result = new StringBuffer();

  if (m_clusterer == null) {
    return "<null> clusterer";
  }
  result.append(toString());
  result.append("Clustering model: \n" + m_clusterer.toString() + '\n');

  // append the performance statistics
  if (m_result != null) {
    // result.append(m_result);

    if (m_doesProduce != null) {
      for (int i = 0; i < m_doesProduce.length; i++) {
        if (m_doesProduce[i]) {
          try {
            double dv = ((AdditionalMeasureProducer) m_clusterer)
              .getMeasure(m_additionalMeasures[i]);
            Double value = new Double(dv);

            result.append(m_additionalMeasures[i] + " : " + value + '\n');
          } catch (Exception ex) {
            System.err.println(ex);
          }
        }
      }
    }
  }
  return result.toString();
}
项目:repo.kmeanspp.silhouette_score    文件:CrossValidationResultProducer.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * SplitEvaluator
 * 
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();
  if (m_SplitEvaluator instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_SplitEvaluator)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.addElement(mname);
    }
  }
  return newVector.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:CrossValidationResultProducer.java   
/**
 * Returns the value of the named measure
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_SplitEvaluator instanceof AdditionalMeasureProducer) {
    return ((AdditionalMeasureProducer) m_SplitEvaluator)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("CrossValidationResultProducer: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_SplitEvaluator.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:ExplicitTestsetResultProducer.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * SplitEvaluator.
 * 
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> result = new Vector<String>();
  if (m_SplitEvaluator instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_SplitEvaluator)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      result.add(mname);
    }
  }
  return result.elements();
}
项目:repo.kmeanspp.silhouette_score    文件:ExplicitTestsetResultProducer.java   
/**
 * Returns the value of the named measure.
 * 
 * @param additionalMeasureName the name of the measure to query for its value
 * @return the value of the named measure
 * @throws IllegalArgumentException if the named measure is not supported
 */
@Override
public double getMeasure(String additionalMeasureName) {
  if (m_SplitEvaluator instanceof AdditionalMeasureProducer) {
    return ((AdditionalMeasureProducer) m_SplitEvaluator)
      .getMeasure(additionalMeasureName);
  } else {
    throw new IllegalArgumentException("ExplicitTestsetResultProducer: "
      + "Can't return value for : " + additionalMeasureName + ". "
      + m_SplitEvaluator.getClass().getName() + " "
      + "is not an AdditionalMeasureProducer");
  }
}
项目:repo.kmeanspp.silhouette_score    文件:RandomSplitResultProducer.java   
/**
 * Returns an enumeration of any additional measure names that might be in the
 * SplitEvaluator
 * 
 * @return an enumeration of the measure names
 */
@Override
public Enumeration<String> enumerateMeasures() {
  Vector<String> newVector = new Vector<String>();
  if (m_SplitEvaluator instanceof AdditionalMeasureProducer) {
    Enumeration<String> en = ((AdditionalMeasureProducer) m_SplitEvaluator)
      .enumerateMeasures();
    while (en.hasMoreElements()) {
      String mname = en.nextElement();
      newVector.add(mname);
    }
  }
  return newVector.elements();
}