Examples of distributionForInstance()


Examples of weka.classifiers.Classifier.distributionForInstance()

      for(int i=0;i<base.numAttributes();i++)
      {
        sample.setValue(i, ((double)c[i]));
      }
     
      double []w=cModel.distributionForInstance(sample);
      for(int j=0;j<target.getSenses().size();j++)
      {
        ArrayList<String> dwords=new ArrayList<String>(window.size());
        for(AmbiguousWord word:window)
        {
View Full Code Here

Examples of weka.classifiers.Classifier.distributionForInstance()

    for (int k = 0; k < m_Classifiers.length; k++) {
      Classifier classifier = getClassifier(k);
      if (m_BaseFormat.classAttribute().isNumeric()) {
  values[i++] = classifier.classifyInstance(instance);
      } else {
  double[] dist = classifier.distributionForInstance(instance);
  for (int j = 0; j < dist.length; j++) {
    values[i++] = dist[j];
  }
      }
    }
View Full Code Here

Examples of weka.classifiers.Classifier.distributionForInstance()

    Classifier classifier = getClassifier(k);

    if (m_BaseFormat.classAttribute().isNumeric()) {
      throw new Exception("Class Attribute must not be numeric!");
    } else {
      double[] dist = classifier.distributionForInstance(instance);
     
      maxIdx=0;
      maxVal=dist[0];
      for (int j = 1; j < dist.length; j++) {
  if (dist[j]>maxVal) {
View Full Code Here

Examples of weka.classifiers.Classifier.distributionForInstance()

      double [] sums = new double [instance.numClasses()], newProbs;
      Classifier curr;
     
      for (int i = 0; i < m_Committee.size(); i++) {
    curr = (Classifier) m_Committee.get(i);
    newProbs = curr.distributionForInstance(instance);
    for (int j = 0; j < newProbs.length; j++)
      sums[j] += newProbs[j];
      }
      if (Utils.eq(Utils.sum(sums), 0)) {
    return sums;
View Full Code Here

Examples of weka.classifiers.Classifier.distributionForInstance()

    for (int k = 0; k < m_Classifiers.length; k++) {
      Classifier classifier = getClassifier(k);
      if (m_BaseFormat.classAttribute().isNumeric()) {
  values[i++] = classifier.classifyInstance(instance);
      } else {
  double[] dist = classifier.distributionForInstance(instance);
  for (int j = 0; j < dist.length; j++) {
    values[i++] = dist[j];
  }
      }
    }
View Full Code Here

Examples of weka.classifiers.Classifier.distributionForInstance()

    } else {
      Classifier classifier = (Classifier)m_classifiers.get(node.m_left.getString() + "|" +
                  node.m_right.getString());
      double[] leftDist = distributionForInstance(inst, node.m_left);
      double[] rightDist = distributionForInstance(inst, node.m_right);
      double[] dist = classifier.distributionForInstance(inst);

      for (int i = 0; i < inst.numClasses(); i++) {
  if (node.m_right.contains(i)) {
    newDist[i] = dist[1] * rightDist[i];
  } else {
View Full Code Here

Examples of weka.classifiers.Classifier.distributionForInstance()

    for (int k = 0; k < m_Classifiers.length; k++) {
      Classifier classifier = getClassifier(k);
      if (m_BaseFormat.classAttribute().isNumeric()) {
  values[i++] = classifier.classifyInstance(instance);
      } else {
  double[] dist = classifier.distributionForInstance(instance);
  for (int j = 0; j < dist.length; j++) {
    values[i++] = dist[j];
  }
      }
    }
View Full Code Here

Examples of weka.classifiers.pmml.consumer.PMMLClassifier.distributionForInstance()

      if (temp.classAttribute().isNumeric()) {
        buff.append(temp.value(temp.classIndex()) + " ");
      } else {
        buff.append(temp.classAttribute().value((int)temp.value(temp.classIndex())) + " ");
      }
      preds = classifier.distributionForInstance(temp);
      buff.append(" Predicted: ");
      for (int j = 0; j < preds.length; j++) {
        buff.append("" + preds[j] + " ");
      }
      buff.append("\n");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.