Class DyadDatasetPoolProvider
- java.lang.Object
-
- ai.libs.jaicore.ml.ranking.dyad.learner.activelearning.DyadDatasetPoolProvider
-
- All Implemented Interfaces:
IDyadRankingPoolProvider,org.api4.java.ai.ml.core.learner.active.IActiveLearningPoolProvider<org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance>
public class DyadDatasetPoolProvider extends java.lang.Object implements IDyadRankingPoolProvider
A pool provider which is created out of aDyadRankingDataset. EachSparseDyadRankingInstanceorDenseDyadRankingInstanceof theDyadRankingDatasetmust represent a full ranking. Only queries of rankings over the same instance features can be answered.
-
-
Constructor Summary
Constructors Constructor Description DyadDatasetPoolProvider(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingDataset dataset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<org.api4.java.ai.ml.ranking.dyad.dataset.IDyad>getDyadsByAlternative(org.api4.java.common.math.IVector alternativeFeatures)Returns the set of allDyads with the givenIVectorof alternative features.java.util.Set<org.api4.java.ai.ml.ranking.dyad.dataset.IDyad>getDyadsByInstance(org.api4.java.common.math.IVector instanceFeatures)Returns the set of allDyads with the givenIVectorof instance features.java.util.Collection<org.api4.java.common.math.IVector>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<org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance>getPool()intgetPoolSize()DyadRankingDatasetgetQueriedRankings()org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstancequery(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance queryInstance)voidsetRemoveDyadsWhenQueried(boolean flag)
-
-
-
Method Detail
-
getPool
public java.util.Collection<org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance> getPool()
- Specified by:
getPoolin interfaceorg.api4.java.ai.ml.core.learner.active.IActiveLearningPoolProvider<org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance>
-
query
public org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance query(org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance queryInstance)
- Specified by:
queryin interfaceorg.api4.java.ai.ml.core.learner.active.IActiveLearningPoolProvider<org.api4.java.ai.ml.ranking.dyad.dataset.IDyadRankingInstance>
-
getDyadsByInstance
public java.util.Set<org.api4.java.ai.ml.ranking.dyad.dataset.IDyad> getDyadsByInstance(org.api4.java.common.math.IVector instanceFeatures)
Description copied from interface:IDyadRankingPoolProviderReturns the set of allDyads with the givenIVectorof instance features.- Specified by:
getDyadsByInstancein interfaceIDyadRankingPoolProvider- Parameters:
instanceFeatures-IVectorof instance features.- Returns:
Setof dyads with the givenIVectorof instance features.
-
getDyadsByAlternative
public java.util.Set<org.api4.java.ai.ml.ranking.dyad.dataset.IDyad> getDyadsByAlternative(org.api4.java.common.math.IVector alternativeFeatures)
Description copied from interface:IDyadRankingPoolProviderReturns the set of allDyads with the givenIVectorof alternative features.- Specified by:
getDyadsByAlternativein interfaceIDyadRankingPoolProvider- Parameters:
alternativeFeatures-IVectorof alternative features.- Returns:
Setof dyads with the givenIVectorof alternative features.
-
getInstanceFeatures
public java.util.Collection<org.api4.java.common.math.IVector> 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
-
-