當前位置: 首頁>>代碼示例>>Java>>正文


Java Utils.SMALL屬性代碼示例

本文整理匯總了Java中weka.core.Utils.SMALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Utils.SMALL屬性的具體用法?Java Utils.SMALL怎麽用?Java Utils.SMALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在weka.core.Utils的用法示例。


在下文中一共展示了Utils.SMALL屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: next

/**
 * Perform another iteration.
 */
public boolean next() throws Exception {
  
  if ((!m_SuitableData) || (m_Classifiers.size() >= m_NumIterations)  ||
      (m_Diff <= Utils.SMALL)) {
    return false;
  }
  
  // Build the classifier
  m_Classifiers.add(AbstractClassifier.makeCopy(m_Classifier));
  m_Classifiers.get(m_Classifiers.size() - 1).buildClassifier(m_Data);
  
  m_Data = residualReplace(m_Data, m_Classifiers.get(m_Classifiers.size() - 1), true);
  double sum = 0;
  for (int i = 0; i < m_Data.numInstances(); i++) {
    sum += m_Data.instance(i).weight() *
      m_Data.instance(i).classValue() * m_Data.instance(i).classValue();
  }
  if (m_Debug) {
    System.err.println("Sum of squared residuals : " + sum);
  }
  m_Diff = m_SSE - sum;
  m_SSE = sum;

  return true;
}
 
開發者ID:mydzigear,項目名稱:repo.kmeanspp.silhouette_score,代碼行數:28,代碼來源:AdditiveRegression.java

示例2: main

/**
 * Tests the MarginCurve generation from the command line. The classifier is
 * currently hardcoded. Pipe in an arff file.
 * 
 * @param args currently ignored
 */
public static void main(String[] args) {

  try {
    Utils.SMALL = 0;
    Instances inst = new Instances(new java.io.InputStreamReader(System.in));
    inst.setClassIndex(inst.numAttributes() - 1);
    MarginCurve tc = new MarginCurve();
    EvaluationUtils eu = new EvaluationUtils();
    weka.classifiers.meta.LogitBoost classifier = new weka.classifiers.meta.LogitBoost();
    classifier.setNumIterations(20);
    ArrayList<Prediction> predictions = eu.getTrainTestPredictions(
      classifier, inst, inst);
    Instances result = tc.getCurve(predictions);
    System.out.println(result);
  } catch (Exception ex) {
    ex.printStackTrace();
  }
}
 
開發者ID:mydzigear,項目名稱:repo.kmeanspp.silhouette_score,代碼行數:24,代碼來源:MarginCurve.java

示例3: KernelEstimator

/**
 * Constructor that takes a precision argument.
 * 
 * @param precision the precision to which numeric values are given. For
 *          example, if the precision is stated to be 0.1, the values in the
 *          interval (0.25,0.35] are all treated as 0.3.
 */
public KernelEstimator(double precision) {

  m_Values = new double[50];
  m_Weights = new double[50];
  m_NumValues = 0;
  m_SumOfWeights = 0;
  m_AllWeightsOne = true;
  m_Precision = precision;
  // precision cannot be zero
  if (m_Precision < Utils.SMALL)
    m_Precision = Utils.SMALL;
  // m_StandardDev = 1e10 * m_Precision; // Set the standard deviation
  // initially very wide
  m_StandardDev = m_Precision / (2 * 3);
}
 
開發者ID:mydzigear,項目名稱:repo.kmeanspp.silhouette_score,代碼行數:22,代碼來源:KernelEstimator.java


注:本文中的weka.core.Utils.SMALL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。