weka.classifiers.rules.ZeroR类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中weka.classifiers.rules.ZeroR类的一些代码示例,展示了ZeroR类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZeroR类的具体详情如下:
包路径:weka.classifiers.rules.ZeroR
类名称:ZeroR

ZeroR介绍

[英]Class for building and using a 0-R classifier. Predicts the mean (for a numeric class) or the mode (for a nominal class).

Valid options are:

-D 
If set, classifier is run in debug mode and 
may output additional info to the console

[中]类,用于构建和使用0-R分类器。预测平均值(对于数值类)或模式(对于标称类)。
有效选项包括:

-D 
If set, classifier is run in debug mode and 
may output additional info to the console

代码示例

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

protected void resetOptions() {
 m_trainInstances = null;
 m_Evaluation = null;
 m_BaseClassifier = new ZeroR();
 m_folds = 5;
 m_seed = 1;
 m_threshold = 0.01;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Computes class distribution of an instance using the tree.
 * 
 * @param instance the instance to compute the distribution for
 * @return the computed class probabilities
 * @throws Exception if computation fails
 */
@Override
public double[] distributionForInstance(Instance instance) throws Exception {
 if (m_zeroR != null) {
  return m_zeroR.distributionForInstance(instance);
 } else {
  return m_Tree.distributionForInstance(instance);
 }
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
  * Main method for testing this class.
  * 
  * @param argv the options
  */
 public static void main(String[] argv) {
  runClassifier(new ZeroR(), argv);
 }
}

代码示例来源:origin: Waikato/wekaDeeplearning4j

zeroR = new ZeroR();
zeroR.buildClassifier(data);
return;

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Outputs the decision tree.
 * 
 * @return a string representation of the classifier
 */
@Override
public String toString() {
 if (m_zeroR != null) {
  return "No attributes other than class. Using ZeroR.\n\n"
   + m_zeroR.toString();
 }
 if ((m_Tree == null)) {
  return "REPTree: No model built yet.";
 }
 return "\nREPTree\n============\n" + m_Tree.toString(0, null) + "\n"
  + "\nSize of the tree : " + numNodes();
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

public void buildClassifier(Instances instances) throws Exception {
 getCapabilities().testWithFail(instances);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

result.append(((ZeroR) m_ZeroR).toSource(className));
} else {
 result.append("class " + className + " {\n");

代码示例来源:origin: Waikato/wekaDeeplearning4j

zeroR = new ZeroR();
zeroR.buildClassifier(data);
return;

代码示例来源:origin: Waikato/weka-trunk

/**
 * Outputs the decision tree.
 * 
 * @return a string representation of the classifier
 */
@Override
public String toString() {
 if (m_zeroR != null) {
  return "No attributes other than class. Using ZeroR.\n\n"
   + m_zeroR.toString();
 }
 if ((m_Tree == null)) {
  return "REPTree: No model built yet.";
 }
 return "\nREPTree\n============\n" + m_Tree.toString(0, null) + "\n"
  + "\nSize of the tree : " + numNodes();
}

代码示例来源:origin: Waikato/weka-trunk

public void buildClassifier(Instances instances) throws Exception {
 getCapabilities().testWithFail(instances);

代码示例来源:origin: Waikato/weka-trunk

result.append(((ZeroR) m_ZeroR).toSource(className));
} else {
 result.append("class " + className + " {\n");

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Default constructor.
 */
public CostSensitiveClassifier() {
 m_Classifier = new weka.classifiers.rules.ZeroR();
}

代码示例来源:origin: Waikato/wekaDeeplearning4j

int numSamples = data.numInstances();
if (numSamples == 0 || data.numAttributes() < 2) {
 zeroR = new ZeroR();
 zeroR.buildClassifier(data);
 return null;

代码示例来源:origin: Waikato/weka-trunk

/**
  * Main method for testing this class.
  * 
  * @param argv the options
  */
 public static void main(String[] argv) {
  runClassifier(new ZeroR(), argv);
 }
}

代码示例来源:origin: Waikato/weka-trunk

/**
 * Computes class distribution of an instance using the tree.
 * 
 * @param instance the instance to compute the distribution for
 * @return the computed class probabilities
 * @throws Exception if computation fails
 */
@Override
public double[] distributionForInstance(Instance instance) throws Exception {
 if (m_zeroR != null) {
  return m_zeroR.distributionForInstance(instance);
 } else {
  return m_Tree.distributionForInstance(instance);
 }
}

代码示例来源:origin: Waikato/weka-trunk

protected void resetOptions() {
 m_trainInstances = null;
 m_Evaluation = null;
 m_BaseClassifier = new ZeroR();
 m_folds = 5;
 m_seed = 1;
 m_threshold = 0.01;
}

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_defaultModel = new ZeroR();
m_defaultModel.buildClassifier(instances);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

return m_defaultModel.distributionForInstance(instance);

代码示例来源:origin: Waikato/weka-trunk

/**
 * Default constructor.
 */
public CostSensitiveClassifier() {
 m_Classifier = new weka.classifiers.rules.ZeroR();
}

代码示例来源:origin: Waikato/weka-trunk

m_defaultModel = new ZeroR();
m_defaultModel.buildClassifier(instances);

相关文章