@Override public List<EvaluatedAxiom<T>> getCurrentlyBestEvaluatedAxioms(int nrOfAxioms) { return getCurrentlyBestEvaluatedAxioms(nrOfAxioms, 0.0); }
public List<EvaluatedAxiom<T>> getCurrentlyBestEvaluatedAxioms(double accuracyThreshold) { return getCurrentlyBestEvaluatedAxioms(Integer.MAX_VALUE, accuracyThreshold); }
public List<T> getCurrentlyBestAxioms(int nrOfAxioms, double accuracyThreshold) { return getCurrentlyBestEvaluatedAxioms(nrOfAxioms, accuracyThreshold) .stream() .map(EvaluatedAxiom<T>::getAxiom) .collect(Collectors.toList()); }
public List<T> getCurrentlyBestAxioms(double accuracyThreshold) { return getCurrentlyBestEvaluatedAxioms(accuracyThreshold) .stream() .map(EvaluatedAxiom<T>::getAxiom) .collect(Collectors.toList()); }
@Override public List<EvaluatedAxiom<T>> getCurrentlyBestEvaluatedAxioms(int nrOfAxioms, double accuracyThreshold) { List<EvaluatedAxiom<T>> returnList = new ArrayList<>(); //get the currently best evaluated axioms List<EvaluatedAxiom<T>> currentlyBestEvAxioms = getCurrentlyBestEvaluatedAxioms(); for(EvaluatedAxiom<T> evAx : currentlyBestEvAxioms){ if(evAx.getScore().getAccuracy() >= accuracyThreshold && returnList.size() < nrOfAxioms){ if(returnOnlyNewAxioms){ if(!existingAxioms.contains(evAx.getAxiom())){ returnList.add(evAx); } } else { returnList.add(evAx); } } } return returnList; }
private List<EvaluatedAxiom<OWLAxiom>> applyAlgorithm(AxiomType<? extends OWLAxiom> axiomType, SparqlEndpointKS ks) throws ComponentInitException{ Class<? extends AbstractAxiomLearningAlgorithm<? extends OWLAxiom, ? extends OWLObject, ? extends OWLEntity>> algorithmClass = AxiomAlgorithms.getAlgorithmClass(axiomType); AbstractAxiomLearningAlgorithm learner = null; try { learner = algorithmClass.getConstructor(SparqlEndpointKS.class).newInstance(ks); } catch (Exception e) { e.printStackTrace(); } learner.setEntityToDescribe(entity); learner.setUseSampling(false); learner.setProgressMonitor(progressMonitor); learner.init(); learner.start(); algorithms.put(axiomType, learner); return learner.getCurrentlyBestEvaluatedAxioms(); }