Class IndexFeatureData<I>
java.lang.Object
es.uam.eps.ir.relison.links.recommendation.features.IndexFeatureData<I>
- Type Parameters:
I
- type of the items.
- All Implemented Interfaces:
es.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
,es.uam.eps.ir.ranksys.core.index.FeatureIndex<java.lang.String>
,es.uam.eps.ir.ranksys.core.index.ItemIndex<I>
public class IndexFeatureData<I>
extends java.lang.Object
implements es.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
Class for loading feature data from an index.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
IndexFeatureData(java.util.Map<I,java.util.Map<java.lang.String,java.lang.Double>> itemMap, java.util.Map<java.lang.String,java.util.Map<I,java.lang.Double>> featMap)
Constructor. -
Method Summary
Modifier and Type Method Description boolean
containsFeature(java.lang.String f)
boolean
containsItem(I i)
java.util.stream.Stream<java.lang.String>
getAllFeatures()
java.util.stream.Stream<I>
getAllItems()
java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<I,java.lang.Double>>
getFeatureItems(java.lang.String f)
java.util.stream.Stream<java.lang.String>
getFeaturesWithItems()
java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<java.lang.String,java.lang.Double>>
getItemFeatures(I i)
java.util.stream.Stream<I>
getItemsWithFeatures()
static <I> IndexFeatureData<I>
load(ForwardIndex<I> fIndex)
Loads the feature data from a forward index.int
numFeatures()
int
numFeatures(I i)
int
numFeaturesWithItems()
int
numItems()
int
numItems(java.lang.String f)
int
numItemsWithFeatures()
-
Field Details
-
Constructor Details
-
IndexFeatureData
protected IndexFeatureData(java.util.Map<I,java.util.Map<java.lang.String,java.lang.Double>> itemMap, java.util.Map<java.lang.String,java.util.Map<I,java.lang.Double>> featMap)Constructor.- Parameters:
itemMap
- item to features map.featMap
- features to items map.
-
-
Method Details
-
numItemsWithFeatures
public int numItemsWithFeatures()- Specified by:
numItemsWithFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
numFeaturesWithItems
public int numFeaturesWithItems()- Specified by:
numFeaturesWithItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
getItemsWithFeatures
- Specified by:
getItemsWithFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
getFeaturesWithItems
public java.util.stream.Stream<java.lang.String> getFeaturesWithItems()- Specified by:
getFeaturesWithItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
getFeatureItems
public java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<I,java.lang.Double>> getFeatureItems(java.lang.String f)- Specified by:
getFeatureItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
getItemFeatures
public java.util.stream.Stream<org.jooq.lambda.tuple.Tuple2<java.lang.String,java.lang.Double>> getItemFeatures(I i)- Specified by:
getItemFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
numFeatures
- Specified by:
numFeatures
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
numItems
public int numItems(java.lang.String f)- Specified by:
numItems
in interfacees.uam.eps.ir.ranksys.core.feature.FeatureData<I,java.lang.String,java.lang.Double>
-
containsFeature
public boolean containsFeature(java.lang.String f)- Specified by:
containsFeature
in interfacees.uam.eps.ir.ranksys.core.index.FeatureIndex<I>
-
numFeatures
public int numFeatures()- Specified by:
numFeatures
in interfacees.uam.eps.ir.ranksys.core.index.FeatureIndex<I>
-
getAllFeatures
public java.util.stream.Stream<java.lang.String> getAllFeatures()- Specified by:
getAllFeatures
in interfacees.uam.eps.ir.ranksys.core.index.FeatureIndex<I>
-
containsItem
- Specified by:
containsItem
in interfacees.uam.eps.ir.ranksys.core.index.ItemIndex<I>
-
numItems
public int numItems()- Specified by:
numItems
in interfacees.uam.eps.ir.ranksys.core.index.ItemIndex<I>
-
getAllItems
- Specified by:
getAllItems
in interfacees.uam.eps.ir.ranksys.core.index.ItemIndex<I>
-
load
Loads the feature data from a forward index.- Type Parameters:
I
- type of the items.- Parameters:
fIndex
- the forward index.- Returns:
- the feature data object.
-