本文整理了Java中weka.core.Utils.grOrEq()
方法的一些代码示例,展示了Utils.grOrEq()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.grOrEq()
方法的具体详情如下:
包路径:weka.core.Utils
类名称:Utils
方法名:grOrEq
[英]Tests if a is greater or equal to b.
[中]测试a是否大于或等于b。
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Returns index of bag containing maximum number of instances.
*/
public final int maxBag() {
double max;
int maxIndex;
int i;
max = 0;
maxIndex = -1;
for (i = 0; i < m_perBag.length; i++) {
if (Utils.grOrEq(m_perBag[i], max)) {
max = m_perBag[i];
maxIndex = i;
}
}
return maxIndex;
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Checks if at least two bags contain a minimum number of instances.
*/
public final boolean check(double minNoObj) {
int counter = 0;
int i;
for (i = 0; i < m_perBag.length; i++) {
if (Utils.grOrEq(m_perBag[i], minNoObj)) {
counter++;
}
}
if (counter > 1) {
return true;
} else {
return false;
}
}
代码示例来源:origin: Waikato/weka-trunk
/**
* Returns index of bag containing maximum number of instances.
*/
public final int maxBag() {
double max;
int maxIndex;
int i;
max = 0;
maxIndex = -1;
for (i = 0; i < m_perBag.length; i++) {
if (Utils.grOrEq(m_perBag[i], max)) {
max = m_perBag[i];
maxIndex = i;
}
}
return maxIndex;
}
代码示例来源:origin: Waikato/weka-trunk
/**
* Checks if at least two bags contain a minimum number of instances.
*/
public final boolean check(double minNoObj) {
int counter = 0;
int i;
for (i = 0; i < m_perBag.length; i++) {
if (Utils.grOrEq(m_perBag[i], minNoObj)) {
counter++;
}
}
if (counter > 1) {
return true;
} else {
return false;
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
boolean overErr = Utils.grOrEq(err, 0.5);
if (!checkErr) {
overErr = false;
if (Utils.grOrEq(potential, 0.0) || overErr) {
代码示例来源:origin: Waikato/weka-trunk
boolean overErr = Utils.grOrEq(err, 0.5);
if (!checkErr) {
overErr = false;
if (Utils.grOrEq(potential, 0.0) || overErr) {
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
System.out.println("5.70001 >= 5.7 ? " + Utils.grOrEq(5.70001, 5.7));
System.out.println("5.7 < 5.70001 ? " + Utils.sm(5.7, 5.70001));
System.out.println("5.7 <= 5.70001 ? " + Utils.smOrEq(5.7, 5.70001));
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Determine whether the scheme performs worse than ZeroR during testing
*
* @param classifier the pre-trained classifier
* @param evaluation the classifier evaluation object
* @param train the training data
* @param test the test data
* @return index 0 is true if the scheme performs better than ZeroR
* @throws Exception if there was a problem during the scheme's testing
*/
protected boolean[] testWRTZeroR(Classifier classifier,
Evaluation evaluation, Instances train, Instances test) throws Exception {
boolean[] result = new boolean[2];
evaluation.evaluateModel(classifier, test);
try {
// Tested OK, compare with ZeroR
Classifier zeroR = new weka.classifiers.rules.ZeroR();
zeroR.buildClassifier(train);
Evaluation zeroREval = new Evaluation(train);
zeroREval.evaluateModel(zeroR, test);
result[0] = Utils.grOrEq(zeroREval.errorRate(), evaluation.errorRate());
} catch (Exception ex) {
throw new Error("Problem determining ZeroR performance: "
+ ex.getMessage());
}
return result;
}
代码示例来源:origin: Waikato/weka-trunk
/**
* Determine whether the scheme performs worse than ZeroR during testing
*
* @param classifier the pre-trained classifier
* @param evaluation the classifier evaluation object
* @param train the training data
* @param test the test data
* @return index 0 is true if the scheme performs better than ZeroR
* @throws Exception if there was a problem during the scheme's testing
*/
protected boolean[] testWRTZeroR(Classifier classifier,
Evaluation evaluation, Instances train, Instances test) throws Exception {
boolean[] result = new boolean[2];
evaluation.evaluateModel(classifier, test);
try {
// Tested OK, compare with ZeroR
Classifier zeroR = new weka.classifiers.rules.ZeroR();
zeroR.buildClassifier(train);
Evaluation zeroREval = new Evaluation(train);
zeroREval.evaluateModel(zeroR, test);
result[0] = Utils.grOrEq(zeroREval.errorRate(), evaluation.errorRate());
} catch (Exception ex) {
throw new Error("Problem determining ZeroR performance: "
+ ex.getMessage());
}
return result;
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* Choose last index (ie. choose rule).
*/
public final int chooseLastIndex() {
int minIndex = 0;
double estimated, min = Double.MAX_VALUE;
if (!m_isLeaf) {
for (int i = 0; i < m_sons.length; i++) {
if (son(i) != null) {
if (Utils.grOrEq(localModel().distribution().perBag(i), m_minNumObj)) {
estimated = son(i).getSizeOfBranch();
if (Utils.sm(estimated, min)) {
min = estimated;
minIndex = i;
}
}
}
}
}
return minIndex;
}
代码示例来源:origin: Waikato/weka-trunk
/**
* Choose last index (ie. choose rule).
*/
public final int chooseLastIndex() {
int minIndex = 0;
double estimated, min = Double.MAX_VALUE;
if (!m_isLeaf) {
for (int i = 0; i < m_sons.length; i++) {
if (son(i) != null) {
if (Utils.grOrEq(localModel().distribution().perBag(i), m_minNumObj)) {
estimated = son(i).getSizeOfBranch();
if (Utils.sm(estimated, min)) {
min = estimated;
minIndex = i;
}
}
}
}
}
return minIndex;
}
代码示例来源:origin: Waikato/weka-trunk
if (Utils.grOrEq(newDistribution.perBag(i), m_minNoObj)) {
secondDistribution = new Distribution(newDistribution, i);
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (Utils.grOrEq(newDistribution.perBag(i), m_minNoObj)) {
secondDistribution = new Distribution(newDistribution, i);
代码示例来源:origin: Waikato/weka-trunk
if (Utils.grOrEq(epsilon, 0.5) || Utils.eq(epsilon, 0)) {
if (m_NumIterationsPerformed == 0) {
m_NumIterationsPerformed = 1; // If we're the first we have to use it
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (Utils.grOrEq(epsilon, 0.5) || Utils.eq(epsilon, 0)) {
if (m_NumIterationsPerformed == 0) {
m_NumIterationsPerformed = 1; // If we're the first we have to use it
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (Utils.grOrEq(m_distribution.perBag(0), minSplit)
&& Utils.grOrEq(m_distribution.perBag(1), minSplit)) {
currentInfoGain = infoGainCrit.splitCritValue(m_distribution,
m_sumOfWeights, defaultEnt);
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
if (Utils.grOrEq(m_distribution.perBag(0), minSplit)
&& Utils.grOrEq(m_distribution.perBag(1), minSplit)) {
currentInfoGain = m_infoGainCrit.splitCritValue(m_distribution,
m_sumOfWeights, defaultEnt);
代码示例来源:origin: Waikato/weka-trunk
if (Utils.grOrEq(m_distribution.perBag(0), minSplit)
&& Utils.grOrEq(m_distribution.perBag(1), minSplit)) {
currentInfoGain = infoGainCrit.splitCritValue(m_distribution,
m_sumOfWeights, defaultEnt);
代码示例来源:origin: Waikato/weka-trunk
if (Utils.grOrEq(m_distribution.perBag(0), minSplit)
&& Utils.grOrEq(m_distribution.perBag(1), minSplit)) {
currentInfoGain = m_infoGainCrit.splitCritValue(m_distribution,
m_sumOfWeights, defaultEnt);
代码示例来源:origin: com.entopix/maui
if (Utils.grOrEq(vals[i], 1.0)) {
currentInstance.setValue(probsAttIndex + 1, Integer.MAX_VALUE);
continue;
内容来源于网络,如有侵权,请联系作者删除!