Class DyadDatasetPoolProvider
- java.lang.Object
-
- ai.libs.jaicore.ml.dyadranking.activelearning.DyadDatasetPoolProvider
-
- All Implemented Interfaces:
IActiveLearningPoolProvider<IDyadRankingInstance>,IDyadRankingPoolProvider
public class DyadDatasetPoolProvider extends java.lang.Object implements IDyadRankingPoolProvider
A pool provider which is created out of aDyadRankingDataset. EachSparseDyadRankingInstanceorDyadRankingInstanceof theDyadRankingDatasetmust represent a full ranking. Only queries of rankings over the same instance features can be answered.
-
-
Constructor Summary
Constructors Constructor Description DyadDatasetPoolProvider(DyadRankingDataset dataset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Dyad>getDyadsByAlternative(ai.libs.jaicore.math.linearalgebra.Vector alternativeFeatures)Returns the set of allDyads with the givenVectorof alternative features.java.util.Set<Dyad>getDyadsByInstance(ai.libs.jaicore.math.linearalgebra.Vector instanceFeatures)Returns the set of allDyads with the givenVectorof instance features.java.util.Collection<ai.libs.jaicore.math.linearalgebra.Vector>getInstanceFeatures()Returns aCollectionthat contains all instance features contained in the pool.intgetNumberQueries()Returns the number of queries the pool provider has answered so far.java.util.Collection<IDyadRankingInstance>getPool()Returns the pool of unlabeled instances.intgetPoolSize()DyadRankingDatasetgetQueriedRankings()IDyadRankingInstancequery(IDyadRankingInstance queryInstance)Labels the given instance.voidsetRemoveDyadsWhenQueried(boolean flag)
-
-
-
Constructor Detail
-
DyadDatasetPoolProvider
public DyadDatasetPoolProvider(DyadRankingDataset dataset)
-
-
Method Detail
-
getPool
public java.util.Collection<IDyadRankingInstance> getPool()
Description copied from interface:IActiveLearningPoolProviderReturns the pool of unlabeled instances.- Specified by:
getPoolin interfaceIActiveLearningPoolProvider<IDyadRankingInstance>- Returns:
- Pool of unlabeled instances.
-
query
public IDyadRankingInstance query(IDyadRankingInstance queryInstance)
Description copied from interface:IActiveLearningPoolProviderLabels the given instance.- Specified by:
queryin interfaceIActiveLearningPoolProvider<IDyadRankingInstance>- Parameters:
queryInstance-IInstanceto be labeled.- Returns:
- Labeled
IInstance.
-
getDyadsByInstance
public java.util.Set<Dyad> getDyadsByInstance(ai.libs.jaicore.math.linearalgebra.Vector instanceFeatures)
Description copied from interface:IDyadRankingPoolProviderReturns the set of allDyads with the givenVectorof instance features.- Specified by:
getDyadsByInstancein interfaceIDyadRankingPoolProvider- Parameters:
instanceFeatures-Vectorof instance features.- Returns:
Setof dyads with the givenVectorof instance features.
-
getDyadsByAlternative
public java.util.Set<Dyad> getDyadsByAlternative(ai.libs.jaicore.math.linearalgebra.Vector alternativeFeatures)
Description copied from interface:IDyadRankingPoolProviderReturns the set of allDyads with the givenVectorof alternative features.- Specified by:
getDyadsByAlternativein interfaceIDyadRankingPoolProvider- Parameters:
alternativeFeatures-Vectorof alternative features.- Returns:
Setof dyads with the givenVectorof alternative features.
-
getInstanceFeatures
public java.util.Collection<ai.libs.jaicore.math.linearalgebra.Vector> getInstanceFeatures()
Description copied from interface:IDyadRankingPoolProviderReturns aCollectionthat contains all instance features contained in the pool.- Specified by:
getInstanceFeaturesin interfaceIDyadRankingPoolProvider- Returns:
- A
Collectionthat contains all instance features contained in the pool.
-
setRemoveDyadsWhenQueried
public void setRemoveDyadsWhenQueried(boolean flag)
- Specified by:
setRemoveDyadsWhenQueriedin interfaceIDyadRankingPoolProvider
-
getPoolSize
public int getPoolSize()
- Specified by:
getPoolSizein interfaceIDyadRankingPoolProvider
-
getNumberQueries
public int getNumberQueries()
Returns the number of queries the pool provider has answered so far.- Returns:
- Number of queries this pool provider has answered.
-
getQueriedRankings
public DyadRankingDataset getQueriedRankings()
- Specified by:
getQueriedRankingsin interfaceIDyadRankingPoolProvider
-
-