The number of true negatives of the specified class.


@param classindex the index of the class to retrieve the true negatives for
@return the number of true negatives of the specified class
513230
public int trueNegatives(int classindex) {
    int tn = 0;
    for(int i = 0; i < confusion.length; i++) {
      for(int j = 0; j < confusion[i].length; j++) {
        if(i != classindex && j != classindex) {
          tn += confusion[i][j];
        }
      }
    }
    return tn;
  }
651526
private @SlashedClassName
    String getClassName(int index) throws InvalidClassFileFormatException {
        if (index == 0) {
            return null;
        }

        checkConstantPoolIndex(index);
        Constant constant = constantPool[index];
        checkConstantTag(constant, IClassConstants.CONSTANT_Class);

        int refIndex = ((Integer) constant.data[0]).intValue();
        String stringValue = getUtf8String(refIndex);

        return stringValue;
    }
3085
public int[] enumerateColorIds (String className)
    {
        // make sure the class exists
        ClassRecord record = getClassRecord(className);
        if (record == null) {
            return null;
        }

        int[] cids = new int[record.colors.size()];
        Iterator<ColorRecord> crecs = record.colors.values().iterator();
        for (int ii = 0; crecs.hasNext(); ii++) {
            cids[ii] = crecs.next().colorId;
        }
        return cids;
    }
1079197
public int findClassIndex(HashMap<Integer, Integer> weightMap)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "findClassIndex");
    
    int classPos = 0;
    int randWeight = 0;
    // First of all determine total weight
    int totalWeight = 0;
    Iterator<Integer> iter = weightMap.values().iterator();
     while(iter.hasNext())
     {
      Integer weight = iter.next();
      totalWeight = totalWeight + weight.intValue();
    }
  
    // TotalWeight might be zero if a zero weighting has been applied to a class. In
    // that case we need to return a zero classPos
    if(totalWeight > 0)
    {
      // Generate a random number that is between zero and the total weight
      randWeight = Math.abs(rand.nextInt() % totalWeight);
      
      // Iterate over the weightMap again so that we can find a class index to use.
      // We search for the index that corresponds to the generated random value.
      //
      // So if we had 3 classes with weights 7, 2 and 1, then we'll have a total
      // weight of 10 and will generate a pseudo random number between 0 and 10. The
      // code will see if the random number...
      // * is less than 7, in which case it chooses index 1,
      // * is between 7 and 9, in which case it chooses index 2, 
      // * is between 9 and 10, in which case it chooses index 3.
      Iterator<Map.Entry<Integer, Integer>> iter2 = weightMap.entrySet().iterator();

      // An aggregate of the weight
      int aggregateWeight = 0;

      while(iter2.hasNext())
      {
        Map.Entry entry = (Map.Entry) iter2.next();
        Integer mappos = (Integer) entry.getKey();
        Integer weight = (Integer) entry.getValue();
      
        aggregateWeight = aggregateWeight + weight.intValue();
        
        // Move the classPos to the next value
        classPos = mappos.intValue(); 
        if(randWeight <= aggregateWeight)
          break;
      }
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "findClassIndex", classPos);
      
    return classPos;
  }
1165015
public int getIndex(String feature)
	{
		//logger.debug("FeatureIndex.get : " + feature + "(" + count + ")");
		Integer index = (Integer) map.get(feature);

		if (index == null)
			return -1;

		return index.intValue();
	}
784794
@Override
	public int lastIndexOf(Object elem) {
		if (elem == null) return -1;
		if (elem instanceof Number) return lastIndexOf(((Number)elem).longValue());
		return -1;
	}
198327
public function getClassIndex(): ClassIndex
    {
        if (is_null($this->classIndex)) {
            $this->classIndex = new ClassIndex();
        }

        return $this->classIndex;
    }
1336624
public int getTopNCorrectCount() {
        if (confusion == null)
            return 0;
        if (topN <= 1) {
            int nClasses = confusion().getClasses().size();
            int countCorrect = 0;
            for (int i = 0; i < nClasses; i++) {
                countCorrect += confusion().getCount(i, i);
            }
            return countCorrect;
        }
        return topNCorrectCount;
    }
1170776
public int falsePositives(int classindex) {
    int fp = 0;
    for(int i = 0; i < confusion[classindex].length; i++) {
      if(i != classindex) {
        fp += confusion[classindex][i];
      }
    }
    return fp;
  }
842019
public boolean exists(int specIndex) {
        return specIndex >= 0 && specIndex < resultList.size()
                && !(resultList.get(specIndex).value() instanceof Exception);
    }
276377
public double falseNegativeRate(Integer classLabel, double edgeCase) {
        double fnCount = falseNegatives(classLabel);
        double tpCount = truePositives(classLabel);

        return EvaluationUtils.falseNegativeRate((long) fnCount, (long) tpCount, edgeCase);
    }
647482
public boolean getBoolean(int columnIndex) {
		Object fieldValue = data[columnIndex];
		if (fieldValue == null) {
			return Boolean.FALSE;
		}
		if (fieldValue instanceof Boolean) {
			return (Boolean) fieldValue;
		}
		throw new DBFException("Unsupported type for Boolean at column:" + columnIndex + " "
				+ fieldValue.getClass().getCanonicalName());
	}
258127
def ele_index(class_name, index)
      results = tags(class_name)
      if index == 'last()'
        index = results.length
        index -= 1 if index >= 0
      else
        raise 'Index must be >= 1' unless index >= 1

        index -= 1 if index >= 1
      end

      # uiautomator has issues with index/instance so calculate the index
      # client side.
      results[index]
    end
194740
public int indexOf(Object o) {
		try {
			for (int i = 0; i < events.size(); i++) {
				if (events.get(i).equals(o)) {
					return i;
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return -1;
	}
681566
public int getClassDepth() {
        int depth = 0;

        ClassFile outer = mOuterClass;
        while (outer != null) {
            depth++;
            outer = outer.mOuterClass;
        }

        return depth;
    }
1177278
public int getNrOfClasses() {
		HashMap<Integer, Integer> classes = new HashMap<Integer, Integer>();

		for (DataObject currentObject : dataList) {
			if (!classes.containsKey(currentObject.getClassLabel()))
				classes.put(currentObject.getClassLabel(), 1);
		}
    	
		return classes.size();
    }
313666
public int getSelectedIndex() {
        Object o = $(getElement()).find("option:selected").last().prop("index");
        if (o != null) {
            return Integer.parseInt(o.toString());
        }
        return -1;
    }