Examples of numAttributes()


Examples of weka.core.Instances.numAttributes()

          Instances insts = createDateDerivedPeriodicList();
          m_dateDerivedPeriodicSelector.setInstances(insts);
          m_dateDerivedPeriodicsHeader = insts;
         
          // make sure that selected stuff stays selected
          boolean[] newSelected = new boolean[insts.numAttributes()];
          for (int i = 0; i < selected.length; i++) {
            Attribute toFind = oldList.attribute(selected[i]);
            Attribute toSet = insts.attribute(toFind.name());
            if (toSet != null) {
              newSelected[toSet.index()] = true;
View Full Code Here

Examples of weka.core.Instances.numAttributes()

          int[] selected = m_dateDerivedPeriodicSelector.getSelectedAttributes();
          Instances insts = createDateDerivedPeriodicList();
          m_dateDerivedPeriodicSelector.setInstances(insts);
          m_dateDerivedPeriodicsHeader = insts;
         
          boolean[] newSelected = new boolean[insts.numAttributes()];
          for (int i = 0; i < selected.length; i++) {
            newSelected[selected[i]] = true;
          }

          // select the newly created field
View Full Code Here

Examples of weka.core.Instances.numAttributes()

    // start of the series?
    if (m_deleteMissingFromStartOfSeries) {
      int start = 0;
      for (int i = 0; i <= m_maxLag; i++) {
        boolean ok = true;
        for (int j = 0; j < result.numAttributes(); j++) {
          if (result.instance(i).isMissing(j)) {
            ok = false;
            break;
          }
        }
View Full Code Here

Examples of weka.core.Instances.numAttributes()

   * @return the new merged instance
   */
  protected Instance mergeInstances(Instance source, Instance dest) {

    Instances outputFormat = outputFormatPeek();
    double[] vals = new double[outputFormat.numAttributes()];
    for(int i = 0; i < vals.length; i++) {
      if ((i != outputFormat.classIndex()) && (m_SelectedCols.isInRange(i))) {
        if (source != null) {
          vals[i] = source.value(i);
        } else {
View Full Code Here

Examples of weka.core.Instances.numAttributes()

                testSet.attributeStats(testSet.classIndex()).missingCount ==
                testSet.numInstances()) {
              // now check the other attributes against the training
              // structure
              boolean ok = true;
              for (int i = 0; i < testSet.numAttributes(); i++) {
                if (i != testSet.classIndex()) {
                  ok = testSet.attribute(i).equals(m_trainingSet.attribute(i));
                  if (!ok) {
                    break;
                  }
View Full Code Here

Examples of weka.core.Instances.numAttributes()

          append(lagOptions + "\n\n");
        }

        outBuff.append("Relation:     " + inst.relationName() + '\n');
        outBuff.append("Instances:    " + inst.numInstances() + '\n');
        outBuff.append("Attributes:   " + inst.numAttributes() + '\n');
        if (inst.numAttributes() < 100) {
          for (int i = 0; i < inst.numAttributes(); i++) {
            outBuff.append("              " + inst.attribute(i).name()
                + '\n');
          }
View Full Code Here

Examples of weka.core.Instances.numAttributes()

        }

        outBuff.append("Relation:     " + inst.relationName() + '\n');
        outBuff.append("Instances:    " + inst.numInstances() + '\n');
        outBuff.append("Attributes:   " + inst.numAttributes() + '\n');
        if (inst.numAttributes() < 100) {
          for (int i = 0; i < inst.numAttributes(); i++) {
            outBuff.append("              " + inst.attribute(i).name()
                + '\n');
          }
        } else {
View Full Code Here

Examples of weka.core.Instances.numAttributes()

        outBuff.append("Relation:     " + inst.relationName() + '\n');
        outBuff.append("Instances:    " + inst.numInstances() + '\n');
        outBuff.append("Attributes:   " + inst.numAttributes() + '\n');
        if (inst.numAttributes() < 100) {
          for (int i = 0; i < inst.numAttributes(); i++) {
            outBuff.append("              " + inst.attribute(i).name()
                + '\n');
          }
        } else {
          outBuff.append("              [list of attributes omitted]\n");
View Full Code Here

Examples of weka.core.Instances.numAttributes()

     
      Instances inst = new Instances(new java.io.InputStreamReader(System.in));
      if (false) {
        System.out.println(ThresholdCurve.getNPointPrecision(inst, 11));
      } else {
        inst.setClassIndex(inst.numAttributes() - 1);
        ThresholdCurve tc = new ThresholdCurve();
        EvaluationUtils eu = new EvaluationUtils();
        Classifier classifier = new weka.classifiers.functions.Logistic();
        FastVector predictions = new FastVector();
        for (int i = 0; i < 2; i++) { // Do two runs.
View Full Code Here

Examples of weka.core.Instances.numAttributes()

    for (File curArff : trainFiles) {

      // load data
      Instances data = new weka.core.converters.ConverterUtils.DataSource(curArff.toString()).getDataSet();
      if (data.classIndex() == -1)
        data.setClassIndex(data.numAttributes() - 1);
      data.deleteWithMissingClass();

      // count numeric and nominal attributes
      int numNumeric = 0, numNominal = 0;
      for (int i = 0; i < data.numAttributes(); i++) {
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.