de.dfki.mycbr.core.retrieval
Class SequentialRetrieval
java.lang.Object
de.dfki.mycbr.core.retrieval.RetrievalEngine
de.dfki.mycbr.core.retrieval.SequentialRetrieval
public class SequentialRetrieval
- extends RetrievalEngine
Sequential retrieval computes the similarity of the query and all cases in
the case base to get the most similar cases.
- Author:
- myCBR Team
|
Method Summary |
java.util.List<Pair<Instance,Similarity>> |
retrieve(ICaseBase cb,
Instance q)
|
java.util.List<Pair<Instance,Similarity>> |
retrieveK(ICaseBase cb,
Instance q,
int k)
|
java.util.List<Pair<Instance,Similarity>> |
retrieveKSorted(ICaseBase cb,
Instance q,
int k)
|
java.util.List<Pair<Instance,Similarity>> |
retrieveSorted(ICaseBase cb,
Instance q)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SequentialRetrieval
public SequentialRetrieval(Project p,
Retrieval r)
- Parameters:
p - the project this retrieval belongs tor - the underlying retrieval object
retrieve
public final java.util.List<Pair<Instance,Similarity>> retrieve(ICaseBase cb,
Instance q)
throws java.lang.Exception
- Specified by:
retrieve in class RetrievalEngine
- Parameters:
cb - the case base this retrieval should be run onq - the current query
- Returns:
- list of retrieval results including pairs of case and similarity
- Throws:
java.lang.Exception - if something goes wrong during similarity computations
retrieveK
public final java.util.List<Pair<Instance,Similarity>> retrieveK(ICaseBase cb,
Instance q,
int k)
throws java.lang.Exception
- Specified by:
retrieveK in class RetrievalEngine
- Parameters:
cb - the case base this retrieval should be run onq - the current queryk - the number of cases to be returned
- Returns:
- list of k pairs of case and similarity (if there are enough)
- Throws:
java.lang.Exception - if something goes wrong during similarity computations
retrieveKSorted
public final java.util.List<Pair<Instance,Similarity>> retrieveKSorted(ICaseBase cb,
Instance q,
int k)
throws java.lang.Exception
- Specified by:
retrieveKSorted in class RetrievalEngine
- Parameters:
cb - the case base this retrieval should be run onq - the current queryk - the number of cases to be returned
- Returns:
- list of k pairs of case and similarity (if there are enough)
sorted with respect to the similarities in descending order
- Throws:
java.lang.Exception - if something goes wrong during similarity computations
retrieveSorted
public final java.util.List<Pair<Instance,Similarity>> retrieveSorted(ICaseBase cb,
Instance q)
throws java.lang.Exception
- Specified by:
retrieveSorted in class RetrievalEngine
- Parameters:
cb - the case base this retrieval should be run onq - the current query
- Returns:
- list of pairs of case and similarity
sorted with respect to the similarities in descending order
- Throws:
java.lang.Exception - if something goes wrong during similarity computations