Returns the metric for the given ID.

@param id		the id to get the metric for
@param classLabel  the class label index for which to return metric (if applicable)
@return		the metric
342073
public double getMetric(int id, int classLabel) {
    try {
      switch (id) {
        case DefaultEvaluationMetrics.EVALUATION_CC:
          return m_Evaluation.correlationCoefficient();
        case DefaultEvaluationMetrics.EVALUATION_MATTHEWS_CC:
          return m_Evaluation.matthewsCorrelationCoefficient(0);
        case DefaultEvaluationMetrics.EVALUATION_RMSE:
          return m_Evaluation.rootMeanSquaredError();
        case DefaultEvaluationMetrics.EVALUATION_RRSE:
          return m_Evaluation.rootRelativeSquaredError();
        case DefaultEvaluationMetrics.EVALUATION_MAE:
          return m_Evaluation.meanAbsoluteError();
        case DefaultEvaluationMetrics.EVALUATION_RAE:
          return m_Evaluation.relativeAbsoluteError();
        case DefaultEvaluationMetrics.EVALUATION_COMBINED:
          return (1 - StrictMath.abs(m_Evaluation.correlationCoefficient()) + m_Evaluation.rootRelativeSquaredError() + m_Evaluation.relativeAbsoluteError());
        case DefaultEvaluationMetrics.EVALUATION_ACC:
          return m_Evaluation.pctCorrect();
        case DefaultEvaluationMetrics.EVALUATION_KAPPA:
          return m_Evaluation.kappa();
        case DefaultEvaluationMetrics.EVALUATION_PRECISION:
          return m_Evaluation.precision(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_WEIGHTED_PRECISION:
          return m_Evaluation.weightedPrecision();
        case DefaultEvaluationMetrics.EVALUATION_RECALL:
          return m_Evaluation.recall(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_WEIGHTED_RECALL:
          return m_Evaluation.weightedRecall();
        case DefaultEvaluationMetrics.EVALUATION_AUC:
          return m_Evaluation.areaUnderROC(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_WEIGHTED_AUC:
          return m_Evaluation.weightedAreaUnderROC();
        case DefaultEvaluationMetrics.EVALUATION_PRC:
          return m_Evaluation.areaUnderPRC(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_WEIGHTED_PRC:
          return m_Evaluation.weightedAreaUnderPRC();
        case DefaultEvaluationMetrics.EVALUATION_FMEASURE:
          return m_Evaluation.fMeasure(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_WEIGHTED_FMEASURE:
          return m_Evaluation.weightedFMeasure();
        case DefaultEvaluationMetrics.EVALUATION_TRUE_POSITIVE_RATE:
          return m_Evaluation.truePositiveRate(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_TRUE_NEGATIVE_RATE:
          return m_Evaluation.trueNegativeRate(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_FALSE_POSITIVE_RATE:
          return m_Evaluation.falsePositiveRate(classLabel);
        case DefaultEvaluationMetrics.EVALUATION_FALSE_NEGATIVE_RATE:
          return m_Evaluation.falseNegativeRate(classLabel);
        default:
          return Double.NaN;
      }
    }
    catch (Exception e) {
      return Double.NaN;
    }
  }
387063
public function getOrFail($classOrPointer, $id=null)
    {
        if ($entity = $this->get($classOrPointer, $id)) {
            return $entity;
        }

        list($class, $id) = $this->toClassAndId($classOrPointer, $id);

        throw new ResourceNotFoundException("Entity $class:$id not found");
    }
1155242
public static String getLabel(String section, String idInSection) {
		Language language=getThreadLocalLanguage(null);
		
		if (language==null){
			return idInSection;
		} else {
			return getLabel(language, section, idInSection);
		}
	}
1011380
@Override
    public ClassLoader getClassLoader(String identifier) throws IllegalArgumentException {
        if (identifier == null)
            return null;
        ThreadContextClassLoader classloader = tcclStore.retrieve(identifier);
        if (classloader != null) {
            return classloader;
        }
        return null;
    }
676009
public static int getIdFor(String slashedClassName) {
		assert Asserts.assertNotDotted(slashedClassName);
		for (int i = 0; i < nextTypeId; i++) {
			if (allocatedIds[i].equals(slashedClassName)) {
				return i;
			}
		}
		return -1;
	}
600144
public static Class<?> getClass(ObjectIdentifier oid)
            throws CertificateException {
        OIDInfo info = oidMap.get(oid);
        return (info == null) ? null : info.getClazz();
    }
1026444
@Property(
            domainEvent = ClassNameDomainEvent.class
    )
    @PropertyLayout(typicalLength=ApplicationFeature.TYPICAL_LENGTH_CLS_NAME)
    @MemberOrder(name="Id", sequence = "2.3")
    public String getClassName() {
        return getFeatureId().getClassName();
    }
810973
@Override
    public String getId() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "getId");
        if (id == null)
        {
            // Set id to the class name
            id = this.getClass().getName();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "getId", new Object[] { id });
        return id;
    }
198903
public int getTypeId(Class classType) {

        final Class origType = classType;
        while (null != classType) {
            Integer typeObj = (Integer) _typeMap.get(classType);
            if (null != typeObj) {
                return typeObj.intValue();
            }
            classType = classType.getSuperclass();
        }

        //
        // special check for blobs/clobs they are interfaces not derived from
        //
        if (Blob.class.isAssignableFrom(origType)) {
            return _typeMap.get(Blob.class).intValue();
        } else if (Clob.class.isAssignableFrom(origType)) {
            return _typeMap.get(Clob.class).intValue();
        }

        return TYPE_UNKNOWN;
    }
19930
public static ConceptId getInstance(String id, Metadata metadata) {
        List<Object> key = new ArrayList<>(1);
        key.add(id);
        ConceptId result = metadata.getFromConceptIdCache(key);
        if (result != null) {
            return result;
        } else {
            result = new SimpleConceptId(id, metadata);
            metadata.putInConceptIdCache(key, result);
            return result;
        }
    }
625287
def label(self, id):
        
        if self.ontology is not None:
            label = self.ontology.label(id)
            if label is not None:
                return label
        if self.subject_label_map is not None and id in self.subject_label_map:
            return self.subject_label_map[id]
        return None
774022
private void doLookup(String id,StringWrapper toFind)
    {
	// retrain if necessary
	if (distance==null) {
	    distance = new MyTeacher().train( distanceLearner );
	}
	// used cached values if it's ok
	if (lastLookup==toFind) return;

	closeMatches = new HashSet();
	closestMatch = null;
	distanceToClosestMatch = -Double.MAX_VALUE;

	// lookup best match to wrapper
	MyWrapper wrapper = asMyWrapper(toFind);
	Token[] tokens = wrapper.getTokens();
	for (int i=0; i<tokens.length; i++) {
	    ArrayList stringsWithToken = (ArrayList) index.get(tokens[i]);
	    if (stringsWithToken!=null && ((double)stringsWithToken.size()/totalEntries) < maxFraction) {
		for (Iterator j=stringsWithToken.iterator(); j.hasNext(); ) {
		    MyWrapper wj = (MyWrapper)j.next(); 
		    String wjId = (String)idMap.get(wj);
		    //if (DEBUG) System.out.println("id:"+id+" wjId:"+wjId);
		    if (!closeMatches.contains(wj) && (wjId==null || !wjId.equals(id))) {
			double score = distance.score( wrapper.getDistanceWrapper(), wj.getDistanceWrapper() );
			if (DEBUG) System.out.println("score for "+wj+": "+score);
			//if (DEBUG) System.out.println(distance.explainScore(wrapper.getDistanceWrapper(),wj.getDistanceWrapper()));
			closeMatches.add( wj );
			if (score>=distanceToClosestMatch) {
			    //if (DEBUG) System.out.println("closest so far");
			    distanceToClosestMatch = score;
			    closestMatch = wj;
			}
		    }
		}
	    }
	}
	lastLookup = toFind;
    }
717013
@Override
    public String _getIDClass() {
        IdClass idCls = this.getIdClass();
        if (idCls == null) {
            return null;
        }

        return idCls.getClazz();
    }
776607
@GET
    @Path("status")
    @Produces(MediaType.TEXT_PLAIN)
    public String getStatus(@QueryParam("id") int id)
    {
        return JqmClientFactory.getClient().getJob(id).getState().toString();
    }
1100544
@Override
    public Object get(final String identifier) {
        Declaration decl = getDeclarations().get( identifier );
        if ( decl == null ) {
            throw new IllegalArgumentException( "identifier '" + identifier + "' cannot be found" );
        }
        return get( decl );
    }
1116283
public function getById(int $id, string $forClassName)
    {
        $params    = $this->getQueryParams();
        $type      = CorrelationTypeHelper::getGraphTypeByClass($forClassName);
        $uriAppend = "{$type}/{$id}";

        unset($params['limit'], $params['offset']);

        $response = $this->handler->handle('GET', false, $uriAppend, $params)->getData();
        if (!$response) {
            return [];
        }

        $functionalNames = [];
        if ($filter = $this->getFilter()) {
            $functionalNames = current($filter->getElements())['functionalNames'] ?? null;
        }

        return $this->client->elastic()
                            ->search($this->prepareElasticSearchBody($response, ['functionalNameId' => $functionalNames]))
                            ->all();
    }
803898
@SuppressWarnings("unchecked")
	@Override
	public Class<ID> getIdType() {
		Field idField = MetadataParser.getIdField(getJavaType());
		return (Class<ID>) idField.getType();
	}