/** * Returns a fraction of class descriptions with sufficiently high accuracy. * @param accuracyThreshold Only return solutions with this accuracy or higher. * @return Return value is getCurrentlyBestDescriptions(Integer.MAX_VALUE, accuracyThreshold, false). */ public synchronized List<? extends EvaluatedDescription<? extends Score>> getCurrentlyBestEvaluatedDescriptions(double accuracyThreshold) { return getCurrentlyBestEvaluatedDescriptions(Integer.MAX_VALUE, accuracyThreshold, false); }
/** * Return the best currently found concepts up to some maximum * count (no minimality filter used). * @param nrOfDescriptions Maximum number of descriptions returned. * @return Return value is getCurrentlyBestDescriptions(nrOfDescriptions, 0.0, false). */ @Override public synchronized List<? extends EvaluatedDescription<? extends Score>> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) { return getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, 0.0, false); }
@Override public void run() { System.out.println("T:" + alg.getCurrentlyBestEvaluatedDescriptions(10, 0.5, true)); } };
public synchronized List<? extends EvaluatedDescription<? extends Score>> getCurrentlyBestMostGeneralEvaluatedDescriptions() { List<? extends EvaluatedDescription<? extends Score>> l = getCurrentlyBestEvaluatedDescriptions(getCurrentlyBestEvaluatedDescriptions().last().getAccuracy()); DescriptionSubsumptionTree t = new DescriptionSubsumptionTree(reasoner); t.insert(l); return t.getMostGeneralDescriptions(true); }
@Override public void run() { if(la.isRunning()){ System.out.println(la.getCurrentlyBestEvaluatedDescriptions()); } }
List<? extends EvaluatedDescription> descriptions; if (accuracyThreshold != -1) { descriptions = state.getLearningAlgorithm().getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, accuracyThreshold, filterNonMinimalDescriptions); } else { descriptions = state.getLearningAlgorithm().getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions);
/** * Returns a list of JSON encoded description including extra information * (which partially depends on the learning problem) such as the accuracy * of the learned description. * * @param id The session ID. * @param limit Maximum number of results desired. * @return A JSON string encoding learned descriptions. * @throws ClientNotKnownException Thrown if client (session ID) is not known. */ @WebMethod public String learnDescriptionsEvaluatedLimit(int id, int limit) throws ClientNotKnownException { ClientState state = getState(id); state.getLearningAlgorithm().start(); List<? extends EvaluatedDescription> descriptions = state.getLearningAlgorithm().getCurrentlyBestEvaluatedDescriptions(limit); String json = "{"; int count = 1; for(EvaluatedDescription description : descriptions) { if (count>1) json += ",\"solution" + count + "\" : " + description.asJSON(); else json += "\"solution" + count + "\" : " + description.asJSON(); count++; } json+="}"; return json; }
NavigableSet<? extends EvaluatedDescription<? extends Score>> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); List<EvaluatedDescription<? extends Score>> returnList = new LinkedList<>(); for(EvaluatedDescription<? extends Score> ed : currentlyBest.descendingSet()) {
celaTimeMills = System.currentTimeMillis() - celaTimeMills; NavigableSet<? extends EvaluatedDescription> evaluatedDescriptions = cela.getCurrentlyBestEvaluatedDescriptions();
/** * Returns a list of JSON encoded description including extra information * (which partially depends on the learning problem) such as the accuracy * of the learned description. * * @param id The session ID. * @return A JSON string encoding learned descriptions. * @throws ClientNotKnownException Thrown if client (session ID) is not known. */ @WebMethod public String learnDescriptionsEvaluated(int id) throws ClientNotKnownException { ClientState state = getState(id); state.getLearningAlgorithm().start(); NavigableSet<? extends EvaluatedDescription> descriptions = state.getLearningAlgorithm() .getCurrentlyBestEvaluatedDescriptions(); String json = "{"; int count = 1; for (EvaluatedDescription description : descriptions.descendingSet()) { if (count > 1) json += ",\"solution" + count + "\" : " + description.asJSON(); else json += "\"solution" + count + "\" : " + description.asJSON(); count++; } json += "}"; return json; }
protected String getSolutionString() { int current = 1; String str = ""; for(EvaluatedDescription<? extends Score> ed : getCurrentlyBestEvaluatedDescriptions().descendingSet()) {
celaTimeMills = System.currentTimeMillis() - celaTimeMills; NavigableSet<? extends EvaluatedDescription> evaluatedDescriptions = cela.getCurrentlyBestEvaluatedDescriptions();
System.out.println(la.getCurrentlyBestEvaluatedDescriptions(10, 0.8, true));
List<? extends EvaluatedDescription> currentlyBestEvaluatedDescriptions = la.getCurrentlyBestEvaluatedDescriptions(0.8); System.out.println(currentlyBestEvaluatedDescriptions);
List<? extends EvaluatedDescription> solutions = alg.getCurrentlyBestEvaluatedDescriptions(10, 0.5, true);