Package weka.core

Examples of weka.core.FastVector.elementAt()


      }     
    }
  }
  else {
    if (m_classObject == null
        && ((Double)tmp.elementAt(0)).intValue() == LEAF) {
      setLinear();
    }
    s.append("Standard Deviation = "
       + Utils.doubleToString(((Double)tmp.elementAt(1))
       .doubleValue(), 6));
View Full Code Here


    if (m_classObject == null
        && ((Double)tmp.elementAt(0)).intValue() == LEAF) {
      setLinear();
    }
    s.append("Standard Deviation = "
       + Utils.doubleToString(((Double)tmp.elementAt(1))
       .doubleValue(), 6));
  }
      }
      else {
  s.append("Split on\\n");
View Full Code Here

    }
 
    // Potential
    double potential = 0;
    for(int k=index+1; k<m_Ruleset.size(); k++){
      double[] ruleStat = (double[])indexPlus.elementAt(k-index-1);
      double ifDeleted = potential(k, expFPRate, rulesetStat,
           ruleStat, checkErr);
      if(!Double.isNaN(ifDeleted))
  potential += ifDeleted;
    }
View Full Code Here

   * Save the currently visible set of instances to a file
   */
  private void saveVisibleInstances() {
    FastVector plots = m_plot.m_plot2D.getPlots();
    if (plots != null) {
      PlotData2D master = (PlotData2D)plots.elementAt(0);
      Instances saveInsts = new Instances(master.getPlotInstances());
      for (int i = 1; i < plots.size(); i++) {
  PlotData2D temp = (PlotData2D)plots.elementAt(i);
  Instances addInsts = temp.getPlotInstances();
  for (int j = 0; j < addInsts.numInstances(); j++) {
View Full Code Here

    FastVector plots = m_plot.m_plot2D.getPlots();
    if (plots != null) {
      PlotData2D master = (PlotData2D)plots.elementAt(0);
      Instances saveInsts = new Instances(master.getPlotInstances());
      for (int i = 1; i < plots.size(); i++) {
  PlotData2D temp = (PlotData2D)plots.elementAt(i);
  Instances addInsts = temp.getPlotInstances();
  for (int j = 0; j < addInsts.numInstances(); j++) {
    saveInsts.add(addInsts.instance(j));
  }
      }
View Full Code Here

      classes.addElement(enm.nextElement());
   
    Instances data = getStructure();
    int fileCount = 0;
    for (int k = 0; k < classes.size(); k++) {
      String subdirPath = (String) classes.elementAt(k);
      File subdir = new File(directoryPath + File.separator + subdirPath);
      String[] files = subdir.list();
      for (int j = 0; j < files.length; j++) {
  try {
    fileCount++;
View Full Code Here

   
    PairedStats pairedStats = new PairedStats(m_SignificanceLevel);

    for (int k = 0; k < dataset1.size(); k ++) {
      Instance current1 = (Instance) dataset1.elementAt(k);
      Instance current2 = (Instance) dataset2.elementAt(k);
      if (current1.isMissing(comparisonColumn)) {
  System.err.println("Instance has missing value in comparison "
         + "column!\n" + current1);
  continue;
      }
View Full Code Here

      if(m_Debug)
        System.err.println("\nNew rule found: "+
         newRule.toString(m_Class));
    }
    else{
      RipperRule oldRule = (RipperRule)ruleset.elementAt(position);
      boolean covers = false;
      // Test coverage of the next old rule
      for(int i=0; i<newData.numInstances(); i++)
        if(oldRule.covers(newData.instance(i))){
    covers = true;
View Full Code Here

    for(int j=0; j<m_RulesetStats.size(); j++){
      RuleStats rs = (RuleStats)m_RulesetStats.elementAt(j);
      FastVector rules = rs.getRuleset();
      for(int k=0; k<rules.size(); k++){
  double[] simStats = rs.getSimpleStats(k);
  sb.append(((RipperRule)rules.elementAt(k)).toString(m_Class)
      + " ("+simStats[0]+"/"+simStats[4]+")\n");
      }         
    }
    if(m_Debug){
      System.err.println("Inside m_Ruleset");
View Full Code Here

      for (int i=0; i<numClassifiers; i++) {
  RemoveWithValues classFilter = new RemoveWithValues();
  classFilter.setAttributeIndex("" + (insts.classIndex() + 1));
  classFilter.setModifyHeader(true);
  classFilter.setInvertSelection(true);
  classFilter.setNominalIndicesArr((int[])pairs.elementAt(i));
  Instances tempInstances = new Instances(insts, 0);
  tempInstances.setClassIndex(-1);
  classFilter.setInputFormat(tempInstances);
  newInsts = Filter.useFilter(insts, classFilter);
  if (newInsts.numInstances() > 0) {
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.