本文整理汇总了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;
}
示例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();
}
}
示例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);
}